Merge branch 'topic/line6' into for-next

This commit is contained in:
Takashi Iwai 2015-01-12 22:33:16 +01:00
commit 7bfb8575b8
223 changed files with 2537 additions and 1831 deletions

View file

@ -51,6 +51,7 @@ Greg Kroah-Hartman <gregkh@suse.de>
Greg Kroah-Hartman <greg@kroah.com> Greg Kroah-Hartman <greg@kroah.com>
Henk Vergonet <Henk.Vergonet@gmail.com> Henk Vergonet <Henk.Vergonet@gmail.com>
Henrik Kretzschmar <henne@nachtwindheim.de> Henrik Kretzschmar <henne@nachtwindheim.de>
Henrik Rydberg <rydberg@bitmath.org>
Herbert Xu <herbert@gondor.apana.org.au> Herbert Xu <herbert@gondor.apana.org.au>
Jacob Shin <Jacob.Shin@amd.com> Jacob Shin <Jacob.Shin@amd.com>
James Bottomley <jejb@mulgrave.(none)> James Bottomley <jejb@mulgrave.(none)>

View file

@ -724,15 +724,15 @@ F: include/uapi/linux/apm_bios.h
F: drivers/char/apm-emulation.c F: drivers/char/apm-emulation.c
APPLE BCM5974 MULTITOUCH DRIVER APPLE BCM5974 MULTITOUCH DRIVER
M: Henrik Rydberg <rydberg@euromail.se> M: Henrik Rydberg <rydberg@bitmath.org>
L: linux-input@vger.kernel.org L: linux-input@vger.kernel.org
S: Maintained S: Odd fixes
F: drivers/input/mouse/bcm5974.c F: drivers/input/mouse/bcm5974.c
APPLE SMC DRIVER APPLE SMC DRIVER
M: Henrik Rydberg <rydberg@euromail.se> M: Henrik Rydberg <rydberg@bitmath.org>
L: lm-sensors@lm-sensors.org L: lm-sensors@lm-sensors.org
S: Maintained S: Odd fixes
F: drivers/hwmon/applesmc.c F: drivers/hwmon/applesmc.c
APPLETALK NETWORK LAYER APPLETALK NETWORK LAYER
@ -2259,6 +2259,7 @@ F: drivers/gpio/gpio-bt8xx.c
BTRFS FILE SYSTEM BTRFS FILE SYSTEM
M: Chris Mason <clm@fb.com> M: Chris Mason <clm@fb.com>
M: Josef Bacik <jbacik@fb.com> M: Josef Bacik <jbacik@fb.com>
M: David Sterba <dsterba@suse.cz>
L: linux-btrfs@vger.kernel.org L: linux-btrfs@vger.kernel.org
W: http://btrfs.wiki.kernel.org/ W: http://btrfs.wiki.kernel.org/
Q: http://patchwork.kernel.org/project/linux-btrfs/list/ Q: http://patchwork.kernel.org/project/linux-btrfs/list/
@ -4940,10 +4941,10 @@ F: include/uapi/linux/input.h
F: include/linux/input/ F: include/linux/input/
INPUT MULTITOUCH (MT) PROTOCOL INPUT MULTITOUCH (MT) PROTOCOL
M: Henrik Rydberg <rydberg@euromail.se> M: Henrik Rydberg <rydberg@bitmath.org>
L: linux-input@vger.kernel.org L: linux-input@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rydberg/input-mt.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/rydberg/input-mt.git
S: Maintained S: Odd fixes
F: Documentation/input/multi-touch-protocol.txt F: Documentation/input/multi-touch-protocol.txt
F: drivers/input/input-mt.c F: drivers/input/input-mt.c
K: \b(ABS|SYN)_MT_ K: \b(ABS|SYN)_MT_

View file

@ -1,7 +1,7 @@
VERSION = 3 VERSION = 3
PATCHLEVEL = 19 PATCHLEVEL = 19
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc3 EXTRAVERSION = -rc4
NAME = Diseased Newt NAME = Diseased Newt
# *DOCUMENTATION* # *DOCUMENTATION*
@ -391,6 +391,7 @@ USERINCLUDE := \
# Needed to be compatible with the O= option # Needed to be compatible with the O= option
LINUXINCLUDE := \ LINUXINCLUDE := \
-I$(srctree)/arch/$(hdr-arch)/include \ -I$(srctree)/arch/$(hdr-arch)/include \
-Iarch/$(hdr-arch)/include/generated/uapi \
-Iarch/$(hdr-arch)/include/generated \ -Iarch/$(hdr-arch)/include/generated \
$(if $(KBUILD_SRC), -I$(srctree)/include) \ $(if $(KBUILD_SRC), -I$(srctree)/include) \
-Iinclude \ -Iinclude \

View file

@ -413,6 +413,7 @@
#define __NR_getrandom (__NR_SYSCALL_BASE+384) #define __NR_getrandom (__NR_SYSCALL_BASE+384)
#define __NR_memfd_create (__NR_SYSCALL_BASE+385) #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
#define __NR_bpf (__NR_SYSCALL_BASE+386) #define __NR_bpf (__NR_SYSCALL_BASE+386)
#define __NR_execveat (__NR_SYSCALL_BASE+387)
/* /*
* The following SWIs are ARM private. * The following SWIs are ARM private.

View file

@ -396,6 +396,7 @@
CALL(sys_getrandom) CALL(sys_getrandom)
/* 385 */ CALL(sys_memfd_create) /* 385 */ CALL(sys_memfd_create)
CALL(sys_bpf) CALL(sys_bpf)
CALL(sys_execveat)
#ifndef syscalls_counted #ifndef syscalls_counted
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
#define syscalls_counted #define syscalls_counted

View file

@ -28,3 +28,11 @@ u64 perf_reg_abi(struct task_struct *task)
{ {
return PERF_SAMPLE_REGS_ABI_32; return PERF_SAMPLE_REGS_ABI_32;
} }
void perf_get_regs_user(struct perf_regs *regs_user,
struct pt_regs *regs,
struct pt_regs *regs_user_copy)
{
regs_user->regs = task_pt_regs(current);
regs_user->abi = perf_reg_abi(current);
}

View file

@ -220,9 +220,6 @@ static void note_page(struct pg_state *st, unsigned long addr, unsigned level, u
static const char units[] = "KMGTPE"; static const char units[] = "KMGTPE";
u64 prot = val & pg_level[level].mask; u64 prot = val & pg_level[level].mask;
if (addr < USER_PGTABLES_CEILING)
return;
if (!st->level) { if (!st->level) {
st->level = level; st->level = level;
st->current_prot = prot; st->current_prot = prot;
@ -308,15 +305,13 @@ static void walk_pgd(struct seq_file *m)
pgd_t *pgd = swapper_pg_dir; pgd_t *pgd = swapper_pg_dir;
struct pg_state st; struct pg_state st;
unsigned long addr; unsigned long addr;
unsigned i, pgdoff = USER_PGTABLES_CEILING / PGDIR_SIZE; unsigned i;
memset(&st, 0, sizeof(st)); memset(&st, 0, sizeof(st));
st.seq = m; st.seq = m;
st.marker = address_markers; st.marker = address_markers;
pgd += pgdoff; for (i = 0; i < PTRS_PER_PGD; i++, pgd++) {
for (i = pgdoff; i < PTRS_PER_PGD; i++, pgd++) {
addr = i * PGDIR_SIZE; addr = i * PGDIR_SIZE;
if (!pgd_none(*pgd)) { if (!pgd_none(*pgd)) {
walk_pud(&st, pgd, addr); walk_pud(&st, pgd, addr);

View file

@ -658,8 +658,8 @@ static struct section_perm ro_perms[] = {
.start = (unsigned long)_stext, .start = (unsigned long)_stext,
.end = (unsigned long)__init_begin, .end = (unsigned long)__init_begin,
#ifdef CONFIG_ARM_LPAE #ifdef CONFIG_ARM_LPAE
.mask = ~PMD_SECT_RDONLY, .mask = ~L_PMD_SECT_RDONLY,
.prot = PMD_SECT_RDONLY, .prot = L_PMD_SECT_RDONLY,
#else #else
.mask = ~(PMD_SECT_APX | PMD_SECT_AP_WRITE), .mask = ~(PMD_SECT_APX | PMD_SECT_AP_WRITE),
.prot = PMD_SECT_APX | PMD_SECT_AP_WRITE, .prot = PMD_SECT_APX | PMD_SECT_AP_WRITE,

View file

@ -1329,8 +1329,8 @@ static void __init kmap_init(void)
static void __init map_lowmem(void) static void __init map_lowmem(void)
{ {
struct memblock_region *reg; struct memblock_region *reg;
unsigned long kernel_x_start = round_down(__pa(_stext), SECTION_SIZE); phys_addr_t kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
unsigned long kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE); phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);
/* Map all the lowmem memory banks. */ /* Map all the lowmem memory banks. */
for_each_memblock(memory, reg) { for_each_memblock(memory, reg) {

View file

@ -21,6 +21,7 @@
#include <asm/barrier.h> #include <asm/barrier.h>
#include <linux/bug.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>

View file

@ -39,6 +39,7 @@ struct cpuinfo_arm64 {
u64 reg_id_aa64pfr0; u64 reg_id_aa64pfr0;
u64 reg_id_aa64pfr1; u64 reg_id_aa64pfr1;
u32 reg_id_dfr0;
u32 reg_id_isar0; u32 reg_id_isar0;
u32 reg_id_isar1; u32 reg_id_isar1;
u32 reg_id_isar2; u32 reg_id_isar2;
@ -51,6 +52,10 @@ struct cpuinfo_arm64 {
u32 reg_id_mmfr3; u32 reg_id_mmfr3;
u32 reg_id_pfr0; u32 reg_id_pfr0;
u32 reg_id_pfr1; u32 reg_id_pfr1;
u32 reg_mvfr0;
u32 reg_mvfr1;
u32 reg_mvfr2;
}; };
DECLARE_PER_CPU(struct cpuinfo_arm64, cpu_data); DECLARE_PER_CPU(struct cpuinfo_arm64, cpu_data);

View file

@ -31,6 +31,7 @@
#include <asm/fpsimd.h> #include <asm/fpsimd.h>
#include <asm/hw_breakpoint.h> #include <asm/hw_breakpoint.h>
#include <asm/pgtable-hwdef.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/types.h> #include <asm/types.h>
@ -123,9 +124,6 @@ struct task_struct;
/* Free all resources held by a thread. */ /* Free all resources held by a thread. */
extern void release_thread(struct task_struct *); extern void release_thread(struct task_struct *);
/* Prepare to copy thread state - unlazy all lazy status */
#define prepare_to_copy(tsk) do { } while (0)
unsigned long get_wchan(struct task_struct *p); unsigned long get_wchan(struct task_struct *p);
#define cpu_relax() barrier() #define cpu_relax() barrier()

View file

@ -44,7 +44,7 @@
#define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2) #define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2)
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5) #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5)
#define __NR_compat_syscalls 386 #define __NR_compat_syscalls 387
#endif #endif
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE

View file

@ -147,6 +147,7 @@ static void cpuinfo_sanity_check(struct cpuinfo_arm64 *cur)
* If we have AArch32, we care about 32-bit features for compat. These * If we have AArch32, we care about 32-bit features for compat. These
* registers should be RES0 otherwise. * registers should be RES0 otherwise.
*/ */
diff |= CHECK(id_dfr0, boot, cur, cpu);
diff |= CHECK(id_isar0, boot, cur, cpu); diff |= CHECK(id_isar0, boot, cur, cpu);
diff |= CHECK(id_isar1, boot, cur, cpu); diff |= CHECK(id_isar1, boot, cur, cpu);
diff |= CHECK(id_isar2, boot, cur, cpu); diff |= CHECK(id_isar2, boot, cur, cpu);
@ -165,6 +166,10 @@ static void cpuinfo_sanity_check(struct cpuinfo_arm64 *cur)
diff |= CHECK(id_pfr0, boot, cur, cpu); diff |= CHECK(id_pfr0, boot, cur, cpu);
diff |= CHECK(id_pfr1, boot, cur, cpu); diff |= CHECK(id_pfr1, boot, cur, cpu);
diff |= CHECK(mvfr0, boot, cur, cpu);
diff |= CHECK(mvfr1, boot, cur, cpu);
diff |= CHECK(mvfr2, boot, cur, cpu);
/* /*
* Mismatched CPU features are a recipe for disaster. Don't even * Mismatched CPU features are a recipe for disaster. Don't even
* pretend to support them. * pretend to support them.
@ -189,6 +194,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
info->reg_id_aa64pfr0 = read_cpuid(ID_AA64PFR0_EL1); info->reg_id_aa64pfr0 = read_cpuid(ID_AA64PFR0_EL1);
info->reg_id_aa64pfr1 = read_cpuid(ID_AA64PFR1_EL1); info->reg_id_aa64pfr1 = read_cpuid(ID_AA64PFR1_EL1);
info->reg_id_dfr0 = read_cpuid(ID_DFR0_EL1);
info->reg_id_isar0 = read_cpuid(ID_ISAR0_EL1); info->reg_id_isar0 = read_cpuid(ID_ISAR0_EL1);
info->reg_id_isar1 = read_cpuid(ID_ISAR1_EL1); info->reg_id_isar1 = read_cpuid(ID_ISAR1_EL1);
info->reg_id_isar2 = read_cpuid(ID_ISAR2_EL1); info->reg_id_isar2 = read_cpuid(ID_ISAR2_EL1);
@ -202,6 +208,10 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
info->reg_id_pfr0 = read_cpuid(ID_PFR0_EL1); info->reg_id_pfr0 = read_cpuid(ID_PFR0_EL1);
info->reg_id_pfr1 = read_cpuid(ID_PFR1_EL1); info->reg_id_pfr1 = read_cpuid(ID_PFR1_EL1);
info->reg_mvfr0 = read_cpuid(MVFR0_EL1);
info->reg_mvfr1 = read_cpuid(MVFR1_EL1);
info->reg_mvfr2 = read_cpuid(MVFR2_EL1);
cpuinfo_detect_icache_policy(info); cpuinfo_detect_icache_policy(info);
check_local_cpu_errata(); check_local_cpu_errata();

View file

@ -326,6 +326,7 @@ void __init efi_idmap_init(void)
/* boot time idmap_pg_dir is incomplete, so fill in missing parts */ /* boot time idmap_pg_dir is incomplete, so fill in missing parts */
efi_setup_idmap(); efi_setup_idmap();
early_memunmap(memmap.map, memmap.map_end - memmap.map);
} }
static int __init remap_region(efi_memory_desc_t *md, void **new) static int __init remap_region(efi_memory_desc_t *md, void **new)
@ -380,7 +381,6 @@ static int __init arm64_enter_virtual_mode(void)
} }
mapsize = memmap.map_end - memmap.map; mapsize = memmap.map_end - memmap.map;
early_memunmap(memmap.map, mapsize);
if (efi_runtime_disabled()) { if (efi_runtime_disabled()) {
pr_info("EFI runtime services will be disabled.\n"); pr_info("EFI runtime services will be disabled.\n");

View file

@ -25,6 +25,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/moduleloader.h> #include <linux/moduleloader.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <asm/alternative.h>
#include <asm/insn.h> #include <asm/insn.h>
#include <asm/sections.h> #include <asm/sections.h>

View file

@ -50,3 +50,11 @@ u64 perf_reg_abi(struct task_struct *task)
else else
return PERF_SAMPLE_REGS_ABI_64; return PERF_SAMPLE_REGS_ABI_64;
} }
void perf_get_regs_user(struct perf_regs *regs_user,
struct pt_regs *regs,
struct pt_regs *regs_user_copy)
{
regs_user->regs = task_pt_regs(current);
regs_user->abi = perf_reg_abi(current);
}

View file

@ -402,6 +402,7 @@ void __init setup_arch(char **cmdline_p)
request_standard_resources(); request_standard_resources();
efi_idmap_init(); efi_idmap_init();
early_ioremap_reset();
unflatten_device_tree(); unflatten_device_tree();

View file

@ -25,6 +25,7 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cpu_ops.h> #include <asm/cpu_ops.h>
#include <asm/cputype.h> #include <asm/cputype.h>
#include <asm/io.h>
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
extern void secondary_holding_pen(void); extern void secondary_holding_pen(void);

View file

@ -7,6 +7,7 @@
*/ */
#include <linux/device.h> #include <linux/device.h>
#include <linux/delay.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>

View file

@ -893,13 +893,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
} }
/* wrapper to silence section mismatch warning */ /* wrapper to silence section mismatch warning */
int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu)
{ {
return _acpi_map_lsapic(handle, physid, pcpu); return _acpi_map_lsapic(handle, physid, pcpu);
} }
EXPORT_SYMBOL(acpi_map_lsapic); EXPORT_SYMBOL(acpi_map_cpu);
int acpi_unmap_lsapic(int cpu) int acpi_unmap_cpu(int cpu)
{ {
ia64_cpu_to_sapicid[cpu] = -1; ia64_cpu_to_sapicid[cpu] = -1;
set_cpu_present(cpu, false); set_cpu_present(cpu, false);
@ -910,8 +910,7 @@ int acpi_unmap_lsapic(int cpu)
return (0); return (0);
} }
EXPORT_SYMBOL(acpi_unmap_cpu);
EXPORT_SYMBOL(acpi_unmap_lsapic);
#endif /* CONFIG_ACPI_HOTPLUG_CPU */ #endif /* CONFIG_ACPI_HOTPLUG_CPU */
#ifdef CONFIG_ACPI_NUMA #ifdef CONFIG_ACPI_NUMA

View file

@ -51,6 +51,7 @@ targets += cpustr.h
$(obj)/cpustr.h: $(obj)/mkcpustr FORCE $(obj)/cpustr.h: $(obj)/mkcpustr FORCE
$(call if_changed,cpustr) $(call if_changed,cpustr)
endif endif
clean-files += cpustr.h
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View file

@ -26,7 +26,6 @@ obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o
obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o obj-$(CONFIG_CRYPTO_SHA1_SSSE3) += sha1-ssse3.o
obj-$(CONFIG_CRYPTO_SHA1_MB) += sha-mb/
obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o obj-$(CONFIG_CRYPTO_CRC32_PCLMUL) += crc32-pclmul.o
obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o obj-$(CONFIG_CRYPTO_SHA256_SSSE3) += sha256-ssse3.o
obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o
@ -46,6 +45,7 @@ endif
ifeq ($(avx2_supported),yes) ifeq ($(avx2_supported),yes)
obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o obj-$(CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64) += camellia-aesni-avx2.o
obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o obj-$(CONFIG_CRYPTO_SERPENT_AVX2_X86_64) += serpent-avx2.o
obj-$(CONFIG_CRYPTO_SHA1_MB) += sha-mb/
endif endif
aes-i586-y := aes-i586-asm_32.o aes_glue.o aes-i586-y := aes-i586-asm_32.o aes_glue.o

View file

@ -208,7 +208,7 @@ ddq_add_8:
.if (klen == KEY_128) .if (klen == KEY_128)
.if (load_keys) .if (load_keys)
vmovdqa 3*16(p_keys), xkeyA vmovdqa 3*16(p_keys), xkey4
.endif .endif
.else .else
vmovdqa 3*16(p_keys), xkeyA vmovdqa 3*16(p_keys), xkeyA
@ -224,7 +224,7 @@ ddq_add_8:
add $(16*by), p_in add $(16*by), p_in
.if (klen == KEY_128) .if (klen == KEY_128)
vmovdqa 4*16(p_keys), xkey4 vmovdqa 4*16(p_keys), xkeyB
.else .else
.if (load_keys) .if (load_keys)
vmovdqa 4*16(p_keys), xkey4 vmovdqa 4*16(p_keys), xkey4
@ -234,7 +234,12 @@ ddq_add_8:
.set i, 0 .set i, 0
.rept by .rept by
club XDATA, i club XDATA, i
vaesenc xkeyA, var_xdata, var_xdata /* key 3 */ /* key 3 */
.if (klen == KEY_128)
vaesenc xkey4, var_xdata, var_xdata
.else
vaesenc xkeyA, var_xdata, var_xdata
.endif
.set i, (i +1) .set i, (i +1)
.endr .endr
@ -243,13 +248,18 @@ ddq_add_8:
.set i, 0 .set i, 0
.rept by .rept by
club XDATA, i club XDATA, i
vaesenc xkey4, var_xdata, var_xdata /* key 4 */ /* key 4 */
.if (klen == KEY_128)
vaesenc xkeyB, var_xdata, var_xdata
.else
vaesenc xkey4, var_xdata, var_xdata
.endif
.set i, (i +1) .set i, (i +1)
.endr .endr
.if (klen == KEY_128) .if (klen == KEY_128)
.if (load_keys) .if (load_keys)
vmovdqa 6*16(p_keys), xkeyB vmovdqa 6*16(p_keys), xkey8
.endif .endif
.else .else
vmovdqa 6*16(p_keys), xkeyB vmovdqa 6*16(p_keys), xkeyB
@ -267,12 +277,17 @@ ddq_add_8:
.set i, 0 .set i, 0
.rept by .rept by
club XDATA, i club XDATA, i
vaesenc xkeyB, var_xdata, var_xdata /* key 6 */ /* key 6 */
.if (klen == KEY_128)
vaesenc xkey8, var_xdata, var_xdata
.else
vaesenc xkeyB, var_xdata, var_xdata
.endif
.set i, (i +1) .set i, (i +1)
.endr .endr
.if (klen == KEY_128) .if (klen == KEY_128)
vmovdqa 8*16(p_keys), xkey8 vmovdqa 8*16(p_keys), xkeyB
.else .else
.if (load_keys) .if (load_keys)
vmovdqa 8*16(p_keys), xkey8 vmovdqa 8*16(p_keys), xkey8
@ -288,7 +303,7 @@ ddq_add_8:
.if (klen == KEY_128) .if (klen == KEY_128)
.if (load_keys) .if (load_keys)
vmovdqa 9*16(p_keys), xkeyA vmovdqa 9*16(p_keys), xkey12
.endif .endif
.else .else
vmovdqa 9*16(p_keys), xkeyA vmovdqa 9*16(p_keys), xkeyA
@ -297,7 +312,12 @@ ddq_add_8:
.set i, 0 .set i, 0
.rept by .rept by
club XDATA, i club XDATA, i
vaesenc xkey8, var_xdata, var_xdata /* key 8 */ /* key 8 */
.if (klen == KEY_128)
vaesenc xkeyB, var_xdata, var_xdata
.else
vaesenc xkey8, var_xdata, var_xdata
.endif
.set i, (i +1) .set i, (i +1)
.endr .endr
@ -306,7 +326,12 @@ ddq_add_8:
.set i, 0 .set i, 0
.rept by .rept by
club XDATA, i club XDATA, i
vaesenc xkeyA, var_xdata, var_xdata /* key 9 */ /* key 9 */
.if (klen == KEY_128)
vaesenc xkey12, var_xdata, var_xdata
.else
vaesenc xkeyA, var_xdata, var_xdata
.endif
.set i, (i +1) .set i, (i +1)
.endr .endr
@ -412,7 +437,6 @@ ddq_add_8:
/* main body of aes ctr load */ /* main body of aes ctr load */
.macro do_aes_ctrmain key_len .macro do_aes_ctrmain key_len
cmp $16, num_bytes cmp $16, num_bytes
jb .Ldo_return2\key_len jb .Ldo_return2\key_len

View file

@ -80,9 +80,11 @@ static inline unsigned int __getcpu(void)
/* /*
* Load per CPU data from GDT. LSL is faster than RDTSCP and * Load per CPU data from GDT. LSL is faster than RDTSCP and
* works on all CPUs. * works on all CPUs. This is volatile so that it orders
* correctly wrt barrier() and to keep gcc from cleverly
* hoisting it out of the calling function.
*/ */
asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG)); asm volatile ("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
return p; return p;
} }

View file

@ -750,13 +750,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
} }
/* wrapper to silence section mismatch warning */ /* wrapper to silence section mismatch warning */
int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu)
{ {
return _acpi_map_lsapic(handle, physid, pcpu); return _acpi_map_lsapic(handle, physid, pcpu);
} }
EXPORT_SYMBOL(acpi_map_lsapic); EXPORT_SYMBOL(acpi_map_cpu);
int acpi_unmap_lsapic(int cpu) int acpi_unmap_cpu(int cpu)
{ {
#ifdef CONFIG_ACPI_NUMA #ifdef CONFIG_ACPI_NUMA
set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE); set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE);
@ -768,8 +768,7 @@ int acpi_unmap_lsapic(int cpu)
return (0); return (0);
} }
EXPORT_SYMBOL(acpi_unmap_cpu);
EXPORT_SYMBOL(acpi_unmap_lsapic);
#endif /* CONFIG_ACPI_HOTPLUG_CPU */ #endif /* CONFIG_ACPI_HOTPLUG_CPU */
int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)

View file

@ -66,3 +66,4 @@ targets += capflags.c
$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE $(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE
$(call if_changed,mkcapflags) $(call if_changed,mkcapflags)
endif endif
clean-files += capflags.c

View file

@ -28,7 +28,7 @@ function dump_array()
# If the /* comment */ starts with a quote string, grab that. # If the /* comment */ starts with a quote string, grab that.
VALUE="$(echo "$i" | sed -n 's@.*/\* *\("[^"]*"\).*\*/@\1@p')" VALUE="$(echo "$i" | sed -n 's@.*/\* *\("[^"]*"\).*\*/@\1@p')"
[ -z "$VALUE" ] && VALUE="\"$NAME\"" [ -z "$VALUE" ] && VALUE="\"$NAME\""
[ "$VALUE" == '""' ] && continue [ "$VALUE" = '""' ] && continue
# Name is uppercase, VALUE is all lowercase # Name is uppercase, VALUE is all lowercase
VALUE="$(echo "$VALUE" | tr A-Z a-z)" VALUE="$(echo "$VALUE" | tr A-Z a-z)"

View file

@ -17,7 +17,7 @@
#define UNCORE_PCI_DEV_TYPE(data) ((data >> 8) & 0xff) #define UNCORE_PCI_DEV_TYPE(data) ((data >> 8) & 0xff)
#define UNCORE_PCI_DEV_IDX(data) (data & 0xff) #define UNCORE_PCI_DEV_IDX(data) (data & 0xff)
#define UNCORE_EXTRA_PCI_DEV 0xff #define UNCORE_EXTRA_PCI_DEV 0xff
#define UNCORE_EXTRA_PCI_DEV_MAX 2 #define UNCORE_EXTRA_PCI_DEV_MAX 3
/* support up to 8 sockets */ /* support up to 8 sockets */
#define UNCORE_SOCKET_MAX 8 #define UNCORE_SOCKET_MAX 8

View file

@ -891,6 +891,7 @@ void snbep_uncore_cpu_init(void)
enum { enum {
SNBEP_PCI_QPI_PORT0_FILTER, SNBEP_PCI_QPI_PORT0_FILTER,
SNBEP_PCI_QPI_PORT1_FILTER, SNBEP_PCI_QPI_PORT1_FILTER,
HSWEP_PCI_PCU_3,
}; };
static int snbep_qpi_hw_config(struct intel_uncore_box *box, struct perf_event *event) static int snbep_qpi_hw_config(struct intel_uncore_box *box, struct perf_event *event)
@ -2026,6 +2027,17 @@ void hswep_uncore_cpu_init(void)
{ {
if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
/* Detect 6-8 core systems with only two SBOXes */
if (uncore_extra_pci_dev[0][HSWEP_PCI_PCU_3]) {
u32 capid4;
pci_read_config_dword(uncore_extra_pci_dev[0][HSWEP_PCI_PCU_3],
0x94, &capid4);
if (((capid4 >> 6) & 0x3) == 0)
hswep_uncore_sbox.num_boxes = 2;
}
uncore_msr_uncores = hswep_msr_uncores; uncore_msr_uncores = hswep_msr_uncores;
} }
@ -2287,6 +2299,11 @@ static DEFINE_PCI_DEVICE_TABLE(hswep_uncore_pci_ids) = {
.driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
SNBEP_PCI_QPI_PORT1_FILTER), SNBEP_PCI_QPI_PORT1_FILTER),
}, },
{ /* PCU.3 (for Capability registers) */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2fc0),
.driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
HSWEP_PCI_PCU_3),
},
{ /* end: all zeroes */ } { /* end: all zeroes */ }
}; };

View file

@ -78,6 +78,14 @@ u64 perf_reg_abi(struct task_struct *task)
{ {
return PERF_SAMPLE_REGS_ABI_32; return PERF_SAMPLE_REGS_ABI_32;
} }
void perf_get_regs_user(struct perf_regs *regs_user,
struct pt_regs *regs,
struct pt_regs *regs_user_copy)
{
regs_user->regs = task_pt_regs(current);
regs_user->abi = perf_reg_abi(current);
}
#else /* CONFIG_X86_64 */ #else /* CONFIG_X86_64 */
#define REG_NOSUPPORT ((1ULL << PERF_REG_X86_DS) | \ #define REG_NOSUPPORT ((1ULL << PERF_REG_X86_DS) | \
(1ULL << PERF_REG_X86_ES) | \ (1ULL << PERF_REG_X86_ES) | \
@ -102,4 +110,86 @@ u64 perf_reg_abi(struct task_struct *task)
else else
return PERF_SAMPLE_REGS_ABI_64; return PERF_SAMPLE_REGS_ABI_64;
} }
void perf_get_regs_user(struct perf_regs *regs_user,
struct pt_regs *regs,
struct pt_regs *regs_user_copy)
{
struct pt_regs *user_regs = task_pt_regs(current);
/*
* If we're in an NMI that interrupted task_pt_regs setup, then
* we can't sample user regs at all. This check isn't really
* sufficient, though, as we could be in an NMI inside an interrupt
* that happened during task_pt_regs setup.
*/
if (regs->sp > (unsigned long)&user_regs->r11 &&
regs->sp <= (unsigned long)(user_regs + 1)) {
regs_user->abi = PERF_SAMPLE_REGS_ABI_NONE;
regs_user->regs = NULL;
return;
}
/*
* RIP, flags, and the argument registers are usually saved.
* orig_ax is probably okay, too.
*/
regs_user_copy->ip = user_regs->ip;
regs_user_copy->cx = user_regs->cx;
regs_user_copy->dx = user_regs->dx;
regs_user_copy->si = user_regs->si;
regs_user_copy->di = user_regs->di;
regs_user_copy->r8 = user_regs->r8;
regs_user_copy->r9 = user_regs->r9;
regs_user_copy->r10 = user_regs->r10;
regs_user_copy->r11 = user_regs->r11;
regs_user_copy->orig_ax = user_regs->orig_ax;
regs_user_copy->flags = user_regs->flags;
/*
* Don't even try to report the "rest" regs.
*/
regs_user_copy->bx = -1;
regs_user_copy->bp = -1;
regs_user_copy->r12 = -1;
regs_user_copy->r13 = -1;
regs_user_copy->r14 = -1;
regs_user_copy->r15 = -1;
/*
* For this to be at all useful, we need a reasonable guess for
* sp and the ABI. Be careful: we're in NMI context, and we're
* considering current to be the current task, so we should
* be careful not to look at any other percpu variables that might
* change during context switches.
*/
if (IS_ENABLED(CONFIG_IA32_EMULATION) &&
task_thread_info(current)->status & TS_COMPAT) {
/* Easy case: we're in a compat syscall. */
regs_user->abi = PERF_SAMPLE_REGS_ABI_32;
regs_user_copy->sp = user_regs->sp;
regs_user_copy->cs = user_regs->cs;
regs_user_copy->ss = user_regs->ss;
} else if (user_regs->orig_ax != -1) {
/*
* We're probably in a 64-bit syscall.
* Warning: this code is severely racy. At least it's better
* than just blindly copying user_regs.
*/
regs_user->abi = PERF_SAMPLE_REGS_ABI_64;
regs_user_copy->sp = this_cpu_read(old_rsp);
regs_user_copy->cs = __USER_CS;
regs_user_copy->ss = __USER_DS;
regs_user_copy->cx = -1; /* usually contains garbage */
} else {
/* We're probably in an interrupt or exception. */
regs_user->abi = user_64bit_mode(user_regs) ?
PERF_SAMPLE_REGS_ABI_64 : PERF_SAMPLE_REGS_ABI_32;
regs_user_copy->sp = user_regs->sp;
regs_user_copy->cs = user_regs->cs;
regs_user_copy->ss = user_regs->ss;
}
regs_user->regs = regs_user_copy;
}
#endif /* CONFIG_X86_32 */ #endif /* CONFIG_X86_32 */

View file

@ -28,7 +28,7 @@
/* Verify next sizeof(t) bytes can be on the same instruction */ /* Verify next sizeof(t) bytes can be on the same instruction */
#define validate_next(t, insn, n) \ #define validate_next(t, insn, n) \
((insn)->next_byte + sizeof(t) + n < (insn)->end_kaddr) ((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
#define __get_next(t, insn) \ #define __get_next(t, insn) \
({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; }) ({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })

View file

@ -438,20 +438,20 @@ static unsigned long __init init_range_memory_mapping(
static unsigned long __init get_new_step_size(unsigned long step_size) static unsigned long __init get_new_step_size(unsigned long step_size)
{ {
/* /*
* Explain why we shift by 5 and why we don't have to worry about * Initial mapped size is PMD_SIZE (2M).
* 'step_size << 5' overflowing:
*
* initial mapped size is PMD_SIZE (2M).
* We can not set step_size to be PUD_SIZE (1G) yet. * We can not set step_size to be PUD_SIZE (1G) yet.
* In worse case, when we cross the 1G boundary, and * In worse case, when we cross the 1G boundary, and
* PG_LEVEL_2M is not set, we will need 1+1+512 pages (2M + 8k) * PG_LEVEL_2M is not set, we will need 1+1+512 pages (2M + 8k)
* to map 1G range with PTE. Use 5 as shift for now. * to map 1G range with PTE. Hence we use one less than the
* difference of page table level shifts.
* *
* Don't need to worry about overflow, on 32bit, when step_size * Don't need to worry about overflow in the top-down case, on 32bit,
* is 0, round_down() returns 0 for start, and that turns it * when step_size is 0, round_down() returns 0 for start, and that
* into 0x100000000ULL. * turns it into 0x100000000ULL.
* In the bottom-up case, round_up(x, 0) returns 0 though too, which
* needs to be taken into consideration by the code below.
*/ */
return step_size << 5; return step_size << (PMD_SHIFT - PAGE_SHIFT - 1);
} }
/** /**
@ -471,7 +471,6 @@ static void __init memory_map_top_down(unsigned long map_start,
unsigned long step_size; unsigned long step_size;
unsigned long addr; unsigned long addr;
unsigned long mapped_ram_size = 0; unsigned long mapped_ram_size = 0;
unsigned long new_mapped_ram_size;
/* xen has big range in reserved near end of ram, skip it at first.*/ /* xen has big range in reserved near end of ram, skip it at first.*/
addr = memblock_find_in_range(map_start, map_end, PMD_SIZE, PMD_SIZE); addr = memblock_find_in_range(map_start, map_end, PMD_SIZE, PMD_SIZE);
@ -496,14 +495,12 @@ static void __init memory_map_top_down(unsigned long map_start,
start = map_start; start = map_start;
} else } else
start = map_start; start = map_start;
new_mapped_ram_size = init_range_memory_mapping(start, mapped_ram_size += init_range_memory_mapping(start,
last_start); last_start);
last_start = start; last_start = start;
min_pfn_mapped = last_start >> PAGE_SHIFT; min_pfn_mapped = last_start >> PAGE_SHIFT;
/* only increase step_size after big range get mapped */ if (mapped_ram_size >= step_size)
if (new_mapped_ram_size > mapped_ram_size)
step_size = get_new_step_size(step_size); step_size = get_new_step_size(step_size);
mapped_ram_size += new_mapped_ram_size;
} }
if (real_end < map_end) if (real_end < map_end)
@ -524,7 +521,7 @@ static void __init memory_map_top_down(unsigned long map_start,
static void __init memory_map_bottom_up(unsigned long map_start, static void __init memory_map_bottom_up(unsigned long map_start,
unsigned long map_end) unsigned long map_end)
{ {
unsigned long next, new_mapped_ram_size, start; unsigned long next, start;
unsigned long mapped_ram_size = 0; unsigned long mapped_ram_size = 0;
/* step_size need to be small so pgt_buf from BRK could cover it */ /* step_size need to be small so pgt_buf from BRK could cover it */
unsigned long step_size = PMD_SIZE; unsigned long step_size = PMD_SIZE;
@ -539,19 +536,19 @@ static void __init memory_map_bottom_up(unsigned long map_start,
* for page table. * for page table.
*/ */
while (start < map_end) { while (start < map_end) {
if (map_end - start > step_size) { if (step_size && map_end - start > step_size) {
next = round_up(start + 1, step_size); next = round_up(start + 1, step_size);
if (next > map_end) if (next > map_end)
next = map_end; next = map_end;
} else } else {
next = map_end; next = map_end;
}
new_mapped_ram_size = init_range_memory_mapping(start, next); mapped_ram_size += init_range_memory_mapping(start, next);
start = next; start = next;
if (new_mapped_ram_size > mapped_ram_size) if (mapped_ram_size >= step_size)
step_size = get_new_step_size(step_size); step_size = get_new_step_size(step_size);
mapped_ram_size += new_mapped_ram_size;
} }
} }

View file

@ -41,12 +41,17 @@ void __init init_vdso_image(const struct vdso_image *image)
struct linux_binprm; struct linux_binprm;
/* Put the vdso above the (randomized) stack with another randomized offset. /*
This way there is no hole in the middle of address space. * Put the vdso above the (randomized) stack with another randomized
To save memory make sure it is still in the same PTE as the stack top. * offset. This way there is no hole in the middle of address space.
This doesn't give that many random bits. * To save memory make sure it is still in the same PTE as the stack
* top. This doesn't give that many random bits.
Only used for the 64-bit and x32 vdsos. */ *
* Note that this algorithm is imperfect: the distribution of the vdso
* start address within a PMD is biased toward the end.
*
* Only used for the 64-bit and x32 vdsos.
*/
static unsigned long vdso_addr(unsigned long start, unsigned len) static unsigned long vdso_addr(unsigned long start, unsigned len)
{ {
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
@ -54,22 +59,30 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
#else #else
unsigned long addr, end; unsigned long addr, end;
unsigned offset; unsigned offset;
end = (start + PMD_SIZE - 1) & PMD_MASK;
/*
* Round up the start address. It can start out unaligned as a result
* of stack start randomization.
*/
start = PAGE_ALIGN(start);
/* Round the lowest possible end address up to a PMD boundary. */
end = (start + len + PMD_SIZE - 1) & PMD_MASK;
if (end >= TASK_SIZE_MAX) if (end >= TASK_SIZE_MAX)
end = TASK_SIZE_MAX; end = TASK_SIZE_MAX;
end -= len; end -= len;
/* This loses some more bits than a modulo, but is cheaper */
offset = get_random_int() & (PTRS_PER_PTE - 1); if (end > start) {
addr = start + (offset << PAGE_SHIFT); offset = get_random_int() % (((end - start) >> PAGE_SHIFT) + 1);
if (addr >= end) addr = start + (offset << PAGE_SHIFT);
addr = end; } else {
addr = start;
}
/* /*
* page-align it here so that get_unmapped_area doesn't * Forcibly align the final address in case we have a hardware
* align it wrongfully again to the next page. addr can come in 4K * issue that requires alignment for performance reasons.
* unaligned here as a result of stack start randomization.
*/ */
addr = PAGE_ALIGN(addr);
addr = align_vdso_addr(addr); addr = align_vdso_addr(addr);
return addr; return addr;

View file

@ -50,7 +50,10 @@ obj-$(CONFIG_RESET_CONTROLLER) += reset/
obj-y += tty/ obj-y += tty/
obj-y += char/ obj-y += char/
# gpu/ comes after char for AGP vs DRM startup # iommu/ comes before gpu as gpu are using iommu controllers
obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
# gpu/ comes after char for AGP vs DRM startup and after iommu
obj-y += gpu/ obj-y += gpu/
obj-$(CONFIG_CONNECTOR) += connector/ obj-$(CONFIG_CONNECTOR) += connector/
@ -141,7 +144,6 @@ obj-y += clk/
obj-$(CONFIG_MAILBOX) += mailbox/ obj-$(CONFIG_MAILBOX) += mailbox/
obj-$(CONFIG_HWSPINLOCK) += hwspinlock/ obj-$(CONFIG_HWSPINLOCK) += hwspinlock/
obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
obj-$(CONFIG_REMOTEPROC) += remoteproc/ obj-$(CONFIG_REMOTEPROC) += remoteproc/
obj-$(CONFIG_RPMSG) += rpmsg/ obj-$(CONFIG_RPMSG) += rpmsg/

View file

@ -170,7 +170,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
acpi_status status; acpi_status status;
int ret; int ret;
if (pr->apic_id == -1) if (pr->phys_id == -1)
return -ENODEV; return -ENODEV;
status = acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta); status = acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta);
@ -180,13 +180,13 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
cpu_maps_update_begin(); cpu_maps_update_begin();
cpu_hotplug_begin(); cpu_hotplug_begin();
ret = acpi_map_lsapic(pr->handle, pr->apic_id, &pr->id); ret = acpi_map_cpu(pr->handle, pr->phys_id, &pr->id);
if (ret) if (ret)
goto out; goto out;
ret = arch_register_cpu(pr->id); ret = arch_register_cpu(pr->id);
if (ret) { if (ret) {
acpi_unmap_lsapic(pr->id); acpi_unmap_cpu(pr->id);
goto out; goto out;
} }
@ -215,7 +215,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
union acpi_object object = { 0 }; union acpi_object object = { 0 };
struct acpi_buffer buffer = { sizeof(union acpi_object), &object }; struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
struct acpi_processor *pr = acpi_driver_data(device); struct acpi_processor *pr = acpi_driver_data(device);
int apic_id, cpu_index, device_declaration = 0; int phys_id, cpu_index, device_declaration = 0;
acpi_status status = AE_OK; acpi_status status = AE_OK;
static int cpu0_initialized; static int cpu0_initialized;
unsigned long long value; unsigned long long value;
@ -262,15 +262,18 @@ static int acpi_processor_get_info(struct acpi_device *device)
pr->acpi_id = value; pr->acpi_id = value;
} }
apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id); phys_id = acpi_get_phys_id(pr->handle, device_declaration, pr->acpi_id);
if (apic_id < 0) if (phys_id < 0)
acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n"); acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n");
pr->apic_id = apic_id; pr->phys_id = phys_id;
cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id); cpu_index = acpi_map_cpuid(pr->phys_id, pr->acpi_id);
if (!cpu0_initialized && !acpi_has_cpu_in_madt()) { if (!cpu0_initialized && !acpi_has_cpu_in_madt()) {
cpu0_initialized = 1; cpu0_initialized = 1;
/* Handle UP system running SMP kernel, with no LAPIC in MADT */ /*
* Handle UP system running SMP kernel, with no CPU
* entry in MADT
*/
if ((cpu_index == -1) && (num_online_cpus() == 1)) if ((cpu_index == -1) && (num_online_cpus() == 1))
cpu_index = 0; cpu_index = 0;
} }
@ -458,7 +461,7 @@ static void acpi_processor_remove(struct acpi_device *device)
/* Remove the CPU. */ /* Remove the CPU. */
arch_unregister_cpu(pr->id); arch_unregister_cpu(pr->id);
acpi_unmap_lsapic(pr->id); acpi_unmap_cpu(pr->id);
cpu_hotplug_done(); cpu_hotplug_done();
cpu_maps_update_done(); cpu_maps_update_done();

View file

@ -257,7 +257,7 @@ int acpi_bus_init_power(struct acpi_device *device)
device->power.state = ACPI_STATE_UNKNOWN; device->power.state = ACPI_STATE_UNKNOWN;
if (!acpi_device_is_present(device)) if (!acpi_device_is_present(device))
return 0; return -ENXIO;
result = acpi_device_get_power(device, &state); result = acpi_device_get_power(device, &state);
if (result) if (result)

View file

@ -69,7 +69,7 @@ static int map_madt_entry(int type, u32 acpi_id)
unsigned long madt_end, entry; unsigned long madt_end, entry;
static struct acpi_table_madt *madt; static struct acpi_table_madt *madt;
static int read_madt; static int read_madt;
int apic_id = -1; int phys_id = -1; /* CPU hardware ID */
if (!read_madt) { if (!read_madt) {
if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0, if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0,
@ -79,7 +79,7 @@ static int map_madt_entry(int type, u32 acpi_id)
} }
if (!madt) if (!madt)
return apic_id; return phys_id;
entry = (unsigned long)madt; entry = (unsigned long)madt;
madt_end = entry + madt->header.length; madt_end = entry + madt->header.length;
@ -91,18 +91,18 @@ static int map_madt_entry(int type, u32 acpi_id)
struct acpi_subtable_header *header = struct acpi_subtable_header *header =
(struct acpi_subtable_header *)entry; (struct acpi_subtable_header *)entry;
if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) { if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
if (!map_lapic_id(header, acpi_id, &apic_id)) if (!map_lapic_id(header, acpi_id, &phys_id))
break; break;
} else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) { } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) {
if (!map_x2apic_id(header, type, acpi_id, &apic_id)) if (!map_x2apic_id(header, type, acpi_id, &phys_id))
break; break;
} else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
if (!map_lsapic_id(header, type, acpi_id, &apic_id)) if (!map_lsapic_id(header, type, acpi_id, &phys_id))
break; break;
} }
entry += header->length; entry += header->length;
} }
return apic_id; return phys_id;
} }
static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id) static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
@ -110,7 +110,7 @@ static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *obj; union acpi_object *obj;
struct acpi_subtable_header *header; struct acpi_subtable_header *header;
int apic_id = -1; int phys_id = -1;
if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
goto exit; goto exit;
@ -126,38 +126,38 @@ static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
header = (struct acpi_subtable_header *)obj->buffer.pointer; header = (struct acpi_subtable_header *)obj->buffer.pointer;
if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) if (header->type == ACPI_MADT_TYPE_LOCAL_APIC)
map_lapic_id(header, acpi_id, &apic_id); map_lapic_id(header, acpi_id, &phys_id);
else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC)
map_lsapic_id(header, type, acpi_id, &apic_id); map_lsapic_id(header, type, acpi_id, &phys_id);
else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC)
map_x2apic_id(header, type, acpi_id, &apic_id); map_x2apic_id(header, type, acpi_id, &phys_id);
exit: exit:
kfree(buffer.pointer); kfree(buffer.pointer);
return apic_id; return phys_id;
} }
int acpi_get_apicid(acpi_handle handle, int type, u32 acpi_id) int acpi_get_phys_id(acpi_handle handle, int type, u32 acpi_id)
{ {
int apic_id; int phys_id;
apic_id = map_mat_entry(handle, type, acpi_id); phys_id = map_mat_entry(handle, type, acpi_id);
if (apic_id == -1) if (phys_id == -1)
apic_id = map_madt_entry(type, acpi_id); phys_id = map_madt_entry(type, acpi_id);
return apic_id; return phys_id;
} }
int acpi_map_cpuid(int apic_id, u32 acpi_id) int acpi_map_cpuid(int phys_id, u32 acpi_id)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
int i; int i;
#endif #endif
if (apic_id == -1) { if (phys_id == -1) {
/* /*
* On UP processor, there is no _MAT or MADT table. * On UP processor, there is no _MAT or MADT table.
* So above apic_id is always set to -1. * So above phys_id is always set to -1.
* *
* BIOS may define multiple CPU handles even for UP processor. * BIOS may define multiple CPU handles even for UP processor.
* For example, * For example,
@ -170,7 +170,7 @@ int acpi_map_cpuid(int apic_id, u32 acpi_id)
* Processor (CPU3, 0x03, 0x00000410, 0x06) {} * Processor (CPU3, 0x03, 0x00000410, 0x06) {}
* } * }
* *
* Ignores apic_id and always returns 0 for the processor * Ignores phys_id and always returns 0 for the processor
* handle with acpi id 0 if nr_cpu_ids is 1. * handle with acpi id 0 if nr_cpu_ids is 1.
* This should be the case if SMP tables are not found. * This should be the case if SMP tables are not found.
* Return -1 for other CPU's handle. * Return -1 for other CPU's handle.
@ -178,28 +178,28 @@ int acpi_map_cpuid(int apic_id, u32 acpi_id)
if (nr_cpu_ids <= 1 && acpi_id == 0) if (nr_cpu_ids <= 1 && acpi_id == 0)
return acpi_id; return acpi_id;
else else
return apic_id; return phys_id;
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
if (cpu_physical_id(i) == apic_id) if (cpu_physical_id(i) == phys_id)
return i; return i;
} }
#else #else
/* In UP kernel, only processor 0 is valid */ /* In UP kernel, only processor 0 is valid */
if (apic_id == 0) if (phys_id == 0)
return apic_id; return phys_id;
#endif #endif
return -1; return -1;
} }
int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)
{ {
int apic_id; int phys_id;
apic_id = acpi_get_apicid(handle, type, acpi_id); phys_id = acpi_get_phys_id(handle, type, acpi_id);
return acpi_map_cpuid(apic_id, acpi_id); return acpi_map_cpuid(phys_id, acpi_id);
} }
EXPORT_SYMBOL_GPL(acpi_get_cpuid); EXPORT_SYMBOL_GPL(acpi_get_cpuid);

View file

@ -1001,7 +1001,7 @@ static void acpi_free_power_resources_lists(struct acpi_device *device)
if (device->wakeup.flags.valid) if (device->wakeup.flags.valid)
acpi_power_resources_list_free(&device->wakeup.resources); acpi_power_resources_list_free(&device->wakeup.resources);
if (!device->flags.power_manageable) if (!device->power.flags.power_resources)
return; return;
for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) { for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
@ -1744,10 +1744,8 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
device->power.flags.power_resources) device->power.flags.power_resources)
device->power.states[ACPI_STATE_D3_COLD].flags.os_accessible = 1; device->power.states[ACPI_STATE_D3_COLD].flags.os_accessible = 1;
if (acpi_bus_init_power(device)) { if (acpi_bus_init_power(device))
acpi_free_power_resources_lists(device);
device->flags.power_manageable = 0; device->flags.power_manageable = 0;
}
} }
static void acpi_bus_get_flags(struct acpi_device *device) static void acpi_bus_get_flags(struct acpi_device *device)
@ -2371,13 +2369,18 @@ static void acpi_bus_attach(struct acpi_device *device)
/* Skip devices that are not present. */ /* Skip devices that are not present. */
if (!acpi_device_is_present(device)) { if (!acpi_device_is_present(device)) {
device->flags.visited = false; device->flags.visited = false;
device->flags.power_manageable = 0;
return; return;
} }
if (device->handler) if (device->handler)
goto ok; goto ok;
if (!device->flags.initialized) { if (!device->flags.initialized) {
acpi_bus_update_power(device, NULL); device->flags.power_manageable =
device->power.states[ACPI_STATE_D0].flags.valid;
if (acpi_bus_init_power(device))
device->flags.power_manageable = 0;
device->flags.initialized = true; device->flags.initialized = true;
} }
device->flags.visited = false; device->flags.visited = false;

View file

@ -522,6 +522,16 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
DMI_MATCH(DMI_PRODUCT_NAME, "370R4E/370R4V/370R5E/3570RE/370R5V"), DMI_MATCH(DMI_PRODUCT_NAME, "370R4E/370R4V/370R5E/3570RE/370R5V"),
}, },
}, },
{
/* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */
.callback = video_disable_native_backlight,
.ident = "Dell XPS15 L521X",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "XPS L521X"),
},
},
{} {}
}; };

View file

@ -969,7 +969,8 @@ static void sender(void *send_info,
do_gettimeofday(&t); do_gettimeofday(&t);
pr_info("**Enqueue %02x %02x: %ld.%6.6ld\n", pr_info("**Enqueue %02x %02x: %ld.%6.6ld\n",
msg->data[0], msg->data[1], t.tv_sec, t.tv_usec); msg->data[0], msg->data[1],
(long) t.tv_sec, (long) t.tv_usec);
} }
} }

View file

@ -37,6 +37,7 @@ obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
obj-$(CONFIG_DRM_TTM) += ttm/ obj-$(CONFIG_DRM_TTM) += ttm/
obj-$(CONFIG_DRM_TDFX) += tdfx/ obj-$(CONFIG_DRM_TDFX) += tdfx/
obj-$(CONFIG_DRM_R128) += r128/ obj-$(CONFIG_DRM_R128) += r128/
obj-$(CONFIG_HSA_AMD) += amd/amdkfd/
obj-$(CONFIG_DRM_RADEON)+= radeon/ obj-$(CONFIG_DRM_RADEON)+= radeon/
obj-$(CONFIG_DRM_MGA) += mga/ obj-$(CONFIG_DRM_MGA) += mga/
obj-$(CONFIG_DRM_I810) += i810/ obj-$(CONFIG_DRM_I810) += i810/
@ -67,4 +68,3 @@ obj-$(CONFIG_DRM_IMX) += imx/
obj-y += i2c/ obj-y += i2c/
obj-y += panel/ obj-y += panel/
obj-y += bridge/ obj-y += bridge/
obj-$(CONFIG_HSA_AMD) += amd/amdkfd/

View file

@ -31,7 +31,6 @@
#include <uapi/linux/kfd_ioctl.h> #include <uapi/linux/kfd_ioctl.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/uaccess.h>
#include <uapi/asm-generic/mman-common.h> #include <uapi/asm-generic/mman-common.h>
#include <asm/processor.h> #include <asm/processor.h>
#include "kfd_priv.h" #include "kfd_priv.h"
@ -127,17 +126,14 @@ static int kfd_open(struct inode *inode, struct file *filep)
return 0; return 0;
} }
static long kfd_ioctl_get_version(struct file *filep, struct kfd_process *p, static int kfd_ioctl_get_version(struct file *filep, struct kfd_process *p,
void __user *arg) void *data)
{ {
struct kfd_ioctl_get_version_args args; struct kfd_ioctl_get_version_args *args = data;
int err = 0; int err = 0;
args.major_version = KFD_IOCTL_MAJOR_VERSION; args->major_version = KFD_IOCTL_MAJOR_VERSION;
args.minor_version = KFD_IOCTL_MINOR_VERSION; args->minor_version = KFD_IOCTL_MINOR_VERSION;
if (copy_to_user(arg, &args, sizeof(args)))
err = -EFAULT;
return err; return err;
} }
@ -221,10 +217,10 @@ static int set_queue_properties_from_user(struct queue_properties *q_properties,
return 0; return 0;
} }
static long kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p, static int kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
void __user *arg) void *data)
{ {
struct kfd_ioctl_create_queue_args args; struct kfd_ioctl_create_queue_args *args = data;
struct kfd_dev *dev; struct kfd_dev *dev;
int err = 0; int err = 0;
unsigned int queue_id; unsigned int queue_id;
@ -233,16 +229,13 @@ static long kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
memset(&q_properties, 0, sizeof(struct queue_properties)); memset(&q_properties, 0, sizeof(struct queue_properties));
if (copy_from_user(&args, arg, sizeof(args)))
return -EFAULT;
pr_debug("kfd: creating queue ioctl\n"); pr_debug("kfd: creating queue ioctl\n");
err = set_queue_properties_from_user(&q_properties, &args); err = set_queue_properties_from_user(&q_properties, args);
if (err) if (err)
return err; return err;
dev = kfd_device_by_id(args.gpu_id); dev = kfd_device_by_id(args->gpu_id);
if (dev == NULL) if (dev == NULL)
return -EINVAL; return -EINVAL;
@ -250,7 +243,7 @@ static long kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
pdd = kfd_bind_process_to_device(dev, p); pdd = kfd_bind_process_to_device(dev, p);
if (IS_ERR(pdd)) { if (IS_ERR(pdd)) {
err = PTR_ERR(pdd); err = -ESRCH;
goto err_bind_process; goto err_bind_process;
} }
@ -263,33 +256,26 @@ static long kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
if (err != 0) if (err != 0)
goto err_create_queue; goto err_create_queue;
args.queue_id = queue_id; args->queue_id = queue_id;
/* Return gpu_id as doorbell offset for mmap usage */ /* Return gpu_id as doorbell offset for mmap usage */
args.doorbell_offset = args.gpu_id << PAGE_SHIFT; args->doorbell_offset = args->gpu_id << PAGE_SHIFT;
if (copy_to_user(arg, &args, sizeof(args))) {
err = -EFAULT;
goto err_copy_args_out;
}
mutex_unlock(&p->mutex); mutex_unlock(&p->mutex);
pr_debug("kfd: queue id %d was created successfully\n", args.queue_id); pr_debug("kfd: queue id %d was created successfully\n", args->queue_id);
pr_debug("ring buffer address == 0x%016llX\n", pr_debug("ring buffer address == 0x%016llX\n",
args.ring_base_address); args->ring_base_address);
pr_debug("read ptr address == 0x%016llX\n", pr_debug("read ptr address == 0x%016llX\n",
args.read_pointer_address); args->read_pointer_address);
pr_debug("write ptr address == 0x%016llX\n", pr_debug("write ptr address == 0x%016llX\n",
args.write_pointer_address); args->write_pointer_address);
return 0; return 0;
err_copy_args_out:
pqm_destroy_queue(&p->pqm, queue_id);
err_create_queue: err_create_queue:
err_bind_process: err_bind_process:
mutex_unlock(&p->mutex); mutex_unlock(&p->mutex);
@ -297,99 +283,90 @@ err_bind_process:
} }
static int kfd_ioctl_destroy_queue(struct file *filp, struct kfd_process *p, static int kfd_ioctl_destroy_queue(struct file *filp, struct kfd_process *p,
void __user *arg) void *data)
{ {
int retval; int retval;
struct kfd_ioctl_destroy_queue_args args; struct kfd_ioctl_destroy_queue_args *args = data;
if (copy_from_user(&args, arg, sizeof(args)))
return -EFAULT;
pr_debug("kfd: destroying queue id %d for PASID %d\n", pr_debug("kfd: destroying queue id %d for PASID %d\n",
args.queue_id, args->queue_id,
p->pasid); p->pasid);
mutex_lock(&p->mutex); mutex_lock(&p->mutex);
retval = pqm_destroy_queue(&p->pqm, args.queue_id); retval = pqm_destroy_queue(&p->pqm, args->queue_id);
mutex_unlock(&p->mutex); mutex_unlock(&p->mutex);
return retval; return retval;
} }
static int kfd_ioctl_update_queue(struct file *filp, struct kfd_process *p, static int kfd_ioctl_update_queue(struct file *filp, struct kfd_process *p,
void __user *arg) void *data)
{ {
int retval; int retval;
struct kfd_ioctl_update_queue_args args; struct kfd_ioctl_update_queue_args *args = data;
struct queue_properties properties; struct queue_properties properties;
if (copy_from_user(&args, arg, sizeof(args))) if (args->queue_percentage > KFD_MAX_QUEUE_PERCENTAGE) {
return -EFAULT;
if (args.queue_percentage > KFD_MAX_QUEUE_PERCENTAGE) {
pr_err("kfd: queue percentage must be between 0 to KFD_MAX_QUEUE_PERCENTAGE\n"); pr_err("kfd: queue percentage must be between 0 to KFD_MAX_QUEUE_PERCENTAGE\n");
return -EINVAL; return -EINVAL;
} }
if (args.queue_priority > KFD_MAX_QUEUE_PRIORITY) { if (args->queue_priority > KFD_MAX_QUEUE_PRIORITY) {
pr_err("kfd: queue priority must be between 0 to KFD_MAX_QUEUE_PRIORITY\n"); pr_err("kfd: queue priority must be between 0 to KFD_MAX_QUEUE_PRIORITY\n");
return -EINVAL; return -EINVAL;
} }
if ((args.ring_base_address) && if ((args->ring_base_address) &&
(!access_ok(VERIFY_WRITE, (!access_ok(VERIFY_WRITE,
(const void __user *) args.ring_base_address, (const void __user *) args->ring_base_address,
sizeof(uint64_t)))) { sizeof(uint64_t)))) {
pr_err("kfd: can't access ring base address\n"); pr_err("kfd: can't access ring base address\n");
return -EFAULT; return -EFAULT;
} }
if (!is_power_of_2(args.ring_size) && (args.ring_size != 0)) { if (!is_power_of_2(args->ring_size) && (args->ring_size != 0)) {
pr_err("kfd: ring size must be a power of 2 or 0\n"); pr_err("kfd: ring size must be a power of 2 or 0\n");
return -EINVAL; return -EINVAL;
} }
properties.queue_address = args.ring_base_address; properties.queue_address = args->ring_base_address;
properties.queue_size = args.ring_size; properties.queue_size = args->ring_size;
properties.queue_percent = args.queue_percentage; properties.queue_percent = args->queue_percentage;
properties.priority = args.queue_priority; properties.priority = args->queue_priority;
pr_debug("kfd: updating queue id %d for PASID %d\n", pr_debug("kfd: updating queue id %d for PASID %d\n",
args.queue_id, p->pasid); args->queue_id, p->pasid);
mutex_lock(&p->mutex); mutex_lock(&p->mutex);
retval = pqm_update_queue(&p->pqm, args.queue_id, &properties); retval = pqm_update_queue(&p->pqm, args->queue_id, &properties);
mutex_unlock(&p->mutex); mutex_unlock(&p->mutex);
return retval; return retval;
} }
static long kfd_ioctl_set_memory_policy(struct file *filep, static int kfd_ioctl_set_memory_policy(struct file *filep,
struct kfd_process *p, void __user *arg) struct kfd_process *p, void *data)
{ {
struct kfd_ioctl_set_memory_policy_args args; struct kfd_ioctl_set_memory_policy_args *args = data;
struct kfd_dev *dev; struct kfd_dev *dev;
int err = 0; int err = 0;
struct kfd_process_device *pdd; struct kfd_process_device *pdd;
enum cache_policy default_policy, alternate_policy; enum cache_policy default_policy, alternate_policy;
if (copy_from_user(&args, arg, sizeof(args))) if (args->default_policy != KFD_IOC_CACHE_POLICY_COHERENT
return -EFAULT; && args->default_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) {
if (args.default_policy != KFD_IOC_CACHE_POLICY_COHERENT
&& args.default_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) {
return -EINVAL; return -EINVAL;
} }
if (args.alternate_policy != KFD_IOC_CACHE_POLICY_COHERENT if (args->alternate_policy != KFD_IOC_CACHE_POLICY_COHERENT
&& args.alternate_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) { && args->alternate_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) {
return -EINVAL; return -EINVAL;
} }
dev = kfd_device_by_id(args.gpu_id); dev = kfd_device_by_id(args->gpu_id);
if (dev == NULL) if (dev == NULL)
return -EINVAL; return -EINVAL;
@ -397,23 +374,23 @@ static long kfd_ioctl_set_memory_policy(struct file *filep,
pdd = kfd_bind_process_to_device(dev, p); pdd = kfd_bind_process_to_device(dev, p);
if (IS_ERR(pdd)) { if (IS_ERR(pdd)) {
err = PTR_ERR(pdd); err = -ESRCH;
goto out; goto out;
} }
default_policy = (args.default_policy == KFD_IOC_CACHE_POLICY_COHERENT) default_policy = (args->default_policy == KFD_IOC_CACHE_POLICY_COHERENT)
? cache_policy_coherent : cache_policy_noncoherent; ? cache_policy_coherent : cache_policy_noncoherent;
alternate_policy = alternate_policy =
(args.alternate_policy == KFD_IOC_CACHE_POLICY_COHERENT) (args->alternate_policy == KFD_IOC_CACHE_POLICY_COHERENT)
? cache_policy_coherent : cache_policy_noncoherent; ? cache_policy_coherent : cache_policy_noncoherent;
if (!dev->dqm->set_cache_memory_policy(dev->dqm, if (!dev->dqm->set_cache_memory_policy(dev->dqm,
&pdd->qpd, &pdd->qpd,
default_policy, default_policy,
alternate_policy, alternate_policy,
(void __user *)args.alternate_aperture_base, (void __user *)args->alternate_aperture_base,
args.alternate_aperture_size)) args->alternate_aperture_size))
err = -EINVAL; err = -EINVAL;
out: out:
@ -422,53 +399,44 @@ out:
return err; return err;
} }
static long kfd_ioctl_get_clock_counters(struct file *filep, static int kfd_ioctl_get_clock_counters(struct file *filep,
struct kfd_process *p, void __user *arg) struct kfd_process *p, void *data)
{ {
struct kfd_ioctl_get_clock_counters_args args; struct kfd_ioctl_get_clock_counters_args *args = data;
struct kfd_dev *dev; struct kfd_dev *dev;
struct timespec time; struct timespec time;
if (copy_from_user(&args, arg, sizeof(args))) dev = kfd_device_by_id(args->gpu_id);
return -EFAULT;
dev = kfd_device_by_id(args.gpu_id);
if (dev == NULL) if (dev == NULL)
return -EINVAL; return -EINVAL;
/* Reading GPU clock counter from KGD */ /* Reading GPU clock counter from KGD */
args.gpu_clock_counter = kfd2kgd->get_gpu_clock_counter(dev->kgd); args->gpu_clock_counter = kfd2kgd->get_gpu_clock_counter(dev->kgd);
/* No access to rdtsc. Using raw monotonic time */ /* No access to rdtsc. Using raw monotonic time */
getrawmonotonic(&time); getrawmonotonic(&time);
args.cpu_clock_counter = (uint64_t)timespec_to_ns(&time); args->cpu_clock_counter = (uint64_t)timespec_to_ns(&time);
get_monotonic_boottime(&time); get_monotonic_boottime(&time);
args.system_clock_counter = (uint64_t)timespec_to_ns(&time); args->system_clock_counter = (uint64_t)timespec_to_ns(&time);
/* Since the counter is in nano-seconds we use 1GHz frequency */ /* Since the counter is in nano-seconds we use 1GHz frequency */
args.system_clock_freq = 1000000000; args->system_clock_freq = 1000000000;
if (copy_to_user(arg, &args, sizeof(args)))
return -EFAULT;
return 0; return 0;
} }
static int kfd_ioctl_get_process_apertures(struct file *filp, static int kfd_ioctl_get_process_apertures(struct file *filp,
struct kfd_process *p, void __user *arg) struct kfd_process *p, void *data)
{ {
struct kfd_ioctl_get_process_apertures_args args; struct kfd_ioctl_get_process_apertures_args *args = data;
struct kfd_process_device_apertures *pAperture; struct kfd_process_device_apertures *pAperture;
struct kfd_process_device *pdd; struct kfd_process_device *pdd;
dev_dbg(kfd_device, "get apertures for PASID %d", p->pasid); dev_dbg(kfd_device, "get apertures for PASID %d", p->pasid);
if (copy_from_user(&args, arg, sizeof(args))) args->num_of_nodes = 0;
return -EFAULT;
args.num_of_nodes = 0;
mutex_lock(&p->mutex); mutex_lock(&p->mutex);
@ -477,7 +445,8 @@ static int kfd_ioctl_get_process_apertures(struct file *filp,
/* Run over all pdd of the process */ /* Run over all pdd of the process */
pdd = kfd_get_first_process_device_data(p); pdd = kfd_get_first_process_device_data(p);
do { do {
pAperture = &args.process_apertures[args.num_of_nodes]; pAperture =
&args->process_apertures[args->num_of_nodes];
pAperture->gpu_id = pdd->dev->id; pAperture->gpu_id = pdd->dev->id;
pAperture->lds_base = pdd->lds_base; pAperture->lds_base = pdd->lds_base;
pAperture->lds_limit = pdd->lds_limit; pAperture->lds_limit = pdd->lds_limit;
@ -487,7 +456,7 @@ static int kfd_ioctl_get_process_apertures(struct file *filp,
pAperture->scratch_limit = pdd->scratch_limit; pAperture->scratch_limit = pdd->scratch_limit;
dev_dbg(kfd_device, dev_dbg(kfd_device,
"node id %u\n", args.num_of_nodes); "node id %u\n", args->num_of_nodes);
dev_dbg(kfd_device, dev_dbg(kfd_device,
"gpu id %u\n", pdd->dev->id); "gpu id %u\n", pdd->dev->id);
dev_dbg(kfd_device, dev_dbg(kfd_device,
@ -503,80 +472,131 @@ static int kfd_ioctl_get_process_apertures(struct file *filp,
dev_dbg(kfd_device, dev_dbg(kfd_device,
"scratch_limit %llX\n", pdd->scratch_limit); "scratch_limit %llX\n", pdd->scratch_limit);
args.num_of_nodes++; args->num_of_nodes++;
} while ((pdd = kfd_get_next_process_device_data(p, pdd)) != NULL && } while ((pdd = kfd_get_next_process_device_data(p, pdd)) != NULL &&
(args.num_of_nodes < NUM_OF_SUPPORTED_GPUS)); (args->num_of_nodes < NUM_OF_SUPPORTED_GPUS));
} }
mutex_unlock(&p->mutex); mutex_unlock(&p->mutex);
if (copy_to_user(arg, &args, sizeof(args)))
return -EFAULT;
return 0; return 0;
} }
#define AMDKFD_IOCTL_DEF(ioctl, _func, _flags) \
[_IOC_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .cmd_drv = 0, .name = #ioctl}
/** Ioctl table */
static const struct amdkfd_ioctl_desc amdkfd_ioctls[] = {
AMDKFD_IOCTL_DEF(AMDKFD_IOC_GET_VERSION,
kfd_ioctl_get_version, 0),
AMDKFD_IOCTL_DEF(AMDKFD_IOC_CREATE_QUEUE,
kfd_ioctl_create_queue, 0),
AMDKFD_IOCTL_DEF(AMDKFD_IOC_DESTROY_QUEUE,
kfd_ioctl_destroy_queue, 0),
AMDKFD_IOCTL_DEF(AMDKFD_IOC_SET_MEMORY_POLICY,
kfd_ioctl_set_memory_policy, 0),
AMDKFD_IOCTL_DEF(AMDKFD_IOC_GET_CLOCK_COUNTERS,
kfd_ioctl_get_clock_counters, 0),
AMDKFD_IOCTL_DEF(AMDKFD_IOC_GET_PROCESS_APERTURES,
kfd_ioctl_get_process_apertures, 0),
AMDKFD_IOCTL_DEF(AMDKFD_IOC_UPDATE_QUEUE,
kfd_ioctl_update_queue, 0),
};
#define AMDKFD_CORE_IOCTL_COUNT ARRAY_SIZE(amdkfd_ioctls)
static long kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) static long kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
{ {
struct kfd_process *process; struct kfd_process *process;
long err = -EINVAL; amdkfd_ioctl_t *func;
const struct amdkfd_ioctl_desc *ioctl = NULL;
unsigned int nr = _IOC_NR(cmd);
char stack_kdata[128];
char *kdata = NULL;
unsigned int usize, asize;
int retcode = -EINVAL;
dev_dbg(kfd_device, if (nr >= AMDKFD_CORE_IOCTL_COUNT)
"ioctl cmd 0x%x (#%d), arg 0x%lx\n", goto err_i1;
cmd, _IOC_NR(cmd), arg);
if ((nr >= AMDKFD_COMMAND_START) && (nr < AMDKFD_COMMAND_END)) {
u32 amdkfd_size;
ioctl = &amdkfd_ioctls[nr];
amdkfd_size = _IOC_SIZE(ioctl->cmd);
usize = asize = _IOC_SIZE(cmd);
if (amdkfd_size > asize)
asize = amdkfd_size;
cmd = ioctl->cmd;
} else
goto err_i1;
dev_dbg(kfd_device, "ioctl cmd 0x%x (#%d), arg 0x%lx\n", cmd, nr, arg);
process = kfd_get_process(current); process = kfd_get_process(current);
if (IS_ERR(process)) if (IS_ERR(process)) {
return PTR_ERR(process); dev_dbg(kfd_device, "no process\n");
goto err_i1;
switch (cmd) {
case KFD_IOC_GET_VERSION:
err = kfd_ioctl_get_version(filep, process, (void __user *)arg);
break;
case KFD_IOC_CREATE_QUEUE:
err = kfd_ioctl_create_queue(filep, process,
(void __user *)arg);
break;
case KFD_IOC_DESTROY_QUEUE:
err = kfd_ioctl_destroy_queue(filep, process,
(void __user *)arg);
break;
case KFD_IOC_SET_MEMORY_POLICY:
err = kfd_ioctl_set_memory_policy(filep, process,
(void __user *)arg);
break;
case KFD_IOC_GET_CLOCK_COUNTERS:
err = kfd_ioctl_get_clock_counters(filep, process,
(void __user *)arg);
break;
case KFD_IOC_GET_PROCESS_APERTURES:
err = kfd_ioctl_get_process_apertures(filep, process,
(void __user *)arg);
break;
case KFD_IOC_UPDATE_QUEUE:
err = kfd_ioctl_update_queue(filep, process,
(void __user *)arg);
break;
default:
dev_err(kfd_device,
"unknown ioctl cmd 0x%x, arg 0x%lx)\n",
cmd, arg);
err = -EINVAL;
break;
} }
if (err < 0) /* Do not trust userspace, use our own definition */
dev_err(kfd_device, func = ioctl->func;
"ioctl error %ld for ioctl cmd 0x%x (#%d)\n",
err, cmd, _IOC_NR(cmd));
return err; if (unlikely(!func)) {
dev_dbg(kfd_device, "no function\n");
retcode = -EINVAL;
goto err_i1;
}
if (cmd & (IOC_IN | IOC_OUT)) {
if (asize <= sizeof(stack_kdata)) {
kdata = stack_kdata;
} else {
kdata = kmalloc(asize, GFP_KERNEL);
if (!kdata) {
retcode = -ENOMEM;
goto err_i1;
}
}
if (asize > usize)
memset(kdata + usize, 0, asize - usize);
}
if (cmd & IOC_IN) {
if (copy_from_user(kdata, (void __user *)arg, usize) != 0) {
retcode = -EFAULT;
goto err_i1;
}
} else if (cmd & IOC_OUT) {
memset(kdata, 0, usize);
}
retcode = func(filep, process, kdata);
if (cmd & IOC_OUT)
if (copy_to_user((void __user *)arg, kdata, usize) != 0)
retcode = -EFAULT;
err_i1:
if (!ioctl)
dev_dbg(kfd_device, "invalid ioctl: pid=%d, cmd=0x%02x, nr=0x%02x\n",
task_pid_nr(current), cmd, nr);
if (kdata != stack_kdata)
kfree(kdata);
if (retcode)
dev_dbg(kfd_device, "ret = %d\n", retcode);
return retcode;
} }
static int kfd_mmap(struct file *filp, struct vm_area_struct *vma) static int kfd_mmap(struct file *filp, struct vm_area_struct *vma)

View file

@ -161,6 +161,9 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
{ {
int bit = qpd->vmid - KFD_VMID_START_OFFSET; int bit = qpd->vmid - KFD_VMID_START_OFFSET;
/* Release the vmid mapping */
set_pasid_vmid_mapping(dqm, 0, qpd->vmid);
set_bit(bit, (unsigned long *)&dqm->vmid_bitmap); set_bit(bit, (unsigned long *)&dqm->vmid_bitmap);
qpd->vmid = 0; qpd->vmid = 0;
q->properties.vmid = 0; q->properties.vmid = 0;
@ -272,6 +275,18 @@ static int create_compute_queue_nocpsch(struct device_queue_manager *dqm,
return retval; return retval;
} }
pr_debug("kfd: loading mqd to hqd on pipe (%d) queue (%d)\n",
q->pipe,
q->queue);
retval = mqd->load_mqd(mqd, q->mqd, q->pipe,
q->queue, q->properties.write_ptr);
if (retval != 0) {
deallocate_hqd(dqm, q);
mqd->uninit_mqd(mqd, q->mqd, q->mqd_mem_obj);
return retval;
}
return 0; return 0;
} }
@ -320,6 +335,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
{ {
int retval; int retval;
struct mqd_manager *mqd; struct mqd_manager *mqd;
bool prev_active = false;
BUG_ON(!dqm || !q || !q->mqd); BUG_ON(!dqm || !q || !q->mqd);
@ -330,10 +346,18 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
return -ENOMEM; return -ENOMEM;
} }
retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
if (q->properties.is_active == true) if (q->properties.is_active == true)
prev_active = true;
/*
*
* check active state vs. the previous state
* and modify counter accordingly
*/
retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
if ((q->properties.is_active == true) && (prev_active == false))
dqm->queue_count++; dqm->queue_count++;
else else if ((q->properties.is_active == false) && (prev_active == true))
dqm->queue_count--; dqm->queue_count--;
if (sched_policy != KFD_SCHED_POLICY_NO_HWS) if (sched_policy != KFD_SCHED_POLICY_NO_HWS)

View file

@ -184,7 +184,7 @@ static bool is_occupied(struct mqd_manager *mm, void *mqd,
uint32_t queue_id) uint32_t queue_id)
{ {
return kfd2kgd->hqd_is_occupies(mm->dev->kgd, queue_address, return kfd2kgd->hqd_is_occupied(mm->dev->kgd, queue_address,
pipe_id, queue_id); pipe_id, queue_id);
} }

View file

@ -32,7 +32,7 @@ int kfd_pasid_init(void)
{ {
pasid_limit = max_num_of_processes; pasid_limit = max_num_of_processes;
pasid_bitmap = kzalloc(BITS_TO_LONGS(pasid_limit), GFP_KERNEL); pasid_bitmap = kcalloc(BITS_TO_LONGS(pasid_limit), sizeof(long), GFP_KERNEL);
if (!pasid_bitmap) if (!pasid_bitmap)
return -ENOMEM; return -ENOMEM;

View file

@ -463,6 +463,24 @@ struct kfd_process {
bool is_32bit_user_mode; bool is_32bit_user_mode;
}; };
/**
* Ioctl function type.
*
* \param filep pointer to file structure.
* \param p amdkfd process pointer.
* \param data pointer to arg that was copied from user.
*/
typedef int amdkfd_ioctl_t(struct file *filep, struct kfd_process *p,
void *data);
struct amdkfd_ioctl_desc {
unsigned int cmd;
int flags;
amdkfd_ioctl_t *func;
unsigned int cmd_drv;
const char *name;
};
void kfd_process_create_wq(void); void kfd_process_create_wq(void);
void kfd_process_destroy_wq(void); void kfd_process_destroy_wq(void);
struct kfd_process *kfd_create_process(const struct task_struct *); struct kfd_process *kfd_create_process(const struct task_struct *);

View file

@ -921,7 +921,7 @@ static int kfd_build_sysfs_node_tree(void)
uint32_t i = 0; uint32_t i = 0;
list_for_each_entry(dev, &topology_device_list, list) { list_for_each_entry(dev, &topology_device_list, list) {
ret = kfd_build_sysfs_node_entry(dev, 0); ret = kfd_build_sysfs_node_entry(dev, i);
if (ret < 0) if (ret < 0)
return ret; return ret;
i++; i++;

View file

@ -183,7 +183,7 @@ struct kfd2kgd_calls {
int (*hqd_load)(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id, int (*hqd_load)(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id,
uint32_t queue_id, uint32_t __user *wptr); uint32_t queue_id, uint32_t __user *wptr);
bool (*hqd_is_occupies)(struct kgd_dev *kgd, uint64_t queue_address, bool (*hqd_is_occupied)(struct kgd_dev *kgd, uint64_t queue_address,
uint32_t pipe_id, uint32_t queue_id); uint32_t pipe_id, uint32_t queue_id);
int (*hqd_destroy)(struct kgd_dev *kgd, uint32_t reset_type, int (*hqd_destroy)(struct kgd_dev *kgd, uint32_t reset_type,

View file

@ -1756,8 +1756,6 @@ struct drm_i915_private {
*/ */
struct workqueue_struct *dp_wq; struct workqueue_struct *dp_wq;
uint32_t bios_vgacntr;
/* Abstract the submission mechanism (legacy ringbuffer or execlists) away */ /* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
struct { struct {
int (*do_execbuf)(struct drm_device *dev, struct drm_file *file, int (*do_execbuf)(struct drm_device *dev, struct drm_file *file,

View file

@ -1048,6 +1048,7 @@ int
i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
struct drm_file *file) struct drm_file *file)
{ {
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_pwrite *args = data; struct drm_i915_gem_pwrite *args = data;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
int ret; int ret;
@ -1067,9 +1068,11 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
return -EFAULT; return -EFAULT;
} }
intel_runtime_pm_get(dev_priv);
ret = i915_mutex_lock_interruptible(dev); ret = i915_mutex_lock_interruptible(dev);
if (ret) if (ret)
return ret; goto put_rpm;
obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle)); obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
if (&obj->base == NULL) { if (&obj->base == NULL) {
@ -1121,6 +1124,9 @@ out:
drm_gem_object_unreference(&obj->base); drm_gem_object_unreference(&obj->base);
unlock: unlock:
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
put_rpm:
intel_runtime_pm_put(dev_priv);
return ret; return ret;
} }

View file

@ -3725,8 +3725,6 @@ static bool i8xx_handle_vblank(struct drm_device *dev,
if ((iir & flip_pending) == 0) if ((iir & flip_pending) == 0)
goto check_page_flip; goto check_page_flip;
intel_prepare_page_flip(dev, plane);
/* We detect FlipDone by looking for the change in PendingFlip from '1' /* We detect FlipDone by looking for the change in PendingFlip from '1'
* to '0' on the following vblank, i.e. IIR has the Pendingflip * to '0' on the following vblank, i.e. IIR has the Pendingflip
* asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence
@ -3736,6 +3734,7 @@ static bool i8xx_handle_vblank(struct drm_device *dev,
if (I915_READ16(ISR) & flip_pending) if (I915_READ16(ISR) & flip_pending)
goto check_page_flip; goto check_page_flip;
intel_prepare_page_flip(dev, plane);
intel_finish_page_flip(dev, pipe); intel_finish_page_flip(dev, pipe);
return true; return true;
@ -3907,8 +3906,6 @@ static bool i915_handle_vblank(struct drm_device *dev,
if ((iir & flip_pending) == 0) if ((iir & flip_pending) == 0)
goto check_page_flip; goto check_page_flip;
intel_prepare_page_flip(dev, plane);
/* We detect FlipDone by looking for the change in PendingFlip from '1' /* We detect FlipDone by looking for the change in PendingFlip from '1'
* to '0' on the following vblank, i.e. IIR has the Pendingflip * to '0' on the following vblank, i.e. IIR has the Pendingflip
* asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence
@ -3918,6 +3915,7 @@ static bool i915_handle_vblank(struct drm_device *dev,
if (I915_READ(ISR) & flip_pending) if (I915_READ(ISR) & flip_pending)
goto check_page_flip; goto check_page_flip;
intel_prepare_page_flip(dev, plane);
intel_finish_page_flip(dev, pipe); intel_finish_page_flip(dev, pipe);
return true; return true;

View file

@ -13057,11 +13057,7 @@ static void i915_disable_vga(struct drm_device *dev)
vga_put(dev->pdev, VGA_RSRC_LEGACY_IO); vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);
udelay(300); udelay(300);
/* I915_WRITE(vga_reg, VGA_DISP_DISABLE);
* Fujitsu-Siemens Lifebook S6010 (830) has problems resuming
* from S3 without preserving (some of?) the other bits.
*/
I915_WRITE(vga_reg, dev_priv->bios_vgacntr | VGA_DISP_DISABLE);
POSTING_READ(vga_reg); POSTING_READ(vga_reg);
} }
@ -13146,8 +13142,6 @@ void intel_modeset_init(struct drm_device *dev)
intel_shared_dpll_init(dev); intel_shared_dpll_init(dev);
/* save the BIOS value before clobbering it */
dev_priv->bios_vgacntr = I915_READ(i915_vgacntrl_reg(dev));
/* Just disable it once at startup */ /* Just disable it once at startup */
i915_disable_vga(dev); i915_disable_vga(dev);
intel_setup_outputs(dev); intel_setup_outputs(dev);

View file

@ -615,29 +615,6 @@ static void chv_pipe_power_well_disable(struct drm_i915_private *dev_priv,
vlv_power_sequencer_reset(dev_priv); vlv_power_sequencer_reset(dev_priv);
} }
static void check_power_well_state(struct drm_i915_private *dev_priv,
struct i915_power_well *power_well)
{
bool enabled = power_well->ops->is_enabled(dev_priv, power_well);
if (power_well->always_on || !i915.disable_power_well) {
if (!enabled)
goto mismatch;
return;
}
if (enabled != (power_well->count > 0))
goto mismatch;
return;
mismatch:
WARN(1, "state mismatch for '%s' (always_on %d hw state %d use-count %d disable_power_well %d\n",
power_well->name, power_well->always_on, enabled,
power_well->count, i915.disable_power_well);
}
/** /**
* intel_display_power_get - grab a power domain reference * intel_display_power_get - grab a power domain reference
* @dev_priv: i915 device instance * @dev_priv: i915 device instance
@ -669,8 +646,6 @@ void intel_display_power_get(struct drm_i915_private *dev_priv,
power_well->ops->enable(dev_priv, power_well); power_well->ops->enable(dev_priv, power_well);
power_well->hw_enabled = true; power_well->hw_enabled = true;
} }
check_power_well_state(dev_priv, power_well);
} }
power_domains->domain_use_count[domain]++; power_domains->domain_use_count[domain]++;
@ -709,8 +684,6 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
power_well->hw_enabled = false; power_well->hw_enabled = false;
power_well->ops->disable(dev_priv, power_well); power_well->ops->disable(dev_priv, power_well);
} }
check_power_well_state(dev_priv, power_well);
} }
mutex_unlock(&power_domains->lock); mutex_unlock(&power_domains->lock);

View file

@ -26,7 +26,7 @@
void void
nvkm_event_put(struct nvkm_event *event, u32 types, int index) nvkm_event_put(struct nvkm_event *event, u32 types, int index)
{ {
BUG_ON(!spin_is_locked(&event->refs_lock)); assert_spin_locked(&event->refs_lock);
while (types) { while (types) {
int type = __ffs(types); types &= ~(1 << type); int type = __ffs(types); types &= ~(1 << type);
if (--event->refs[index * event->types_nr + type] == 0) { if (--event->refs[index * event->types_nr + type] == 0) {
@ -39,7 +39,7 @@ nvkm_event_put(struct nvkm_event *event, u32 types, int index)
void void
nvkm_event_get(struct nvkm_event *event, u32 types, int index) nvkm_event_get(struct nvkm_event *event, u32 types, int index)
{ {
BUG_ON(!spin_is_locked(&event->refs_lock)); assert_spin_locked(&event->refs_lock);
while (types) { while (types) {
int type = __ffs(types); types &= ~(1 << type); int type = __ffs(types); types &= ~(1 << type);
if (++event->refs[index * event->types_nr + type] == 1) { if (++event->refs[index * event->types_nr + type] == 1) {

View file

@ -98,7 +98,7 @@ nvkm_notify_send(struct nvkm_notify *notify, void *data, u32 size)
struct nvkm_event *event = notify->event; struct nvkm_event *event = notify->event;
unsigned long flags; unsigned long flags;
BUG_ON(!spin_is_locked(&event->list_lock)); assert_spin_locked(&event->list_lock);
BUG_ON(size != notify->size); BUG_ON(size != notify->size);
spin_lock_irqsave(&event->refs_lock, flags); spin_lock_irqsave(&event->refs_lock, flags);

View file

@ -249,6 +249,39 @@ nve0_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass; device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass;
device->oclass[NVDEV_ENGINE_PERFMON] = &nvf0_perfmon_oclass; device->oclass[NVDEV_ENGINE_PERFMON] = &nvf0_perfmon_oclass;
break; break;
case 0x106:
device->cname = "GK208B";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
device->oclass[NVDEV_SUBDEV_GPIO ] = nve0_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nve0_i2c_oclass;
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_CLOCK ] = &nve0_clock_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nvd0_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nvc0_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nve0_fb_oclass;
device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
device->oclass[NVDEV_SUBDEV_IBUS ] = &nve0_ibus_oclass;
device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
device->oclass[NVDEV_SUBDEV_BAR ] = &nvc0_bar_oclass;
device->oclass[NVDEV_SUBDEV_PWR ] = nv108_pwr_oclass;
device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass;
device->oclass[NVDEV_ENGINE_DMAOBJ ] = nvd0_dmaeng_oclass;
device->oclass[NVDEV_ENGINE_FIFO ] = nv108_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nvc0_software_oclass;
device->oclass[NVDEV_ENGINE_GR ] = nv108_graph_oclass;
device->oclass[NVDEV_ENGINE_DISP ] = nvf0_disp_oclass;
device->oclass[NVDEV_ENGINE_COPY0 ] = &nve0_copy0_oclass;
device->oclass[NVDEV_ENGINE_COPY1 ] = &nve0_copy1_oclass;
device->oclass[NVDEV_ENGINE_COPY2 ] = &nve0_copy2_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &nve0_bsp_oclass;
device->oclass[NVDEV_ENGINE_VP ] = &nve0_vp_oclass;
device->oclass[NVDEV_ENGINE_PPP ] = &nvc0_ppp_oclass;
break;
case 0x108: case 0x108:
device->cname = "GK208"; device->cname = "GK208";
device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;

View file

@ -44,8 +44,10 @@ static void
pramin_fini(void *data) pramin_fini(void *data)
{ {
struct priv *priv = data; struct priv *priv = data;
nv_wr32(priv->bios, 0x001700, priv->bar0); if (priv) {
kfree(priv); nv_wr32(priv->bios, 0x001700, priv->bar0);
kfree(priv);
}
} }
static void * static void *

View file

@ -24,34 +24,71 @@
#include "nv50.h" #include "nv50.h"
struct nvaa_ram_priv {
struct nouveau_ram base;
u64 poller_base;
};
static int static int
nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nvaa_ram_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 datasize, struct nouveau_oclass *oclass, void *data, u32 datasize,
struct nouveau_object **pobject) struct nouveau_object **pobject)
{ {
const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */ u32 rsvd_head = ( 256 * 1024); /* vga memory */
const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */ u32 rsvd_tail = (1024 * 1024); /* vbios etc */
struct nouveau_fb *pfb = nouveau_fb(parent); struct nouveau_fb *pfb = nouveau_fb(parent);
struct nouveau_ram *ram; struct nvaa_ram_priv *priv;
int ret; int ret;
ret = nouveau_ram_create(parent, engine, oclass, &ram); ret = nouveau_ram_create(parent, engine, oclass, &priv);
*pobject = nv_object(ram); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
ram->size = nv_rd32(pfb, 0x10020c); priv->base.type = NV_MEM_TYPE_STOLEN;
ram->size = (ram->size & 0xffffff00) | ((ram->size & 0x000000ff) << 32); priv->base.stolen = (u64)nv_rd32(pfb, 0x100e10) << 12;
priv->base.size = (u64)nv_rd32(pfb, 0x100e14) << 12;
ret = nouveau_mm_init(&pfb->vram, rsvd_head, (ram->size >> 12) - rsvd_tail += 0x1000;
(rsvd_head + rsvd_tail), 1); priv->poller_base = priv->base.size - rsvd_tail;
ret = nouveau_mm_init(&pfb->vram, rsvd_head >> 12,
(priv->base.size - (rsvd_head + rsvd_tail)) >> 12,
1);
if (ret) if (ret)
return ret; return ret;
ram->type = NV_MEM_TYPE_STOLEN; priv->base.get = nv50_ram_get;
ram->stolen = (u64)nv_rd32(pfb, 0x100e10) << 12; priv->base.put = nv50_ram_put;
ram->get = nv50_ram_get; return 0;
ram->put = nv50_ram_put; }
static int
nvaa_ram_init(struct nouveau_object *object)
{
struct nouveau_fb *pfb = nouveau_fb(object);
struct nvaa_ram_priv *priv = (void *)object;
int ret;
u64 dniso, hostnb, flush;
ret = nouveau_ram_init(&priv->base);
if (ret)
return ret;
dniso = ((priv->base.size - (priv->poller_base + 0x00)) >> 5) - 1;
hostnb = ((priv->base.size - (priv->poller_base + 0x20)) >> 5) - 1;
flush = ((priv->base.size - (priv->poller_base + 0x40)) >> 5) - 1;
/* Enable NISO poller for various clients and set their associated
* read address, only for MCP77/78 and MCP79/7A. (fd#25701)
*/
nv_wr32(pfb, 0x100c18, dniso);
nv_mask(pfb, 0x100c14, 0x00000000, 0x00000001);
nv_wr32(pfb, 0x100c1c, hostnb);
nv_mask(pfb, 0x100c14, 0x00000000, 0x00000002);
nv_wr32(pfb, 0x100c24, flush);
nv_mask(pfb, 0x100c14, 0x00000000, 0x00010000);
return 0; return 0;
} }
@ -60,7 +97,7 @@ nvaa_ram_oclass = {
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nouveau_ofuncs) {
.ctor = nvaa_ram_ctor, .ctor = nvaa_ram_ctor,
.dtor = _nouveau_ram_dtor, .dtor = _nouveau_ram_dtor,
.init = _nouveau_ram_init, .init = nvaa_ram_init,
.fini = _nouveau_ram_fini, .fini = _nouveau_ram_fini,
}, },
}; };

View file

@ -24,13 +24,6 @@
#include "nv04.h" #include "nv04.h"
static void
nv4c_mc_msi_rearm(struct nouveau_mc *pmc)
{
struct nv04_mc_priv *priv = (void *)pmc;
nv_wr08(priv, 0x088050, 0xff);
}
struct nouveau_oclass * struct nouveau_oclass *
nv4c_mc_oclass = &(struct nouveau_mc_oclass) { nv4c_mc_oclass = &(struct nouveau_mc_oclass) {
.base.handle = NV_SUBDEV(MC, 0x4c), .base.handle = NV_SUBDEV(MC, 0x4c),
@ -41,5 +34,4 @@ nv4c_mc_oclass = &(struct nouveau_mc_oclass) {
.fini = _nouveau_mc_fini, .fini = _nouveau_mc_fini,
}, },
.intr = nv04_mc_intr, .intr = nv04_mc_intr,
.msi_rearm = nv4c_mc_msi_rearm,
}.base; }.base;

View file

@ -1572,8 +1572,10 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm)
* so use the DMA API for them. * so use the DMA API for them.
*/ */
if (!nv_device_is_cpu_coherent(device) && if (!nv_device_is_cpu_coherent(device) &&
ttm->caching_state == tt_uncached) ttm->caching_state == tt_uncached) {
ttm_dma_unpopulate(ttm_dma, dev->dev); ttm_dma_unpopulate(ttm_dma, dev->dev);
return;
}
#if __OS_HAS_AGP #if __OS_HAS_AGP
if (drm->agp.stat == ENABLED) { if (drm->agp.stat == ENABLED) {

View file

@ -36,7 +36,14 @@ void
nouveau_gem_object_del(struct drm_gem_object *gem) nouveau_gem_object_del(struct drm_gem_object *gem)
{ {
struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct nouveau_bo *nvbo = nouveau_gem_object(gem);
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct ttm_buffer_object *bo = &nvbo->bo; struct ttm_buffer_object *bo = &nvbo->bo;
struct device *dev = drm->dev->dev;
int ret;
ret = pm_runtime_get_sync(dev);
if (WARN_ON(ret < 0 && ret != -EACCES))
return;
if (gem->import_attach) if (gem->import_attach)
drm_prime_gem_destroy(gem, nvbo->bo.sg); drm_prime_gem_destroy(gem, nvbo->bo.sg);
@ -46,6 +53,9 @@ nouveau_gem_object_del(struct drm_gem_object *gem)
/* reset filp so nouveau_bo_del_ttm() can test for it */ /* reset filp so nouveau_bo_del_ttm() can test for it */
gem->filp = NULL; gem->filp = NULL;
ttm_bo_unref(&bo); ttm_bo_unref(&bo);
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
} }
int int
@ -53,7 +63,9 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
{ {
struct nouveau_cli *cli = nouveau_cli(file_priv); struct nouveau_cli *cli = nouveau_cli(file_priv);
struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct nouveau_bo *nvbo = nouveau_gem_object(gem);
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct nouveau_vma *vma; struct nouveau_vma *vma;
struct device *dev = drm->dev->dev;
int ret; int ret;
if (!cli->vm) if (!cli->vm)
@ -71,11 +83,16 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
goto out; goto out;
} }
ret = nouveau_bo_vma_add(nvbo, cli->vm, vma); ret = pm_runtime_get_sync(dev);
if (ret) { if (ret < 0 && ret != -EACCES)
kfree(vma);
goto out; goto out;
}
ret = nouveau_bo_vma_add(nvbo, cli->vm, vma);
if (ret)
kfree(vma);
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
} else { } else {
vma->refcount++; vma->refcount++;
} }
@ -129,6 +146,8 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
{ {
struct nouveau_cli *cli = nouveau_cli(file_priv); struct nouveau_cli *cli = nouveau_cli(file_priv);
struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct nouveau_bo *nvbo = nouveau_gem_object(gem);
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct device *dev = drm->dev->dev;
struct nouveau_vma *vma; struct nouveau_vma *vma;
int ret; int ret;
@ -141,8 +160,14 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
vma = nouveau_bo_vma_find(nvbo, cli->vm); vma = nouveau_bo_vma_find(nvbo, cli->vm);
if (vma) { if (vma) {
if (--vma->refcount == 0) if (--vma->refcount == 0) {
nouveau_gem_object_unmap(nvbo, vma); ret = pm_runtime_get_sync(dev);
if (!WARN_ON(ret < 0 && ret != -EACCES)) {
nouveau_gem_object_unmap(nvbo, vma);
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
}
}
} }
ttm_bo_unreserve(&nvbo->bo); ttm_bo_unreserve(&nvbo->bo);
} }

View file

@ -1851,10 +1851,9 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
return pll; return pll;
} }
/* otherwise, pick one of the plls */ /* otherwise, pick one of the plls */
if ((rdev->family == CHIP_KAVERI) || if ((rdev->family == CHIP_KABINI) ||
(rdev->family == CHIP_KABINI) ||
(rdev->family == CHIP_MULLINS)) { (rdev->family == CHIP_MULLINS)) {
/* KB/KV/ML has PPLL1 and PPLL2 */ /* KB/ML has PPLL1 and PPLL2 */
pll_in_use = radeon_get_pll_use_mask(crtc); pll_in_use = radeon_get_pll_use_mask(crtc);
if (!(pll_in_use & (1 << ATOM_PPLL2))) if (!(pll_in_use & (1 << ATOM_PPLL2)))
return ATOM_PPLL2; return ATOM_PPLL2;
@ -1863,7 +1862,7 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
DRM_ERROR("unable to allocate a PPLL\n"); DRM_ERROR("unable to allocate a PPLL\n");
return ATOM_PPLL_INVALID; return ATOM_PPLL_INVALID;
} else { } else {
/* CI has PPLL0, PPLL1, and PPLL2 */ /* CI/KV has PPLL0, PPLL1, and PPLL2 */
pll_in_use = radeon_get_pll_use_mask(crtc); pll_in_use = radeon_get_pll_use_mask(crtc);
if (!(pll_in_use & (1 << ATOM_PPLL2))) if (!(pll_in_use & (1 << ATOM_PPLL2)))
return ATOM_PPLL2; return ATOM_PPLL2;
@ -2155,6 +2154,7 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)
case ATOM_PPLL0: case ATOM_PPLL0:
/* disable the ppll */ /* disable the ppll */
if ((rdev->family == CHIP_ARUBA) || if ((rdev->family == CHIP_ARUBA) ||
(rdev->family == CHIP_KAVERI) ||
(rdev->family == CHIP_BONAIRE) || (rdev->family == CHIP_BONAIRE) ||
(rdev->family == CHIP_HAWAII)) (rdev->family == CHIP_HAWAII))
atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id, atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id,

View file

@ -492,6 +492,10 @@ int radeon_dp_mode_valid_helper(struct drm_connector *connector,
struct radeon_connector_atom_dig *dig_connector; struct radeon_connector_atom_dig *dig_connector;
int dp_clock; int dp_clock;
if ((mode->clock > 340000) &&
(!radeon_connector_is_dp12_capable(connector)))
return MODE_CLOCK_HIGH;
if (!radeon_connector->con_priv) if (!radeon_connector->con_priv)
return MODE_CLOCK_HIGH; return MODE_CLOCK_HIGH;
dig_connector = radeon_connector->con_priv; dig_connector = radeon_connector->con_priv;

View file

@ -2156,4 +2156,6 @@
#define ATC_VM_APERTURE1_HIGH_ADDR 0x330Cu #define ATC_VM_APERTURE1_HIGH_ADDR 0x330Cu
#define ATC_VM_APERTURE1_LOW_ADDR 0x3304u #define ATC_VM_APERTURE1_LOW_ADDR 0x3304u
#define IH_VMID_0_LUT 0x3D40u
#endif #endif

View file

@ -103,7 +103,7 @@ static void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder)
} }
sad_count = drm_edid_to_sad(radeon_connector->edid, &sads); sad_count = drm_edid_to_sad(radeon_connector->edid, &sads);
if (sad_count < 0) { if (sad_count <= 0) {
DRM_ERROR("Couldn't read SADs: %d\n", sad_count); DRM_ERROR("Couldn't read SADs: %d\n", sad_count);
return; return;
} }

View file

@ -2745,13 +2745,11 @@ int kv_dpm_init(struct radeon_device *rdev)
pi->enable_auto_thermal_throttling = true; pi->enable_auto_thermal_throttling = true;
pi->disable_nb_ps3_in_battery = false; pi->disable_nb_ps3_in_battery = false;
if (radeon_bapm == -1) { if (radeon_bapm == -1) {
/* There are stability issues reported on with /* only enable bapm on KB, ML by default */
* bapm enabled on an asrock system. if (rdev->family == CHIP_KABINI || rdev->family == CHIP_MULLINS)
*/
if (rdev->pdev->subsystem_vendor == 0x1849)
pi->bapm_enable = false;
else
pi->bapm_enable = true; pi->bapm_enable = true;
else
pi->bapm_enable = false;
} else if (radeon_bapm == 0) { } else if (radeon_bapm == 0) {
pi->bapm_enable = false; pi->bapm_enable = false;
} else { } else {

View file

@ -72,7 +72,7 @@ static int kgd_init_pipeline(struct kgd_dev *kgd, uint32_t pipe_id,
static int kgd_hqd_load(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id, static int kgd_hqd_load(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id,
uint32_t queue_id, uint32_t __user *wptr); uint32_t queue_id, uint32_t __user *wptr);
static bool kgd_hqd_is_occupies(struct kgd_dev *kgd, uint64_t queue_address, static bool kgd_hqd_is_occupied(struct kgd_dev *kgd, uint64_t queue_address,
uint32_t pipe_id, uint32_t queue_id); uint32_t pipe_id, uint32_t queue_id);
static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type, static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type,
@ -92,7 +92,7 @@ static const struct kfd2kgd_calls kfd2kgd = {
.init_memory = kgd_init_memory, .init_memory = kgd_init_memory,
.init_pipeline = kgd_init_pipeline, .init_pipeline = kgd_init_pipeline,
.hqd_load = kgd_hqd_load, .hqd_load = kgd_hqd_load,
.hqd_is_occupies = kgd_hqd_is_occupies, .hqd_is_occupied = kgd_hqd_is_occupied,
.hqd_destroy = kgd_hqd_destroy, .hqd_destroy = kgd_hqd_destroy,
.get_fw_version = get_fw_version .get_fw_version = get_fw_version
}; };
@ -101,6 +101,7 @@ static const struct kgd2kfd_calls *kgd2kfd;
bool radeon_kfd_init(void) bool radeon_kfd_init(void)
{ {
#if defined(CONFIG_HSA_AMD_MODULE)
bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*, bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*,
const struct kgd2kfd_calls**); const struct kgd2kfd_calls**);
@ -117,6 +118,17 @@ bool radeon_kfd_init(void)
} }
return true; return true;
#elif defined(CONFIG_HSA_AMD)
if (!kgd2kfd_init(KFD_INTERFACE_VERSION, &kfd2kgd, &kgd2kfd)) {
kgd2kfd = NULL;
return false;
}
return true;
#else
return false;
#endif
} }
void radeon_kfd_fini(void) void radeon_kfd_fini(void)
@ -378,6 +390,10 @@ static int kgd_set_pasid_vmid_mapping(struct kgd_dev *kgd, unsigned int pasid,
cpu_relax(); cpu_relax();
write_register(kgd, ATC_VMID_PASID_MAPPING_UPDATE_STATUS, 1U << vmid); write_register(kgd, ATC_VMID_PASID_MAPPING_UPDATE_STATUS, 1U << vmid);
/* Mapping vmid to pasid also for IH block */
write_register(kgd, IH_VMID_0_LUT + vmid * sizeof(uint32_t),
pasid_mapping);
return 0; return 0;
} }
@ -517,7 +533,7 @@ static int kgd_hqd_load(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id,
return 0; return 0;
} }
static bool kgd_hqd_is_occupies(struct kgd_dev *kgd, uint64_t queue_address, static bool kgd_hqd_is_occupied(struct kgd_dev *kgd, uint64_t queue_address,
uint32_t pipe_id, uint32_t queue_id) uint32_t pipe_id, uint32_t queue_id)
{ {
uint32_t act; uint32_t act;
@ -556,6 +572,7 @@ static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type,
if (timeout == 0) { if (timeout == 0) {
pr_err("kfd: cp queue preemption time out (%dms)\n", pr_err("kfd: cp queue preemption time out (%dms)\n",
temp); temp);
release_queue(kgd);
return -ETIME; return -ETIME;
} }
msleep(20); msleep(20);

View file

@ -1703,7 +1703,7 @@ static int radeon_cp_dispatch_texture(struct drm_device * dev,
u32 format; u32 format;
u32 *buffer; u32 *buffer;
const u8 __user *data; const u8 __user *data;
int size, dwords, tex_width, blit_width, spitch; unsigned int size, dwords, tex_width, blit_width, spitch;
u32 height; u32 height;
int i; int i;
u32 texpitch, microtile; u32 texpitch, microtile;

View file

@ -27,7 +27,8 @@ if HID
config HID_BATTERY_STRENGTH config HID_BATTERY_STRENGTH
bool "Battery level reporting for HID devices" bool "Battery level reporting for HID devices"
depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY depends on HID
select POWER_SUPPLY
default n default n
---help--- ---help---
This option adds support of reporting battery strength (for HID devices This option adds support of reporting battery strength (for HID devices

View file

@ -1805,6 +1805,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) }, { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) }, { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },

View file

@ -526,6 +526,7 @@
#define USB_DEVICE_ID_KYE_GPEN_560 0x5003 #define USB_DEVICE_ID_KYE_GPEN_560 0x5003
#define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010
#define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011 #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011
#define USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2 0x501a
#define USB_DEVICE_ID_KYE_EASYPEN_M610X 0x5013 #define USB_DEVICE_ID_KYE_EASYPEN_M610X 0x5013
#define USB_VENDOR_ID_LABTEC 0x1020 #define USB_VENDOR_ID_LABTEC 0x1020

View file

@ -311,6 +311,9 @@ static const struct hid_device_id hid_battery_quirks[] = {
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI), USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI),
HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE }, HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO),
HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI), USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI),
HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE }, HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },

View file

@ -323,6 +323,7 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
} }
break; break;
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X: case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2:
if (*rsize == MOUSEPEN_I608X_RDESC_ORIG_SIZE) { if (*rsize == MOUSEPEN_I608X_RDESC_ORIG_SIZE) {
rdesc = mousepen_i608x_rdesc_fixed; rdesc = mousepen_i608x_rdesc_fixed;
*rsize = sizeof(mousepen_i608x_rdesc_fixed); *rsize = sizeof(mousepen_i608x_rdesc_fixed);
@ -415,6 +416,7 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
switch (id->product) { switch (id->product) {
case USB_DEVICE_ID_KYE_EASYPEN_I405X: case USB_DEVICE_ID_KYE_EASYPEN_I405X:
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X: case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2:
case USB_DEVICE_ID_KYE_EASYPEN_M610X: case USB_DEVICE_ID_KYE_EASYPEN_M610X:
ret = kye_tablet_enable(hdev); ret = kye_tablet_enable(hdev);
if (ret) { if (ret) {
@ -445,6 +447,8 @@ static const struct hid_device_id kye_devices[] = {
USB_DEVICE_ID_KYE_EASYPEN_I405X) }, USB_DEVICE_ID_KYE_EASYPEN_I405X) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
USB_DEVICE_ID_KYE_EASYPEN_M610X) }, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, { HID_USB_DEVICE(USB_VENDOR_ID_KYE,

View file

@ -962,10 +962,24 @@ static int logi_dj_raw_event(struct hid_device *hdev,
switch (data[0]) { switch (data[0]) {
case REPORT_ID_DJ_SHORT: case REPORT_ID_DJ_SHORT:
if (size != DJREPORT_SHORT_LENGTH) {
dev_err(&hdev->dev, "DJ report of bad size (%d)", size);
return false;
}
return logi_dj_dj_event(hdev, report, data, size); return logi_dj_dj_event(hdev, report, data, size);
case REPORT_ID_HIDPP_SHORT: case REPORT_ID_HIDPP_SHORT:
/* intentional fallthrough */ if (size != HIDPP_REPORT_SHORT_LENGTH) {
dev_err(&hdev->dev,
"Short HID++ report of bad size (%d)", size);
return false;
}
return logi_dj_hidpp_event(hdev, report, data, size);
case REPORT_ID_HIDPP_LONG: case REPORT_ID_HIDPP_LONG:
if (size != HIDPP_REPORT_LONG_LENGTH) {
dev_err(&hdev->dev,
"Long HID++ report of bad size (%d)", size);
return false;
}
return logi_dj_hidpp_event(hdev, report, data, size); return logi_dj_hidpp_event(hdev, report, data, size);
} }

View file

@ -282,6 +282,33 @@ static inline bool hidpp_report_is_connect_event(struct hidpp_report *report)
(report->rap.sub_id == 0x41); (report->rap.sub_id == 0x41);
} }
/**
* hidpp_prefix_name() prefixes the current given name with "Logitech ".
*/
static void hidpp_prefix_name(char **name, int name_length)
{
#define PREFIX_LENGTH 9 /* "Logitech " */
int new_length;
char *new_name;
if (name_length > PREFIX_LENGTH &&
strncmp(*name, "Logitech ", PREFIX_LENGTH) == 0)
/* The prefix has is already in the name */
return;
new_length = PREFIX_LENGTH + name_length;
new_name = kzalloc(new_length, GFP_KERNEL);
if (!new_name)
return;
snprintf(new_name, new_length, "Logitech %s", *name);
kfree(*name);
*name = new_name;
}
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* HIDP++ 1.0 commands */ /* HIDP++ 1.0 commands */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
@ -321,6 +348,10 @@ static char *hidpp_get_unifying_name(struct hidpp_device *hidpp_dev)
return NULL; return NULL;
memcpy(name, &response.rap.params[2], len); memcpy(name, &response.rap.params[2], len);
/* include the terminating '\0' */
hidpp_prefix_name(&name, len + 1);
return name; return name;
} }
@ -498,6 +529,9 @@ static char *hidpp_get_device_name(struct hidpp_device *hidpp)
index += ret; index += ret;
} }
/* include the terminating '\0' */
hidpp_prefix_name(&name, __name_length + 1);
return name; return name;
} }
@ -794,18 +828,25 @@ static int wtp_raw_event(struct hid_device *hdev, u8 *data, int size)
switch (data[0]) { switch (data[0]) {
case 0x02: case 0x02:
if (size < 2) {
hid_err(hdev, "Received HID report of bad size (%d)",
size);
return 1;
}
if (hidpp->quirks & HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS) { if (hidpp->quirks & HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS) {
input_event(wd->input, EV_KEY, BTN_LEFT, input_event(wd->input, EV_KEY, BTN_LEFT,
!!(data[1] & 0x01)); !!(data[1] & 0x01));
input_event(wd->input, EV_KEY, BTN_RIGHT, input_event(wd->input, EV_KEY, BTN_RIGHT,
!!(data[1] & 0x02)); !!(data[1] & 0x02));
input_sync(wd->input); input_sync(wd->input);
return 0;
} else { } else {
if (size < 21) if (size < 21)
return 1; return 1;
return wtp_mouse_raw_xy_event(hidpp, &data[7]); return wtp_mouse_raw_xy_event(hidpp, &data[7]);
} }
case REPORT_ID_HIDPP_LONG: case REPORT_ID_HIDPP_LONG:
/* size is already checked in hidpp_raw_event. */
if ((report->fap.feature_index != wd->mt_feature_index) || if ((report->fap.feature_index != wd->mt_feature_index) ||
(report->fap.funcindex_clientid != EVENT_TOUCHPAD_RAW_XY)) (report->fap.funcindex_clientid != EVENT_TOUCHPAD_RAW_XY))
return 1; return 1;

View file

@ -35,6 +35,8 @@ static struct class *pyra_class;
static void profile_activated(struct pyra_device *pyra, static void profile_activated(struct pyra_device *pyra,
unsigned int new_profile) unsigned int new_profile)
{ {
if (new_profile >= ARRAY_SIZE(pyra->profile_settings))
return;
pyra->actual_profile = new_profile; pyra->actual_profile = new_profile;
pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi; pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi;
} }
@ -257,9 +259,11 @@ static ssize_t pyra_sysfs_write_settings(struct file *fp,
if (off != 0 || count != PYRA_SIZE_SETTINGS) if (off != 0 || count != PYRA_SIZE_SETTINGS)
return -EINVAL; return -EINVAL;
mutex_lock(&pyra->pyra_lock);
settings = (struct pyra_settings const *)buf; settings = (struct pyra_settings const *)buf;
if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings))
return -EINVAL;
mutex_lock(&pyra->pyra_lock);
retval = pyra_set_settings(usb_dev, settings); retval = pyra_set_settings(usb_dev, settings);
if (retval) { if (retval) {

View file

@ -706,12 +706,7 @@ static int i2c_hid_start(struct hid_device *hid)
static void i2c_hid_stop(struct hid_device *hid) static void i2c_hid_stop(struct hid_device *hid)
{ {
struct i2c_client *client = hid->driver_data;
struct i2c_hid *ihid = i2c_get_clientdata(client);
hid->claimed = 0; hid->claimed = 0;
i2c_hid_free_buffers(ihid);
} }
static int i2c_hid_open(struct hid_device *hid) static int i2c_hid_open(struct hid_device *hid)

View file

@ -124,6 +124,7 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2, HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD, HID_QUIRK_NO_INIT_REPORTS },

View file

@ -4029,14 +4029,6 @@ static int device_notifier(struct notifier_block *nb,
if (action != BUS_NOTIFY_REMOVED_DEVICE) if (action != BUS_NOTIFY_REMOVED_DEVICE)
return 0; return 0;
/*
* If the device is still attached to a device driver we can't
* tear down the domain yet as DMA mappings may still be in use.
* Wait for the BUS_NOTIFY_UNBOUND_DRIVER event to do that.
*/
if (action == BUS_NOTIFY_DEL_DEVICE && dev->driver != NULL)
return 0;
domain = find_domain(dev); domain = find_domain(dev);
if (!domain) if (!domain)
return 0; return 0;
@ -4428,6 +4420,10 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
domain_remove_one_dev_info(old_domain, dev); domain_remove_one_dev_info(old_domain, dev);
else else
domain_remove_dev_info(old_domain); domain_remove_dev_info(old_domain);
if (!domain_type_is_vm_or_si(old_domain) &&
list_empty(&old_domain->devices))
domain_exit(old_domain);
} }
} }

View file

@ -558,7 +558,7 @@ static pmd_t *ipmmu_alloc_pmd(struct ipmmu_vmsa_device *mmu, pgd_t *pgd,
static u64 ipmmu_page_prot(unsigned int prot, u64 type) static u64 ipmmu_page_prot(unsigned int prot, u64 type)
{ {
u64 pgprot = ARM_VMSA_PTE_XN | ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF u64 pgprot = ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF
| ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV | ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV
| ARM_VMSA_PTE_NS | type; | ARM_VMSA_PTE_NS | type;
@ -568,8 +568,8 @@ static u64 ipmmu_page_prot(unsigned int prot, u64 type)
if (prot & IOMMU_CACHE) if (prot & IOMMU_CACHE)
pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT; pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT;
if (prot & IOMMU_EXEC) if (prot & IOMMU_NOEXEC)
pgprot &= ~ARM_VMSA_PTE_XN; pgprot |= ARM_VMSA_PTE_XN;
else if (!(prot & (IOMMU_READ | IOMMU_WRITE))) else if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
/* If no access create a faulting entry to avoid TLB fills. */ /* If no access create a faulting entry to avoid TLB fills. */
pgprot &= ~ARM_VMSA_PTE_PAGE; pgprot &= ~ARM_VMSA_PTE_PAGE;

View file

@ -1009,7 +1009,6 @@ static struct platform_driver rk_iommu_driver = {
.remove = rk_iommu_remove, .remove = rk_iommu_remove,
.driver = { .driver = {
.name = "rk_iommu", .name = "rk_iommu",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(rk_iommu_dt_ids), .of_match_table = of_match_ptr(rk_iommu_dt_ids),
}, },
}; };

View file

@ -850,8 +850,10 @@ static int emac_probe(struct platform_device *pdev)
} }
db->clk = devm_clk_get(&pdev->dev, NULL); db->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(db->clk)) if (IS_ERR(db->clk)) {
ret = PTR_ERR(db->clk);
goto out; goto out;
}
clk_prepare_enable(db->clk); clk_prepare_enable(db->clk);

View file

@ -1170,10 +1170,6 @@ tx_request_irq_error:
init_error: init_error:
free_skbufs(dev); free_skbufs(dev);
alloc_skbuf_error: alloc_skbuf_error:
if (priv->phydev) {
phy_disconnect(priv->phydev);
priv->phydev = NULL;
}
phy_error: phy_error:
return ret; return ret;
} }
@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev)
int ret; int ret;
unsigned long int flags; unsigned long int flags;
/* Stop and disconnect the PHY */ /* Stop the PHY */
if (priv->phydev) { if (priv->phydev)
phy_stop(priv->phydev); phy_stop(priv->phydev);
phy_disconnect(priv->phydev);
priv->phydev = NULL;
}
netif_stop_queue(dev); netif_stop_queue(dev);
napi_disable(&priv->napi); napi_disable(&priv->napi);
@ -1525,6 +1518,10 @@ err_free_netdev:
static int altera_tse_remove(struct platform_device *pdev) static int altera_tse_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct altera_tse_private *priv = netdev_priv(ndev);
if (priv->phydev)
phy_disconnect(priv->phydev);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
altera_tse_mdio_destroy(ndev); altera_tse_mdio_destroy(ndev);

View file

@ -1616,7 +1616,7 @@ static int enic_open(struct net_device *netdev)
if (vnic_rq_desc_used(&enic->rq[i]) == 0) { if (vnic_rq_desc_used(&enic->rq[i]) == 0) {
netdev_err(netdev, "Unable to alloc receive buffers\n"); netdev_err(netdev, "Unable to alloc receive buffers\n");
err = -ENOMEM; err = -ENOMEM;
goto err_out_notify_unset; goto err_out_free_rq;
} }
} }
@ -1649,7 +1649,9 @@ static int enic_open(struct net_device *netdev)
return 0; return 0;
err_out_notify_unset: err_out_free_rq:
for (i = 0; i < enic->rq_count; i++)
vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
enic_dev_notify_unset(enic); enic_dev_notify_unset(enic);
err_out_free_intr: err_out_free_intr:
enic_free_intr(enic); enic_free_intr(enic);

View file

@ -1543,7 +1543,7 @@ static int e100_phy_init(struct nic *nic)
mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr);
} else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
(mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) &&
!(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { (nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) {
/* enable/disable MDI/MDI-X auto-switching. */ /* enable/disable MDI/MDI-X auto-switching. */
mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);

View file

@ -829,7 +829,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
if (desc_n >= ring->count || desc_n < 0) { if (desc_n >= ring->count || desc_n < 0) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"descriptor %d not found\n", desc_n); "descriptor %d not found\n", desc_n);
return; goto out;
} }
if (!is_rx_ring) { if (!is_rx_ring) {
txd = I40E_TX_DESC(ring, desc_n); txd = I40E_TX_DESC(ring, desc_n);
@ -855,6 +855,8 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
} else { } else {
dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n");
} }
out:
kfree(ring); kfree(ring);
} }

View file

@ -1125,7 +1125,7 @@ static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask)
u32 swmask = mask; u32 swmask = mask;
u32 fwmask = mask << 16; u32 fwmask = mask << 16;
s32 ret_val = 0; s32 ret_val = 0;
s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ s32 i = 0, timeout = 200;
while (i < timeout) { while (i < timeout) {
if (igb_get_hw_semaphore(hw)) { if (igb_get_hw_semaphore(hw)) {

View file

@ -1829,7 +1829,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
err = mlx4_dev_cap(dev, &dev_cap); err = mlx4_dev_cap(dev, &dev_cap);
if (err) { if (err) {
mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n");
goto err_stop_fw; return err;
} }
choose_steering_mode(dev, &dev_cap); choose_steering_mode(dev, &dev_cap);
@ -1860,7 +1860,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
&init_hca); &init_hca);
if ((long long) icm_size < 0) { if ((long long) icm_size < 0) {
err = icm_size; err = icm_size;
goto err_stop_fw; return err;
} }
dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1;
@ -1874,7 +1874,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size);
if (err) if (err)
goto err_stop_fw; return err;
err = mlx4_INIT_HCA(dev, &init_hca); err = mlx4_INIT_HCA(dev, &init_hca);
if (err) { if (err) {
@ -1886,7 +1886,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
err = mlx4_query_func(dev, &dev_cap); err = mlx4_query_func(dev, &dev_cap);
if (err < 0) { if (err < 0) {
mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n");
goto err_stop_fw; goto err_close;
} else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) {
dev->caps.num_eqs = dev_cap.max_eqs; dev->caps.num_eqs = dev_cap.max_eqs;
dev->caps.reserved_eqs = dev_cap.reserved_eqs; dev->caps.reserved_eqs = dev_cap.reserved_eqs;
@ -2006,11 +2006,6 @@ err_free_icm:
if (!mlx4_is_slave(dev)) if (!mlx4_is_slave(dev))
mlx4_free_icms(dev); mlx4_free_icms(dev);
err_stop_fw:
if (!mlx4_is_slave(dev)) {
mlx4_UNMAP_FA(dev);
mlx4_free_icm(dev, priv->fw.fw_icm, 0);
}
return err; return err;
} }

View file

@ -584,6 +584,7 @@ EXPORT_SYMBOL_GPL(mlx4_mr_free);
void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr)
{ {
mlx4_mtt_cleanup(dev, &mr->mtt); mlx4_mtt_cleanup(dev, &mr->mtt);
mr->mtt.order = -1;
} }
EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup);
@ -593,14 +594,14 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr,
{ {
int err; int err;
mpt_entry->start = cpu_to_be64(iova);
mpt_entry->length = cpu_to_be64(size);
mpt_entry->entity_size = cpu_to_be32(page_shift);
err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt);
if (err) if (err)
return err; return err;
mpt_entry->start = cpu_to_be64(mr->iova);
mpt_entry->length = cpu_to_be64(mr->size);
mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift);
mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK |
MLX4_MPT_PD_FLAG_EN_INV); MLX4_MPT_PD_FLAG_EN_INV);
mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE | mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE |

View file

@ -4033,8 +4033,10 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
(void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),
&mgp->cmd_bus, GFP_KERNEL); &mgp->cmd_bus, GFP_KERNEL);
if (mgp->cmd == NULL) if (!mgp->cmd) {
status = -ENOMEM;
goto abort_with_enabled; goto abort_with_enabled;
}
mgp->board_span = pci_resource_len(pdev, 0); mgp->board_span = pci_resource_len(pdev, 0);
mgp->iomem_base = pci_resource_start(pdev, 0); mgp->iomem_base = pci_resource_start(pdev, 0);

View file

@ -146,10 +146,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
{ {
int i = 0; int i = 0;
while (i < 10) { do {
if (i)
ssleep(1);
if (ql_sem_lock(qdev, if (ql_sem_lock(qdev,
QL_DRVR_SEM_MASK, QL_DRVR_SEM_MASK,
(QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index)
@ -158,7 +155,8 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
"driver lock acquired\n"); "driver lock acquired\n");
return 1; return 1;
} }
} ssleep(1);
} while (++i < 10);
netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n");
return 0; return 0;

View file

@ -2605,6 +2605,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} else { } else {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"%s: failed. Please Reboot\n", __func__); "%s: failed. Please Reboot\n", __func__);
err = -ENODEV;
goto err_out_free_hw; goto err_out_free_hw;
} }

View file

@ -757,6 +757,14 @@ requeue:
static irqreturn_t cpsw_interrupt(int irq, void *dev_id) static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
{ {
struct cpsw_priv *priv = dev_id; struct cpsw_priv *priv = dev_id;
int value = irq - priv->irqs_table[0];
/* NOTICE: Ending IRQ here. The trick with the 'value' variable above
* is to make sure we will always write the correct value to the EOI
* register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2
* for TX Interrupt and 3 for MISC Interrupt.
*/
cpdma_ctlr_eoi(priv->dma, value);
cpsw_intr_disable(priv); cpsw_intr_disable(priv);
if (priv->irq_enabled == true) { if (priv->irq_enabled == true) {
@ -786,8 +794,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
int num_tx, num_rx; int num_tx, num_rx;
num_tx = cpdma_chan_process(priv->txch, 128); num_tx = cpdma_chan_process(priv->txch, 128);
if (num_tx)
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
num_rx = cpdma_chan_process(priv->rxch, budget); num_rx = cpdma_chan_process(priv->rxch, budget);
if (num_rx < budget) { if (num_rx < budget) {
@ -795,7 +801,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
napi_complete(napi); napi_complete(napi);
cpsw_intr_enable(priv); cpsw_intr_enable(priv);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
prim_cpsw = cpsw_get_slave_priv(priv, 0); prim_cpsw = cpsw_get_slave_priv(priv, 0);
if (prim_cpsw->irq_enabled == false) { if (prim_cpsw->irq_enabled == false) {
prim_cpsw->irq_enabled = true; prim_cpsw->irq_enabled = true;
@ -1310,8 +1315,6 @@ static int cpsw_ndo_open(struct net_device *ndev)
napi_enable(&priv->napi); napi_enable(&priv->napi);
cpdma_ctlr_start(priv->dma); cpdma_ctlr_start(priv->dma);
cpsw_intr_enable(priv); cpsw_intr_enable(priv);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
prim_cpsw = cpsw_get_slave_priv(priv, 0); prim_cpsw = cpsw_get_slave_priv(priv, 0);
if (prim_cpsw->irq_enabled == false) { if (prim_cpsw->irq_enabled == false) {
@ -1578,9 +1581,6 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev)
cpdma_chan_start(priv->txch); cpdma_chan_start(priv->txch);
cpdma_ctlr_int_ctrl(priv->dma, true); cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv); cpsw_intr_enable(priv);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
} }
static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p)
@ -1620,9 +1620,6 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
cpsw_interrupt(ndev->irq, priv); cpsw_interrupt(ndev->irq, priv);
cpdma_ctlr_int_ctrl(priv->dma, true); cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv); cpsw_intr_enable(priv);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
} }
#endif #endif

View file

@ -1043,6 +1043,7 @@ static int temac_of_probe(struct platform_device *op)
lp->regs = of_iomap(op->dev.of_node, 0); lp->regs = of_iomap(op->dev.of_node, 0);
if (!lp->regs) { if (!lp->regs) {
dev_err(&op->dev, "could not map temac regs.\n"); dev_err(&op->dev, "could not map temac regs.\n");
rc = -ENOMEM;
goto nodev; goto nodev;
} }
@ -1062,6 +1063,7 @@ static int temac_of_probe(struct platform_device *op)
np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); np = of_parse_phandle(op->dev.of_node, "llink-connected", 0);
if (!np) { if (!np) {
dev_err(&op->dev, "could not find DMA node\n"); dev_err(&op->dev, "could not find DMA node\n");
rc = -ENODEV;
goto err_iounmap; goto err_iounmap;
} }

View file

@ -1501,6 +1501,7 @@ static int axienet_of_probe(struct platform_device *op)
lp->regs = of_iomap(op->dev.of_node, 0); lp->regs = of_iomap(op->dev.of_node, 0);
if (!lp->regs) { if (!lp->regs) {
dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); dev_err(&op->dev, "could not map Axi Ethernet regs.\n");
ret = -ENOMEM;
goto nodev; goto nodev;
} }
/* Setup checksum offload, but default to off if not specified */ /* Setup checksum offload, but default to off if not specified */
@ -1563,6 +1564,7 @@ static int axienet_of_probe(struct platform_device *op)
np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0);
if (!np) { if (!np) {
dev_err(&op->dev, "could not find DMA node\n"); dev_err(&op->dev, "could not find DMA node\n");
ret = -ENODEV;
goto err_iounmap; goto err_iounmap;
} }
lp->dma_regs = of_iomap(np, 0); lp->dma_regs = of_iomap(np, 0);

View file

@ -1109,6 +1109,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
if (!res) { if (!res) {
dev_err(dev, "no IRQ found\n"); dev_err(dev, "no IRQ found\n");
rc = -ENXIO;
goto error; goto error;
} }

View file

@ -56,6 +56,8 @@ struct qmi_wwan_state {
/* default ethernet address used by the modem */ /* default ethernet address used by the modem */
static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};
static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};
/* Make up an ethernet header if the packet doesn't have one. /* Make up an ethernet header if the packet doesn't have one.
* *
* A firmware bug common among several devices cause them to send raw * A firmware bug common among several devices cause them to send raw
@ -332,10 +334,12 @@ next_desc:
usb_driver_release_interface(driver, info->data); usb_driver_release_interface(driver, info->data);
} }
/* Never use the same address on both ends of the link, even /* Never use the same address on both ends of the link, even if the
* if the buggy firmware told us to. * buggy firmware told us to. Or, if device is assigned the well-known
* buggy firmware MAC address, replace it with a random address,
*/ */
if (ether_addr_equal(dev->net->dev_addr, default_modem_addr)) if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) ||
ether_addr_equal(dev->net->dev_addr, buggy_fw_addr))
eth_hw_addr_random(dev->net); eth_hw_addr_random(dev->net);
/* make MAC addr easily distinguishable from an IP header */ /* make MAC addr easily distinguishable from an IP header */

View file

@ -1897,6 +1897,22 @@ static void _rtl8152_set_rx_mode(struct net_device *netdev)
netif_wake_queue(netdev); netif_wake_queue(netdev);
} }
static netdev_features_t
rtl8152_features_check(struct sk_buff *skb, struct net_device *dev,
netdev_features_t features)
{
u32 mss = skb_shinfo(skb)->gso_size;
int max_offset = mss ? GTTCPHO_MAX : TCPHO_MAX;
int offset = skb_transport_offset(skb);
if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) && offset > max_offset)
features &= ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
else if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz)
features &= ~NETIF_F_GSO_MASK;
return features;
}
static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb,
struct net_device *netdev) struct net_device *netdev)
{ {
@ -3706,6 +3722,7 @@ static const struct net_device_ops rtl8152_netdev_ops = {
.ndo_set_mac_address = rtl8152_set_mac_address, .ndo_set_mac_address = rtl8152_set_mac_address,
.ndo_change_mtu = rtl8152_change_mtu, .ndo_change_mtu = rtl8152_change_mtu,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
.ndo_features_check = rtl8152_features_check,
}; };
static void r8152b_get_version(struct r8152 *tp) static void r8152b_get_version(struct r8152 *tp)

View file

@ -737,6 +737,7 @@ static void connect(struct backend_info *be)
} }
queue->remaining_credit = credit_bytes; queue->remaining_credit = credit_bytes;
queue->credit_usec = credit_usec;
err = connect_rings(be, queue); err = connect_rings(be, queue);
if (err) { if (err) {

Some files were not shown because too many files have changed in this diff Show more