Merge branch 'android-4.14-stable' of https://android.googlesource.com/kernel/common into android-11.0

This commit is contained in:
SahilSonar 2021-10-13 09:34:56 +02:00
commit c568f76b30
311 changed files with 2014 additions and 1090 deletions

View File

@ -2989,10 +2989,10 @@
65 = /dev/infiniband/issm1 Second InfiniBand IsSM device 65 = /dev/infiniband/issm1 Second InfiniBand IsSM device
... ...
127 = /dev/infiniband/issm63 63rd InfiniBand IsSM device 127 = /dev/infiniband/issm63 63rd InfiniBand IsSM device
128 = /dev/infiniband/uverbs0 First InfiniBand verbs device 192 = /dev/infiniband/uverbs0 First InfiniBand verbs device
129 = /dev/infiniband/uverbs1 Second InfiniBand verbs device 193 = /dev/infiniband/uverbs1 Second InfiniBand verbs device
... ...
159 = /dev/infiniband/uverbs31 31st InfiniBand verbs device 223 = /dev/infiniband/uverbs31 31st InfiniBand verbs device
232 char Biometric Devices 232 char Biometric Devices
0 = /dev/biometric/sensor0/fingerprint first fingerprint sensor on first device 0 = /dev/biometric/sensor0/fingerprint first fingerprint sensor on first device

View File

@ -123,7 +123,7 @@ on various other factors also like;
so the device should have enough free bytes available its OOB/Spare so the device should have enough free bytes available its OOB/Spare
area to accommodate ECC for entire page. In general following expression area to accommodate ECC for entire page. In general following expression
helps in determining if given device can accommodate ECC syndrome: helps in determining if given device can accommodate ECC syndrome:
"2 + (PAGESIZE / 512) * ECC_BYTES" >= OOBSIZE" "2 + (PAGESIZE / 512) * ECC_BYTES" <= OOBSIZE"
where where
OOBSIZE number of bytes in OOB/spare area OOBSIZE number of bytes in OOB/spare area
PAGESIZE number of bytes in main-area of device page PAGESIZE number of bytes in main-area of device page

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 4 VERSION = 4
PATCHLEVEL = 14 PATCHLEVEL = 14
SUBLEVEL = 246 SUBLEVEL = 250
EXTRAVERSION = EXTRAVERSION =
NAME = Petit Gorille NAME = Petit Gorille

View File

@ -61,7 +61,7 @@ extern inline void set_hae(unsigned long new_hae)
* Change virtual addresses to physical addresses and vv. * Change virtual addresses to physical addresses and vv.
*/ */
#ifdef USE_48_BIT_KSEG #ifdef USE_48_BIT_KSEG
static inline unsigned long virt_to_phys(void *address) static inline unsigned long virt_to_phys(volatile void *address)
{ {
return (unsigned long)address - IDENT_ADDR; return (unsigned long)address - IDENT_ADDR;
} }
@ -71,7 +71,7 @@ static inline void * phys_to_virt(unsigned long address)
return (void *) (address + IDENT_ADDR); return (void *) (address + IDENT_ADDR);
} }
#else #else
static inline unsigned long virt_to_phys(void *address) static inline unsigned long virt_to_phys(volatile void *address)
{ {
unsigned long phys = (unsigned long)address; unsigned long phys = (unsigned long)address;
@ -112,7 +112,7 @@ static inline dma_addr_t __deprecated isa_page_to_bus(struct page *page)
extern unsigned long __direct_map_base; extern unsigned long __direct_map_base;
extern unsigned long __direct_map_size; extern unsigned long __direct_map_size;
static inline unsigned long __deprecated virt_to_bus(void *address) static inline unsigned long __deprecated virt_to_bus(volatile void *address)
{ {
unsigned long phys = virt_to_phys(address); unsigned long phys = virt_to_phys(address);
unsigned long bus = phys + __direct_map_base; unsigned long bus = phys + __direct_map_base;

View File

@ -1118,7 +1118,7 @@ void clear_user_page(void *to, unsigned long u_vaddr, struct page *page)
clear_page(to); clear_page(to);
clear_bit(PG_dc_clean, &page->flags); clear_bit(PG_dc_clean, &page->flags);
} }
EXPORT_SYMBOL(clear_user_page);
/********************************************************************** /**********************************************************************
* Explicit Cache flush request from user space via syscall * Explicit Cache flush request from user space via syscall

View File

@ -87,6 +87,8 @@ $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \
$(addprefix $(obj)/,$(libfdt_hdrs)) $(addprefix $(obj)/,$(libfdt_hdrs))
ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
OBJS += $(libfdt_objs) atags_to_fdt.o OBJS += $(libfdt_objs) atags_to_fdt.o
endif endif

View File

@ -1228,9 +1228,9 @@
<&mmcc DSI1_BYTE_CLK>, <&mmcc DSI1_BYTE_CLK>,
<&mmcc DSI_PIXEL_CLK>, <&mmcc DSI_PIXEL_CLK>,
<&mmcc DSI1_ESC_CLK>; <&mmcc DSI1_ESC_CLK>;
clock-names = "iface_clk", "bus_clk", "core_mmss_clk", clock-names = "iface", "bus", "core_mmss",
"src_clk", "byte_clk", "pixel_clk", "src", "byte", "pixel",
"core_clk"; "core";
assigned-clocks = <&mmcc DSI1_BYTE_SRC>, assigned-clocks = <&mmcc DSI1_BYTE_SRC>,
<&mmcc DSI1_ESC_SRC>, <&mmcc DSI1_ESC_SRC>,

View File

@ -185,8 +185,9 @@
nvidia,pins = "ata", "atb", "atc", "atd", "ate", nvidia,pins = "ata", "atb", "atc", "atd", "ate",
"cdev1", "cdev2", "dap1", "dtb", "gma", "cdev1", "cdev2", "dap1", "dtb", "gma",
"gmb", "gmc", "gmd", "gme", "gpu7", "gmb", "gmc", "gmd", "gme", "gpu7",
"gpv", "i2cp", "pta", "rm", "slxa", "gpv", "i2cp", "irrx", "irtx", "pta",
"slxk", "spia", "spib", "uac"; "rm", "slxa", "slxk", "spia", "spib",
"uac";
nvidia,pull = <TEGRA_PIN_PULL_NONE>; nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>; nvidia,tristate = <TEGRA_PIN_DISABLE>;
}; };
@ -211,7 +212,7 @@
conf_ddc { conf_ddc {
nvidia,pins = "ddc", "dta", "dtd", "kbca", nvidia,pins = "ddc", "dta", "dtd", "kbca",
"kbcb", "kbcc", "kbcd", "kbce", "kbcf", "kbcb", "kbcc", "kbcd", "kbce", "kbcf",
"sdc"; "sdc", "uad", "uca";
nvidia,pull = <TEGRA_PIN_PULL_UP>; nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>; nvidia,tristate = <TEGRA_PIN_DISABLE>;
}; };
@ -221,10 +222,9 @@
"lvp0", "owc", "sdb"; "lvp0", "owc", "sdb";
nvidia,tristate = <TEGRA_PIN_ENABLE>; nvidia,tristate = <TEGRA_PIN_ENABLE>;
}; };
conf_irrx { conf_sdd {
nvidia,pins = "irrx", "irtx", "sdd", "spic", nvidia,pins = "sdd", "spic", "spie", "spih",
"spie", "spih", "uaa", "uab", "uad", "uaa", "uab", "ucb";
"uca", "ucb";
nvidia,pull = <TEGRA_PIN_PULL_UP>; nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_ENABLE>; nvidia,tristate = <TEGRA_PIN_ENABLE>;
}; };

View File

@ -19,6 +19,9 @@ struct dyn_arch_ftrace {
#ifdef CONFIG_OLD_MCOUNT #ifdef CONFIG_OLD_MCOUNT
bool old_mcount; bool old_mcount;
#endif #endif
#ifdef CONFIG_ARM_MODULE_PLTS
struct module *mod;
#endif
}; };
static inline unsigned long ftrace_call_adjust(unsigned long addr) static inline unsigned long ftrace_call_adjust(unsigned long addr)

View File

@ -13,18 +13,18 @@ arm_gen_nop(void)
} }
unsigned long unsigned long
__arm_gen_branch(unsigned long pc, unsigned long addr, bool link); __arm_gen_branch(unsigned long pc, unsigned long addr, bool link, bool warn);
static inline unsigned long static inline unsigned long
arm_gen_branch(unsigned long pc, unsigned long addr) arm_gen_branch(unsigned long pc, unsigned long addr)
{ {
return __arm_gen_branch(pc, addr, false); return __arm_gen_branch(pc, addr, false, true);
} }
static inline unsigned long static inline unsigned long
arm_gen_branch_link(unsigned long pc, unsigned long addr) arm_gen_branch_link(unsigned long pc, unsigned long addr, bool warn)
{ {
return __arm_gen_branch(pc, addr, true); return __arm_gen_branch(pc, addr, true, warn);
} }
#endif #endif

View File

@ -19,8 +19,18 @@ enum {
}; };
#endif #endif
#define PLT_ENT_STRIDE L1_CACHE_BYTES
#define PLT_ENT_COUNT (PLT_ENT_STRIDE / sizeof(u32))
#define PLT_ENT_SIZE (sizeof(struct plt_entries) / PLT_ENT_COUNT)
struct plt_entries {
u32 ldr[PLT_ENT_COUNT];
u32 lit[PLT_ENT_COUNT];
};
struct mod_plt_sec { struct mod_plt_sec {
struct elf32_shdr *plt; struct elf32_shdr *plt;
struct plt_entries *plt_ent;
int plt_count; int plt_count;
}; };

View File

@ -22,10 +22,14 @@ ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/
# Object file lists. # Object file lists.
obj-y := elf.o entry-common.o irq.o opcodes.o \ obj-y := elf.o entry-common.o irq.o opcodes.o \
process.o ptrace.o reboot.o return_address.o \ process.o ptrace.o reboot.o \
setup.o signal.o sigreturn_codes.o \ setup.o signal.o sigreturn_codes.o \
stacktrace.o sys_arm.o time.o traps.o stacktrace.o sys_arm.o time.o traps.o
ifneq ($(CONFIG_ARM_UNWIND),y)
obj-$(CONFIG_FRAME_POINTER) += return_address.o
endif
obj-$(CONFIG_ATAGS) += atags_parse.o obj-$(CONFIG_ATAGS) += atags_parse.o
obj-$(CONFIG_ATAGS_PROC) += atags_proc.o obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o

View File

@ -96,9 +96,10 @@ int ftrace_arch_code_modify_post_process(void)
return 0; return 0;
} }
static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr) static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
bool warn)
{ {
return arm_gen_branch_link(pc, addr); return arm_gen_branch_link(pc, addr, warn);
} }
static int ftrace_modify_code(unsigned long pc, unsigned long old, static int ftrace_modify_code(unsigned long pc, unsigned long old,
@ -137,14 +138,14 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
int ret; int ret;
pc = (unsigned long)&ftrace_call; pc = (unsigned long)&ftrace_call;
new = ftrace_call_replace(pc, (unsigned long)func); new = ftrace_call_replace(pc, (unsigned long)func, true);
ret = ftrace_modify_code(pc, 0, new, false); ret = ftrace_modify_code(pc, 0, new, false);
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
if (!ret) { if (!ret) {
pc = (unsigned long)&ftrace_regs_call; pc = (unsigned long)&ftrace_regs_call;
new = ftrace_call_replace(pc, (unsigned long)func); new = ftrace_call_replace(pc, (unsigned long)func, true);
ret = ftrace_modify_code(pc, 0, new, false); ret = ftrace_modify_code(pc, 0, new, false);
} }
@ -153,7 +154,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
#ifdef CONFIG_OLD_MCOUNT #ifdef CONFIG_OLD_MCOUNT
if (!ret) { if (!ret) {
pc = (unsigned long)&ftrace_call_old; pc = (unsigned long)&ftrace_call_old;
new = ftrace_call_replace(pc, (unsigned long)func); new = ftrace_call_replace(pc, (unsigned long)func, true);
ret = ftrace_modify_code(pc, 0, new, false); ret = ftrace_modify_code(pc, 0, new, false);
} }
@ -166,10 +167,22 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
{ {
unsigned long new, old; unsigned long new, old;
unsigned long ip = rec->ip; unsigned long ip = rec->ip;
unsigned long aaddr = adjust_address(rec, addr);
struct module *mod = NULL;
#ifdef CONFIG_ARM_MODULE_PLTS
mod = rec->arch.mod;
#endif
old = ftrace_nop_replace(rec); old = ftrace_nop_replace(rec);
new = ftrace_call_replace(ip, adjust_address(rec, addr)); new = ftrace_call_replace(ip, aaddr, !mod);
#ifdef CONFIG_ARM_MODULE_PLTS
if (!new && mod) {
aaddr = get_module_plt(mod, ip, aaddr);
new = ftrace_call_replace(ip, aaddr, true);
}
#endif
return ftrace_modify_code(rec->ip, old, new, true); return ftrace_modify_code(rec->ip, old, new, true);
} }
@ -182,9 +195,9 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
unsigned long new, old; unsigned long new, old;
unsigned long ip = rec->ip; unsigned long ip = rec->ip;
old = ftrace_call_replace(ip, adjust_address(rec, old_addr)); old = ftrace_call_replace(ip, adjust_address(rec, old_addr), true);
new = ftrace_call_replace(ip, adjust_address(rec, addr)); new = ftrace_call_replace(ip, adjust_address(rec, addr), true);
return ftrace_modify_code(rec->ip, old, new, true); return ftrace_modify_code(rec->ip, old, new, true);
} }
@ -194,12 +207,29 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
int ftrace_make_nop(struct module *mod, int ftrace_make_nop(struct module *mod,
struct dyn_ftrace *rec, unsigned long addr) struct dyn_ftrace *rec, unsigned long addr)
{ {
unsigned long aaddr = adjust_address(rec, addr);
unsigned long ip = rec->ip; unsigned long ip = rec->ip;
unsigned long old; unsigned long old;
unsigned long new; unsigned long new;
int ret; int ret;
old = ftrace_call_replace(ip, adjust_address(rec, addr)); #ifdef CONFIG_ARM_MODULE_PLTS
/* mod is only supplied during module loading */
if (!mod)
mod = rec->arch.mod;
else
rec->arch.mod = mod;
#endif
old = ftrace_call_replace(ip, aaddr,
!IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || !mod);
#ifdef CONFIG_ARM_MODULE_PLTS
if (!old && mod) {
aaddr = get_module_plt(mod, ip, aaddr);
old = ftrace_call_replace(ip, aaddr, true);
}
#endif
new = ftrace_nop_replace(rec); new = ftrace_nop_replace(rec);
ret = ftrace_modify_code(ip, old, new, true); ret = ftrace_modify_code(ip, old, new, true);
@ -207,7 +237,7 @@ int ftrace_make_nop(struct module *mod,
if (ret == -EINVAL && addr == MCOUNT_ADDR) { if (ret == -EINVAL && addr == MCOUNT_ADDR) {
rec->arch.old_mcount = true; rec->arch.old_mcount = true;
old = ftrace_call_replace(ip, adjust_address(rec, addr)); old = ftrace_call_replace(ip, adjust_address(rec, addr), true);
new = ftrace_nop_replace(rec); new = ftrace_nop_replace(rec);
ret = ftrace_modify_code(ip, old, new, true); ret = ftrace_modify_code(ip, old, new, true);
} }

View File

@ -3,8 +3,9 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/opcodes.h> #include <asm/opcodes.h>
static unsigned long static unsigned long __arm_gen_branch_thumb2(unsigned long pc,
__arm_gen_branch_thumb2(unsigned long pc, unsigned long addr, bool link) unsigned long addr, bool link,
bool warn)
{ {
unsigned long s, j1, j2, i1, i2, imm10, imm11; unsigned long s, j1, j2, i1, i2, imm10, imm11;
unsigned long first, second; unsigned long first, second;
@ -12,7 +13,7 @@ __arm_gen_branch_thumb2(unsigned long pc, unsigned long addr, bool link)
offset = (long)addr - (long)(pc + 4); offset = (long)addr - (long)(pc + 4);
if (offset < -16777216 || offset > 16777214) { if (offset < -16777216 || offset > 16777214) {
WARN_ON_ONCE(1); WARN_ON_ONCE(warn);
return 0; return 0;
} }
@ -33,8 +34,8 @@ __arm_gen_branch_thumb2(unsigned long pc, unsigned long addr, bool link)
return __opcode_thumb32_compose(first, second); return __opcode_thumb32_compose(first, second);
} }
static unsigned long static unsigned long __arm_gen_branch_arm(unsigned long pc, unsigned long addr,
__arm_gen_branch_arm(unsigned long pc, unsigned long addr, bool link) bool link, bool warn)
{ {
unsigned long opcode = 0xea000000; unsigned long opcode = 0xea000000;
long offset; long offset;
@ -44,7 +45,7 @@ __arm_gen_branch_arm(unsigned long pc, unsigned long addr, bool link)
offset = (long)addr - (long)(pc + 8); offset = (long)addr - (long)(pc + 8);
if (unlikely(offset < -33554432 || offset > 33554428)) { if (unlikely(offset < -33554432 || offset > 33554428)) {
WARN_ON_ONCE(1); WARN_ON_ONCE(warn);
return 0; return 0;
} }
@ -54,10 +55,10 @@ __arm_gen_branch_arm(unsigned long pc, unsigned long addr, bool link)
} }
unsigned long unsigned long
__arm_gen_branch(unsigned long pc, unsigned long addr, bool link) __arm_gen_branch(unsigned long pc, unsigned long addr, bool link, bool warn)
{ {
if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) if (IS_ENABLED(CONFIG_THUMB2_KERNEL))
return __arm_gen_branch_thumb2(pc, addr, link); return __arm_gen_branch_thumb2(pc, addr, link, warn);
else else
return __arm_gen_branch_arm(pc, addr, link); return __arm_gen_branch_arm(pc, addr, link, warn);
} }

View File

@ -7,6 +7,7 @@
*/ */
#include <linux/elf.h> #include <linux/elf.h>
#include <linux/ftrace.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sort.h> #include <linux/sort.h>
@ -14,10 +15,6 @@
#include <asm/cache.h> #include <asm/cache.h>
#include <asm/opcodes.h> #include <asm/opcodes.h>
#define PLT_ENT_STRIDE L1_CACHE_BYTES
#define PLT_ENT_COUNT (PLT_ENT_STRIDE / sizeof(u32))
#define PLT_ENT_SIZE (sizeof(struct plt_entries) / PLT_ENT_COUNT)
#ifdef CONFIG_THUMB2_KERNEL #ifdef CONFIG_THUMB2_KERNEL
#define PLT_ENT_LDR __opcode_to_mem_thumb32(0xf8dff000 | \ #define PLT_ENT_LDR __opcode_to_mem_thumb32(0xf8dff000 | \
(PLT_ENT_STRIDE - 4)) (PLT_ENT_STRIDE - 4))
@ -26,9 +23,11 @@
(PLT_ENT_STRIDE - 8)) (PLT_ENT_STRIDE - 8))
#endif #endif
struct plt_entries { static const u32 fixed_plts[] = {
u32 ldr[PLT_ENT_COUNT]; #ifdef CONFIG_DYNAMIC_FTRACE
u32 lit[PLT_ENT_COUNT]; FTRACE_ADDR,
MCOUNT_ADDR,
#endif
}; };
static bool in_init(const struct module *mod, unsigned long loc) static bool in_init(const struct module *mod, unsigned long loc)
@ -36,14 +35,40 @@ static bool in_init(const struct module *mod, unsigned long loc)
return loc - (u32)mod->init_layout.base < mod->init_layout.size; return loc - (u32)mod->init_layout.base < mod->init_layout.size;
} }
static void prealloc_fixed(struct mod_plt_sec *pltsec, struct plt_entries *plt)
{
int i;
if (!ARRAY_SIZE(fixed_plts) || pltsec->plt_count)
return;
pltsec->plt_count = ARRAY_SIZE(fixed_plts);
for (i = 0; i < ARRAY_SIZE(plt->ldr); ++i)
plt->ldr[i] = PLT_ENT_LDR;
BUILD_BUG_ON(sizeof(fixed_plts) > sizeof(plt->lit));
memcpy(plt->lit, fixed_plts, sizeof(fixed_plts));
}
u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val) u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val)
{ {
struct mod_plt_sec *pltsec = !in_init(mod, loc) ? &mod->arch.core : struct mod_plt_sec *pltsec = !in_init(mod, loc) ? &mod->arch.core :
&mod->arch.init; &mod->arch.init;
struct plt_entries *plt;
int idx;
struct plt_entries *plt = (struct plt_entries *)pltsec->plt->sh_addr; /* cache the address, ELF header is available only during module load */
int idx = 0; if (!pltsec->plt_ent)
pltsec->plt_ent = (struct plt_entries *)pltsec->plt->sh_addr;
plt = pltsec->plt_ent;
prealloc_fixed(pltsec, plt);
for (idx = 0; idx < ARRAY_SIZE(fixed_plts); ++idx)
if (plt->lit[idx] == val)
return (u32)&plt->ldr[idx];
idx = 0;
/* /*
* Look for an existing entry pointing to 'val'. Given that the * Look for an existing entry pointing to 'val'. Given that the
* relocations are sorted, this will be the last entry we allocated. * relocations are sorted, this will be the last entry we allocated.
@ -191,8 +216,8 @@ static unsigned int count_plts(const Elf32_Sym *syms, Elf32_Addr base,
int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
char *secstrings, struct module *mod) char *secstrings, struct module *mod)
{ {
unsigned long core_plts = 0; unsigned long core_plts = ARRAY_SIZE(fixed_plts);
unsigned long init_plts = 0; unsigned long init_plts = ARRAY_SIZE(fixed_plts);
Elf32_Shdr *s, *sechdrs_end = sechdrs + ehdr->e_shnum; Elf32_Shdr *s, *sechdrs_end = sechdrs + ehdr->e_shnum;
Elf32_Sym *syms = NULL; Elf32_Sym *syms = NULL;
@ -247,6 +272,7 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
mod->arch.core.plt->sh_size = round_up(core_plts * PLT_ENT_SIZE, mod->arch.core.plt->sh_size = round_up(core_plts * PLT_ENT_SIZE,
sizeof(struct plt_entries)); sizeof(struct plt_entries));
mod->arch.core.plt_count = 0; mod->arch.core.plt_count = 0;
mod->arch.core.plt_ent = NULL;
mod->arch.init.plt->sh_type = SHT_NOBITS; mod->arch.init.plt->sh_type = SHT_NOBITS;
mod->arch.init.plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC; mod->arch.init.plt->sh_flags = SHF_EXECINSTR | SHF_ALLOC;
@ -254,6 +280,7 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
mod->arch.init.plt->sh_size = round_up(init_plts * PLT_ENT_SIZE, mod->arch.init.plt->sh_size = round_up(init_plts * PLT_ENT_SIZE,
sizeof(struct plt_entries)); sizeof(struct plt_entries));
mod->arch.init.plt_count = 0; mod->arch.init.plt_count = 0;
mod->arch.init.plt_ent = NULL;
pr_debug("%s: plt=%x, init.plt=%x\n", __func__, pr_debug("%s: plt=%x, init.plt=%x\n", __func__,
mod->arch.core.plt->sh_size, mod->arch.init.plt->sh_size); mod->arch.core.plt->sh_size, mod->arch.init.plt->sh_size);

View File

@ -10,8 +10,6 @@
*/ */
#include <linux/export.h> #include <linux/export.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
#include <linux/sched.h> #include <linux/sched.h>
#include <asm/stacktrace.h> #include <asm/stacktrace.h>
@ -56,6 +54,4 @@ void *return_address(unsigned int level)
return NULL; return NULL;
} }
#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */
EXPORT_SYMBOL_GPL(return_address); EXPORT_SYMBOL_GPL(return_address);

View File

@ -456,7 +456,7 @@ config ARM64_ERRATUM_1024718
help help
This option adds work around for Arm Cortex-A55 Erratum 1024718. This option adds work around for Arm Cortex-A55 Erratum 1024718.
Affected Cortex-A55 cores (r0p0, r0p1, r1p0) could cause incorrect Affected Cortex-A55 cores (all revisions) could cause incorrect
update of the hardware dirty bit when the DBM/AP bits are updated update of the hardware dirty bit when the DBM/AP bits are updated
without a break-before-make. The work around is to disable the usage without a break-before-make. The work around is to disable the usage
of hardware DBM locally on the affected cores. CPUs not affected by of hardware DBM locally on the affected cores. CPUs not affected by

View File

@ -94,7 +94,7 @@
#address-cells = <0>; #address-cells = <0>;
interrupt-controller; interrupt-controller;
reg = <0x11001000 0x1000>, reg = <0x11001000 0x1000>,
<0x11002000 0x1000>, <0x11002000 0x2000>,
<0x11004000 0x2000>, <0x11004000 0x2000>,
<0x11006000 0x2000>; <0x11006000 0x2000>;
}; };

View File

@ -347,8 +347,15 @@
#interrupt-cells = <1>; #interrupt-cells = <1>;
msi-parent = <&pcie0>; msi-parent = <&pcie0>;
msi-controller; msi-controller;
ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x1000000 /* Port 0 MEM */ /*
0x81000000 0 0xe9000000 0 0xe9000000 0 0x10000>; /* Port 0 IO*/ * The 128 MiB address range [0xe8000000-0xf0000000] is
* dedicated for PCIe and can be assigned to 8 windows
* with size a power of two. Use one 64 KiB window for
* IO at the end and the remaining seven windows
* (totaling 127 MiB) for MEM.
*/
ranges = <0x82000000 0 0xe8000000 0 0xe8000000 0 0x07f00000 /* Port 0 MEM */
0x81000000 0 0xefff0000 0 0xefff0000 0 0x00010000>; /* Port 0 IO */
interrupt-map-mask = <0 0 0 7>; interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0 0 0 1 &pcie_intc 0>, interrupt-map = <0 0 0 1 &pcie_intc 0>,
<0 0 0 2 &pcie_intc 1>, <0 0 0 2 &pcie_intc 1>,

View File

@ -27,7 +27,7 @@
stdout-path = "serial0"; stdout-path = "serial0";
}; };
memory { memory@40000000 {
device_type = "memory"; device_type = "memory";
reg = <0x0 0x40000000 0x0 0x20000000>; reg = <0x0 0x40000000 0x0 0x20000000>;
}; };

View File

@ -65,7 +65,7 @@
#ifdef CONFIG_CC_STACKPROTECTOR #ifdef CONFIG_CC_STACKPROTECTOR
#include <linux/stackprotector.h> #include <linux/stackprotector.h>
unsigned long __stack_chk_guard __read_mostly; unsigned long __stack_chk_guard __ro_after_init;
EXPORT_SYMBOL(__stack_chk_guard); EXPORT_SYMBOL(__stack_chk_guard);
#endif #endif

View File

@ -477,8 +477,8 @@ ENTRY(__cpu_setup)
cmp x9, #2 cmp x9, #2
b.lt 1f b.lt 1f
#ifdef CONFIG_ARM64_ERRATUM_1024718 #ifdef CONFIG_ARM64_ERRATUM_1024718
/* Disable hardware DBM on Cortex-A55 r0p0, r0p1 & r1p0 */ /* Disable hardware DBM on Cortex-A55 all versions */
cpu_midr_match MIDR_CORTEX_A55, MIDR_CPU_VAR_REV(0, 0), MIDR_CPU_VAR_REV(1, 0), x1, x2, x3, x4 cpu_midr_match MIDR_CORTEX_A55, MIDR_CPU_VAR_REV(0, 0), MIDR_CPU_VAR_REV(0xf, 0xf), x1, x2, x3, x4
cbnz x1, 1f cbnz x1, 1f
#endif #endif
orr x10, x10, #TCR_HD // hardware Dirty flag update orr x10, x10, #TCR_HD // hardware Dirty flag update

View File

@ -258,8 +258,8 @@ static void __exit nfeth_cleanup(void)
for (i = 0; i < MAX_UNIT; i++) { for (i = 0; i < MAX_UNIT; i++) {
if (nfeth_dev[i]) { if (nfeth_dev[i]) {
unregister_netdev(nfeth_dev[0]); unregister_netdev(nfeth_dev[i]);
free_netdev(nfeth_dev[0]); free_netdev(nfeth_dev[i]);
} }
} }
free_irq(nfEtherIRQ, nfeth_interrupt); free_irq(nfEtherIRQ, nfeth_interrupt);

View File

@ -31,21 +31,21 @@ extern void __iounmap(void *addr, unsigned long size);
* two accesses to memory, which may be undesirable for some devices. * two accesses to memory, which may be undesirable for some devices.
*/ */
#define in_8(addr) \ #define in_8(addr) \
({ u8 __v = (*(__force volatile u8 *) (addr)); __v; }) ({ u8 __v = (*(__force volatile u8 *) (unsigned long)(addr)); __v; })
#define in_be16(addr) \ #define in_be16(addr) \
({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) ({ u16 __v = (*(__force volatile u16 *) (unsigned long)(addr)); __v; })
#define in_be32(addr) \ #define in_be32(addr) \
({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) ({ u32 __v = (*(__force volatile u32 *) (unsigned long)(addr)); __v; })
#define in_le16(addr) \ #define in_le16(addr) \
({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (addr)); __v; }) ({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (unsigned long)(addr)); __v; })
#define in_le32(addr) \ #define in_le32(addr) \
({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (addr)); __v; }) ({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (unsigned long)(addr)); __v; })
#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) #define out_8(addr,b) (void)((*(__force volatile u8 *) (unsigned long)(addr)) = (b))
#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w)) #define out_be16(addr,w) (void)((*(__force volatile u16 *) (unsigned long)(addr)) = (w))
#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l)) #define out_be32(addr,l) (void)((*(__force volatile u32 *) (unsigned long)(addr)) = (l))
#define out_le16(addr,w) (void)((*(__force volatile __le16 *) (addr)) = cpu_to_le16(w)) #define out_le16(addr,w) (void)((*(__force volatile __le16 *) (unsigned long)(addr)) = cpu_to_le16(w))
#define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l)) #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (unsigned long)(addr)) = cpu_to_le32(l))
#define raw_inb in_8 #define raw_inb in_8
#define raw_inw in_be16 #define raw_inw in_be16

View File

@ -26,7 +26,7 @@
#define ROCIT_CONFIG_GEN1_MEMMAP_SHIFT 8 #define ROCIT_CONFIG_GEN1_MEMMAP_SHIFT 8
#define ROCIT_CONFIG_GEN1_MEMMAP_MASK (0xf << 8) #define ROCIT_CONFIG_GEN1_MEMMAP_MASK (0xf << 8)
static unsigned char fdt_buf[16 << 10] __initdata; static unsigned char fdt_buf[16 << 10] __initdata __aligned(8);
/* determined physical memory size, not overridden by command line args */ /* determined physical memory size, not overridden by command line args */
extern unsigned long physical_memsize; extern unsigned long physical_memsize;

View File

@ -495,6 +495,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
l.bnf 1f // ext irq enabled, all ok. l.bnf 1f // ext irq enabled, all ok.
l.nop l.nop
#ifdef CONFIG_PRINTK
l.addi r1,r1,-0x8 l.addi r1,r1,-0x8
l.movhi r3,hi(42f) l.movhi r3,hi(42f)
l.ori r3,r3,lo(42f) l.ori r3,r3,lo(42f)
@ -508,6 +509,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
.string "\n\rESR interrupt bug: in _external_irq_handler (ESR %x)\n\r" .string "\n\rESR interrupt bug: in _external_irq_handler (ESR %x)\n\r"
.align 4 .align 4
.previous .previous
#endif
l.ori r4,r4,SPR_SR_IEE // fix the bug l.ori r4,r4,SPR_SR_IEE // fix the bug
// l.sw PT_SR(r1),r4 // l.sw PT_SR(r1),r4

View File

@ -179,7 +179,7 @@ extern int npmem_ranges;
#include <asm-generic/getorder.h> #include <asm-generic/getorder.h>
#include <asm/pdc.h> #include <asm/pdc.h>
#define PAGE0 ((struct zeropage *)__PAGE_OFFSET) #define PAGE0 ((struct zeropage *)absolute_pointer(__PAGE_OFFSET))
/* DEFINITION OF THE ZERO-PAGE (PAG0) */ /* DEFINITION OF THE ZERO-PAGE (PAG0) */
/* based on work by Jason Eckhardt (jason@equator.com) */ /* based on work by Jason Eckhardt (jason@equator.com) */

View File

@ -242,6 +242,12 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
#endif #endif
usp = (regs->gr[30] & ~(0x01UL)); usp = (regs->gr[30] & ~(0x01UL));
#ifdef CONFIG_64BIT
if (is_compat_task()) {
/* The gcc alloca implementation leaves garbage in the upper 32 bits of sp */
usp = (compat_uint_t)usp;
}
#endif
/*FIXME: frame_size parameter is unused, remove it. */ /*FIXME: frame_size parameter is unused, remove it. */
frame = get_sigframe(&ksig->ka, usp, sizeof(*frame)); frame = get_sigframe(&ksig->ka, usp, sizeof(*frame));

View File

@ -49,9 +49,6 @@ p_end: .long _end
p_pstack: .long _platform_stack_top p_pstack: .long _platform_stack_top
#endif #endif
.globl _zimage_start
/* Clang appears to require the .weak directive to be after the symbol
* is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921 */
.weak _zimage_start .weak _zimage_start
_zimage_start: _zimage_start:
.globl _zimage_start_lib .globl _zimage_start_lib

View File

@ -695,7 +695,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
/* /*
* If found, replace it with: * If found, replace it with:
* addis r2, r12, (.TOC.-func)@ha * addis r2, r12, (.TOC.-func)@ha
* addi r2, r12, (.TOC.-func)@l * addi r2, r2, (.TOC.-func)@l
*/ */
((uint32_t *)location)[0] = 0x3c4c0000 + PPC_HA(value); ((uint32_t *)location)[0] = 0x3c4c0000 + PPC_HA(value);
((uint32_t *)location)[1] = 0x38420000 + PPC_LO(value); ((uint32_t *)location)[1] = 0x38420000 + PPC_LO(value);

View File

@ -168,7 +168,7 @@ static unsigned long single_gpci_request(u32 req, u32 starting_index,
*/ */
count = 0; count = 0;
for (i = offset; i < offset + length; i++) for (i = offset; i < offset + length; i++)
count |= arg->bytes[i] << (i - offset); count |= (u64)(arg->bytes[i]) << ((length - 1 - (i - offset)) * 8);
*value = count; *value = count;
out: out:

View File

@ -2018,7 +2018,7 @@ void show_code(struct pt_regs *regs)
start += opsize; start += opsize;
pr_cont("%s", buffer); pr_cont("%s", buffer);
ptr = buffer; ptr = buffer;
ptr += sprintf(ptr, "\n\t "); ptr += sprintf(ptr, "\n ");
hops++; hops++;
} }
pr_cont("\n"); pr_cont("\n");

View File

@ -43,7 +43,7 @@ static void jump_label_bug(struct jump_entry *entry, struct insn *expected,
unsigned char *ipe = (unsigned char *)expected; unsigned char *ipe = (unsigned char *)expected;
unsigned char *ipn = (unsigned char *)new; unsigned char *ipn = (unsigned char *)new;
pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc); pr_emerg("Jump label code mismatch at %pS [%px]\n", ipc, ipc);
pr_emerg("Found: %6ph\n", ipc); pr_emerg("Found: %6ph\n", ipc);
pr_emerg("Expected: %6ph\n", ipe); pr_emerg("Expected: %6ph\n", ipe);
pr_emerg("New: %6ph\n", ipn); pr_emerg("New: %6ph\n", ipn);

View File

@ -592,10 +592,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
EMIT4(0xb9080000, dst_reg, src_reg); EMIT4(0xb9080000, dst_reg, src_reg);
break; break;
case BPF_ALU | BPF_ADD | BPF_K: /* dst = (u32) dst + (u32) imm */ case BPF_ALU | BPF_ADD | BPF_K: /* dst = (u32) dst + (u32) imm */
if (!imm) if (imm != 0) {
break; /* alfi %dst,imm */
/* alfi %dst,imm */ EMIT6_IMM(0xc20b0000, dst_reg, imm);
EMIT6_IMM(0xc20b0000, dst_reg, imm); }
EMIT_ZERO(dst_reg); EMIT_ZERO(dst_reg);
break; break;
case BPF_ALU64 | BPF_ADD | BPF_K: /* dst = dst + imm */ case BPF_ALU64 | BPF_ADD | BPF_K: /* dst = dst + imm */
@ -617,17 +617,22 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
EMIT4(0xb9090000, dst_reg, src_reg); EMIT4(0xb9090000, dst_reg, src_reg);
break; break;
case BPF_ALU | BPF_SUB | BPF_K: /* dst = (u32) dst - (u32) imm */ case BPF_ALU | BPF_SUB | BPF_K: /* dst = (u32) dst - (u32) imm */
if (!imm) if (imm != 0) {
break; /* alfi %dst,-imm */
/* alfi %dst,-imm */ EMIT6_IMM(0xc20b0000, dst_reg, -imm);
EMIT6_IMM(0xc20b0000, dst_reg, -imm); }
EMIT_ZERO(dst_reg); EMIT_ZERO(dst_reg);
break; break;
case BPF_ALU64 | BPF_SUB | BPF_K: /* dst = dst - imm */ case BPF_ALU64 | BPF_SUB | BPF_K: /* dst = dst - imm */
if (!imm) if (!imm)
break; break;
/* agfi %dst,-imm */ if (imm == -0x80000000) {
EMIT6_IMM(0xc2080000, dst_reg, -imm); /* algfi %dst,0x80000000 */
EMIT6_IMM(0xc20a0000, dst_reg, 0x80000000);
} else {
/* agfi %dst,-imm */
EMIT6_IMM(0xc2080000, dst_reg, -imm);
}
break; break;
/* /*
* BPF_MUL * BPF_MUL
@ -642,10 +647,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
EMIT4(0xb90c0000, dst_reg, src_reg); EMIT4(0xb90c0000, dst_reg, src_reg);
break; break;
case BPF_ALU | BPF_MUL | BPF_K: /* dst = (u32) dst * (u32) imm */ case BPF_ALU | BPF_MUL | BPF_K: /* dst = (u32) dst * (u32) imm */
if (imm == 1) if (imm != 1) {
break; /* msfi %r5,imm */
/* msfi %r5,imm */ EMIT6_IMM(0xc2010000, dst_reg, imm);
EMIT6_IMM(0xc2010000, dst_reg, imm); }
EMIT_ZERO(dst_reg); EMIT_ZERO(dst_reg);
break; break;
case BPF_ALU64 | BPF_MUL | BPF_K: /* dst = dst * imm */ case BPF_ALU64 | BPF_MUL | BPF_K: /* dst = dst * imm */
@ -706,6 +711,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
if (BPF_OP(insn->code) == BPF_MOD) if (BPF_OP(insn->code) == BPF_MOD)
/* lhgi %dst,0 */ /* lhgi %dst,0 */
EMIT4_IMM(0xa7090000, dst_reg, 0); EMIT4_IMM(0xa7090000, dst_reg, 0);
else
EMIT_ZERO(dst_reg);
break; break;
} }
/* lhi %w0,0 */ /* lhi %w0,0 */
@ -798,10 +805,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
EMIT4(0xb9820000, dst_reg, src_reg); EMIT4(0xb9820000, dst_reg, src_reg);
break; break;
case BPF_ALU | BPF_XOR | BPF_K: /* dst = (u32) dst ^ (u32) imm */ case BPF_ALU | BPF_XOR | BPF_K: /* dst = (u32) dst ^ (u32) imm */
if (!imm) if (imm != 0) {
break; /* xilf %dst,imm */
/* xilf %dst,imm */ EMIT6_IMM(0xc0070000, dst_reg, imm);
EMIT6_IMM(0xc0070000, dst_reg, imm); }
EMIT_ZERO(dst_reg); EMIT_ZERO(dst_reg);
break; break;
case BPF_ALU64 | BPF_XOR | BPF_K: /* dst = dst ^ imm */ case BPF_ALU64 | BPF_XOR | BPF_K: /* dst = dst ^ imm */
@ -822,10 +829,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
EMIT6_DISP_LH(0xeb000000, 0x000d, dst_reg, dst_reg, src_reg, 0); EMIT6_DISP_LH(0xeb000000, 0x000d, dst_reg, dst_reg, src_reg, 0);
break; break;
case BPF_ALU | BPF_LSH | BPF_K: /* dst = (u32) dst << (u32) imm */ case BPF_ALU | BPF_LSH | BPF_K: /* dst = (u32) dst << (u32) imm */
if (imm == 0) if (imm != 0) {
break; /* sll %dst,imm(%r0) */
/* sll %dst,imm(%r0) */ EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
EMIT4_DISP(0x89000000, dst_reg, REG_0, imm); }
EMIT_ZERO(dst_reg); EMIT_ZERO(dst_reg);
break; break;
case BPF_ALU64 | BPF_LSH | BPF_K: /* dst = dst << imm */ case BPF_ALU64 | BPF_LSH | BPF_K: /* dst = dst << imm */
@ -847,10 +854,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
EMIT6_DISP_LH(0xeb000000, 0x000c, dst_reg, dst_reg, src_reg, 0); EMIT6_DISP_LH(0xeb000000, 0x000c, dst_reg, dst_reg, src_reg, 0);
break; break;
case BPF_ALU | BPF_RSH | BPF_K: /* dst = (u32) dst >> (u32) imm */ case BPF_ALU | BPF_RSH | BPF_K: /* dst = (u32) dst >> (u32) imm */
if (imm == 0) if (imm != 0) {
break; /* srl %dst,imm(%r0) */
/* srl %dst,imm(%r0) */ EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
EMIT4_DISP(0x88000000, dst_reg, REG_0, imm); }
EMIT_ZERO(dst_reg); EMIT_ZERO(dst_reg);
break; break;
case BPF_ALU64 | BPF_RSH | BPF_K: /* dst = dst >> imm */ case BPF_ALU64 | BPF_RSH | BPF_K: /* dst = dst >> imm */

View File

@ -38,6 +38,7 @@ struct mdesc_hdr {
u32 node_sz; /* node block size */ u32 node_sz; /* node block size */
u32 name_sz; /* name block size */ u32 name_sz; /* name block size */
u32 data_sz; /* data block size */ u32 data_sz; /* data block size */
char data[];
} __attribute__((aligned(16))); } __attribute__((aligned(16)));
struct mdesc_elem { struct mdesc_elem {
@ -611,7 +612,7 @@ EXPORT_SYMBOL(mdesc_get_node_info);
static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc) static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc)
{ {
return (struct mdesc_elem *) (mdesc + 1); return (struct mdesc_elem *) mdesc->data;
} }
static void *name_block(struct mdesc_hdr *mdesc) static void *name_block(struct mdesc_hdr *mdesc)

View File

@ -19,8 +19,10 @@ void ioport_unmap(void __iomem *addr)
EXPORT_SYMBOL(ioport_map); EXPORT_SYMBOL(ioport_map);
EXPORT_SYMBOL(ioport_unmap); EXPORT_SYMBOL(ioport_unmap);
#ifdef CONFIG_PCI
void pci_iounmap(struct pci_dev *dev, void __iomem * addr) void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
{ {
/* nothing to do */ /* nothing to do */
} }
EXPORT_SYMBOL(pci_iounmap); EXPORT_SYMBOL(pci_iounmap);
#endif

View File

@ -90,6 +90,7 @@ struct perf_ibs {
unsigned long offset_mask[1]; unsigned long offset_mask[1];
int offset_max; int offset_max;
unsigned int fetch_count_reset_broken : 1; unsigned int fetch_count_reset_broken : 1;
unsigned int fetch_ignore_if_zero_rip : 1;
struct cpu_perf_ibs __percpu *pcpu; struct cpu_perf_ibs __percpu *pcpu;
struct attribute **format_attrs; struct attribute **format_attrs;
@ -674,6 +675,10 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
if (check_rip && (ibs_data.regs[2] & IBS_RIP_INVALID)) { if (check_rip && (ibs_data.regs[2] & IBS_RIP_INVALID)) {
regs.flags &= ~PERF_EFLAGS_EXACT; regs.flags &= ~PERF_EFLAGS_EXACT;
} else { } else {
/* Workaround for erratum #1197 */
if (perf_ibs->fetch_ignore_if_zero_rip && !(ibs_data.regs[1]))
goto out;
set_linear_ip(&regs, ibs_data.regs[1]); set_linear_ip(&regs, ibs_data.regs[1]);
regs.flags |= PERF_EFLAGS_EXACT; regs.flags |= PERF_EFLAGS_EXACT;
} }
@ -767,6 +772,9 @@ static __init void perf_event_ibs_init(void)
if (boot_cpu_data.x86 >= 0x16 && boot_cpu_data.x86 <= 0x18) if (boot_cpu_data.x86 >= 0x16 && boot_cpu_data.x86 <= 0x18)
perf_ibs_fetch.fetch_count_reset_broken = 1; perf_ibs_fetch.fetch_count_reset_broken = 1;
if (boot_cpu_data.x86 == 0x19 && boot_cpu_data.x86_model < 0x10)
perf_ibs_fetch.fetch_ignore_if_zero_rip = 1;
perf_ibs_pmu_init(&perf_ibs_fetch, "ibs_fetch"); perf_ibs_pmu_init(&perf_ibs_fetch, "ibs_fetch");
if (ibs_caps & IBS_CAPS_OPCNT) { if (ibs_caps & IBS_CAPS_OPCNT) {

View File

@ -69,7 +69,7 @@ static struct pt_cap_desc {
PT_CAP(topa_multiple_entries, 0, CPUID_ECX, BIT(1)), PT_CAP(topa_multiple_entries, 0, CPUID_ECX, BIT(1)),
PT_CAP(single_range_output, 0, CPUID_ECX, BIT(2)), PT_CAP(single_range_output, 0, CPUID_ECX, BIT(2)),
PT_CAP(payloads_lip, 0, CPUID_ECX, BIT(31)), PT_CAP(payloads_lip, 0, CPUID_ECX, BIT(31)),
PT_CAP(num_address_ranges, 1, CPUID_EAX, 0x3), PT_CAP(num_address_ranges, 1, CPUID_EAX, 0x7),
PT_CAP(mtc_periods, 1, CPUID_EAX, 0xffff0000), PT_CAP(mtc_periods, 1, CPUID_EAX, 0xffff0000),
PT_CAP(cycle_thresholds, 1, CPUID_EBX, 0xffff), PT_CAP(cycle_thresholds, 1, CPUID_EBX, 0xffff),
PT_CAP(psb_periods, 1, CPUID_EBX, 0xffff0000), PT_CAP(psb_periods, 1, CPUID_EBX, 0xffff0000),

View File

@ -244,6 +244,12 @@ static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)
case QOS_L3_MBM_LOCAL_EVENT_ID: case QOS_L3_MBM_LOCAL_EVENT_ID:
m = &rr->d->mbm_local[rmid]; m = &rr->d->mbm_local[rmid];
break; break;
default:
/*
* Code would never reach here because an invalid
* event id would fail the __rmid_read.
*/
return RMID_VAL_ERROR;
} }
if (rr->first) { if (rr->first) {

View File

@ -388,10 +388,11 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = {
}, },
{ /* Handle problems with rebooting on the OptiPlex 990. */ { /* Handle problems with rebooting on the OptiPlex 990. */
.callback = set_pci_reboot, .callback = set_pci_reboot,
.ident = "Dell OptiPlex 990", .ident = "Dell OptiPlex 990 BIOS A0x",
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"), DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
DMI_MATCH(DMI_BIOS_VERSION, "A0"),
}, },
}, },
{ /* Handle problems with rebooting on Dell 300's */ { /* Handle problems with rebooting on Dell 300's */

View File

@ -2355,6 +2355,10 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
if (!msr_info->host_initiated) { if (!msr_info->host_initiated) {
s64 adj = data - vcpu->arch.ia32_tsc_adjust_msr; s64 adj = data - vcpu->arch.ia32_tsc_adjust_msr;
adjust_tsc_offset_guest(vcpu, adj); adjust_tsc_offset_guest(vcpu, adj);
/* Before back to guest, tsc_timestamp must be adjusted
* as well, otherwise guest's percpu pvclock time could jump.
*/
kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
} }
vcpu->arch.ia32_tsc_adjust_msr = data; vcpu->arch.ia32_tsc_adjust_msr = data;
} }

View File

@ -1282,18 +1282,18 @@ int kern_addr_valid(unsigned long addr)
return 0; return 0;
p4d = p4d_offset(pgd, addr); p4d = p4d_offset(pgd, addr);
if (p4d_none(*p4d)) if (!p4d_present(*p4d))
return 0; return 0;
pud = pud_offset(p4d, addr); pud = pud_offset(p4d, addr);
if (pud_none(*pud)) if (!pud_present(*pud))
return 0; return 0;
if (pud_large(*pud)) if (pud_large(*pud))
return pfn_valid(pud_pfn(*pud)); return pfn_valid(pud_pfn(*pud));
pmd = pmd_offset(pud, addr); pmd = pmd_offset(pud, addr);
if (pmd_none(*pmd)) if (!pmd_present(*pmd))
return 0; return 0;
if (pmd_large(*pmd)) if (pmd_large(*pmd))

View File

@ -721,8 +721,8 @@ static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
preempt_enable(); preempt_enable();
} }
static void xen_convert_trap_info(const struct desc_ptr *desc, static unsigned xen_convert_trap_info(const struct desc_ptr *desc,
struct trap_info *traps) struct trap_info *traps, bool full)
{ {
unsigned in, out, count; unsigned in, out, count;
@ -732,17 +732,18 @@ static void xen_convert_trap_info(const struct desc_ptr *desc,
for (in = out = 0; in < count; in++) { for (in = out = 0; in < count; in++) {
gate_desc *entry = (gate_desc *)(desc->address) + in; gate_desc *entry = (gate_desc *)(desc->address) + in;
if (cvt_gate_to_trap(in, entry, &traps[out])) if (cvt_gate_to_trap(in, entry, &traps[out]) || full)
out++; out++;
} }
traps[out].address = 0;
return out;
} }
void xen_copy_trap_info(struct trap_info *traps) void xen_copy_trap_info(struct trap_info *traps)
{ {
const struct desc_ptr *desc = this_cpu_ptr(&idt_desc); const struct desc_ptr *desc = this_cpu_ptr(&idt_desc);
xen_convert_trap_info(desc, traps); xen_convert_trap_info(desc, traps, true);
} }
/* Load a new IDT into Xen. In principle this can be per-CPU, so we /* Load a new IDT into Xen. In principle this can be per-CPU, so we
@ -752,6 +753,7 @@ static void xen_load_idt(const struct desc_ptr *desc)
{ {
static DEFINE_SPINLOCK(lock); static DEFINE_SPINLOCK(lock);
static struct trap_info traps[257]; static struct trap_info traps[257];
unsigned out;
trace_xen_cpu_load_idt(desc); trace_xen_cpu_load_idt(desc);
@ -759,7 +761,8 @@ static void xen_load_idt(const struct desc_ptr *desc)
memcpy(this_cpu_ptr(&idt_desc), desc, sizeof(idt_desc)); memcpy(this_cpu_ptr(&idt_desc), desc, sizeof(idt_desc));
xen_convert_trap_info(desc, traps); out = xen_convert_trap_info(desc, traps, false);
memset(&traps[out], 0, sizeof(traps[0]));
xen_mc_flush(); xen_mc_flush();
if (HYPERVISOR_set_trap_table(traps)) if (HYPERVISOR_set_trap_table(traps))
@ -1214,6 +1217,11 @@ static void __init xen_dom0_set_legacy_features(void)
x86_platform.legacy.rtc = 1; x86_platform.legacy.rtc = 1;
} }
static void __init xen_domu_set_legacy_features(void)
{
x86_platform.legacy.rtc = 0;
}
/* First C function to be called on Xen boot */ /* First C function to be called on Xen boot */
asmlinkage __visible void __init xen_start_kernel(void) asmlinkage __visible void __init xen_start_kernel(void)
{ {
@ -1375,6 +1383,8 @@ asmlinkage __visible void __init xen_start_kernel(void)
add_preferred_console("hvc", 0, NULL); add_preferred_console("hvc", 0, NULL);
if (pci_xen) if (pci_xen)
x86_init.pci.arch_init = pci_xen_init; x86_init.pci.arch_init = pci_xen_init;
x86_platform.set_legacy_features =
xen_domu_set_legacy_features;
} else { } else {
const struct dom0_vga_console_info *info = const struct dom0_vga_console_info *info =
(void *)((char *)xen_start_info + (void *)((char *)xen_start_info +

View File

@ -613,8 +613,8 @@ int xen_alloc_p2m_entry(unsigned long pfn)
} }
/* Expanded the p2m? */ /* Expanded the p2m? */
if (pfn > xen_p2m_last_pfn) { if (pfn >= xen_p2m_last_pfn) {
xen_p2m_last_pfn = pfn; xen_p2m_last_pfn = ALIGN(pfn + 1, P2M_PER_PAGE);
HYPERVISOR_shared_info->arch.max_pfn = xen_p2m_last_pfn; HYPERVISOR_shared_info->arch.max_pfn = xen_p2m_last_pfn;
} }

View File

@ -20,7 +20,7 @@ config XTENSA
select HAVE_DMA_CONTIGUOUS select HAVE_DMA_CONTIGUOUS
select HAVE_EXIT_THREAD select HAVE_EXIT_THREAD
select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACER
select HAVE_FUTEX_CMPXCHG if !MMU select HAVE_FUTEX_CMPXCHG if !MMU && FUTEX
select HAVE_HW_BREAKPOINT if PERF_EVENTS select HAVE_HW_BREAKPOINT if PERF_EVENTS
select HAVE_IRQ_TIME_ACCOUNTING select HAVE_IRQ_TIME_ACCOUNTING
select HAVE_MEMBLOCK select HAVE_MEMBLOCK

View File

@ -182,9 +182,13 @@ static const struct tty_operations serial_ops = {
int __init rs_init(void) int __init rs_init(void)
{ {
tty_port_init(&serial_port); int ret;
serial_driver = alloc_tty_driver(SERIAL_MAX_NUM_LINES); serial_driver = alloc_tty_driver(SERIAL_MAX_NUM_LINES);
if (!serial_driver)
return -ENOMEM;
tty_port_init(&serial_port);
printk ("%s %s\n", serial_name, serial_version); printk ("%s %s\n", serial_name, serial_version);
@ -204,8 +208,15 @@ int __init rs_init(void)
tty_set_operations(serial_driver, &serial_ops); tty_set_operations(serial_driver, &serial_ops);
tty_port_link_device(&serial_port, serial_driver, 0); tty_port_link_device(&serial_port, serial_driver, 0);
if (tty_register_driver(serial_driver)) ret = tty_register_driver(serial_driver);
panic("Couldn't register serial driver\n"); if (ret) {
pr_err("Couldn't register serial driver\n");
tty_driver_kref_put(serial_driver);
tty_port_destroy(&serial_port);
return ret;
}
return 0; return 0;
} }

View File

@ -3825,7 +3825,7 @@ bfq_set_next_ioprio_data(struct bfq_queue *bfqq, struct bfq_io_cq *bic)
if (bfqq->new_ioprio >= IOPRIO_BE_NR) { if (bfqq->new_ioprio >= IOPRIO_BE_NR) {
pr_crit("bfq_set_next_ioprio_data: new_ioprio %d\n", pr_crit("bfq_set_next_ioprio_data: new_ioprio %d\n",
bfqq->new_ioprio); bfqq->new_ioprio);
bfqq->new_ioprio = IOPRIO_BE_NR; bfqq->new_ioprio = IOPRIO_BE_NR - 1;
} }
bfqq->entity.new_weight = bfq_ioprio_to_weight(bfqq->new_ioprio); bfqq->entity.new_weight = bfq_ioprio_to_weight(bfqq->new_ioprio);

View File

@ -2414,6 +2414,7 @@ int blk_throtl_init(struct request_queue *q)
void blk_throtl_exit(struct request_queue *q) void blk_throtl_exit(struct request_queue *q)
{ {
BUG_ON(!q->td); BUG_ON(!q->td);
del_timer_sync(&q->td->service_queue.pending_timer);
throtl_shutdown_wq(q); throtl_shutdown_wq(q);
blkcg_deactivate_policy(q, &blkcg_policy_throtl); blkcg_deactivate_policy(q, &blkcg_policy_throtl);
free_percpu(q->td->latency_buckets); free_percpu(q->td->latency_buckets);

View File

@ -277,9 +277,6 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
if (!blk_queue_is_zoned(q)) if (!blk_queue_is_zoned(q))
return -ENOTTY; return -ENOTTY;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (copy_from_user(&rep, argp, sizeof(struct blk_zone_report))) if (copy_from_user(&rep, argp, sizeof(struct blk_zone_report)))
return -EFAULT; return -EFAULT;
@ -338,9 +335,6 @@ int blkdev_reset_zones_ioctl(struct block_device *bdev, fmode_t mode,
if (!blk_queue_is_zoned(q)) if (!blk_queue_is_zoned(q))
return -ENOTTY; return -ENOTTY;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (!(mode & FMODE_WRITE)) if (!(mode & FMODE_WRITE))
return -EBADF; return -EBADF;

View File

@ -46,11 +46,19 @@ endif
redirect_openssl = 2>&1 redirect_openssl = 2>&1
quiet_redirect_openssl = 2>&1 quiet_redirect_openssl = 2>&1
silent_redirect_openssl = 2>/dev/null silent_redirect_openssl = 2>/dev/null
openssl_available = $(shell openssl help 2>/dev/null && echo yes)
# We do it this way rather than having a boolean option for enabling an # We do it this way rather than having a boolean option for enabling an
# external private key, because 'make randconfig' might enable such a # external private key, because 'make randconfig' might enable such a
# boolean option and we unfortunately can't make it depend on !RANDCONFIG. # boolean option and we unfortunately can't make it depend on !RANDCONFIG.
ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem") ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem")
ifeq ($(openssl_available),yes)
X509TEXT=$(shell openssl x509 -in "certs/signing_key.pem" -text 2>/dev/null)
$(if $(findstring rsaEncryption,$(X509TEXT)),,$(shell rm -f "certs/signing_key.pem"))
endif
$(obj)/signing_key.pem: $(obj)/x509.genkey $(obj)/signing_key.pem: $(obj)/x509.genkey
@$(kecho) "###" @$(kecho) "###"
@$(kecho) "### Now generating an X.509 key pair to be used for signing modules." @$(kecho) "### Now generating an X.509 key pair to be used for signing modules."

View File

@ -2276,6 +2276,25 @@ static void ata_dev_config_ncq_prio(struct ata_device *dev)
} }
static bool ata_dev_check_adapter(struct ata_device *dev,
unsigned short vendor_id)
{
struct pci_dev *pcidev = NULL;
struct device *parent_dev = NULL;
for (parent_dev = dev->tdev.parent; parent_dev != NULL;
parent_dev = parent_dev->parent) {
if (dev_is_pci(parent_dev)) {
pcidev = to_pci_dev(parent_dev);
if (pcidev->vendor == vendor_id)
return true;
break;
}
}
return false;
}
static int ata_dev_config_ncq(struct ata_device *dev, static int ata_dev_config_ncq(struct ata_device *dev,
char *desc, size_t desc_sz) char *desc, size_t desc_sz)
{ {
@ -2292,6 +2311,13 @@ static int ata_dev_config_ncq(struct ata_device *dev,
snprintf(desc, desc_sz, "NCQ (not used)"); snprintf(desc, desc_sz, "NCQ (not used)");
return 0; return 0;
} }
if (dev->horkage & ATA_HORKAGE_NO_NCQ_ON_ATI &&
ata_dev_check_adapter(dev, PCI_VENDOR_ID_ATI)) {
snprintf(desc, desc_sz, "NCQ (not used)");
return 0;
}
if (ap->flags & ATA_FLAG_NCQ) { if (ap->flags & ATA_FLAG_NCQ) {
hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE - 1); hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE - 1);
dev->flags |= ATA_DFLAG_NCQ; dev->flags |= ATA_DFLAG_NCQ;
@ -4564,6 +4590,12 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
ATA_HORKAGE_ZERO_AFTER_TRIM, }, ATA_HORKAGE_ZERO_AFTER_TRIM, },
{ "Samsung SSD 850*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | { "Samsung SSD 850*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, }, ATA_HORKAGE_ZERO_AFTER_TRIM, },
{ "Samsung SSD 860*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM |
ATA_HORKAGE_NO_NCQ_ON_ATI, },
{ "Samsung SSD 870*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM |
ATA_HORKAGE_NO_NCQ_ON_ATI, },
{ "FCCT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | { "FCCT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, }, ATA_HORKAGE_ZERO_AFTER_TRIM, },
@ -6339,7 +6371,7 @@ int ata_host_start(struct ata_host *host)
have_stop = 1; have_stop = 1;
} }
if (host->ops->host_stop) if (host->ops && host->ops->host_stop)
have_stop = 1; have_stop = 1;
if (have_stop) { if (have_stop) {
@ -6856,6 +6888,8 @@ static int __init ata_parse_force_one(char **cur,
{ "ncq", .horkage_off = ATA_HORKAGE_NONCQ }, { "ncq", .horkage_off = ATA_HORKAGE_NONCQ },
{ "noncqtrim", .horkage_on = ATA_HORKAGE_NO_NCQ_TRIM }, { "noncqtrim", .horkage_on = ATA_HORKAGE_NO_NCQ_TRIM },
{ "ncqtrim", .horkage_off = ATA_HORKAGE_NO_NCQ_TRIM }, { "ncqtrim", .horkage_off = ATA_HORKAGE_NO_NCQ_TRIM },
{ "noncqati", .horkage_on = ATA_HORKAGE_NO_NCQ_ON_ATI },
{ "ncqati", .horkage_off = ATA_HORKAGE_NO_NCQ_ON_ATI },
{ "dump_id", .horkage_on = ATA_HORKAGE_DUMP_ID }, { "dump_id", .horkage_on = ATA_HORKAGE_DUMP_ID },
{ "pio0", .xfer_mask = 1 << (ATA_SHIFT_PIO + 0) }, { "pio0", .xfer_mask = 1 << (ATA_SHIFT_PIO + 0) },
{ "pio1", .xfer_mask = 1 << (ATA_SHIFT_PIO + 1) }, { "pio1", .xfer_mask = 1 << (ATA_SHIFT_PIO + 1) },

View File

@ -1253,24 +1253,20 @@ static int sata_dwc_probe(struct platform_device *ofdev)
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
if (irq == NO_IRQ) { if (irq == NO_IRQ) {
dev_err(&ofdev->dev, "no SATA DMA irq\n"); dev_err(&ofdev->dev, "no SATA DMA irq\n");
err = -ENODEV; return -ENODEV;
goto error_out;
} }
#ifdef CONFIG_SATA_DWC_OLD_DMA #ifdef CONFIG_SATA_DWC_OLD_DMA
if (!of_find_property(np, "dmas", NULL)) { if (!of_find_property(np, "dmas", NULL)) {
err = sata_dwc_dma_init_old(ofdev, hsdev); err = sata_dwc_dma_init_old(ofdev, hsdev);
if (err) if (err)
goto error_out; return err;
} }
#endif #endif
hsdev->phy = devm_phy_optional_get(hsdev->dev, "sata-phy"); hsdev->phy = devm_phy_optional_get(hsdev->dev, "sata-phy");
if (IS_ERR(hsdev->phy)) { if (IS_ERR(hsdev->phy))
err = PTR_ERR(hsdev->phy); return PTR_ERR(hsdev->phy);
hsdev->phy = NULL;
goto error_out;
}
err = phy_init(hsdev->phy); err = phy_init(hsdev->phy);
if (err) if (err)

View File

@ -11,6 +11,7 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/rtc.h> #include <linux/rtc.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/init.h>
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
@ -165,6 +166,9 @@ void generate_pm_trace(const void *tracedata, unsigned int user)
const char *file = *(const char **)(tracedata + 2); const char *file = *(const char **)(tracedata + 2);
unsigned int user_hash_value, file_hash_value; unsigned int user_hash_value, file_hash_value;
if (!x86_platform.legacy.rtc)
return;
user_hash_value = user % USERHASH; user_hash_value = user % USERHASH;
file_hash_value = hash_string(lineno, file, FILEHASH); file_hash_value = hash_string(lineno, file, FILEHASH);
set_magic_time(user_hash_value, file_hash_value, dev_hash_value); set_magic_time(user_hash_value, file_hash_value, dev_hash_value);
@ -267,6 +271,9 @@ static struct notifier_block pm_trace_nb = {
static int early_resume_init(void) static int early_resume_init(void)
{ {
if (!x86_platform.legacy.rtc)
return 0;
hash_value_early_read = read_magic_time(); hash_value_early_read = read_magic_time();
register_pm_notifier(&pm_trace_nb); register_pm_notifier(&pm_trace_nb);
return 0; return 0;
@ -277,6 +284,9 @@ static int late_resume_init(void)
unsigned int val = hash_value_early_read; unsigned int val = hash_value_early_read;
unsigned int user, file, dev; unsigned int user, file, dev;
if (!x86_platform.legacy.rtc)
return 0;
user = val % USERHASH; user = val % USERHASH;
val = val / USERHASH; val = val / USERHASH;
file = val % FILEHASH; file = val % FILEHASH;

View File

@ -1378,7 +1378,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
if (ret) { if (ret) {
dev_err(map->dev, dev_err(map->dev,
"Error in caching of register: %x ret: %d\n", "Error in caching of register: %x ret: %d\n",
reg + i, ret); reg + regmap_get_offset(map, i), ret);
return ret; return ret;
} }
} }

View File

@ -236,6 +236,7 @@ EXPORT_SYMBOL(bcma_core_irq);
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core) void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
{ {
device_initialize(&core->dev);
core->dev.release = bcma_release_core_dev; core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type; core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
@ -299,11 +300,10 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
{ {
int err; int err;
err = device_register(&core->dev); err = device_add(&core->dev);
if (err) { if (err) {
bcma_err(bus, "Could not register dev for core 0x%03X\n", bcma_err(bus, "Could not register dev for core 0x%03X\n",
core->id.id); core->id.id);
put_device(&core->dev);
return; return;
} }
core->dev_registered = true; core->dev_registered = true;
@ -394,7 +394,7 @@ void bcma_unregister_cores(struct bcma_bus *bus)
/* Now noone uses internally-handled cores, we can free them */ /* Now noone uses internally-handled cores, we can free them */
list_for_each_entry_safe(core, tmp, &bus->cores, list) { list_for_each_entry_safe(core, tmp, &bus->cores, list) {
list_del(&core->list); list_del(&core->list);
kfree(core); put_device(&core->dev);
} }
} }

View File

@ -234,7 +234,7 @@ config BLK_DEV_LOOP_MIN_COUNT
dynamically allocated with the /dev/loop-control interface. dynamically allocated with the /dev/loop-control interface.
config BLK_DEV_CRYPTOLOOP config BLK_DEV_CRYPTOLOOP
tristate "Cryptoloop Support" tristate "Cryptoloop Support (DEPRECATED)"
select CRYPTO select CRYPTO
select CRYPTO_CBC select CRYPTO_CBC
depends on BLK_DEV_LOOP depends on BLK_DEV_LOOP
@ -246,7 +246,7 @@ config BLK_DEV_CRYPTOLOOP
WARNING: This device is not safe for journaled file systems like WARNING: This device is not safe for journaled file systems like
ext3 or Reiserfs. Please use the Device Mapper crypto module ext3 or Reiserfs. Please use the Device Mapper crypto module
instead, which can be configured to be on-disk compatible with the instead, which can be configured to be on-disk compatible with the
cryptoloop device. cryptoloop device. cryptoloop support will be removed in Linux 5.16.
source "drivers/block/drbd/Kconfig" source "drivers/block/drbd/Kconfig"

View File

@ -203,6 +203,8 @@ init_cryptoloop(void)
if (rc) if (rc)
printk(KERN_ERR "cryptoloop: loop_register_transfer failed\n"); printk(KERN_ERR "cryptoloop: loop_register_transfer failed\n");
else
pr_warn("the cryptoloop driver has been deprecated and will be removed in in Linux 5.16\n");
return rc; return rc;
} }

View File

@ -45,11 +45,6 @@ static struct hlist_head *all_lists[] = {
NULL, NULL,
}; };
static struct hlist_head *orphan_list[] = {
&clk_orphan_list,
NULL,
};
/*** private data structures ***/ /*** private data structures ***/
struct clk_core { struct clk_core {
@ -2015,6 +2010,11 @@ static int inited = 0;
static DEFINE_MUTEX(clk_debug_lock); static DEFINE_MUTEX(clk_debug_lock);
static HLIST_HEAD(clk_debug_list); static HLIST_HEAD(clk_debug_list);
static struct hlist_head *orphan_list[] = {
&clk_orphan_list,
NULL,
};
static void clk_summary_show_one(struct seq_file *s, struct clk_core *c, static void clk_summary_show_one(struct seq_file *s, struct clk_core *c,
int level) int level)
{ {

View File

@ -254,6 +254,7 @@ static const char *powersave_parents[] = {
static const struct clk_muxing_soc_desc kirkwood_mux_desc[] __initconst = { static const struct clk_muxing_soc_desc kirkwood_mux_desc[] __initconst = {
{ "powersave", powersave_parents, ARRAY_SIZE(powersave_parents), { "powersave", powersave_parents, ARRAY_SIZE(powersave_parents),
11, 1, 0 }, 11, 1, 0 },
{ }
}; };
static struct clk *clk_muxing_get_src( static struct clk *clk_muxing_get_src(

View File

@ -570,7 +570,8 @@ static int sh_cmt_start(struct sh_cmt_channel *ch, unsigned long flag)
ch->flags |= flag; ch->flags |= flag;
/* setup timeout if no clockevent */ /* setup timeout if no clockevent */
if ((flag == FLAG_CLOCKSOURCE) && (!(ch->flags & FLAG_CLOCKEVENT))) if (ch->cmt->num_channels == 1 &&
flag == FLAG_CLOCKSOURCE && (!(ch->flags & FLAG_CLOCKEVENT)))
__sh_cmt_set_next(ch, ch->max_match_value); __sh_cmt_set_next(ch, ch->max_match_value);
out: out:
raw_spin_unlock_irqrestore(&ch->lock, flags); raw_spin_unlock_irqrestore(&ch->lock, flags);
@ -606,20 +607,25 @@ static struct sh_cmt_channel *cs_to_sh_cmt(struct clocksource *cs)
static u64 sh_cmt_clocksource_read(struct clocksource *cs) static u64 sh_cmt_clocksource_read(struct clocksource *cs)
{ {
struct sh_cmt_channel *ch = cs_to_sh_cmt(cs); struct sh_cmt_channel *ch = cs_to_sh_cmt(cs);
unsigned long flags;
u32 has_wrapped; u32 has_wrapped;
u64 value;
u32 raw;
raw_spin_lock_irqsave(&ch->lock, flags); if (ch->cmt->num_channels == 1) {
value = ch->total_cycles; unsigned long flags;
raw = sh_cmt_get_counter(ch, &has_wrapped); u64 value;
u32 raw;
if (unlikely(has_wrapped)) raw_spin_lock_irqsave(&ch->lock, flags);
raw += ch->match_value + 1; value = ch->total_cycles;
raw_spin_unlock_irqrestore(&ch->lock, flags); raw = sh_cmt_get_counter(ch, &has_wrapped);
return value + raw; if (unlikely(has_wrapped))
raw += ch->match_value + 1;
raw_spin_unlock_irqrestore(&ch->lock, flags);
return value + raw;
}
return sh_cmt_get_counter(ch, &has_wrapped);
} }
static int sh_cmt_clocksource_enable(struct clocksource *cs) static int sh_cmt_clocksource_enable(struct clocksource *cs)
@ -682,7 +688,7 @@ static int sh_cmt_register_clocksource(struct sh_cmt_channel *ch,
cs->disable = sh_cmt_clocksource_disable; cs->disable = sh_cmt_clocksource_disable;
cs->suspend = sh_cmt_clocksource_suspend; cs->suspend = sh_cmt_clocksource_suspend;
cs->resume = sh_cmt_clocksource_resume; cs->resume = sh_cmt_clocksource_resume;
cs->mask = CLOCKSOURCE_MASK(sizeof(u64) * 8); cs->mask = CLOCKSOURCE_MASK(ch->cmt->info->width);
cs->flags = CLOCK_SOURCE_IS_CONTINUOUS; cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
dev_info(&ch->cmt->pdev->dev, "ch%u: used as clock source\n", dev_info(&ch->cmt->pdev->dev, "ch%u: used as clock source\n",

View File

@ -77,8 +77,8 @@ unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *l
if (count) if (count)
return count; return count;
kobject_put(&attr_set->kobj);
mutex_destroy(&attr_set->update_lock); mutex_destroy(&attr_set->update_lock);
kobject_put(&attr_set->kobj);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(gov_attr_set_put); EXPORT_SYMBOL_GPL(gov_attr_set_put);

View File

@ -44,6 +44,7 @@
#define MAX_PSTATE_SHIFT 32 #define MAX_PSTATE_SHIFT 32
#define LPSTATE_SHIFT 48 #define LPSTATE_SHIFT 48
#define GPSTATE_SHIFT 56 #define GPSTATE_SHIFT 56
#define MAX_NR_CHIPS 32
#define MAX_RAMP_DOWN_TIME 5120 #define MAX_RAMP_DOWN_TIME 5120
/* /*
@ -1011,12 +1012,20 @@ static int init_chip_info(void)
unsigned int *chip; unsigned int *chip;
unsigned int cpu, i; unsigned int cpu, i;
unsigned int prev_chip_id = UINT_MAX; unsigned int prev_chip_id = UINT_MAX;
cpumask_t *chip_cpu_mask;
int ret = 0; int ret = 0;
chip = kcalloc(num_possible_cpus(), sizeof(*chip), GFP_KERNEL); chip = kcalloc(num_possible_cpus(), sizeof(*chip), GFP_KERNEL);
if (!chip) if (!chip)
return -ENOMEM; return -ENOMEM;
/* Allocate a chip cpu mask large enough to fit mask for all chips */
chip_cpu_mask = kcalloc(MAX_NR_CHIPS, sizeof(cpumask_t), GFP_KERNEL);
if (!chip_cpu_mask) {
ret = -ENOMEM;
goto free_and_return;
}
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
unsigned int id = cpu_to_chip_id(cpu); unsigned int id = cpu_to_chip_id(cpu);
@ -1024,22 +1033,25 @@ static int init_chip_info(void)
prev_chip_id = id; prev_chip_id = id;
chip[nr_chips++] = id; chip[nr_chips++] = id;
} }
cpumask_set_cpu(cpu, &chip_cpu_mask[nr_chips-1]);
} }
chips = kcalloc(nr_chips, sizeof(struct chip), GFP_KERNEL); chips = kcalloc(nr_chips, sizeof(struct chip), GFP_KERNEL);
if (!chips) { if (!chips) {
ret = -ENOMEM; ret = -ENOMEM;
goto free_and_return; goto out_free_chip_cpu_mask;
} }
for (i = 0; i < nr_chips; i++) { for (i = 0; i < nr_chips; i++) {
chips[i].id = chip[i]; chips[i].id = chip[i];
cpumask_copy(&chips[i].mask, cpumask_of_node(chip[i])); cpumask_copy(&chips[i].mask, &chip_cpu_mask[i]);
INIT_WORK(&chips[i].throttle, powernv_cpufreq_work_fn); INIT_WORK(&chips[i].throttle, powernv_cpufreq_work_fn);
for_each_cpu(cpu, &chips[i].mask) for_each_cpu(cpu, &chips[i].mask)
per_cpu(chip_info, cpu) = &chips[i]; per_cpu(chip_info, cpu) = &chips[i];
} }
out_free_chip_cpu_mask:
kfree(chip_cpu_mask);
free_and_return: free_and_return:
kfree(chip); kfree(chip);
return ret; return ret;

View File

@ -783,7 +783,7 @@ ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
in_place ? DMA_BIDIRECTIONAL in_place ? DMA_BIDIRECTIONAL
: DMA_TO_DEVICE); : DMA_TO_DEVICE);
if (ret) if (ret)
goto e_ctx; goto e_aad;
if (in_place) { if (in_place) {
dst = src; dst = src;
@ -868,7 +868,7 @@ ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
op.u.aes.size = 0; op.u.aes.size = 0;
ret = cmd_q->ccp->vdata->perform->aes(&op); ret = cmd_q->ccp->vdata->perform->aes(&op);
if (ret) if (ret)
goto e_dst; goto e_final_wa;
if (aes->action == CCP_AES_ACTION_ENCRYPT) { if (aes->action == CCP_AES_ACTION_ENCRYPT) {
/* Put the ciphered tag after the ciphertext. */ /* Put the ciphered tag after the ciphertext. */
@ -878,17 +878,19 @@ ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
ret = ccp_init_dm_workarea(&tag, cmd_q, authsize, ret = ccp_init_dm_workarea(&tag, cmd_q, authsize,
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
if (ret) if (ret)
goto e_tag; goto e_final_wa;
ret = ccp_set_dm_area(&tag, 0, p_tag, 0, authsize); ret = ccp_set_dm_area(&tag, 0, p_tag, 0, authsize);
if (ret) if (ret) {
goto e_tag; ccp_dm_free(&tag);
goto e_final_wa;
}
ret = crypto_memneq(tag.address, final_wa.address, ret = crypto_memneq(tag.address, final_wa.address,
authsize) ? -EBADMSG : 0; authsize) ? -EBADMSG : 0;
ccp_dm_free(&tag); ccp_dm_free(&tag);
} }
e_tag: e_final_wa:
ccp_dm_free(&final_wa); ccp_dm_free(&final_wa);
e_dst: e_dst:

View File

@ -167,15 +167,19 @@ static struct dcp *global_sdcp;
static int mxs_dcp_start_dma(struct dcp_async_ctx *actx) static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)
{ {
int dma_err;
struct dcp *sdcp = global_sdcp; struct dcp *sdcp = global_sdcp;
const int chan = actx->chan; const int chan = actx->chan;
uint32_t stat; uint32_t stat;
unsigned long ret; unsigned long ret;
struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];
dma_addr_t desc_phys = dma_map_single(sdcp->dev, desc, sizeof(*desc), dma_addr_t desc_phys = dma_map_single(sdcp->dev, desc, sizeof(*desc),
DMA_TO_DEVICE); DMA_TO_DEVICE);
dma_err = dma_mapping_error(sdcp->dev, desc_phys);
if (dma_err)
return dma_err;
reinit_completion(&sdcp->completion[chan]); reinit_completion(&sdcp->completion[chan]);
/* Clear status register. */ /* Clear status register. */
@ -213,18 +217,29 @@ static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)
static int mxs_dcp_run_aes(struct dcp_async_ctx *actx, static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
struct ablkcipher_request *req, int init) struct ablkcipher_request *req, int init)
{ {
dma_addr_t key_phys, src_phys, dst_phys;
struct dcp *sdcp = global_sdcp; struct dcp *sdcp = global_sdcp;
struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];
struct dcp_aes_req_ctx *rctx = ablkcipher_request_ctx(req); struct dcp_aes_req_ctx *rctx = ablkcipher_request_ctx(req);
int ret; int ret;
dma_addr_t key_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_key, key_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_key,
2 * AES_KEYSIZE_128, 2 * AES_KEYSIZE_128, DMA_TO_DEVICE);
DMA_TO_DEVICE); ret = dma_mapping_error(sdcp->dev, key_phys);
dma_addr_t src_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_in_buf, if (ret)
DCP_BUF_SZ, DMA_TO_DEVICE); return ret;
dma_addr_t dst_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_out_buf,
DCP_BUF_SZ, DMA_FROM_DEVICE); src_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_in_buf,
DCP_BUF_SZ, DMA_TO_DEVICE);
ret = dma_mapping_error(sdcp->dev, src_phys);
if (ret)
goto err_src;
dst_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_out_buf,
DCP_BUF_SZ, DMA_FROM_DEVICE);
ret = dma_mapping_error(sdcp->dev, dst_phys);
if (ret)
goto err_dst;
if (actx->fill % AES_BLOCK_SIZE) { if (actx->fill % AES_BLOCK_SIZE) {
dev_err(sdcp->dev, "Invalid block size!\n"); dev_err(sdcp->dev, "Invalid block size!\n");
@ -262,10 +277,12 @@ static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
ret = mxs_dcp_start_dma(actx); ret = mxs_dcp_start_dma(actx);
aes_done_run: aes_done_run:
dma_unmap_single(sdcp->dev, dst_phys, DCP_BUF_SZ, DMA_FROM_DEVICE);
err_dst:
dma_unmap_single(sdcp->dev, src_phys, DCP_BUF_SZ, DMA_TO_DEVICE);
err_src:
dma_unmap_single(sdcp->dev, key_phys, 2 * AES_KEYSIZE_128, dma_unmap_single(sdcp->dev, key_phys, 2 * AES_KEYSIZE_128,
DMA_TO_DEVICE); DMA_TO_DEVICE);
dma_unmap_single(sdcp->dev, src_phys, DCP_BUF_SZ, DMA_TO_DEVICE);
dma_unmap_single(sdcp->dev, dst_phys, DCP_BUF_SZ, DMA_FROM_DEVICE);
return ret; return ret;
} }
@ -280,21 +297,20 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)
struct scatterlist *dst = req->dst; struct scatterlist *dst = req->dst;
struct scatterlist *src = req->src; struct scatterlist *src = req->src;
const int nents = sg_nents(req->src); int dst_nents = sg_nents(dst);
const int out_off = DCP_BUF_SZ; const int out_off = DCP_BUF_SZ;
uint8_t *in_buf = sdcp->coh->aes_in_buf; uint8_t *in_buf = sdcp->coh->aes_in_buf;
uint8_t *out_buf = sdcp->coh->aes_out_buf; uint8_t *out_buf = sdcp->coh->aes_out_buf;
uint8_t *out_tmp, *src_buf, *dst_buf = NULL;
uint32_t dst_off = 0; uint32_t dst_off = 0;
uint8_t *src_buf = NULL;
uint32_t last_out_len = 0; uint32_t last_out_len = 0;
uint8_t *key = sdcp->coh->aes_key; uint8_t *key = sdcp->coh->aes_key;
int ret = 0; int ret = 0;
int split = 0; unsigned int i, len, clen, tlen = 0;
unsigned int i, len, clen, rem = 0, tlen = 0;
int init = 0; int init = 0;
bool limit_hit = false; bool limit_hit = false;
@ -312,7 +328,7 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)
memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128); memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128);
} }
for_each_sg(req->src, src, nents, i) { for_each_sg(req->src, src, sg_nents(src), i) {
src_buf = sg_virt(src); src_buf = sg_virt(src);
len = sg_dma_len(src); len = sg_dma_len(src);
tlen += len; tlen += len;
@ -337,34 +353,17 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)
* submit the buffer. * submit the buffer.
*/ */
if (actx->fill == out_off || sg_is_last(src) || if (actx->fill == out_off || sg_is_last(src) ||
limit_hit) { limit_hit) {
ret = mxs_dcp_run_aes(actx, req, init); ret = mxs_dcp_run_aes(actx, req, init);
if (ret) if (ret)
return ret; return ret;
init = 0; init = 0;
out_tmp = out_buf; sg_pcopy_from_buffer(dst, dst_nents, out_buf,
actx->fill, dst_off);
dst_off += actx->fill;
last_out_len = actx->fill; last_out_len = actx->fill;
while (dst && actx->fill) { actx->fill = 0;
if (!split) {
dst_buf = sg_virt(dst);
dst_off = 0;
}
rem = min(sg_dma_len(dst) - dst_off,
actx->fill);
memcpy(dst_buf + dst_off, out_tmp, rem);
out_tmp += rem;
dst_off += rem;
actx->fill -= rem;
if (dst_off == sg_dma_len(dst)) {
dst = sg_next(dst);
split = 0;
} else {
split = 1;
}
}
} }
} while (len); } while (len);
@ -565,6 +564,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)
dma_addr_t buf_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_in_buf, dma_addr_t buf_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_in_buf,
DCP_BUF_SZ, DMA_TO_DEVICE); DCP_BUF_SZ, DMA_TO_DEVICE);
ret = dma_mapping_error(sdcp->dev, buf_phys);
if (ret)
return ret;
/* Fill in the DMA descriptor. */ /* Fill in the DMA descriptor. */
desc->control0 = MXS_DCP_CONTROL0_DECR_SEMAPHORE | desc->control0 = MXS_DCP_CONTROL0_DECR_SEMAPHORE |
MXS_DCP_CONTROL0_INTERRUPT | MXS_DCP_CONTROL0_INTERRUPT |
@ -597,6 +600,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)
if (rctx->fini) { if (rctx->fini) {
digest_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_out_buf, digest_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_out_buf,
DCP_SHA_PAY_SZ, DMA_FROM_DEVICE); DCP_SHA_PAY_SZ, DMA_FROM_DEVICE);
ret = dma_mapping_error(sdcp->dev, digest_phys);
if (ret)
goto done_run;
desc->control0 |= MXS_DCP_CONTROL0_HASH_TERM; desc->control0 |= MXS_DCP_CONTROL0_HASH_TERM;
desc->payload = digest_phys; desc->payload = digest_phys;
} }

View File

@ -1746,7 +1746,7 @@ static void omap_sham_done_task(unsigned long data)
if (test_and_clear_bit(FLAGS_OUTPUT_READY, &dd->flags)) if (test_and_clear_bit(FLAGS_OUTPUT_READY, &dd->flags))
goto finish; goto finish;
} else if (test_bit(FLAGS_DMA_READY, &dd->flags)) { } else if (test_bit(FLAGS_DMA_READY, &dd->flags)) {
if (test_and_clear_bit(FLAGS_DMA_ACTIVE, &dd->flags)) { if (test_bit(FLAGS_DMA_ACTIVE, &dd->flags)) {
omap_sham_update_dma_stop(dd); omap_sham_update_dma_stop(dd);
if (dd->err) { if (dd->err) {
err = dd->err; err = dd->err;

View File

@ -123,10 +123,10 @@ void adf_init_hw_data_c3xxxiov(struct adf_hw_device_data *hw_data)
hw_data->enable_error_correction = adf_vf_void_noop; hw_data->enable_error_correction = adf_vf_void_noop;
hw_data->init_admin_comms = adf_vf_int_noop; hw_data->init_admin_comms = adf_vf_int_noop;
hw_data->exit_admin_comms = adf_vf_void_noop; hw_data->exit_admin_comms = adf_vf_void_noop;
hw_data->send_admin_init = adf_vf2pf_init; hw_data->send_admin_init = adf_vf2pf_notify_init;
hw_data->init_arb = adf_vf_int_noop; hw_data->init_arb = adf_vf_int_noop;
hw_data->exit_arb = adf_vf_void_noop; hw_data->exit_arb = adf_vf_void_noop;
hw_data->disable_iov = adf_vf2pf_shutdown; hw_data->disable_iov = adf_vf2pf_notify_shutdown;
hw_data->get_accel_mask = get_accel_mask; hw_data->get_accel_mask = get_accel_mask;
hw_data->get_ae_mask = get_ae_mask; hw_data->get_ae_mask = get_ae_mask;
hw_data->get_num_accels = get_num_accels; hw_data->get_num_accels = get_num_accels;

View File

@ -123,10 +123,10 @@ void adf_init_hw_data_c62xiov(struct adf_hw_device_data *hw_data)
hw_data->enable_error_correction = adf_vf_void_noop; hw_data->enable_error_correction = adf_vf_void_noop;
hw_data->init_admin_comms = adf_vf_int_noop; hw_data->init_admin_comms = adf_vf_int_noop;
hw_data->exit_admin_comms = adf_vf_void_noop; hw_data->exit_admin_comms = adf_vf_void_noop;
hw_data->send_admin_init = adf_vf2pf_init; hw_data->send_admin_init = adf_vf2pf_notify_init;
hw_data->init_arb = adf_vf_int_noop; hw_data->init_arb = adf_vf_int_noop;
hw_data->exit_arb = adf_vf_void_noop; hw_data->exit_arb = adf_vf_void_noop;
hw_data->disable_iov = adf_vf2pf_shutdown; hw_data->disable_iov = adf_vf2pf_notify_shutdown;
hw_data->get_accel_mask = get_accel_mask; hw_data->get_accel_mask = get_accel_mask;
hw_data->get_ae_mask = get_ae_mask; hw_data->get_ae_mask = get_ae_mask;
hw_data->get_num_accels = get_num_accels; hw_data->get_num_accels = get_num_accels;

View File

@ -239,8 +239,8 @@ void adf_enable_vf2pf_interrupts(struct adf_accel_dev *accel_dev,
void adf_enable_pf2vf_interrupts(struct adf_accel_dev *accel_dev); void adf_enable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev); void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
int adf_vf2pf_init(struct adf_accel_dev *accel_dev); int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev);
void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev); void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev);
int adf_init_pf_wq(void); int adf_init_pf_wq(void);
void adf_exit_pf_wq(void); void adf_exit_pf_wq(void);
int adf_init_vf_wq(void); int adf_init_vf_wq(void);
@ -263,12 +263,12 @@ static inline void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev)
{ {
} }
static inline int adf_vf2pf_init(struct adf_accel_dev *accel_dev) static inline int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
{ {
return 0; return 0;
} }
static inline void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev) static inline void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
{ {
} }

View File

@ -105,6 +105,7 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
struct service_hndl *service; struct service_hndl *service;
struct list_head *list_itr; struct list_head *list_itr;
struct adf_hw_device_data *hw_data = accel_dev->hw_device; struct adf_hw_device_data *hw_data = accel_dev->hw_device;
int ret;
if (!hw_data) { if (!hw_data) {
dev_err(&GET_DEV(accel_dev), dev_err(&GET_DEV(accel_dev),
@ -171,9 +172,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
} }
hw_data->enable_error_correction(accel_dev); hw_data->enable_error_correction(accel_dev);
hw_data->enable_vf2pf_comms(accel_dev); ret = hw_data->enable_vf2pf_comms(accel_dev);
return 0; return ret;
} }
EXPORT_SYMBOL_GPL(adf_dev_init); EXPORT_SYMBOL_GPL(adf_dev_init);

View File

@ -59,6 +59,8 @@
#include "adf_transport_access_macros.h" #include "adf_transport_access_macros.h"
#include "adf_transport_internal.h" #include "adf_transport_internal.h"
#define ADF_MAX_NUM_VFS 32
static int adf_enable_msix(struct adf_accel_dev *accel_dev) static int adf_enable_msix(struct adf_accel_dev *accel_dev)
{ {
struct adf_accel_pci *pci_dev_info = &accel_dev->accel_pci_dev; struct adf_accel_pci *pci_dev_info = &accel_dev->accel_pci_dev;
@ -111,7 +113,7 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
struct adf_bar *pmisc = struct adf_bar *pmisc =
&GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)]; &GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
void __iomem *pmisc_bar_addr = pmisc->virt_addr; void __iomem *pmisc_bar_addr = pmisc->virt_addr;
u32 vf_mask; unsigned long vf_mask;
/* Get the interrupt sources triggered by VFs */ /* Get the interrupt sources triggered by VFs */
vf_mask = ((ADF_CSR_RD(pmisc_bar_addr, ADF_ERRSOU5) & vf_mask = ((ADF_CSR_RD(pmisc_bar_addr, ADF_ERRSOU5) &
@ -132,8 +134,7 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
* unless the VF is malicious and is attempting to * unless the VF is malicious and is attempting to
* flood the host OS with VF2PF interrupts. * flood the host OS with VF2PF interrupts.
*/ */
for_each_set_bit(i, (const unsigned long *)&vf_mask, for_each_set_bit(i, &vf_mask, ADF_MAX_NUM_VFS) {
(sizeof(vf_mask) * BITS_PER_BYTE)) {
vf_info = accel_dev->pf.vf_info + i; vf_info = accel_dev->pf.vf_info + i;
if (!__ratelimit(&vf_info->vf2pf_ratelimit)) { if (!__ratelimit(&vf_info->vf2pf_ratelimit)) {

View File

@ -231,7 +231,6 @@ int adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr)
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(adf_iov_putmsg);
void adf_vf2pf_req_hndl(struct adf_accel_vf_info *vf_info) void adf_vf2pf_req_hndl(struct adf_accel_vf_info *vf_info)
{ {
@ -361,6 +360,8 @@ static int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev)
msg |= ADF_PFVF_COMPATIBILITY_VERSION << ADF_VF2PF_COMPAT_VER_REQ_SHIFT; msg |= ADF_PFVF_COMPATIBILITY_VERSION << ADF_VF2PF_COMPAT_VER_REQ_SHIFT;
BUILD_BUG_ON(ADF_PFVF_COMPATIBILITY_VERSION > 255); BUILD_BUG_ON(ADF_PFVF_COMPATIBILITY_VERSION > 255);
reinit_completion(&accel_dev->vf.iov_msg_completion);
/* Send request from VF to PF */ /* Send request from VF to PF */
ret = adf_iov_putmsg(accel_dev, msg, 0); ret = adf_iov_putmsg(accel_dev, msg, 0);
if (ret) { if (ret) {

View File

@ -49,14 +49,14 @@
#include "adf_pf2vf_msg.h" #include "adf_pf2vf_msg.h"
/** /**
* adf_vf2pf_init() - send init msg to PF * adf_vf2pf_notify_init() - send init msg to PF
* @accel_dev: Pointer to acceleration VF device. * @accel_dev: Pointer to acceleration VF device.
* *
* Function sends an init messge from the VF to a PF * Function sends an init messge from the VF to a PF
* *
* Return: 0 on success, error code otherwise. * Return: 0 on success, error code otherwise.
*/ */
int adf_vf2pf_init(struct adf_accel_dev *accel_dev) int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
{ {
u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM | u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
(ADF_VF2PF_MSGTYPE_INIT << ADF_VF2PF_MSGTYPE_SHIFT)); (ADF_VF2PF_MSGTYPE_INIT << ADF_VF2PF_MSGTYPE_SHIFT));
@ -69,17 +69,17 @@ int adf_vf2pf_init(struct adf_accel_dev *accel_dev)
set_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status); set_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(adf_vf2pf_init); EXPORT_SYMBOL_GPL(adf_vf2pf_notify_init);
/** /**
* adf_vf2pf_shutdown() - send shutdown msg to PF * adf_vf2pf_notify_shutdown() - send shutdown msg to PF
* @accel_dev: Pointer to acceleration VF device. * @accel_dev: Pointer to acceleration VF device.
* *
* Function sends a shutdown messge from the VF to a PF * Function sends a shutdown messge from the VF to a PF
* *
* Return: void * Return: void
*/ */
void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev) void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
{ {
u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM | u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
(ADF_VF2PF_MSGTYPE_SHUTDOWN << ADF_VF2PF_MSGTYPE_SHIFT)); (ADF_VF2PF_MSGTYPE_SHUTDOWN << ADF_VF2PF_MSGTYPE_SHIFT));
@ -89,4 +89,4 @@ void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)
dev_err(&GET_DEV(accel_dev), dev_err(&GET_DEV(accel_dev),
"Failed to send Shutdown event to PF\n"); "Failed to send Shutdown event to PF\n");
} }
EXPORT_SYMBOL_GPL(adf_vf2pf_shutdown); EXPORT_SYMBOL_GPL(adf_vf2pf_notify_shutdown);

View File

@ -203,6 +203,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)
struct adf_bar *pmisc = struct adf_bar *pmisc =
&GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)]; &GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
void __iomem *pmisc_bar_addr = pmisc->virt_addr; void __iomem *pmisc_bar_addr = pmisc->virt_addr;
bool handled = false;
u32 v_int; u32 v_int;
/* Read VF INT source CSR to determine the source of VF interrupt */ /* Read VF INT source CSR to determine the source of VF interrupt */
@ -215,7 +216,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)
/* Schedule tasklet to handle interrupt BH */ /* Schedule tasklet to handle interrupt BH */
tasklet_hi_schedule(&accel_dev->vf.pf2vf_bh_tasklet); tasklet_hi_schedule(&accel_dev->vf.pf2vf_bh_tasklet);
return IRQ_HANDLED; handled = true;
} }
/* Check bundle interrupt */ /* Check bundle interrupt */
@ -227,10 +228,10 @@ static irqreturn_t adf_isr(int irq, void *privdata)
WRITE_CSR_INT_FLAG_AND_COL(bank->csr_addr, bank->bank_number, WRITE_CSR_INT_FLAG_AND_COL(bank->csr_addr, bank->bank_number,
0); 0);
tasklet_hi_schedule(&bank->resp_handler); tasklet_hi_schedule(&bank->resp_handler);
return IRQ_HANDLED; handled = true;
} }
return IRQ_NONE; return handled ? IRQ_HANDLED : IRQ_NONE;
} }
static int adf_request_msi_irq(struct adf_accel_dev *accel_dev) static int adf_request_msi_irq(struct adf_accel_dev *accel_dev)

View File

@ -123,10 +123,10 @@ void adf_init_hw_data_dh895xcciov(struct adf_hw_device_data *hw_data)
hw_data->enable_error_correction = adf_vf_void_noop; hw_data->enable_error_correction = adf_vf_void_noop;
hw_data->init_admin_comms = adf_vf_int_noop; hw_data->init_admin_comms = adf_vf_int_noop;
hw_data->exit_admin_comms = adf_vf_void_noop; hw_data->exit_admin_comms = adf_vf_void_noop;
hw_data->send_admin_init = adf_vf2pf_init; hw_data->send_admin_init = adf_vf2pf_notify_init;
hw_data->init_arb = adf_vf_int_noop; hw_data->init_arb = adf_vf_int_noop;
hw_data->exit_arb = adf_vf_void_noop; hw_data->exit_arb = adf_vf_void_noop;
hw_data->disable_iov = adf_vf2pf_shutdown; hw_data->disable_iov = adf_vf2pf_notify_shutdown;
hw_data->get_accel_mask = get_accel_mask; hw_data->get_accel_mask = get_accel_mask;
hw_data->get_ae_mask = get_ae_mask; hw_data->get_ae_mask = get_ae_mask;
hw_data->get_num_accels = get_num_accels; hw_data->get_num_accels = get_num_accels;

View File

@ -816,7 +816,11 @@ static void talitos_unregister_rng(struct device *dev)
* HMAC_SNOOP_NO_AFEA (HSNA) instead of type IPSEC_ESP * HMAC_SNOOP_NO_AFEA (HSNA) instead of type IPSEC_ESP
*/ */
#define TALITOS_CRA_PRIORITY_AEAD_HSNA (TALITOS_CRA_PRIORITY - 1) #define TALITOS_CRA_PRIORITY_AEAD_HSNA (TALITOS_CRA_PRIORITY - 1)
#ifdef CONFIG_CRYPTO_DEV_TALITOS2
#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE) #define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE)
#else
#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA256_BLOCK_SIZE)
#endif
#define TALITOS_MAX_IV_LENGTH 16 /* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */ #define TALITOS_MAX_IV_LENGTH 16 /* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */
struct talitos_ctx { struct talitos_ctx {

View File

@ -273,7 +273,7 @@ config INTEL_IDMA64
config INTEL_IOATDMA config INTEL_IOATDMA
tristate "Intel I/OAT DMA support" tristate "Intel I/OAT DMA support"
depends on PCI && X86_64 depends on PCI && X86_64 && !UML
select DMA_ENGINE select DMA_ENGINE
select DMA_ENGINE_RAID select DMA_ENGINE_RAID
select DCA select DCA

View File

@ -72,10 +72,14 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
si = (const struct acpi_csrt_shared_info *)&grp[1]; si = (const struct acpi_csrt_shared_info *)&grp[1];
/* Match device by MMIO and IRQ */ /* Match device by MMIO */
if (si->mmio_base_low != lower_32_bits(mem) || if (si->mmio_base_low != lower_32_bits(mem) ||
si->mmio_base_high != upper_32_bits(mem) || si->mmio_base_high != upper_32_bits(mem))
si->gsi_interrupt != irq) return 0;
/* Match device by Linux vIRQ */
ret = acpi_register_gsi(NULL, si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity);
if (ret != irq)
return 0; return 0;
dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n", dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n",

View File

@ -2585,7 +2585,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
xdev->ext_addr = false; xdev->ext_addr = false;
/* Set the dma mask bits */ /* Set the dma mask bits */
dma_set_mask(xdev->dev, DMA_BIT_MASK(addr_width)); dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
/* Initialize the DMA engine */ /* Initialize the DMA engine */
xdev->common.dev = &pdev->dev; xdev->common.dev = &pdev->dev;

View File

@ -371,7 +371,7 @@ static int synps_edac_init_csrows(struct mem_ctl_info *mci)
for (j = 0; j < csi->nr_channels; j++) { for (j = 0; j < csi->nr_channels; j++) {
dimm = csi->channels[j]->dimm; dimm = csi->channels[j]->dimm;
dimm->edac_mode = EDAC_FLAG_SECDED; dimm->edac_mode = EDAC_SECDED;
dimm->mtype = synps_edac_get_mtype(priv->baseaddr); dimm->mtype = synps_edac_get_mtype(priv->baseaddr);
dimm->nr_pages = (size >> PAGE_SHIFT) / csi->nr_channels; dimm->nr_pages = (size >> PAGE_SHIFT) / csi->nr_channels;
dimm->grain = SYNPS_EDAC_ERR_GRAIN; dimm->grain = SYNPS_EDAC_ERR_GRAIN;

View File

@ -338,7 +338,7 @@ static void amdgpu_i2c_put_byte(struct amdgpu_i2c_chan *i2c_bus,
void void
amdgpu_i2c_router_select_ddc_port(const struct amdgpu_connector *amdgpu_connector) amdgpu_i2c_router_select_ddc_port(const struct amdgpu_connector *amdgpu_connector)
{ {
u8 val; u8 val = 0;
if (!amdgpu_connector->router.ddc_valid) if (!amdgpu_connector->router.ddc_valid)
return; return;

View File

@ -34,8 +34,10 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
} }
phy_pdev = of_find_device_by_node(phy_node); phy_pdev = of_find_device_by_node(phy_node);
if (phy_pdev) if (phy_pdev) {
msm_dsi->phy = platform_get_drvdata(phy_pdev); msm_dsi->phy = platform_get_drvdata(phy_pdev);
msm_dsi->phy_dev = &phy_pdev->dev;
}
of_node_put(phy_node); of_node_put(phy_node);
@ -44,8 +46,6 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
msm_dsi->phy_dev = get_device(&phy_pdev->dev);
return 0; return 0;
} }

View File

@ -57,7 +57,7 @@ nvkm_control_mthd_pstate_info(struct nvkm_control *ctrl, void *data, u32 size)
args->v0.count = 0; args->v0.count = 0;
args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE; args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE; args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
args->v0.pwrsrc = -ENOSYS; args->v0.pwrsrc = -ENODEV;
args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN; args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN;
} }

View File

@ -59,15 +59,22 @@ static int betopff_init(struct hid_device *hid)
{ {
struct betopff_device *betopff; struct betopff_device *betopff;
struct hid_report *report; struct hid_report *report;
struct hid_input *hidinput = struct hid_input *hidinput;
list_first_entry(&hid->inputs, struct hid_input, list);
struct list_head *report_list = struct list_head *report_list =
&hid->report_enum[HID_OUTPUT_REPORT].report_list; &hid->report_enum[HID_OUTPUT_REPORT].report_list;
struct input_dev *dev = hidinput->input; struct input_dev *dev;
int field_count = 0; int field_count = 0;
int error; int error;
int i, j; int i, j;
if (list_empty(&hid->inputs)) {
hid_err(hid, "no inputs found\n");
return -ENODEV;
}
hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
dev = hidinput->input;
if (list_empty(report_list)) { if (list_empty(report_list)) {
hid_err(hid, "no output reports found\n"); hid_err(hid, "no output reports found\n");
return -ENODEV; return -ENODEV;

View File

@ -425,8 +425,6 @@ static int hidinput_get_battery_property(struct power_supply *psy,
if (dev->battery_status == HID_BATTERY_UNKNOWN) if (dev->battery_status == HID_BATTERY_UNKNOWN)
val->intval = POWER_SUPPLY_STATUS_UNKNOWN; val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
else if (dev->battery_capacity == 100)
val->intval = POWER_SUPPLY_STATUS_FULL;
else else
val->intval = POWER_SUPPLY_STATUS_DISCHARGING; val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
break; break;

View File

@ -501,7 +501,7 @@ static void hid_ctrl(struct urb *urb)
if (unplug) { if (unplug) {
usbhid->ctrltail = usbhid->ctrlhead; usbhid->ctrltail = usbhid->ctrlhead;
} else { } else if (usbhid->ctrlhead != usbhid->ctrltail) {
usbhid->ctrltail = (usbhid->ctrltail + 1) & (HID_CONTROL_FIFO_SIZE - 1); usbhid->ctrltail = (usbhid->ctrltail + 1) & (HID_CONTROL_FIFO_SIZE - 1);
if (usbhid->ctrlhead != usbhid->ctrltail && if (usbhid->ctrlhead != usbhid->ctrltail &&
@ -1214,9 +1214,20 @@ static void usbhid_stop(struct hid_device *hid)
mutex_lock(&usbhid->mutex); mutex_lock(&usbhid->mutex);
clear_bit(HID_STARTED, &usbhid->iofl); clear_bit(HID_STARTED, &usbhid->iofl);
spin_lock_irq(&usbhid->lock); /* Sync with error and led handlers */ spin_lock_irq(&usbhid->lock); /* Sync with error and led handlers */
set_bit(HID_DISCONNECTED, &usbhid->iofl); set_bit(HID_DISCONNECTED, &usbhid->iofl);
while (usbhid->ctrltail != usbhid->ctrlhead) {
if (usbhid->ctrl[usbhid->ctrltail].dir == USB_DIR_OUT) {
kfree(usbhid->ctrl[usbhid->ctrltail].raw_report);
usbhid->ctrl[usbhid->ctrltail].raw_report = NULL;
}
usbhid->ctrltail = (usbhid->ctrltail + 1) &
(HID_CONTROL_FIFO_SIZE - 1);
}
spin_unlock_irq(&usbhid->lock); spin_unlock_irq(&usbhid->lock);
usb_kill_urb(usbhid->urbin); usb_kill_urb(usbhid->urbin);
usb_kill_urb(usbhid->urbout); usb_kill_urb(usbhid->urbout);
usb_kill_urb(usbhid->urbctrl); usb_kill_urb(usbhid->urbctrl);

View File

@ -109,23 +109,17 @@ struct tmp421_data {
s16 temp[4]; s16 temp[4];
}; };
static int temp_from_s16(s16 reg) static int temp_from_raw(u16 reg, bool extended)
{ {
/* Mask out status bits */ /* Mask out status bits */
int temp = reg & ~0xf; int temp = reg & ~0xf;
return (temp * 1000 + 128) / 256; if (extended)
} temp = temp - 64 * 256;
else
temp = (s16)temp;
static int temp_from_u16(u16 reg) return DIV_ROUND_CLOSEST(temp * 1000, 256);
{
/* Mask out status bits */
int temp = reg & ~0xf;
/* Add offset for extended temperature range. */
temp -= 64 * 256;
return (temp * 1000 + 128) / 256;
} }
static struct tmp421_data *tmp421_update_device(struct device *dev) static struct tmp421_data *tmp421_update_device(struct device *dev)
@ -162,10 +156,8 @@ static int tmp421_read(struct device *dev, enum hwmon_sensor_types type,
switch (attr) { switch (attr) {
case hwmon_temp_input: case hwmon_temp_input:
if (tmp421->config & TMP421_CONFIG_RANGE) *val = temp_from_raw(tmp421->temp[channel],
*val = temp_from_u16(tmp421->temp[channel]); tmp421->config & TMP421_CONFIG_RANGE);
else
*val = temp_from_s16(tmp421->temp[channel]);
return 0; return 0;
case hwmon_temp_fault: case hwmon_temp_fault:
/* /*

View File

@ -382,7 +382,7 @@ static int highlander_i2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
dev->irq = platform_get_irq(pdev, 0); dev->irq = platform_get_irq(pdev, 0);
if (iic_force_poll) if (dev->irq < 0 || iic_force_poll)
dev->irq = 0; dev->irq = 0;
if (dev->irq) { if (dev->irq) {

View File

@ -456,16 +456,14 @@ iop3xx_i2c_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
ret = -ENXIO; ret = irq;
goto unmap; goto unmap;
} }
ret = request_irq(irq, iop3xx_i2c_irq_handler, 0, ret = request_irq(irq, iop3xx_i2c_irq_handler, 0,
pdev->name, adapter_data); pdev->name, adapter_data);
if (ret) { if (ret)
ret = -EIO;
goto unmap; goto unmap;
}
memcpy(new_adapter->name, pdev->name, strlen(pdev->name)); memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
new_adapter->owner = THIS_MODULE; new_adapter->owner = THIS_MODULE;

View File

@ -801,7 +801,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
return PTR_ERR(i2c->pdmabase); return PTR_ERR(i2c->pdmabase);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) if (irq < 0)
return irq; return irq;
init_completion(&i2c->msg_complete); init_completion(&i2c->msg_complete);

View File

@ -1181,7 +1181,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
*/ */
if (!(i2c->quirks & QUIRK_POLL)) { if (!(i2c->quirks & QUIRK_POLL)) {
i2c->irq = ret = platform_get_irq(pdev, 0); i2c->irq = ret = platform_get_irq(pdev, 0);
if (ret <= 0) { if (ret < 0) {
dev_err(&pdev->dev, "cannot find IRQ\n"); dev_err(&pdev->dev, "cannot find IRQ\n");
clk_unprepare(i2c->clk); clk_unprepare(i2c->clk);
return ret; return ret;

View File

@ -231,7 +231,7 @@ static int ad5624r_probe(struct spi_device *spi)
if (!indio_dev) if (!indio_dev)
return -ENOMEM; return -ENOMEM;
st = iio_priv(indio_dev); st = iio_priv(indio_dev);
st->reg = devm_regulator_get(&spi->dev, "vcc"); st->reg = devm_regulator_get_optional(&spi->dev, "vref");
if (!IS_ERR(st->reg)) { if (!IS_ERR(st->reg)) {
ret = regulator_enable(st->reg); ret = regulator_enable(st->reg);
if (ret) if (ret)
@ -242,6 +242,22 @@ static int ad5624r_probe(struct spi_device *spi)
goto error_disable_reg; goto error_disable_reg;
voltage_uv = ret; voltage_uv = ret;
} else {
if (PTR_ERR(st->reg) != -ENODEV)
return PTR_ERR(st->reg);
/* Backwards compatibility. This naming is not correct */
st->reg = devm_regulator_get_optional(&spi->dev, "vcc");
if (!IS_ERR(st->reg)) {
ret = regulator_enable(st->reg);
if (ret)
return ret;
ret = regulator_get_voltage(st->reg);
if (ret < 0)
goto error_disable_reg;
voltage_uv = ret;
}
} }
spi_set_drvdata(spi, indio_dev); spi_set_drvdata(spi, indio_dev);

View File

@ -1176,29 +1176,34 @@ static int __init iw_cm_init(void)
ret = iwpm_init(RDMA_NL_IWCM); ret = iwpm_init(RDMA_NL_IWCM);
if (ret) if (ret)
pr_err("iw_cm: couldn't init iwpm\n"); return ret;
else
rdma_nl_register(RDMA_NL_IWCM, iwcm_nl_cb_table);
iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", 0); iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", 0);
if (!iwcm_wq) if (!iwcm_wq)
return -ENOMEM; goto err_alloc;
iwcm_ctl_table_hdr = register_net_sysctl(&init_net, "net/iw_cm", iwcm_ctl_table_hdr = register_net_sysctl(&init_net, "net/iw_cm",
iwcm_ctl_table); iwcm_ctl_table);
if (!iwcm_ctl_table_hdr) { if (!iwcm_ctl_table_hdr) {
pr_err("iw_cm: couldn't register sysctl paths\n"); pr_err("iw_cm: couldn't register sysctl paths\n");
destroy_workqueue(iwcm_wq); goto err_sysctl;
return -ENOMEM;
} }
rdma_nl_register(RDMA_NL_IWCM, iwcm_nl_cb_table);
return 0; return 0;
err_sysctl:
destroy_workqueue(iwcm_wq);
err_alloc:
iwpm_exit(RDMA_NL_IWCM);
return -ENOMEM;
} }
static void __exit iw_cm_cleanup(void) static void __exit iw_cm_cleanup(void)
{ {
rdma_nl_unregister(RDMA_NL_IWCM);
unregister_net_sysctl_table(iwcm_ctl_table_hdr); unregister_net_sysctl_table(iwcm_ctl_table_hdr);
destroy_workqueue(iwcm_wq); destroy_workqueue(iwcm_wq);
rdma_nl_unregister(RDMA_NL_IWCM);
iwpm_exit(RDMA_NL_IWCM); iwpm_exit(RDMA_NL_IWCM);
} }

View File

@ -38,6 +38,7 @@ struct ipoctal_channel {
unsigned int pointer_read; unsigned int pointer_read;
unsigned int pointer_write; unsigned int pointer_write;
struct tty_port tty_port; struct tty_port tty_port;
bool tty_registered;
union scc2698_channel __iomem *regs; union scc2698_channel __iomem *regs;
union scc2698_block __iomem *block_regs; union scc2698_block __iomem *block_regs;
unsigned int board_id; unsigned int board_id;
@ -86,22 +87,34 @@ static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty)
return 0; return 0;
} }
static int ipoctal_open(struct tty_struct *tty, struct file *file) static int ipoctal_install(struct tty_driver *driver, struct tty_struct *tty)
{ {
struct ipoctal_channel *channel = dev_get_drvdata(tty->dev); struct ipoctal_channel *channel = dev_get_drvdata(tty->dev);
struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index); struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);
int err; int res;
tty->driver_data = channel;
if (!ipack_get_carrier(ipoctal->dev)) if (!ipack_get_carrier(ipoctal->dev))
return -EBUSY; return -EBUSY;
err = tty_port_open(&channel->tty_port, tty, file); res = tty_standard_install(driver, tty);
if (err) if (res)
ipack_put_carrier(ipoctal->dev); goto err_put_carrier;
return err; tty->driver_data = channel;
return 0;
err_put_carrier:
ipack_put_carrier(ipoctal->dev);
return res;
}
static int ipoctal_open(struct tty_struct *tty, struct file *file)
{
struct ipoctal_channel *channel = tty->driver_data;
return tty_port_open(&channel->tty_port, tty, file);
} }
static void ipoctal_reset_stats(struct ipoctal_stats *stats) static void ipoctal_reset_stats(struct ipoctal_stats *stats)
@ -269,7 +282,6 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
int res; int res;
int i; int i;
struct tty_driver *tty; struct tty_driver *tty;
char name[20];
struct ipoctal_channel *channel; struct ipoctal_channel *channel;
struct ipack_region *region; struct ipack_region *region;
void __iomem *addr; void __iomem *addr;
@ -360,8 +372,11 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
/* Fill struct tty_driver with ipoctal data */ /* Fill struct tty_driver with ipoctal data */
tty->owner = THIS_MODULE; tty->owner = THIS_MODULE;
tty->driver_name = KBUILD_MODNAME; tty->driver_name = KBUILD_MODNAME;
sprintf(name, KBUILD_MODNAME ".%d.%d.", bus_nr, slot); tty->name = kasprintf(GFP_KERNEL, KBUILD_MODNAME ".%d.%d.", bus_nr, slot);
tty->name = name; if (!tty->name) {
res = -ENOMEM;
goto err_put_driver;
}
tty->major = 0; tty->major = 0;
tty->minor_start = 0; tty->minor_start = 0;
@ -377,8 +392,7 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
res = tty_register_driver(tty); res = tty_register_driver(tty);
if (res) { if (res) {
dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n"); dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");
put_tty_driver(tty); goto err_free_name;
return res;
} }
/* Save struct tty_driver for use it when uninstalling the device */ /* Save struct tty_driver for use it when uninstalling the device */
@ -389,7 +403,9 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
channel = &ipoctal->channel[i]; channel = &ipoctal->channel[i];
tty_port_init(&channel->tty_port); tty_port_init(&channel->tty_port);
tty_port_alloc_xmit_buf(&channel->tty_port); res = tty_port_alloc_xmit_buf(&channel->tty_port);
if (res)
continue;
channel->tty_port.ops = &ipoctal_tty_port_ops; channel->tty_port.ops = &ipoctal_tty_port_ops;
ipoctal_reset_stats(&channel->stats); ipoctal_reset_stats(&channel->stats);
@ -397,13 +413,15 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
spin_lock_init(&channel->lock); spin_lock_init(&channel->lock);
channel->pointer_read = 0; channel->pointer_read = 0;
channel->pointer_write = 0; channel->pointer_write = 0;
tty_dev = tty_port_register_device(&channel->tty_port, tty, i, NULL); tty_dev = tty_port_register_device_attr(&channel->tty_port, tty,
i, NULL, channel, NULL);
if (IS_ERR(tty_dev)) { if (IS_ERR(tty_dev)) {
dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n"); dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n");
tty_port_free_xmit_buf(&channel->tty_port);
tty_port_destroy(&channel->tty_port); tty_port_destroy(&channel->tty_port);
continue; continue;
} }
dev_set_drvdata(tty_dev, channel); channel->tty_registered = true;
} }
/* /*
@ -415,6 +433,13 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
ipoctal_irq_handler, ipoctal); ipoctal_irq_handler, ipoctal);
return 0; return 0;
err_free_name:
kfree(tty->name);
err_put_driver:
put_tty_driver(tty);
return res;
} }
static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel, static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel,
@ -655,6 +680,7 @@ static void ipoctal_cleanup(struct tty_struct *tty)
static const struct tty_operations ipoctal_fops = { static const struct tty_operations ipoctal_fops = {
.ioctl = NULL, .ioctl = NULL,
.install = ipoctal_install,
.open = ipoctal_open, .open = ipoctal_open,
.close = ipoctal_close, .close = ipoctal_close,
.write = ipoctal_write_tty, .write = ipoctal_write_tty,
@ -697,12 +723,17 @@ static void __ipoctal_remove(struct ipoctal *ipoctal)
for (i = 0; i < NR_CHANNELS; i++) { for (i = 0; i < NR_CHANNELS; i++) {
struct ipoctal_channel *channel = &ipoctal->channel[i]; struct ipoctal_channel *channel = &ipoctal->channel[i];
if (!channel->tty_registered)
continue;
tty_unregister_device(ipoctal->tty_drv, i); tty_unregister_device(ipoctal->tty_drv, i);
tty_port_free_xmit_buf(&channel->tty_port); tty_port_free_xmit_buf(&channel->tty_port);
tty_port_destroy(&channel->tty_port); tty_port_destroy(&channel->tty_port);
} }
tty_unregister_driver(ipoctal->tty_drv); tty_unregister_driver(ipoctal->tty_drv);
kfree(ipoctal->tty_drv->name);
put_tty_driver(ipoctal->tty_drv); put_tty_driver(ipoctal->tty_drv);
kfree(ipoctal); kfree(ipoctal);
} }

View File

@ -2730,7 +2730,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
if (err) { if (err) {
if (i > 0) if (i > 0)
its_vpe_irq_domain_free(domain, virq, i - 1); its_vpe_irq_domain_free(domain, virq, i);
its_lpi_free_chunks(bitmap, base, nr_ids); its_lpi_free_chunks(bitmap, base, nr_ids);
its_free_prop_table(vprop_page); its_free_prop_table(vprop_page);

View File

@ -280,8 +280,8 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
bus_nr = ida_simple_get(&mcb_ida, 0, 0, GFP_KERNEL); bus_nr = ida_simple_get(&mcb_ida, 0, 0, GFP_KERNEL);
if (bus_nr < 0) { if (bus_nr < 0) {
rc = bus_nr; kfree(bus);
goto err_free; return ERR_PTR(bus_nr);
} }
bus->bus_nr = bus_nr; bus->bus_nr = bus_nr;
@ -296,12 +296,12 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
dev_set_name(&bus->dev, "mcb:%d", bus_nr); dev_set_name(&bus->dev, "mcb:%d", bus_nr);
rc = device_add(&bus->dev); rc = device_add(&bus->dev);
if (rc) if (rc)
goto err_free; goto err_put;
return bus; return bus;
err_free:
put_device(carrier); err_put:
kfree(bus); put_device(&bus->dev);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
EXPORT_SYMBOL_GPL(mcb_alloc_bus); EXPORT_SYMBOL_GPL(mcb_alloc_bus);

View File

@ -2285,7 +2285,12 @@ static void *crypt_page_alloc(gfp_t gfp_mask, void *pool_data)
struct crypt_config *cc = pool_data; struct crypt_config *cc = pool_data;
struct page *page; struct page *page;
if (unlikely(percpu_counter_compare(&cc->n_allocated_pages, dm_crypt_pages_per_client) >= 0) && /*
* Note, percpu_counter_read_positive() may over (and under) estimate
* the current usage by at most (batch - 1) * num_online_cpus() pages,
* but avoids potential spinlock contention of an exact result.
*/
if (unlikely(percpu_counter_read_positive(&cc->n_allocated_pages) >= dm_crypt_pages_per_client) &&
likely(gfp_mask & __GFP_NORETRY)) likely(gfp_mask & __GFP_NORETRY))
return NULL; return NULL;

View File

@ -5375,10 +5375,6 @@ static int md_alloc(dev_t dev, char *name)
*/ */
disk->flags |= GENHD_FL_EXT_DEVT; disk->flags |= GENHD_FL_EXT_DEVT;
mddev->gendisk = disk; mddev->gendisk = disk;
/* As soon as we call add_disk(), another thread could get
* through to md_open, so make sure it doesn't get too far
*/
mutex_lock(&mddev->open_mutex);
add_disk(disk); add_disk(disk);
error = kobject_init_and_add(&mddev->kobj, &md_ktype, error = kobject_init_and_add(&mddev->kobj, &md_ktype,
@ -5394,7 +5390,6 @@ static int md_alloc(dev_t dev, char *name)
if (mddev->kobj.sd && if (mddev->kobj.sd &&
sysfs_create_group(&mddev->kobj, &md_bitmap_group)) sysfs_create_group(&mddev->kobj, &md_bitmap_group))
pr_debug("pointless warning\n"); pr_debug("pointless warning\n");
mutex_unlock(&mddev->open_mutex);
abort: abort:
mutex_unlock(&disks_mutex); mutex_unlock(&disks_mutex);
if (!error && mddev->kobj.sd) { if (!error && mddev->kobj.sd) {

View File

@ -2110,32 +2110,55 @@ static void dib8000_load_ana_fe_coefs(struct dib8000_state *state, const s16 *an
dib8000_write_word(state, 117 + mode, ana_fe[mode]); dib8000_write_word(state, 117 + mode, ana_fe[mode]);
} }
static const u16 lut_prbs_2k[14] = { static const u16 lut_prbs_2k[13] = {
0, 0x423, 0x009, 0x5C7, 0x7A6, 0x3D8, 0x527, 0x7FF, 0x79B, 0x3D6, 0x3A2, 0x53B, 0x2F4, 0x213 0x423, 0x009, 0x5C7,
0x7A6, 0x3D8, 0x527,
0x7FF, 0x79B, 0x3D6,
0x3A2, 0x53B, 0x2F4,
0x213
}; };
static const u16 lut_prbs_4k[14] = {
0, 0x208, 0x0C3, 0x7B9, 0x423, 0x5C7, 0x3D8, 0x7FF, 0x3D6, 0x53B, 0x213, 0x029, 0x0D0, 0x48E static const u16 lut_prbs_4k[13] = {
0x208, 0x0C3, 0x7B9,
0x423, 0x5C7, 0x3D8,
0x7FF, 0x3D6, 0x53B,
0x213, 0x029, 0x0D0,
0x48E
}; };
static const u16 lut_prbs_8k[14] = {
0, 0x740, 0x069, 0x7DD, 0x208, 0x7B9, 0x5C7, 0x7FF, 0x53B, 0x029, 0x48E, 0x4C4, 0x367, 0x684 static const u16 lut_prbs_8k[13] = {
0x740, 0x069, 0x7DD,
0x208, 0x7B9, 0x5C7,
0x7FF, 0x53B, 0x029,
0x48E, 0x4C4, 0x367,
0x684
}; };
static u16 dib8000_get_init_prbs(struct dib8000_state *state, u16 subchannel) static u16 dib8000_get_init_prbs(struct dib8000_state *state, u16 subchannel)
{ {
int sub_channel_prbs_group = 0; int sub_channel_prbs_group = 0;
int prbs_group;
sub_channel_prbs_group = (subchannel / 3) + 1; sub_channel_prbs_group = subchannel / 3;
dprintk("sub_channel_prbs_group = %d , subchannel =%d prbs = 0x%04x\n", sub_channel_prbs_group, subchannel, lut_prbs_8k[sub_channel_prbs_group]); if (sub_channel_prbs_group >= ARRAY_SIZE(lut_prbs_2k))
return 0;
switch (state->fe[0]->dtv_property_cache.transmission_mode) { switch (state->fe[0]->dtv_property_cache.transmission_mode) {
case TRANSMISSION_MODE_2K: case TRANSMISSION_MODE_2K:
return lut_prbs_2k[sub_channel_prbs_group]; prbs_group = lut_prbs_2k[sub_channel_prbs_group];
break;
case TRANSMISSION_MODE_4K: case TRANSMISSION_MODE_4K:
return lut_prbs_4k[sub_channel_prbs_group]; prbs_group = lut_prbs_4k[sub_channel_prbs_group];
break;
default: default:
case TRANSMISSION_MODE_8K: case TRANSMISSION_MODE_8K:
return lut_prbs_8k[sub_channel_prbs_group]; prbs_group = lut_prbs_8k[sub_channel_prbs_group];
} }
dprintk("sub_channel_prbs_group = %d , subchannel =%d prbs = 0x%04x\n",
sub_channel_prbs_group, subchannel, prbs_group);
return prbs_group;
} }
static void dib8000_set_13seg_channel(struct dib8000_state *state) static void dib8000_set_13seg_channel(struct dib8000_state *state)
@ -2412,10 +2435,8 @@ static void dib8000_set_isdbt_common_channel(struct dib8000_state *state, u8 seq
/* TSB or ISDBT ? apply it now */ /* TSB or ISDBT ? apply it now */
if (c->isdbt_sb_mode) { if (c->isdbt_sb_mode) {
dib8000_set_sb_channel(state); dib8000_set_sb_channel(state);
if (c->isdbt_sb_subchannel < 14) init_prbs = dib8000_get_init_prbs(state,
init_prbs = dib8000_get_init_prbs(state, c->isdbt_sb_subchannel); c->isdbt_sb_subchannel);
else
init_prbs = 0;
} else { } else {
dib8000_set_13seg_channel(state); dib8000_set_13seg_channel(state);
init_prbs = 0xfff; init_prbs = 0xfff;
@ -3007,6 +3028,7 @@ static int dib8000_tune(struct dvb_frontend *fe)
unsigned long *timeout = &state->timeout; unsigned long *timeout = &state->timeout;
unsigned long now = jiffies; unsigned long now = jiffies;
u16 init_prbs;
#ifdef DIB8000_AGC_FREEZE #ifdef DIB8000_AGC_FREEZE
u16 agc1, agc2; u16 agc1, agc2;
#endif #endif
@ -3305,8 +3327,10 @@ static int dib8000_tune(struct dvb_frontend *fe)
break; break;
case CT_DEMOD_STEP_11: /* 41 : init prbs autosearch */ case CT_DEMOD_STEP_11: /* 41 : init prbs autosearch */
if (state->subchannel <= 41) { init_prbs = dib8000_get_init_prbs(state, state->subchannel);
dib8000_set_subchannel_prbs(state, dib8000_get_init_prbs(state, state->subchannel));
if (init_prbs) {
dib8000_set_subchannel_prbs(state, init_prbs);
*tune_state = CT_DEMOD_STEP_9; *tune_state = CT_DEMOD_STEP_9;
} else { } else {
*tune_state = CT_DEMOD_STOP; *tune_state = CT_DEMOD_STOP;

View File

@ -52,7 +52,7 @@ static int loop_set_tx_mask(struct rc_dev *dev, u32 mask)
if ((mask & (RXMASK_REGULAR | RXMASK_LEARNING)) != mask) { if ((mask & (RXMASK_REGULAR | RXMASK_LEARNING)) != mask) {
dprintk("invalid tx mask: %u\n", mask); dprintk("invalid tx mask: %u\n", mask);
return -EINVAL; return 2;
} }
dprintk("setting tx mask: %u\n", mask); dprintk("setting tx mask: %u\n", mask);

View File

@ -133,7 +133,7 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6]) static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6])
{ {
int i; int i, ret;
u8 b; u8 b;
mac[0] = 0x00; mac[0] = 0x00;
@ -142,7 +142,9 @@ static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6])
/* this is a complete guess, but works for my box */ /* this is a complete guess, but works for my box */
for (i = 136; i < 139; i++) { for (i = 136; i < 139; i++) {
dibusb_read_eeprom_byte(d,i, &b); ret = dibusb_read_eeprom_byte(d, i, &b);
if (ret)
return ret;
mac[5 - (i - 136)] = b; mac[5 - (i - 136)] = b;
} }

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