Merge remote-tracking branch 'qcom_sm8250/lineage-20' into lineage-21

Change-Id: I3159ae2c81329a81f9f6d4feba3fd1324a86b4f6
This commit is contained in:
Sebastiano Barezzi
2024-08-21 19:34:17 +02:00
511 changed files with 6139 additions and 7571 deletions

View File

@@ -94,7 +94,6 @@ class KernelInclude(Include):
# HINT: this is the only line I had to change / commented out: # HINT: this is the only line I had to change / commented out:
#path = utils.relative_path(None, path) #path = utils.relative_path(None, path)
path = nodes.reprunicode(path)
encoding = self.options.get( encoding = self.options.get(
'encoding', self.state.document.settings.input_encoding) 'encoding', self.state.document.settings.input_encoding)
e_handler=self.state.document.settings.input_encoding_error_handler e_handler=self.state.document.settings.input_encoding_error_handler

View File

@@ -5,8 +5,6 @@
# #
mainmenu "Linux/$(ARCH) $(KERNELVERSION) Kernel Configuration" mainmenu "Linux/$(ARCH) $(KERNELVERSION) Kernel Configuration"
comment "Compiler: $(CC_VERSION_TEXT)"
source "scripts/Kconfig.include" source "scripts/Kconfig.include"
source "init/Kconfig" source "init/Kconfig"

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 4 VERSION = 4
PATCHLEVEL = 19 PATCHLEVEL = 19
SUBLEVEL = 312 SUBLEVEL = 318
EXTRAVERSION = EXTRAVERSION =
NAME = "People's Front" NAME = "People's Front"
@@ -519,8 +519,6 @@ endif
ifneq ($(LLVM_IAS),1) ifneq ($(LLVM_IAS),1)
CLANG_FLAGS += -no-integrated-as CLANG_FLAGS += -no-integrated-as
endif endif
CLANG_FLAGS += $(call cc-option, -Wno-misleading-indentation)
CLANG_FLAGS += $(call cc-option, -Wno-bool-operation)
CLANG_FLAGS += -Werror=unknown-warning-option CLANG_FLAGS += -Werror=unknown-warning-option
CLANG_FLAGS += $(call cc-option, -Wno-unsequenced) CLANG_FLAGS += $(call cc-option, -Wno-unsequenced)
KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_CFLAGS += $(CLANG_FLAGS)
@@ -762,10 +760,6 @@ KBUILD_CFLAGS += $(call cc-option, -mllvm -disable-struct-const-merge)
# Quiet clang warning: comparison of unsigned expression < 0 is always false # Quiet clang warning: comparison of unsigned expression < 0 is always false
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
# See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
endif endif

View File

@@ -964,7 +964,7 @@ put_tv32(struct timeval32 __user *o, struct timespec64 *i)
} }
static inline long static inline long
put_tv_to_tv32(struct timeval32 __user *o, struct __kernel_old_timeval *i) put_tv_to_tv32(struct timeval32 __user *o, struct timeval *i)
{ {
return copy_to_user(o, &(struct timeval32){ return copy_to_user(o, &(struct timeval32){
.tv_sec = i->tv_sec, .tv_sec = i->tv_sec,

View File

@@ -170,7 +170,6 @@
}; };
gmac: ethernet@8000 { gmac: ethernet@8000 {
#interrupt-cells = <1>;
compatible = "snps,dwmac"; compatible = "snps,dwmac";
reg = <0x8000 0x2000>; reg = <0x8000 0x2000>;
interrupts = <10>; interrupts = <10>;

View File

@@ -64,7 +64,7 @@
&keypad { &keypad {
samsung,keypad-num-rows = <2>; samsung,keypad-num-rows = <2>;
samsung,keypad-num-columns = <8>; samsung,keypad-num-columns = <8>;
linux,keypad-no-autorepeat; linux,input-no-autorepeat;
wakeup-source; wakeup-source;
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&keypad_rows &keypad_cols>; pinctrl-0 = <&keypad_rows &keypad_cols>;

View File

@@ -437,7 +437,7 @@
&keypad { &keypad {
samsung,keypad-num-rows = <3>; samsung,keypad-num-rows = <3>;
samsung,keypad-num-columns = <2>; samsung,keypad-num-columns = <2>;
linux,keypad-no-autorepeat; linux,input-no-autorepeat;
wakeup-source; wakeup-source;
pinctrl-0 = <&keypad_rows &keypad_cols>; pinctrl-0 = <&keypad_rows &keypad_cols>;
pinctrl-names = "default"; pinctrl-names = "default";

View File

@@ -43,7 +43,7 @@
&keypad { &keypad {
samsung,keypad-num-rows = <3>; samsung,keypad-num-rows = <3>;
samsung,keypad-num-columns = <8>; samsung,keypad-num-columns = <8>;
linux,keypad-no-autorepeat; linux,input-no-autorepeat;
wakeup-source; wakeup-source;
pinctrl-0 = <&keypad_rows &keypad_cols>; pinctrl-0 = <&keypad_rows &keypad_cols>;
pinctrl-names = "default"; pinctrl-names = "default";

View File

@@ -65,7 +65,7 @@ static void davinci_pm_suspend(void)
/* Configure sleep count in deep sleep register */ /* Configure sleep count in deep sleep register */
val = __raw_readl(pm_config.deepsleep_reg); val = __raw_readl(pm_config.deepsleep_reg);
val &= ~DEEPSLEEP_SLEEPCOUNT_MASK, val &= ~DEEPSLEEP_SLEEPCOUNT_MASK;
val |= pm_config.sleepcount; val |= pm_config.sleepcount;
__raw_writel(val, pm_config.deepsleep_reg); __raw_writel(val, pm_config.deepsleep_reg);

View File

@@ -49,11 +49,7 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
endif endif
endif endif
ifeq ($(cc-name),clang)
KBUILD_CFLAGS += -mno-implicit-float
else
KBUILD_CFLAGS += -mgeneral-regs-only KBUILD_CFLAGS += -mgeneral-regs-only
endif
KBUILD_CFLAGS += $(lseinstr) $(brokengasinst) $(compat_vdso) KBUILD_CFLAGS += $(lseinstr) $(brokengasinst) $(compat_vdso)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(call cc-disable-warning, psabi) KBUILD_CFLAGS += $(call cc-disable-warning, psabi)

View File

@@ -60,7 +60,7 @@
gic: interrupt-controller@f1001000 { gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400"; compatible = "arm,gic-400";
reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */ reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */
<0x0 0xf1002000 0x0 0x100>; /* GICC */ <0x0 0xf1002000 0x0 0x2000>; /* GICC */
#address-cells = <0>; #address-cells = <0>;
#interrupt-cells = <3>; #interrupt-cells = <3>;
interrupt-controller; interrupt-controller;

View File

@@ -232,7 +232,7 @@
clock-names = "hif_sel"; clock-names = "hif_sel";
}; };
cir: cir@10009000 { cir: ir-receiver@10009000 {
compatible = "mediatek,mt7622-cir"; compatible = "mediatek,mt7622-cir";
reg = <0 0x10009000 0 0x1000>; reg = <0 0x10009000 0 0x1000>;
interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_LOW>; interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_LOW>;
@@ -459,7 +459,6 @@
<&pericfg CLK_PERI_AUXADC_PD>; <&pericfg CLK_PERI_AUXADC_PD>;
clock-names = "therm", "auxadc"; clock-names = "therm", "auxadc";
resets = <&pericfg MT7622_PERI_THERM_SW_RST>; resets = <&pericfg MT7622_PERI_THERM_SW_RST>;
reset-names = "therm";
mediatek,auxadc = <&auxadc>; mediatek,auxadc = <&auxadc>;
mediatek,apmixedsys = <&apmixedsys>; mediatek,apmixedsys = <&apmixedsys>;
nvmem-cells = <&thermal_calibration>; nvmem-cells = <&thermal_calibration>;
@@ -846,9 +845,7 @@
}; };
eth: ethernet@1b100000 { eth: ethernet@1b100000 {
compatible = "mediatek,mt7622-eth", compatible = "mediatek,mt7622-eth";
"mediatek,mt2701-eth",
"syscon";
reg = <0 0x1b100000 0 0x20000>; reg = <0 0x1b100000 0 0x20000>;
interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_LOW>, interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_LOW>,
<GIC_SPI 224 IRQ_TYPE_LEVEL_LOW>, <GIC_SPI 224 IRQ_TYPE_LEVEL_LOW>,

View File

@@ -9,8 +9,8 @@
compatible = "nvidia,norrin", "nvidia,tegra132", "nvidia,tegra124"; compatible = "nvidia,norrin", "nvidia,tegra132", "nvidia,tegra124";
aliases { aliases {
rtc0 = "/i2c@7000d000/as3722@40"; rtc0 = &as3722;
rtc1 = "/rtc@7000e000"; rtc1 = &tegra_rtc;
serial0 = &uarta; serial0 = &uarta;
}; };

View File

@@ -569,7 +569,7 @@
status = "disabled"; status = "disabled";
}; };
rtc@7000e000 { tegra_rtc: rtc@7000e000 {
compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc"; compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc";
reg = <0x0 0x7000e000 0x0 0x100>; reg = <0x0 0x7000e000 0x0 0x100>;
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;

View File

@@ -677,6 +677,7 @@
dma-names = "tx"; dma-names = "tx";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&spdif_tx>; pinctrl-0 = <&spdif_tx>;
#sound-dai-cells = <0>;
status = "disabled"; status = "disabled";
}; };
@@ -688,6 +689,7 @@
clocks = <&cru SCLK_I2S_2CH>, <&cru HCLK_I2S_2CH>; clocks = <&cru SCLK_I2S_2CH>, <&cru HCLK_I2S_2CH>;
dmas = <&dmac_bus 6>, <&dmac_bus 7>; dmas = <&dmac_bus 6>, <&dmac_bus 7>;
dma-names = "tx", "rx"; dma-names = "tx", "rx";
#sound-dai-cells = <0>;
status = "disabled"; status = "disabled";
}; };
@@ -701,6 +703,7 @@
dma-names = "tx", "rx"; dma-names = "tx", "rx";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&i2s_8ch_bus>; pinctrl-0 = <&i2s_8ch_bus>;
#sound-dai-cells = <0>;
status = "disabled"; status = "disabled";
}; };

View File

@@ -426,16 +426,22 @@
gpio1830-supply = <&vcc_1v8>; gpio1830-supply = <&vcc_1v8>;
}; };
&pmu_io_domains { &pcie_clkreqn_cpm {
status = "okay"; rockchip,pins =
pmu1830-supply = <&vcc_1v8>; <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
};
&pwm2 {
status = "okay";
}; };
&pinctrl { &pinctrl {
pinctrl-names = "default";
pinctrl-0 = <&q7_thermal_pin>;
gpios {
q7_thermal_pin: q7-thermal-pin {
rockchip,pins =
<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
i2c8 { i2c8 {
i2c8_xfer_a: i2c8-xfer { i2c8_xfer_a: i2c8-xfer {
rockchip,pins = rockchip,pins =
@@ -466,6 +472,15 @@
}; };
}; };
&pmu_io_domains {
status = "okay";
pmu1830-supply = <&vcc_1v8>;
};
&pwm2 {
status = "okay";
};
&sdhci { &sdhci {
/* /*
* Signal integrity isn't great at 200MHz but 100MHz has proven stable * Signal integrity isn't great at 200MHz but 100MHz has proven stable

View File

@@ -16,6 +16,11 @@ Optional properties:
a GPIO spec for the external headphone detect pin. If jd-mode = 0, a GPIO spec for the external headphone detect pin. If jd-mode = 0,
we will get the JD status by getting the value of hp-detect-gpios. we will get the JD status by getting the value of hp-detect-gpios.
- cbj-sleeve-gpios:
a GPIO spec to control the external combo jack circuit to tie the sleeve/ring2
contacts to the ground or floating. It could avoid some electric noise from the
active speaker jacks.
- realtek,in2-differential - realtek,in2-differential
Boolean. Indicate MIC2 input are differential, rather than single-ended. Boolean. Indicate MIC2 input are differential, rather than single-ended.
@@ -64,6 +69,7 @@ codec: rt5650@1a {
compatible = "realtek,rt5650"; compatible = "realtek,rt5650";
reg = <0x1a>; reg = <0x1a>;
hp-detect-gpios = <&gpio 19 0>; hp-detect-gpios = <&gpio 19 0>;
cbj-sleeve-gpios = <&gpio 20 0>;
interrupt-parent = <&gpio>; interrupt-parent = <&gpio>;
interrupts = <7 IRQ_TYPE_EDGE_FALLING>; interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
realtek,dmic-en = "true"; realtek,dmic-en = "true";

View File

@@ -39,6 +39,7 @@
14470: .long 14471f - 14470b; \ 14470: .long 14471f - 14470b; \
_BUGVERBOSE_LOCATION(__FILE__, __LINE__) \ _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
.short flags; \ .short flags; \
.align 2; \
.popsection; \ .popsection; \
14471: 14471:
#else #else

View File

@@ -25,6 +25,8 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/sched/task_stack.h> #include <linux/sched/task_stack.h>
#include <asm-generic/compat.h>
#define COMPAT_USER_HZ 100 #define COMPAT_USER_HZ 100
#ifdef __AARCH64EB__ #ifdef __AARCH64EB__
#define COMPAT_UTS_MACHINE "armv8b\0\0" #define COMPAT_UTS_MACHINE "armv8b\0\0"
@@ -32,10 +34,6 @@
#define COMPAT_UTS_MACHINE "armv8l\0\0" #define COMPAT_UTS_MACHINE "armv8l\0\0"
#endif #endif
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_clock_t;
typedef s32 compat_pid_t;
typedef u16 __compat_uid_t; typedef u16 __compat_uid_t;
typedef u16 __compat_gid_t; typedef u16 __compat_gid_t;
typedef u16 __compat_uid16_t; typedef u16 __compat_uid16_t;
@@ -43,27 +41,13 @@ typedef u16 __compat_gid16_t;
typedef u32 __compat_uid32_t; typedef u32 __compat_uid32_t;
typedef u32 __compat_gid32_t; typedef u32 __compat_gid32_t;
typedef u16 compat_mode_t; typedef u16 compat_mode_t;
typedef u32 compat_ino_t;
typedef u32 compat_dev_t; typedef u32 compat_dev_t;
typedef s32 compat_off_t;
typedef s64 compat_loff_t;
typedef s32 compat_nlink_t; typedef s32 compat_nlink_t;
typedef u16 compat_ipc_pid_t; typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t; typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_key_t;
typedef s32 compat_timer_t;
typedef s16 compat_short_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 compat_s64; typedef s64 compat_s64;
typedef u16 compat_ushort_t;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u64 compat_u64; typedef u64 compat_u64;
typedef u32 compat_uptr_t;
struct compat_stat { struct compat_stat {
#ifdef __AARCH64EB__ #ifdef __AARCH64EB__

View File

@@ -134,6 +134,7 @@ SECTIONS
IDMAP_TEXT IDMAP_TEXT
HIBERNATE_TEXT HIBERNATE_TEXT
TRAMP_TEXT TRAMP_TEXT
*(.text..L.cfi.jumptable .text..L.cfi.jumptable.*)
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
. = ALIGN(16); . = ALIGN(16);

View File

@@ -175,6 +175,7 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
case PSR_AA32_MODE_SVC: case PSR_AA32_MODE_SVC:
case PSR_AA32_MODE_ABT: case PSR_AA32_MODE_ABT:
case PSR_AA32_MODE_UND: case PSR_AA32_MODE_UND:
case PSR_AA32_MODE_SYS:
if (!vcpu_el1_is_32bit(vcpu)) if (!vcpu_el1_is_32bit(vcpu))
return -EINVAL; return -EINVAL;
break; break;

View File

@@ -0,0 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */
#include <asm-generic/syscalls.h>
asmlinkage long sys_hexagon_fadvise64_64(int fd, int advice,
u32 a2, u32 a3, u32 a4, u32 a5);

View File

@@ -27,6 +27,13 @@
#undef __SYSCALL #undef __SYSCALL
#define __SYSCALL(nr, call) [nr] = (call), #define __SYSCALL(nr, call) [nr] = (call),
SYSCALL_DEFINE6(hexagon_fadvise64_64, int, fd, int, advice,
SC_ARG64(offset), SC_ARG64(len))
{
return ksys_fadvise64_64(fd, SC_VAL64(loff_t, offset), SC_VAL64(loff_t, len), advice);
}
#define sys_fadvise64_64 sys_hexagon_fadvise64_64
void *sys_call_table[__NR_syscalls] = { void *sys_call_table[__NR_syscalls] = {
#include <asm/unistd.h> #include <asm/unistd.h>
}; };

View File

@@ -425,7 +425,9 @@ resume:
movec %a0,%dfc movec %a0,%dfc
/* restore status register */ /* restore status register */
movew %a1@(TASK_THREAD+THREAD_SR),%sr movew %a1@(TASK_THREAD+THREAD_SR),%d0
oriw #0x0700,%d0
movew %d0,%sr
rts rts

View File

@@ -462,40 +462,18 @@ void mac_poweroff(void)
void mac_reset(void) void mac_reset(void)
{ {
if (macintosh_config->adb_type == MAC_ADB_II) {
unsigned long flags;
/* need ROMBASE in booter */
/* indeed, plus need to MAP THE ROM !! */
if (mac_bi_data.rombase == 0)
mac_bi_data.rombase = 0x40800000;
/* works on some */
rom_reset = (void *) (mac_bi_data.rombase + 0xa);
if (macintosh_config->ident == MAC_MODEL_SE30) {
/*
* MSch: Machines known to crash on ROM reset ...
*/
} else {
local_irq_save(flags);
rom_reset();
local_irq_restore(flags);
}
#ifdef CONFIG_ADB_CUDA #ifdef CONFIG_ADB_CUDA
} else if (macintosh_config->adb_type == MAC_ADB_EGRET || if (macintosh_config->adb_type == MAC_ADB_EGRET ||
macintosh_config->adb_type == MAC_ADB_CUDA) { macintosh_config->adb_type == MAC_ADB_CUDA) {
cuda_restart(); cuda_restart();
} else
#endif #endif
#ifdef CONFIG_ADB_PMU #ifdef CONFIG_ADB_PMU
} else if (macintosh_config->adb_type == MAC_ADB_PB2) { if (macintosh_config->adb_type == MAC_ADB_PB2) {
pmu_restart(); pmu_restart();
} else
#endif #endif
} else if (CPU_IS_030) { if (CPU_IS_030) {
/* 030-specific reset routine. The idea is general, but the /* 030-specific reset routine. The idea is general, but the
* specific registers to reset are '030-specific. Until I * specific registers to reset are '030-specific. Until I
* have a non-030 machine, I can't test anything else. * have a non-030 machine, I can't test anything else.
@@ -543,6 +521,18 @@ void mac_reset(void)
"jmp %/a0@\n\t" /* jump to the reset vector */ "jmp %/a0@\n\t" /* jump to the reset vector */
".chip 68k" ".chip 68k"
: : "r" (offset), "a" (rombase) : "a0"); : : "r" (offset), "a" (rombase) : "a0");
} else {
/* need ROMBASE in booter */
/* indeed, plus need to MAP THE ROM !! */
if (mac_bi_data.rombase == 0)
mac_bi_data.rombase = 0x40800000;
/* works on some */
rom_reset = (void *)(mac_bi_data.rombase + 0xa);
local_irq_disable();
rom_reset();
} }
/* should never get here */ /* should never get here */

View File

@@ -7,7 +7,6 @@ ifdef CONFIG_FUNCTION_TRACER
# Do not trace early boot code and low level code # Do not trace early boot code and low level code
CFLAGS_REMOVE_timer.o = -pg CFLAGS_REMOVE_timer.o = -pg
CFLAGS_REMOVE_intc.o = -pg CFLAGS_REMOVE_intc.o = -pg
CFLAGS_REMOVE_early_printk.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_process.o = -pg CFLAGS_REMOVE_process.o = -pg
endif endif

View File

@@ -18,7 +18,7 @@ static const char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER; static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
#define err_printk(x) \ #define err_printk(x) \
early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n"); pr_err("ERROR: Microblaze " x "-different for kernel and DTS\n");
void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
{ {

View File

@@ -9,43 +9,25 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm-generic/compat.h>
#define COMPAT_USER_HZ 100 #define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "mips\0\0\0" #define COMPAT_UTS_MACHINE "mips\0\0\0"
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_clock_t;
typedef s32 compat_suseconds_t;
typedef s32 compat_pid_t;
typedef s32 __compat_uid_t; typedef s32 __compat_uid_t;
typedef s32 __compat_gid_t; typedef s32 __compat_gid_t;
typedef __compat_uid_t __compat_uid32_t; typedef __compat_uid_t __compat_uid32_t;
typedef __compat_gid_t __compat_gid32_t; typedef __compat_gid_t __compat_gid32_t;
typedef u32 compat_mode_t; typedef u32 compat_mode_t;
typedef u32 compat_ino_t;
typedef u32 compat_dev_t; typedef u32 compat_dev_t;
typedef s32 compat_off_t;
typedef s64 compat_loff_t;
typedef u32 compat_nlink_t; typedef u32 compat_nlink_t;
typedef s32 compat_ipc_pid_t; typedef s32 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef s32 compat_caddr_t; typedef s32 compat_caddr_t;
typedef struct { typedef struct {
s32 val[2]; s32 val[2];
} compat_fsid_t; } compat_fsid_t;
typedef s32 compat_timer_t;
typedef s32 compat_key_t;
typedef s16 compat_short_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 compat_s64; typedef s64 compat_s64;
typedef u16 compat_ushort_t;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u64 compat_u64; typedef u64 compat_u64;
typedef u32 compat_uptr_t;
struct compat_stat { struct compat_stat {
compat_dev_t st_dev; compat_dev_t st_dev;

View File

@@ -112,8 +112,8 @@ static int read_config_dword(struct pci_bus *bus, unsigned int devfn,
* gives them time to settle * gives them time to settle
*/ */
if (where == PCI_VENDOR_ID) { if (where == PCI_VENDOR_ID) {
if (ret == 0xffffffff || ret == 0x00000000 || if (*val == 0xffffffff || *val == 0x00000000 ||
ret == 0x0000ffff || ret == 0xffff0000) { *val == 0x0000ffff || *val == 0xffff0000) {
if (delay > 4) if (delay > 4)
return 0; return 0;
delay *= 2; delay *= 2;

6
arch/mips/pci/pcie-octeon.c Normal file → Executable file
View File

@@ -230,12 +230,18 @@ static inline uint64_t __cvmx_pcie_build_config_addr(int pcie_port, int bus,
{ {
union cvmx_pcie_address pcie_addr; union cvmx_pcie_address pcie_addr;
union cvmx_pciercx_cfg006 pciercx_cfg006; union cvmx_pciercx_cfg006 pciercx_cfg006;
union cvmx_pciercx_cfg032 pciercx_cfg032;
pciercx_cfg006.u32 = pciercx_cfg006.u32 =
cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG006(pcie_port)); cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG006(pcie_port));
if ((bus <= pciercx_cfg006.s.pbnum) && (dev != 0)) if ((bus <= pciercx_cfg006.s.pbnum) && (dev != 0))
return 0; return 0;
pciercx_cfg032.u32 =
cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port));
if ((pciercx_cfg032.s.dlla == 0) || (pciercx_cfg032.s.lt == 1))
return 0;
pcie_addr.u64 = 0; pcie_addr.u64 = 0;
pcie_addr.config.upper = 2; pcie_addr.config.upper = 2;
pcie_addr.config.io = 1; pcie_addr.config.io = 1;

View File

@@ -8,36 +8,22 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/thread_info.h> #include <linux/thread_info.h>
#include <asm-generic/compat.h>
#define COMPAT_USER_HZ 100 #define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "parisc\0\0" #define COMPAT_UTS_MACHINE "parisc\0\0"
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_clock_t;
typedef s32 compat_pid_t;
typedef u32 __compat_uid_t; typedef u32 __compat_uid_t;
typedef u32 __compat_gid_t; typedef u32 __compat_gid_t;
typedef u32 __compat_uid32_t; typedef u32 __compat_uid32_t;
typedef u32 __compat_gid32_t; typedef u32 __compat_gid32_t;
typedef u16 compat_mode_t; typedef u16 compat_mode_t;
typedef u32 compat_ino_t;
typedef u32 compat_dev_t; typedef u32 compat_dev_t;
typedef s32 compat_off_t;
typedef s64 compat_loff_t;
typedef u16 compat_nlink_t; typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t; typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef s32 compat_key_t;
typedef s32 compat_timer_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 compat_s64; typedef s64 compat_s64;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u64 compat_u64; typedef u64 compat_u64;
typedef u32 compat_uptr_t;
struct compat_stat { struct compat_stat {
compat_dev_t st_dev; /* dev_t is 32 bits on parisc */ compat_dev_t st_dev; /* dev_t is 32 bits on parisc */

View File

@@ -34,6 +34,7 @@ EXPORT_SYMBOL(memset);
#include <linux/atomic.h> #include <linux/atomic.h>
EXPORT_SYMBOL(__xchg8); EXPORT_SYMBOL(__xchg8);
EXPORT_SYMBOL(__xchg32); EXPORT_SYMBOL(__xchg32);
EXPORT_SYMBOL(__cmpxchg_u8);
EXPORT_SYMBOL(__cmpxchg_u32); EXPORT_SYMBOL(__cmpxchg_u32);
EXPORT_SYMBOL(__cmpxchg_u64); EXPORT_SYMBOL(__cmpxchg_u64);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP

View File

@@ -8,6 +8,8 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <asm-generic/compat.h>
#define COMPAT_USER_HZ 100 #define COMPAT_USER_HZ 100
#ifdef __BIG_ENDIAN__ #ifdef __BIG_ENDIAN__
#define COMPAT_UTS_MACHINE "ppc\0\0" #define COMPAT_UTS_MACHINE "ppc\0\0"
@@ -15,34 +17,18 @@
#define COMPAT_UTS_MACHINE "ppcle\0\0" #define COMPAT_UTS_MACHINE "ppcle\0\0"
#endif #endif
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_clock_t;
typedef s32 compat_pid_t;
typedef u32 __compat_uid_t; typedef u32 __compat_uid_t;
typedef u32 __compat_gid_t; typedef u32 __compat_gid_t;
typedef u32 __compat_uid32_t; typedef u32 __compat_uid32_t;
typedef u32 __compat_gid32_t; typedef u32 __compat_gid32_t;
typedef u32 compat_mode_t; typedef u32 compat_mode_t;
typedef u32 compat_ino_t;
typedef u32 compat_dev_t; typedef u32 compat_dev_t;
typedef s32 compat_off_t;
typedef s64 compat_loff_t;
typedef s16 compat_nlink_t; typedef s16 compat_nlink_t;
typedef u16 compat_ipc_pid_t; typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t; typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_key_t;
typedef s32 compat_timer_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 compat_s64; typedef s64 compat_s64;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u64 compat_u64; typedef u64 compat_u64;
typedef u32 compat_uptr_t;
struct compat_stat { struct compat_stat {
compat_dev_t st_dev; compat_dev_t st_dev;

View File

@@ -383,7 +383,7 @@ long plpar_hcall_norets(unsigned long opcode, ...);
* Used for all but the craziest of phyp interfaces (see plpar_hcall9) * Used for all but the craziest of phyp interfaces (see plpar_hcall9)
*/ */
#define PLPAR_HCALL_BUFSIZE 4 #define PLPAR_HCALL_BUFSIZE 4
long plpar_hcall(unsigned long opcode, unsigned long *retbuf, ...); long plpar_hcall(unsigned long opcode, unsigned long retbuf[static PLPAR_HCALL_BUFSIZE], ...);
/** /**
* plpar_hcall_raw: - Make a hypervisor call without calculating hcall stats * plpar_hcall_raw: - Make a hypervisor call without calculating hcall stats
@@ -397,7 +397,7 @@ long plpar_hcall(unsigned long opcode, unsigned long *retbuf, ...);
* plpar_hcall, but plpar_hcall_raw works in real mode and does not * plpar_hcall, but plpar_hcall_raw works in real mode and does not
* calculate hypervisor call statistics. * calculate hypervisor call statistics.
*/ */
long plpar_hcall_raw(unsigned long opcode, unsigned long *retbuf, ...); long plpar_hcall_raw(unsigned long opcode, unsigned long retbuf[static PLPAR_HCALL_BUFSIZE], ...);
/** /**
* plpar_hcall9: - Make a pseries hypervisor call with up to 9 return arguments * plpar_hcall9: - Make a pseries hypervisor call with up to 9 return arguments
@@ -408,8 +408,8 @@ long plpar_hcall_raw(unsigned long opcode, unsigned long *retbuf, ...);
* PLPAR_HCALL9_BUFSIZE to size the return argument buffer. * PLPAR_HCALL9_BUFSIZE to size the return argument buffer.
*/ */
#define PLPAR_HCALL9_BUFSIZE 9 #define PLPAR_HCALL9_BUFSIZE 9
long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...); long plpar_hcall9(unsigned long opcode, unsigned long retbuf[static PLPAR_HCALL9_BUFSIZE], ...);
long plpar_hcall9_raw(unsigned long opcode, unsigned long *retbuf, ...); long plpar_hcall9_raw(unsigned long opcode, unsigned long retbuf[static PLPAR_HCALL9_BUFSIZE], ...);
struct hvcall_mpp_data { struct hvcall_mpp_data {
unsigned long entitled_mem; unsigned long entitled_mem;
@@ -424,7 +424,7 @@ struct hvcall_mpp_data {
unsigned long backing_mem; unsigned long backing_mem;
}; };
int h_get_mpp(struct hvcall_mpp_data *); long h_get_mpp(struct hvcall_mpp_data *mpp_data);
struct hvcall_mpp_x_data { struct hvcall_mpp_x_data {
unsigned long coalesced_bytes; unsigned long coalesced_bytes;

View File

@@ -47,7 +47,7 @@ extern struct pci_dev *isa_bridge_pcidev;
* define properly based on the platform * define properly based on the platform
*/ */
#ifndef CONFIG_PCI #ifndef CONFIG_PCI
#define _IO_BASE 0 #define _IO_BASE POISON_POINTER_DELTA
#define _ISA_MEM_BASE 0 #define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0 #define PCI_DRAM_OFFSET 0
#elif defined(CONFIG_PPC32) #elif defined(CONFIG_PPC32)
@@ -569,12 +569,12 @@ __do_out_asm(_rec_outl, "stwbrx")
#define __do_inw(port) _rec_inw(port) #define __do_inw(port) _rec_inw(port)
#define __do_inl(port) _rec_inl(port) #define __do_inl(port) _rec_inl(port)
#else /* CONFIG_PPC32 */ #else /* CONFIG_PPC32 */
#define __do_outb(val, port) writeb(val,(PCI_IO_ADDR)_IO_BASE+port); #define __do_outb(val, port) writeb(val,(PCI_IO_ADDR)(_IO_BASE+port));
#define __do_outw(val, port) writew(val,(PCI_IO_ADDR)_IO_BASE+port); #define __do_outw(val, port) writew(val,(PCI_IO_ADDR)(_IO_BASE+port));
#define __do_outl(val, port) writel(val,(PCI_IO_ADDR)_IO_BASE+port); #define __do_outl(val, port) writel(val,(PCI_IO_ADDR)(_IO_BASE+port));
#define __do_inb(port) readb((PCI_IO_ADDR)_IO_BASE + port); #define __do_inb(port) readb((PCI_IO_ADDR)(_IO_BASE + port));
#define __do_inw(port) readw((PCI_IO_ADDR)_IO_BASE + port); #define __do_inw(port) readw((PCI_IO_ADDR)(_IO_BASE + port));
#define __do_inl(port) readl((PCI_IO_ADDR)_IO_BASE + port); #define __do_inl(port) readl((PCI_IO_ADDR)(_IO_BASE + port));
#endif /* !CONFIG_PPC32 */ #endif /* !CONFIG_PPC32 */
#ifdef CONFIG_EEH #ifdef CONFIG_EEH
@@ -590,12 +590,12 @@ __do_out_asm(_rec_outl, "stwbrx")
#define __do_writesw(a, b, n) _outsw(PCI_FIX_ADDR(a),(b),(n)) #define __do_writesw(a, b, n) _outsw(PCI_FIX_ADDR(a),(b),(n))
#define __do_writesl(a, b, n) _outsl(PCI_FIX_ADDR(a),(b),(n)) #define __do_writesl(a, b, n) _outsl(PCI_FIX_ADDR(a),(b),(n))
#define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) #define __do_insb(p, b, n) readsb((PCI_IO_ADDR)(_IO_BASE+(p)), (b), (n))
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)(_IO_BASE+(p)), (b), (n))
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)(_IO_BASE+(p)), (b), (n))
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)(_IO_BASE+(p)),(b),(n))
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)(_IO_BASE+(p)),(b),(n))
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)(_IO_BASE+(p)),(b),(n))
#define __do_memset_io(addr, c, n) \ #define __do_memset_io(addr, c, n) \
_memset_io(PCI_FIX_ADDR(addr), c, n) _memset_io(PCI_FIX_ADDR(addr), c, n)

View File

@@ -933,10 +933,10 @@ void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf)
* h_get_mpp * h_get_mpp
* H_GET_MPP hcall returns info in 7 parms * H_GET_MPP hcall returns info in 7 parms
*/ */
int h_get_mpp(struct hvcall_mpp_data *mpp_data) long h_get_mpp(struct hvcall_mpp_data *mpp_data)
{ {
int rc; unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; long rc;
rc = plpar_hcall9(H_GET_MPP, retbuf); rc = plpar_hcall9(H_GET_MPP, retbuf);

View File

@@ -114,8 +114,8 @@ struct hvcall_ppp_data {
*/ */
static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data) static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
{ {
unsigned long rc; unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; long rc;
rc = plpar_hcall9(H_GET_PPP, retbuf); rc = plpar_hcall9(H_GET_PPP, retbuf);
@@ -161,7 +161,7 @@ static void parse_ppp_data(struct seq_file *m)
struct hvcall_ppp_data ppp_data; struct hvcall_ppp_data ppp_data;
struct device_node *root; struct device_node *root;
const __be32 *perf_level; const __be32 *perf_level;
int rc; long rc;
rc = h_get_ppp(&ppp_data); rc = h_get_ppp(&ppp_data);
if (rc) if (rc)

View File

@@ -578,10 +578,12 @@ static const struct fsl_msi_feature ipic_msi_feature = {
.msiir_offset = 0x38, .msiir_offset = 0x38,
}; };
#ifdef CONFIG_EPAPR_PARAVIRT
static const struct fsl_msi_feature vmpic_msi_feature = { static const struct fsl_msi_feature vmpic_msi_feature = {
.fsl_pic_ip = FSL_PIC_IP_VMPIC, .fsl_pic_ip = FSL_PIC_IP_VMPIC,
.msiir_offset = 0, .msiir_offset = 0,
}; };
#endif
static const struct of_device_id fsl_of_msi_ids[] = { static const struct of_device_id fsl_of_msi_ids[] = {
{ {

View File

@@ -1154,7 +1154,7 @@ static int cpu_cmd(void)
unsigned long cpu, first_cpu, last_cpu; unsigned long cpu, first_cpu, last_cpu;
int timeout; int timeout;
if (!scanhex(&cpu)) { if (!scanhex(&cpu) || cpu >= num_possible_cpus()) {
/* print cpus waiting or in xmon */ /* print cpus waiting or in xmon */
printf("cpus stopped:"); printf("cpus stopped:");
last_cpu = first_cpu = NR_CPUS; last_cpu = first_cpu = NR_CPUS;
@@ -2485,7 +2485,7 @@ static void dump_pacas(void)
termch = c; /* Put c back, it wasn't 'a' */ termch = c; /* Put c back, it wasn't 'a' */
if (scanhex(&num)) if (scanhex(&num) && num < num_possible_cpus())
dump_one_paca(num); dump_one_paca(num);
else else
dump_one_paca(xmon_owner); dump_one_paca(xmon_owner);
@@ -2568,7 +2568,7 @@ static void dump_xives(void)
termch = c; /* Put c back, it wasn't 'a' */ termch = c; /* Put c back, it wasn't 'a' */
if (scanhex(&num)) if (scanhex(&num) && num < num_possible_cpus())
dump_one_xive(num); dump_one_xive(num);
else else
dump_one_xive(xmon_owner); dump_one_xive(xmon_owner);

View File

@@ -9,6 +9,8 @@
#include <linux/sched/task_stack.h> #include <linux/sched/task_stack.h>
#include <linux/thread_info.h> #include <linux/thread_info.h>
#include <asm-generic/compat.h>
#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \ #define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \
typeof(0?(__force t)0:0ULL), u64)) typeof(0?(__force t)0:0ULL), u64))
@@ -51,34 +53,18 @@
#define COMPAT_USER_HZ 100 #define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "s390\0\0\0\0" #define COMPAT_UTS_MACHINE "s390\0\0\0\0"
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_clock_t;
typedef s32 compat_pid_t;
typedef u16 __compat_uid_t; typedef u16 __compat_uid_t;
typedef u16 __compat_gid_t; typedef u16 __compat_gid_t;
typedef u32 __compat_uid32_t; typedef u32 __compat_uid32_t;
typedef u32 __compat_gid32_t; typedef u32 __compat_gid32_t;
typedef u16 compat_mode_t; typedef u16 compat_mode_t;
typedef u32 compat_ino_t;
typedef u16 compat_dev_t; typedef u16 compat_dev_t;
typedef s32 compat_off_t;
typedef s64 compat_loff_t;
typedef u16 compat_nlink_t; typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t; typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t; typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_key_t;
typedef s32 compat_timer_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 compat_s64; typedef s64 compat_s64;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u64 compat_u64; typedef u64 compat_u64;
typedef u32 compat_uptr_t;
typedef struct { typedef struct {
u32 mask; u32 mask;

View File

@@ -2583,7 +2583,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr,
return 0; return 0;
start = pmd_val(*pmd) & HPAGE_MASK; start = pmd_val(*pmd) & HPAGE_MASK;
end = start + HPAGE_SIZE - 1; end = start + HPAGE_SIZE;
__storage_key_init_range(start, end); __storage_key_init_range(start, end);
set_bit(PG_arch_1, &page->flags); set_bit(PG_arch_1, &page->flags);
return 0; return 0;

View File

@@ -146,7 +146,7 @@ static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste)
} }
if (!test_and_set_bit(PG_arch_1, &page->flags)) if (!test_and_set_bit(PG_arch_1, &page->flags))
__storage_key_init_range(paddr, paddr + size - 1); __storage_key_init_range(paddr, paddr + size);
} }
void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,

View File

@@ -47,17 +47,12 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
if (OPCODE_RTE(opcode)) if (OPCODE_RTE(opcode))
return -EFAULT; /* Bad breakpoint */ return -EFAULT; /* Bad breakpoint */
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = opcode; p->opcode = opcode;
return 0; return 0;
} }
void __kprobes arch_copy_kprobe(struct kprobe *p)
{
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = *p->addr;
}
void __kprobes arch_arm_kprobe(struct kprobe *p) void __kprobes arch_arm_kprobe(struct kprobe *p)
{ {
*p->addr = BREAKPOINT_INSTRUCTION; *p->addr = BREAKPOINT_INSTRUCTION;

View File

@@ -36,7 +36,8 @@
*/ */
/* /*
* asmlinkage __wsum csum_partial(const void *buf, int len, __wsum sum); * unsigned int csum_partial(const unsigned char *buf, int len,
* unsigned int sum);
*/ */
.text .text
@@ -48,31 +49,11 @@ ENTRY(csum_partial)
* Fortunately, it is easy to convert 2-byte alignment to 4-byte * Fortunately, it is easy to convert 2-byte alignment to 4-byte
* alignment for the unrolled loop. * alignment for the unrolled loop.
*/ */
mov r5, r1
mov r4, r0 mov r4, r0
tst #3, r0 ! Check alignment. tst #2, r0 ! Check alignment.
bt/s 2f ! Jump if alignment is ok. bt 2f ! Jump if alignment is ok.
mov r4, r7 ! Keep a copy to check for alignment
! !
tst #1, r0 ! Check alignment.
bt 21f ! Jump if alignment is boundary of 2bytes.
! buf is odd
tst r5, r5
add #-1, r5
bt 9f
mov.b @r4+, r0
extu.b r0, r0
addc r0, r6 ! t=0 from previous tst
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
mov r4, r0
tst #2, r0
bt 2f
21:
! buf is 2 byte aligned (len could be 0)
add #-2, r5 ! Alignment uses up two bytes. add #-2, r5 ! Alignment uses up two bytes.
cmp/pz r5 ! cmp/pz r5 !
bt/s 1f ! Jump if we had at least two bytes. bt/s 1f ! Jump if we had at least two bytes.
@@ -80,17 +61,16 @@ ENTRY(csum_partial)
bra 6f bra 6f
add #2, r5 ! r5 was < 2. Deal with it. add #2, r5 ! r5 was < 2. Deal with it.
1: 1:
mov r5, r1 ! Save new len for later use.
mov.w @r4+, r0 mov.w @r4+, r0
extu.w r0, r0 extu.w r0, r0
addc r0, r6 addc r0, r6
bf 2f bf 2f
add #1, r6 add #1, r6
2: 2:
! buf is 4 byte aligned (len could be 0)
mov r5, r1
mov #-5, r0 mov #-5, r0
shld r0, r1 shld r0, r5
tst r1, r1 tst r5, r5
bt/s 4f ! if it's =0, go to 4f bt/s 4f ! if it's =0, go to 4f
clrt clrt
.align 2 .align 2
@@ -112,31 +92,30 @@ ENTRY(csum_partial)
addc r0, r6 addc r0, r6
addc r2, r6 addc r2, r6
movt r0 movt r0
dt r1 dt r5
bf/s 3b bf/s 3b
cmp/eq #1, r0 cmp/eq #1, r0
! here, we know r1==0 ! here, we know r5==0
addc r1, r6 ! add carry to r6 addc r5, r6 ! add carry to r6
4: 4:
mov r5, r0 mov r1, r0
and #0x1c, r0 and #0x1c, r0
tst r0, r0 tst r0, r0
bt 6f bt/s 6f
! 4 bytes or more remaining mov r0, r5
mov r0, r1 shlr2 r5
shlr2 r1
mov #0, r2 mov #0, r2
5: 5:
addc r2, r6 addc r2, r6
mov.l @r4+, r2 mov.l @r4+, r2
movt r0 movt r0
dt r1 dt r5
bf/s 5b bf/s 5b
cmp/eq #1, r0 cmp/eq #1, r0
addc r2, r6 addc r2, r6
addc r1, r6 ! r1==0 here, so it means add carry-bit addc r5, r6 ! r5==0 here, so it means add carry-bit
6: 6:
! 3 bytes or less remaining mov r1, r5
mov #3, r0 mov #3, r0
and r0, r5 and r0, r5
tst r5, r5 tst r5, r5
@@ -162,16 +141,6 @@ ENTRY(csum_partial)
mov #0, r0 mov #0, r0
addc r0, r6 addc r0, r6
9: 9:
! Check if the buffer was misaligned, if so realign sum
mov r7, r0
tst #1, r0
bt 10f
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
10:
rts rts
mov r6, r0 mov r6, r0

View File

@@ -6,38 +6,23 @@
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <asm-generic/compat.h>
#define COMPAT_USER_HZ 100 #define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "sparc\0\0" #define COMPAT_UTS_MACHINE "sparc\0\0"
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_clock_t;
typedef s32 compat_pid_t;
typedef u16 __compat_uid_t; typedef u16 __compat_uid_t;
typedef u16 __compat_gid_t; typedef u16 __compat_gid_t;
typedef u32 __compat_uid32_t; typedef u32 __compat_uid32_t;
typedef u32 __compat_gid32_t; typedef u32 __compat_gid32_t;
typedef u16 compat_mode_t; typedef u16 compat_mode_t;
typedef u32 compat_ino_t;
typedef u16 compat_dev_t; typedef u16 compat_dev_t;
typedef s32 compat_off_t;
typedef s64 compat_loff_t;
typedef s16 compat_nlink_t; typedef s16 compat_nlink_t;
typedef u16 compat_ipc_pid_t; typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t; typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_key_t;
typedef s32 compat_timer_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 compat_s64; typedef s64 compat_s64;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u64 compat_u64; typedef u64 compat_u64;
typedef u32 compat_uptr_t;
struct compat_stat { struct compat_stat {
compat_dev_t st_dev; compat_dev_t st_dev;
compat_ino_t st_ino; compat_ino_t st_ino;

View File

@@ -47,7 +47,6 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask);
int hard_smp_processor_id(void); int hard_smp_processor_id(void);
#define raw_smp_processor_id() (current_thread_info()->cpu) #define raw_smp_processor_id() (current_thread_info()->cpu)
void smp_fill_in_cpu_possible_map(void);
void smp_fill_in_sib_core_maps(void); void smp_fill_in_sib_core_maps(void);
void cpu_play_dead(void); void cpu_play_dead(void);
@@ -77,7 +76,6 @@ void __cpu_die(unsigned int cpu);
#define smp_fill_in_sib_core_maps() do { } while (0) #define smp_fill_in_sib_core_maps() do { } while (0)
#define smp_fetch_global_regs() do { } while (0) #define smp_fetch_global_regs() do { } while (0)
#define smp_fetch_global_pmu() do { } while (0) #define smp_fetch_global_pmu() do { } while (0)
#define smp_fill_in_cpu_possible_map() do { } while (0)
#define smp_init_cpu_poke() do { } while (0) #define smp_init_cpu_poke() do { } while (0)
#define scheduler_poke() do { } while (0) #define scheduler_poke() do { } while (0)

View File

@@ -13,16 +13,6 @@ typedef unsigned int tcflag_t;
typedef unsigned long tcflag_t; typedef unsigned long tcflag_t;
#endif #endif
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#define NCCS 17 #define NCCS 17
struct termios { struct termios {
tcflag_t c_iflag; /* input mode flags */ tcflag_t c_iflag; /* input mode flags */

View File

@@ -40,5 +40,14 @@ struct winsize {
unsigned short ws_ypixel; unsigned short ws_ypixel;
}; };
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#endif /* _UAPI_SPARC_TERMIOS_H */ #endif /* _UAPI_SPARC_TERMIOS_H */

View File

@@ -479,7 +479,9 @@ static void *record_one_cpu(struct device_node *dp, int cpuid, int arg)
ncpus_probed++; ncpus_probed++;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
set_cpu_present(cpuid, true); set_cpu_present(cpuid, true);
set_cpu_possible(cpuid, true);
if (num_possible_cpus() < nr_cpu_ids)
set_cpu_possible(cpuid, true);
#endif #endif
return NULL; return NULL;
} }

View File

@@ -690,7 +690,6 @@ void __init setup_arch(char **cmdline_p)
paging_init(); paging_init();
init_sparc64_elf_hwcap(); init_sparc64_elf_hwcap();
smp_fill_in_cpu_possible_map();
/* /*
* Once the OF device tree and MDESC have been setup and nr_cpus has * Once the OF device tree and MDESC have been setup and nr_cpus has
* been parsed, we know the list of possible cpus. Therefore we can * been parsed, we know the list of possible cpus. Therefore we can

View File

@@ -1213,20 +1213,6 @@ void __init smp_setup_processor_id(void)
xcall_deliver_impl = hypervisor_xcall_deliver; xcall_deliver_impl = hypervisor_xcall_deliver;
} }
void __init smp_fill_in_cpu_possible_map(void)
{
int possible_cpus = num_possible_cpus();
int i;
if (possible_cpus > nr_cpu_ids)
possible_cpus = nr_cpu_ids;
for (i = 0; i < possible_cpus; i++)
set_cpu_possible(i, true);
for (; i < NR_CPUS; i++)
set_cpu_possible(i, false);
}
void smp_fill_in_sib_core_maps(void) void smp_fill_in_sib_core_maps(void)
{ {
unsigned int i; unsigned int i;

View File

@@ -683,24 +683,26 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port,
goto cleanup; goto cleanup;
} }
*winch = ((struct winch) { .list = LIST_HEAD_INIT(winch->list), *winch = ((struct winch) { .fd = fd,
.fd = fd,
.tty_fd = tty_fd, .tty_fd = tty_fd,
.pid = pid, .pid = pid,
.port = port, .port = port,
.stack = stack }); .stack = stack });
spin_lock(&winch_handler_lock);
list_add(&winch->list, &winch_handlers);
spin_unlock(&winch_handler_lock);
if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
IRQF_SHARED, "winch", winch) < 0) { IRQF_SHARED, "winch", winch) < 0) {
printk(KERN_ERR "register_winch_irq - failed to register " printk(KERN_ERR "register_winch_irq - failed to register "
"IRQ\n"); "IRQ\n");
spin_lock(&winch_handler_lock);
list_del(&winch->list);
spin_unlock(&winch_handler_lock);
goto out_free; goto out_free;
} }
spin_lock(&winch_handler_lock);
list_add(&winch->list, &winch_handlers);
spin_unlock(&winch_handler_lock);
return; return;
out_free: out_free:

View File

@@ -1135,7 +1135,7 @@ static int __init ubd_init(void)
if (irq_req_buffer == NULL) { if (irq_req_buffer == NULL) {
printk(KERN_ERR "Failed to initialize ubd buffering\n"); printk(KERN_ERR "Failed to initialize ubd buffering\n");
return -1; return -ENOMEM;
} }
io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE, io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE,
sizeof(struct io_thread_req *), sizeof(struct io_thread_req *),
@@ -1146,7 +1146,7 @@ static int __init ubd_init(void)
if (io_req_buffer == NULL) { if (io_req_buffer == NULL) {
printk(KERN_ERR "Failed to initialize ubd buffering\n"); printk(KERN_ERR "Failed to initialize ubd buffering\n");
return -1; return -ENOMEM;
} }
platform_driver_register(&ubd_driver); platform_driver_register(&ubd_driver);
mutex_lock(&ubd_lock); mutex_lock(&ubd_lock);

View File

@@ -15,8 +15,6 @@ typedef struct mm_context {
struct page *stub_pages[2]; struct page *stub_pages[2];
} mm_context_t; } mm_context_t;
extern void __switch_mm(struct mm_id * mm_idp);
/* Avoid tangled inclusion with asm/ldt.h */ /* Avoid tangled inclusion with asm/ldt.h */
extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm); extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm);
extern void free_ldt(struct mm_context *mm); extern void free_ldt(struct mm_context *mm);

View File

@@ -14,4 +14,6 @@ struct mm_id {
unsigned long stack; unsigned long stack;
}; };
void __switch_mm(struct mm_id *mm_idp);
#endif #endif

View File

@@ -376,6 +376,7 @@ config UNWINDER_ORC
config UNWINDER_FRAME_POINTER config UNWINDER_FRAME_POINTER
bool "Frame pointer unwinder" bool "Frame pointer unwinder"
select ARCH_WANT_FRAME_POINTERS
select FRAME_POINTER select FRAME_POINTER
---help--- ---help---
This option enables the frame pointer unwinder for unwinding kernel This option enables the frame pointer unwinder for unwinding kernel
@@ -403,7 +404,3 @@ config UNWINDER_GUESS
overhead. overhead.
endchoice endchoice
config FRAME_POINTER
depends on !UNWINDER_ORC && !UNWINDER_GUESS
bool

View File

@@ -11,6 +11,7 @@
#include <asm/mpspec.h> #include <asm/mpspec.h>
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/io.h>
#define ARCH_APICTIMER_STOPS_ON_C3 1 #define ARCH_APICTIMER_STOPS_ON_C3 1
@@ -110,7 +111,7 @@ static inline void native_apic_mem_write(u32 reg, u32 v)
static inline u32 native_apic_mem_read(u32 reg) static inline u32 native_apic_mem_read(u32 reg)
{ {
return *((volatile u32 *)(APIC_BASE + reg)); return readl((void __iomem *)(APIC_BASE + reg));
} }
extern void native_apic_wait_icr_idle(void); extern void native_apic_wait_icr_idle(void);

View File

@@ -12,38 +12,23 @@
#include <asm/user32.h> #include <asm/user32.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm-generic/compat.h>
#define COMPAT_USER_HZ 100 #define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "i686\0\0" #define COMPAT_UTS_MACHINE "i686\0\0"
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_clock_t;
typedef s32 compat_pid_t;
typedef u16 __compat_uid_t; typedef u16 __compat_uid_t;
typedef u16 __compat_gid_t; typedef u16 __compat_gid_t;
typedef u32 __compat_uid32_t; typedef u32 __compat_uid32_t;
typedef u32 __compat_gid32_t; typedef u32 __compat_gid32_t;
typedef u16 compat_mode_t; typedef u16 compat_mode_t;
typedef u32 compat_ino_t;
typedef u16 compat_dev_t; typedef u16 compat_dev_t;
typedef s32 compat_off_t;
typedef s64 compat_loff_t;
typedef u16 compat_nlink_t; typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t; typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t; typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_timer_t;
typedef s32 compat_key_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef s64 __attribute__((aligned(4))) compat_s64; typedef s64 __attribute__((aligned(4))) compat_s64;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
typedef u32 compat_u32;
typedef u64 __attribute__((aligned(4))) compat_u64; typedef u64 __attribute__((aligned(4))) compat_u64;
typedef u32 compat_uptr_t;
struct compat_stat { struct compat_stat {
u32 st_dev; u32 st_dev;

View File

@@ -145,7 +145,14 @@ static int __amd_smn_rw(u16 node, u32 address, u32 *value, bool write)
int amd_smn_read(u16 node, u32 address, u32 *value) int amd_smn_read(u16 node, u32 address, u32 *value)
{ {
return __amd_smn_rw(node, address, value, false); int err = __amd_smn_rw(node, address, value, false);
if (PCI_POSSIBLE_ERROR(*value)) {
err = -ENODEV;
*value = 0;
}
return err;
} }
EXPORT_SYMBOL_GPL(amd_smn_read); EXPORT_SYMBOL_GPL(amd_smn_read);

View File

@@ -915,7 +915,8 @@ static void __send_cleanup_vector(struct apic_chip_data *apicd)
hlist_add_head(&apicd->clist, per_cpu_ptr(&cleanup_list, cpu)); hlist_add_head(&apicd->clist, per_cpu_ptr(&cleanup_list, cpu));
apic->send_IPI(cpu, IRQ_MOVE_CLEANUP_VECTOR); apic->send_IPI(cpu, IRQ_MOVE_CLEANUP_VECTOR);
} else { } else {
apicd->prev_vector = 0; pr_warn("IRQ %u schedule cleanup for offline CPU %u\n", apicd->irq, cpu);
free_moved_vector(apicd);
} }
raw_spin_unlock(&vector_lock); raw_spin_unlock(&vector_lock);
} }
@@ -951,6 +952,7 @@ void irq_complete_move(struct irq_cfg *cfg)
*/ */
void irq_force_complete_move(struct irq_desc *desc) void irq_force_complete_move(struct irq_desc *desc)
{ {
unsigned int cpu = smp_processor_id();
struct apic_chip_data *apicd; struct apic_chip_data *apicd;
struct irq_data *irqd; struct irq_data *irqd;
unsigned int vector; unsigned int vector;
@@ -975,10 +977,11 @@ void irq_force_complete_move(struct irq_desc *desc)
goto unlock; goto unlock;
/* /*
* If prev_vector is empty, no action required. * If prev_vector is empty or the descriptor is neither currently
* nor previously on the outgoing CPU no action required.
*/ */
vector = apicd->prev_vector; vector = apicd->prev_vector;
if (!vector) if (!vector || (apicd->cpu != cpu && apicd->prev_cpu != cpu))
goto unlock; goto unlock;
/* /*

View File

@@ -26,26 +26,7 @@
unsigned long profile_pc(struct pt_regs *regs) unsigned long profile_pc(struct pt_regs *regs)
{ {
unsigned long pc = instruction_pointer(regs); return instruction_pointer(regs);
if (!user_mode(regs) && in_lock_functions(pc)) {
#ifdef CONFIG_FRAME_POINTER
return *(unsigned long *)(regs->bp + sizeof(long));
#else
unsigned long *sp =
(unsigned long *)kernel_stack_pointer(regs);
/*
* Return address is either directly at stack pointer
* or above a saved flags. Eflags has bits 22-31 zero,
* kernel addresses don't.
*/
if (sp[0] >> 22)
return sp[0];
if (sp[1] >> 22)
return sp[1];
#endif
}
return pc;
} }
EXPORT_SYMBOL(profile_pc); EXPORT_SYMBOL(profile_pc);

View File

@@ -151,11 +151,9 @@ bool tsc_store_and_check_tsc_adjust(bool bootcpu)
cur->warned = false; cur->warned = false;
/* /*
* If a non-zero TSC value for socket 0 may be valid then the default * The default adjust value cannot be assumed to be zero on any socket.
* adjusted value cannot assumed to be zero either.
*/ */
if (tsc_async_resets) cur->adjusted = bootval;
cur->adjusted = bootval;
/* /*
* Check whether this CPU is the first in a package to come up. In * Check whether this CPU is the first in a package to come up. In

View File

@@ -148,7 +148,7 @@ AVXcode:
65: SEG=GS (Prefix) 65: SEG=GS (Prefix)
66: Operand-Size (Prefix) 66: Operand-Size (Prefix)
67: Address-Size (Prefix) 67: Address-Size (Prefix)
68: PUSH Iz (d64) 68: PUSH Iz
69: IMUL Gv,Ev,Iz 69: IMUL Gv,Ev,Iz
6a: PUSH Ib (d64) 6a: PUSH Ib (d64)
6b: IMUL Gv,Ev,Ib 6b: IMUL Gv,Ev,Ib

View File

@@ -30,7 +30,8 @@ KCOV_INSTRUMENT := n
# make up the standalone purgatory.ro # make up the standalone purgatory.ro
PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel
PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss -g0 PURGATORY_CFLAGS := -mcmodel=small -ffreestanding -fno-zero-initialized-in-bss -g0
PURGATORY_CFLAGS += -fpic -fvisibility=hidden
PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING
# Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That

View File

@@ -673,6 +673,15 @@ static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) { if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) {
continue; continue;
} }
/*
* Do not perform relocations in .notes sections; any
* values there are meant for pre-boot consumption (e.g.
* startup_xen).
*/
if (sec_applies->shdr.sh_type == SHT_NOTE)
continue;
sh_symtab = sec_symtab->symtab; sh_symtab = sec_symtab->symtab;
sym_strtab = sec_symtab->link->strtab; sym_strtab = sec_symtab->link->strtab;
for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {

View File

@@ -236,7 +236,6 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
} }
if (!strcmp(q->cra_driver_name, alg->cra_name) || if (!strcmp(q->cra_driver_name, alg->cra_name) ||
!strcmp(q->cra_driver_name, alg->cra_driver_name) ||
!strcmp(q->cra_name, alg->cra_driver_name)) !strcmp(q->cra_name, alg->cra_driver_name))
goto err; goto err;
} }

View File

@@ -5,6 +5,7 @@
ccflags-y := -D_LINUX -DBUILDING_ACPICA ccflags-y := -D_LINUX -DBUILDING_ACPICA
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
CFLAGS_tbfind.o += $(call cc-disable-warning, stringop-truncation)
# use acpi.o to put all files here into acpi.o modparam namespace # use acpi.o to put all files here into acpi.o modparam namespace
obj-y += acpi.o obj-y += acpi.o

View File

@@ -43,7 +43,6 @@ acpi_ex_system_memory_space_handler(u32 function,
struct acpi_mem_space_context *mem_info = region_context; struct acpi_mem_space_context *mem_info = region_context;
u32 length; u32 length;
acpi_size map_length; acpi_size map_length;
acpi_size page_boundary_map_length;
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
u32 remainder; u32 remainder;
#endif #endif
@@ -120,26 +119,8 @@ acpi_ex_system_memory_space_handler(u32 function,
map_length = (acpi_size) map_length = (acpi_size)
((mem_info->address + mem_info->length) - address); ((mem_info->address + mem_info->length) - address);
/* if (map_length > ACPI_DEFAULT_PAGE_SIZE)
* If mapping the entire remaining portion of the region will cross map_length = ACPI_DEFAULT_PAGE_SIZE;
* a page boundary, just map up to the page boundary, do not cross.
* On some systems, crossing a page boundary while mapping regions
* can cause warnings if the pages have different attributes
* due to resource management.
*
* This has the added benefit of constraining a single mapping to
* one page, which is similar to the original code that used a 4k
* maximum window.
*/
page_boundary_map_length = (acpi_size)
(ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address);
if (page_boundary_map_length == 0) {
page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
}
if (map_length > page_boundary_map_length) {
map_length = page_boundary_map_length;
}
/* Create a new mapping starting at the address given */ /* Create a new mapping starting at the address given */

View File

@@ -519,7 +519,7 @@ struct binder_proc {
struct list_head todo; struct list_head todo;
struct binder_stats stats; struct binder_stats stats;
struct list_head delivered_death; struct list_head delivered_death;
int max_threads; u32 max_threads;
int requested_threads; int requested_threads;
int requested_threads_started; int requested_threads_started;
int tmp_ref; int tmp_ref;
@@ -5034,7 +5034,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
goto err; goto err;
break; break;
case BINDER_SET_MAX_THREADS: { case BINDER_SET_MAX_THREADS: {
int max_threads; u32 max_threads;
if (copy_from_user(&max_threads, ubuf, if (copy_from_user(&max_threads, ubuf,
sizeof(max_threads))) { sizeof(max_threads))) {

View File

@@ -6212,8 +6212,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
if (!host) if (!host)
return NULL; return NULL;
if (!devres_open_group(dev, NULL, GFP_KERNEL)) if (!devres_open_group(dev, NULL, GFP_KERNEL)) {
goto err_free; kfree(host);
return NULL;
}
dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL); dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL);
if (!dr) if (!dr)
@@ -6245,8 +6247,6 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
err_out: err_out:
devres_release_group(dev, NULL); devres_release_group(dev, NULL);
err_free:
kfree(host);
return NULL; return NULL;
} }

View File

@@ -128,8 +128,6 @@ static int legacy_port[NR_HOST] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
static struct legacy_probe probe_list[NR_HOST]; static struct legacy_probe probe_list[NR_HOST];
static struct legacy_data legacy_data[NR_HOST]; static struct legacy_data legacy_data[NR_HOST];
static struct ata_host *legacy_host[NR_HOST]; static struct ata_host *legacy_host[NR_HOST];
static int nr_legacy_host;
static int probe_all; /* Set to check all ISA port ranges */ static int probe_all; /* Set to check all ISA port ranges */
static int ht6560a; /* HT 6560A on primary 1, second 2, both 3 */ static int ht6560a; /* HT 6560A on primary 1, second 2, both 3 */
@@ -1253,9 +1251,11 @@ static __exit void legacy_exit(void)
{ {
int i; int i;
for (i = 0; i < nr_legacy_host; i++) { for (i = 0; i < NR_HOST; i++) {
struct legacy_data *ld = &legacy_data[i]; struct legacy_data *ld = &legacy_data[i];
ata_host_detach(legacy_host[i]);
if (legacy_host[i])
ata_host_detach(legacy_host[i]);
platform_device_unregister(ld->platform_dev); platform_device_unregister(ld->platform_dev);
} }
} }

View File

@@ -200,7 +200,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
pclk = sg->sata0_pclk; pclk = sg->sata0_pclk;
else else
pclk = sg->sata1_pclk; pclk = sg->sata1_pclk;
clk_enable(pclk); ret = clk_enable(pclk);
if (ret)
return ret;
msleep(10); msleep(10);
/* Do not keep clocking a bridge that is not online */ /* Do not keep clocking a bridge that is not online */

View File

@@ -1684,8 +1684,11 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr,
if (!env) if (!env)
return -ENOMEM; return -ENOMEM;
/* Synchronize with really_probe() */
device_lock(dev);
/* let the kset specific function add its keys */ /* let the kset specific function add its keys */
retval = kset->uevent_ops->uevent(kset, &dev->kobj, env); retval = kset->uevent_ops->uevent(kset, &dev->kobj, env);
device_unlock(dev);
if (retval) if (retval)
goto out; goto out;

View File

@@ -1967,10 +1967,13 @@ static void __exit null_exit(void)
if (g_queue_mode == NULL_Q_MQ && shared_tags) if (g_queue_mode == NULL_Q_MQ && shared_tags)
blk_mq_free_tag_set(&tag_set); blk_mq_free_tag_set(&tag_set);
mutex_destroy(&lock);
} }
module_init(null_init); module_init(null_init);
module_exit(null_exit); module_exit(null_exit);
MODULE_AUTHOR("Jens Axboe <axboe@kernel.dk>"); MODULE_AUTHOR("Jens Axboe <axboe@kernel.dk>");
MODULE_DESCRIPTION("multi queue aware block test driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@@ -307,8 +307,13 @@ hpet_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
if (!devp->hd_ireqfreq) if (!devp->hd_ireqfreq)
return -EIO; return -EIO;
if (count < sizeof(unsigned long)) if (in_compat_syscall()) {
return -EINVAL; if (count < sizeof(compat_ulong_t))
return -EINVAL;
} else {
if (count < sizeof(unsigned long))
return -EINVAL;
}
add_wait_queue(&devp->hd_waitqueue, &wait); add_wait_queue(&devp->hd_waitqueue, &wait);
@@ -332,9 +337,16 @@ hpet_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
schedule(); schedule();
} }
retval = put_user(data, (unsigned long __user *)buf); if (in_compat_syscall()) {
if (!retval) retval = put_user(data, (compat_ulong_t __user *)buf);
retval = sizeof(unsigned long); if (!retval)
retval = sizeof(compat_ulong_t);
} else {
retval = put_user(data, (unsigned long __user *)buf);
if (!retval)
retval = sizeof(unsigned long);
}
out: out:
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
remove_wait_queue(&devp->hd_waitqueue, &wait); remove_wait_queue(&devp->hd_waitqueue, &wait);
@@ -689,12 +701,24 @@ struct compat_hpet_info {
unsigned short hi_timer; unsigned short hi_timer;
}; };
/* 32-bit types would lead to different command codes which should be
* translated into 64-bit ones before passed to hpet_ioctl_common
*/
#define COMPAT_HPET_INFO _IOR('h', 0x03, struct compat_hpet_info)
#define COMPAT_HPET_IRQFREQ _IOW('h', 0x6, compat_ulong_t)
static long static long
hpet_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) hpet_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
struct hpet_info info; struct hpet_info info;
int err; int err;
if (cmd == COMPAT_HPET_INFO)
cmd = HPET_INFO;
if (cmd == COMPAT_HPET_IRQFREQ)
cmd = HPET_IRQFREQ;
mutex_lock(&hpet_mutex); mutex_lock(&hpet_mutex);
err = hpet_ioctl_common(file->private_data, cmd, arg, &info); err = hpet_ioctl_common(file->private_data, cmd, arg, &info);
mutex_unlock(&hpet_mutex); mutex_unlock(&hpet_mutex);

View File

@@ -300,28 +300,35 @@ static int register_device(int minor, struct pp_struct *pp)
if (!port) { if (!port) {
pr_warn("%s: no associated port!\n", name); pr_warn("%s: no associated port!\n", name);
rc = -ENXIO; rc = -ENXIO;
goto err; goto err_free_name;
}
index = ida_alloc(&ida_index, GFP_KERNEL);
if (index < 0) {
pr_warn("%s: failed to get index!\n", name);
rc = index;
goto err_put_port;
} }
index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
memset(&ppdev_cb, 0, sizeof(ppdev_cb)); memset(&ppdev_cb, 0, sizeof(ppdev_cb));
ppdev_cb.irq_func = pp_irq; ppdev_cb.irq_func = pp_irq;
ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0; ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0;
ppdev_cb.private = pp; ppdev_cb.private = pp;
pdev = parport_register_dev_model(port, name, &ppdev_cb, index); pdev = parport_register_dev_model(port, name, &ppdev_cb, index);
parport_put_port(port);
if (!pdev) { if (!pdev) {
pr_warn("%s: failed to register device!\n", name); pr_warn("%s: failed to register device!\n", name);
rc = -ENXIO; rc = -ENXIO;
ida_simple_remove(&ida_index, index); ida_free(&ida_index, index);
goto err; goto err_put_port;
} }
pp->pdev = pdev; pp->pdev = pdev;
pp->index = index; pp->index = index;
dev_dbg(&pdev->dev, "registered pardevice\n"); dev_dbg(&pdev->dev, "registered pardevice\n");
err: err_put_port:
parport_put_port(port);
err_free_name:
kfree(name); kfree(name);
return rc; return rc;
} }
@@ -766,7 +773,7 @@ static int pp_release(struct inode *inode, struct file *file)
if (pp->pdev) { if (pp->pdev) {
parport_unregister_device(pp->pdev); parport_unregister_device(pp->pdev);
ida_simple_remove(&ida_index, pp->index); ida_free(&ida_index, pp->index);
pp->pdev = NULL; pp->pdev = NULL;
pr_debug(CHRDEV "%x: unregistered pardevice\n", minor); pr_debug(CHRDEV "%x: unregistered pardevice\n", minor);
} }

View File

@@ -3,8 +3,6 @@ menu "CPU Idle"
config CPU_IDLE config CPU_IDLE
bool "CPU idle PM support" bool "CPU idle PM support"
default y if ACPI || PPC_PSERIES default y if ACPI || PPC_PSERIES
select CPU_IDLE_GOV_LADDER if (!NO_HZ && !NO_HZ_IDLE)
select CPU_IDLE_GOV_MENU if (NO_HZ || NO_HZ_IDLE)
help help
CPU idle is a generic framework for supporting software-controlled CPU idle is a generic framework for supporting software-controlled
idle processor power management. It includes modular cross-platform idle processor power management. It includes modular cross-platform

View File

@@ -506,7 +506,7 @@ static void spu2_dump_omd(u8 *omd, u16 hash_key_len, u16 ciph_key_len,
if (hash_iv_len) { if (hash_iv_len) {
packet_log(" Hash IV Length %u bytes\n", hash_iv_len); packet_log(" Hash IV Length %u bytes\n", hash_iv_len);
packet_dump(" hash IV: ", ptr, hash_iv_len); packet_dump(" hash IV: ", ptr, hash_iv_len);
ptr += ciph_key_len; ptr += hash_iv_len;
} }
if (ciph_iv_len) { if (ciph_iv_len) {

View File

@@ -33,30 +33,47 @@ struct sp_platform {
unsigned int irq_count; unsigned int irq_count;
}; };
static const struct acpi_device_id sp_acpi_match[]; static const struct sp_dev_vdata dev_vdata[] = {
static const struct of_device_id sp_of_match[]; {
.bar = 0,
#ifdef CONFIG_CRYPTO_DEV_SP_CCP
.ccp_vdata = &ccpv3_platform,
#endif
},
};
static const struct acpi_device_id sp_acpi_match[] = {
{ "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(acpi, sp_acpi_match);
static const struct of_device_id sp_of_match[] = {
{ .compatible = "amd,ccp-seattle-v1a",
.data = (const void *)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(of, sp_of_match);
static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev) static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev)
{ {
#ifdef CONFIG_OF
const struct of_device_id *match; const struct of_device_id *match;
match = of_match_node(sp_of_match, pdev->dev.of_node); match = of_match_node(sp_of_match, pdev->dev.of_node);
if (match && match->data) if (match && match->data)
return (struct sp_dev_vdata *)match->data; return (struct sp_dev_vdata *)match->data;
#endif
return NULL; return NULL;
} }
static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev) static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev)
{ {
#ifdef CONFIG_ACPI
const struct acpi_device_id *match; const struct acpi_device_id *match;
match = acpi_match_device(sp_acpi_match, &pdev->dev); match = acpi_match_device(sp_acpi_match, &pdev->dev);
if (match && match->driver_data) if (match && match->driver_data)
return (struct sp_dev_vdata *)match->driver_data; return (struct sp_dev_vdata *)match->driver_data;
#endif
return NULL; return NULL;
} }
@@ -201,41 +218,11 @@ static int sp_platform_resume(struct platform_device *pdev)
} }
#endif #endif
static const struct sp_dev_vdata dev_vdata[] = {
{
.bar = 0,
#ifdef CONFIG_CRYPTO_DEV_SP_CCP
.ccp_vdata = &ccpv3_platform,
#endif
},
};
#ifdef CONFIG_ACPI
static const struct acpi_device_id sp_acpi_match[] = {
{ "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(acpi, sp_acpi_match);
#endif
#ifdef CONFIG_OF
static const struct of_device_id sp_of_match[] = {
{ .compatible = "amd,ccp-seattle-v1a",
.data = (const void *)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(of, sp_of_match);
#endif
static struct platform_driver sp_platform_driver = { static struct platform_driver sp_platform_driver = {
.driver = { .driver = {
.name = "ccp", .name = "ccp",
#ifdef CONFIG_ACPI
.acpi_match_table = sp_acpi_match, .acpi_match_table = sp_acpi_match,
#endif
#ifdef CONFIG_OF
.of_match_table = sp_of_match, .of_match_table = sp_of_match,
#endif
}, },
.probe = sp_platform_probe, .probe = sp_platform_probe,
.remove = sp_platform_remove, .remove = sp_platform_remove,

View File

@@ -4875,7 +4875,7 @@ static int select_mode(struct qce_device *pce_dev,
pce_dev->intr_cadence = 0; pce_dev->intr_cadence = 0;
atomic_set(&pce_dev->bunch_cmd_seq, 0); atomic_set(&pce_dev->bunch_cmd_seq, 0);
atomic_set(&pce_dev->last_intr_seq, 0); atomic_set(&pce_dev->last_intr_seq, 0);
pce_dev->cadence_flag = ~pce_dev->cadence_flag; pce_dev->cadence_flag = !pce_dev->cadence_flag;
} }
} }

View File

@@ -80,14 +80,14 @@ static dev_t qcedev_device_no;
static struct class *driver_class; static struct class *driver_class;
static struct device *class_dev; static struct device *class_dev;
MODULE_DEVICE_TABLE(of, qcedev_match);
static const struct of_device_id qcedev_match[] = { static const struct of_device_id qcedev_match[] = {
{ .compatible = "qcom,qcedev"}, { .compatible = "qcom,qcedev"},
{ .compatible = "qcom,qcedev,context-bank"}, { .compatible = "qcom,qcedev,context-bank"},
{} {}
}; };
MODULE_DEVICE_TABLE(of, qcedev_match);
static uint32_t qcedev_get_block_size(enum qcedev_sha_alg_enum alg) static uint32_t qcedev_get_block_size(enum qcedev_sha_alg_enum alg)
{ {
switch (alg) { switch (alg) {
@@ -1876,6 +1876,7 @@ static inline long qcedev_ioctl(struct file *file,
err = -ENOTTY; err = -ENOTTY;
goto exit_free_qcedev_areq; goto exit_free_qcedev_areq;
} }
/* Fall-through */
case QCEDEV_IOCTL_SHA_UPDATE_REQ: case QCEDEV_IOCTL_SHA_UPDATE_REQ:
{ {
struct scatterlist sg_src; struct scatterlist sg_src;
@@ -1926,10 +1927,11 @@ static inline long qcedev_ioctl(struct file *file,
handle->sha_ctxt.diglen); handle->sha_ctxt.diglen);
mutex_unlock(&hash_access_lock); mutex_unlock(&hash_access_lock);
if (copy_to_user((void __user *)arg, &qcedev_areq->sha_op_req, if (copy_to_user((void __user *)arg, &qcedev_areq->sha_op_req,
sizeof(struct qcedev_sha_op_req))) sizeof(struct qcedev_sha_op_req))) {
err = -EFAULT; err = -EFAULT;
goto exit_free_qcedev_areq; goto exit_free_qcedev_areq;
} }
}
break; break;
case QCEDEV_IOCTL_SHA_FINAL_REQ: case QCEDEV_IOCTL_SHA_FINAL_REQ:
@@ -2018,10 +2020,11 @@ static inline long qcedev_ioctl(struct file *file,
handle->sha_ctxt.diglen); handle->sha_ctxt.diglen);
mutex_unlock(&hash_access_lock); mutex_unlock(&hash_access_lock);
if (copy_to_user((void __user *)arg, &qcedev_areq->sha_op_req, if (copy_to_user((void __user *)arg, &qcedev_areq->sha_op_req,
sizeof(struct qcedev_sha_op_req))) sizeof(struct qcedev_sha_op_req))) {
err = -EFAULT; err = -EFAULT;
goto exit_free_qcedev_areq; goto exit_free_qcedev_areq;
} }
}
break; break;
case QCEDEV_IOCTL_MAP_BUF_REQ: case QCEDEV_IOCTL_MAP_BUF_REQ:

View File

@@ -139,8 +139,7 @@ static void adf_device_reset_worker(struct work_struct *work)
if (adf_dev_init(accel_dev) || adf_dev_start(accel_dev)) { if (adf_dev_init(accel_dev) || adf_dev_start(accel_dev)) {
/* The device hanged and we can't restart it so stop here */ /* The device hanged and we can't restart it so stop here */
dev_err(&GET_DEV(accel_dev), "Restart device failed\n"); dev_err(&GET_DEV(accel_dev), "Restart device failed\n");
if (reset_data->mode == ADF_DEV_RESET_ASYNC || if (reset_data->mode == ADF_DEV_RESET_ASYNC)
completion_done(&reset_data->compl))
kfree(reset_data); kfree(reset_data);
WARN(1, "QAT: device restart failed. Device is unusable\n"); WARN(1, "QAT: device restart failed. Device is unusable\n");
return; return;
@@ -148,16 +147,8 @@ static void adf_device_reset_worker(struct work_struct *work)
adf_dev_restarted_notify(accel_dev); adf_dev_restarted_notify(accel_dev);
clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status); clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
/* /* The dev is back alive. Notify the caller if in sync mode */
* The dev is back alive. Notify the caller if in sync mode if (reset_data->mode == ADF_DEV_RESET_ASYNC)
*
* If device restart will take a more time than expected,
* the schedule_reset() function can timeout and exit. This can be
* detected by calling the completion_done() function. In this case
* the reset_data structure needs to be freed here.
*/
if (reset_data->mode == ADF_DEV_RESET_ASYNC ||
completion_done(&reset_data->compl))
kfree(reset_data); kfree(reset_data);
else else
complete(&reset_data->compl); complete(&reset_data->compl);
@@ -192,10 +183,10 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,
if (!timeout) { if (!timeout) {
dev_err(&GET_DEV(accel_dev), dev_err(&GET_DEV(accel_dev),
"Reset device timeout expired\n"); "Reset device timeout expired\n");
cancel_work_sync(&reset_data->reset_work);
ret = -EFAULT; ret = -EFAULT;
} else {
kfree(reset_data);
} }
kfree(reset_data);
return ret; return ret;
} }
return 0; return 0;

View File

@@ -119,12 +119,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
seq_printf(s, "%s: %d\n", obj->name, obj->value); seq_printf(s, "%s: %d\n", obj->name, obj->value);
spin_lock_irq(&obj->lock); spin_lock(&obj->lock); /* Caller already disabled IRQ. */
list_for_each(pos, &obj->pt_list) { list_for_each(pos, &obj->pt_list) {
struct sync_pt *pt = container_of(pos, struct sync_pt, link); struct sync_pt *pt = container_of(pos, struct sync_pt, link);
sync_print_fence(s, &pt->base, false); sync_print_fence(s, &pt->base, false);
} }
spin_unlock_irq(&obj->lock); spin_unlock(&obj->lock);
} }
static void sync_print_sync_file(struct seq_file *s, static void sync_print_sync_file(struct seq_file *s,

View File

@@ -710,8 +710,8 @@ static int axi_dmac_remove(struct platform_device *pdev)
{ {
struct axi_dmac *dmac = platform_get_drvdata(pdev); struct axi_dmac *dmac = platform_get_drvdata(pdev);
of_dma_controller_free(pdev->dev.of_node);
free_irq(dmac->irq, dmac); free_irq(dmac->irq, dmac);
of_dma_controller_free(pdev->dev.of_node);
tasklet_kill(&dmac->chan.vchan.task); tasklet_kill(&dmac->chan.vchan.task);
dma_async_device_unregister(&dmac->dma_dev); dma_async_device_unregister(&dmac->dma_dev);
clk_disable_unprepare(dmac->clk); clk_disable_unprepare(dmac->clk);

View File

@@ -172,6 +172,10 @@ static irqreturn_t idma64_irq(int irq, void *dev)
u32 status_err; u32 status_err;
unsigned short i; unsigned short i;
/* Since IRQ may be shared, check if DMA controller is powered on */
if (status == GENMASK(31, 0))
return IRQ_NONE;
dev_vdbg(idma64->dma.dev, "%s: status=%#x\n", __func__, status); dev_vdbg(idma64->dma.dev, "%s: status=%#x\n", __func__, status);
/* Check if we have any interrupt from the DMA controller */ /* Check if we have any interrupt from the DMA controller */
@@ -599,7 +603,9 @@ static int idma64_probe(struct idma64_chip *chip)
idma64->dma.dev = chip->sysdev; idma64->dma.dev = chip->sysdev;
dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK); ret = dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK);
if (ret)
return ret;
ret = dma_async_device_register(&idma64->dma); ret = dma_async_device_register(&idma64->dma);
if (ret) if (ret)

View File

@@ -1429,6 +1429,7 @@ module_init(ioat_init_module);
static void __exit ioat_exit_module(void) static void __exit ioat_exit_module(void)
{ {
pci_unregister_driver(&ioat_pci_driver); pci_unregister_driver(&ioat_pci_driver);
kmem_cache_destroy(ioat_sed_cache);
kmem_cache_destroy(ioat_cache); kmem_cache_destroy(ioat_cache);
} }
module_exit(ioat_exit_module); module_exit(ioat_exit_module);

View File

@@ -230,7 +230,7 @@ static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
else else
regval &= ~val; regval &= ~val;
writel(val, pchan->base + reg); writel(regval, pchan->base + reg);
} }
static void pchan_writel(struct owl_dma_pchan *pchan, u32 reg, u32 data) static void pchan_writel(struct owl_dma_pchan *pchan, u32 reg, u32 data)
@@ -254,7 +254,7 @@ static void dma_update(struct owl_dma *od, u32 reg, u32 val, bool state)
else else
regval &= ~val; regval &= ~val;
writel(val, od->base + reg); writel(regval, od->base + reg);
} }
static void dma_writel(struct owl_dma *od, u32 reg, u32 data) static void dma_writel(struct owl_dma *od, u32 reg, u32 data)

View File

@@ -101,7 +101,8 @@ config EXTCON_MAX77843
config EXTCON_MAX8997 config EXTCON_MAX8997
tristate "Maxim MAX8997 EXTCON Support" tristate "Maxim MAX8997 EXTCON Support"
depends on MFD_MAX8997 && IRQ_DOMAIN depends on MFD_MAX8997
select IRQ_DOMAIN
help help
If you say yes here you get support for the MUIC device of If you say yes here you get support for the MUIC device of
Maxim MAX8997 PMIC. The MAX8997 MUIC is a USB port accessory Maxim MAX8997 PMIC. The MAX8997 MUIC is a USB port accessory

View File

@@ -161,10 +161,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length)
if (atomic_read(&buffer->size) == 0) if (atomic_read(&buffer->size) == 0)
return -ENODEV; return -ENODEV;
/* FIXME: Check length <= user_length. */ length = buffer->head->length;
if (length > user_length)
return 0;
end = buffer->data + buffer->capacity; end = buffer->data + buffer->capacity;
length = buffer->head->length;
if (&buffer->head->data[length] < end) { if (&buffer->head->data[length] < end) {
if (copy_to_user(data, buffer->head->data, length)) if (copy_to_user(data, buffer->head->data, length))

View File

@@ -2066,6 +2066,8 @@ static void bus_reset_work(struct work_struct *work)
ohci->generation = generation; ohci->generation = generation;
reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
if (ohci->quirks & QUIRK_RESET_PACKET) if (ohci->quirks & QUIRK_RESET_PACKET)
ohci->request_generation = generation; ohci->request_generation = generation;
@@ -2132,12 +2134,14 @@ static irqreturn_t irq_handler(int irq, void *data)
return IRQ_NONE; return IRQ_NONE;
/* /*
* busReset and postedWriteErr must not be cleared yet * busReset and postedWriteErr events must not be cleared yet
* (OHCI 1.1 clauses 7.2.3.2 and 13.2.8.1) * (OHCI 1.1 clauses 7.2.3.2 and 13.2.8.1)
*/ */
reg_write(ohci, OHCI1394_IntEventClear, reg_write(ohci, OHCI1394_IntEventClear,
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr)); event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
log_irqs(ohci, event); log_irqs(ohci, event);
if (event & OHCI1394_busReset)
reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
if (event & OHCI1394_selfIDComplete) if (event & OHCI1394_selfIDComplete)
queue_work(selfid_workqueue, &ohci->bus_reset_work); queue_work(selfid_workqueue, &ohci->bus_reset_work);

View File

@@ -161,9 +161,14 @@ static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
return 0; return 0;
} }
static void dmi_dev_release(struct device *dev)
{
kfree(dev);
}
static struct class dmi_class = { static struct class dmi_class = {
.name = "dmi", .name = "dmi",
.dev_release = (void(*)(struct device *)) kfree, .dev_release = dmi_dev_release,
.dev_uevent = dmi_dev_uevent, .dev_uevent = dmi_dev_uevent,
}; };

View File

@@ -95,6 +95,17 @@ static void dmi_decode_table(u8 *buf,
(data - buf + sizeof(struct dmi_header)) <= dmi_len) { (data - buf + sizeof(struct dmi_header)) <= dmi_len) {
const struct dmi_header *dm = (const struct dmi_header *)data; const struct dmi_header *dm = (const struct dmi_header *)data;
/*
* If a short entry is found (less than 4 bytes), not only it
* is invalid, but we cannot reliably locate the next entry.
*/
if (dm->length < sizeof(struct dmi_header)) {
pr_warn(FW_BUG
"Corrupted DMI table, offset %zd (only %d entries processed)\n",
data - buf, i);
break;
}
/* /*
* We want to know the total length (formatted area and * We want to know the total length (formatted area and
* strings) before decoding to make sure we won't run off the * strings) before decoding to make sure we won't run off the

View File

@@ -11,6 +11,7 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/mailbox_client.h> #include <linux/mailbox_client.h>
#include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
@@ -91,8 +92,8 @@ int rpi_firmware_property_list(struct rpi_firmware *fw,
if (size & 3) if (size & 3)
return -EINVAL; return -EINVAL;
buf = dma_alloc_coherent(fw->cl.dev, PAGE_ALIGN(size), &bus_addr, buf = dma_alloc_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size),
GFP_ATOMIC); &bus_addr, GFP_ATOMIC);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
@@ -120,7 +121,7 @@ int rpi_firmware_property_list(struct rpi_firmware *fw,
ret = -EINVAL; ret = -EINVAL;
} }
dma_free_coherent(fw->cl.dev, PAGE_ALIGN(size), buf, bus_addr); dma_free_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size), buf, bus_addr);
return ret; return ret;
} }

View File

@@ -99,7 +99,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
case 0x5e: case 0x5e:
return GPIOPANELCTL; return GPIOPANELCTL;
default: default:
return -EOPNOTSUPP; return -ENOTSUPP;
} }
} }

View File

@@ -207,6 +207,11 @@ static int davinci_gpio_probe(struct platform_device *pdev)
else else
nirq = DIV_ROUND_UP(ngpio, 16); nirq = DIV_ROUND_UP(ngpio, 16);
if (nirq > MAX_INT_PER_BANK) {
dev_err(dev, "Too many IRQs!\n");
return -EINVAL;
}
nbank = DIV_ROUND_UP(ngpio, 32); nbank = DIV_ROUND_UP(ngpio, 32);
chips = devm_kcalloc(dev, chips = devm_kcalloc(dev,
nbank, sizeof(struct davinci_gpio_controller), nbank, sizeof(struct davinci_gpio_controller),

View File

@@ -110,7 +110,7 @@ static inline unsigned int to_reg(int gpio, enum ctrl_register reg_type)
unsigned int reg; unsigned int reg;
if (gpio >= WCOVE_GPIO_NUM) if (gpio >= WCOVE_GPIO_NUM)
return -EOPNOTSUPP; return -ENOTSUPP;
if (reg_type == CTRL_IN) if (reg_type == CTRL_IN)
reg = GPIO_IN_CTRL_BASE + gpio; reg = GPIO_IN_CTRL_BASE + gpio;

View File

@@ -46,9 +46,9 @@
/* Impose limit on how much memory KFD can use */ /* Impose limit on how much memory KFD can use */
static struct { static struct {
uint64_t max_system_mem_limit; uint64_t max_system_mem_limit;
uint64_t max_userptr_mem_limit; uint64_t max_ttm_mem_limit;
int64_t system_mem_used; int64_t system_mem_used;
int64_t userptr_mem_used; int64_t ttm_mem_used;
spinlock_t mem_limit_lock; spinlock_t mem_limit_lock;
} kfd_mem_limit; } kfd_mem_limit;
@@ -90,8 +90,8 @@ static bool check_if_add_bo_to_vm(struct amdgpu_vm *avm,
} }
/* Set memory usage limits. Current, limits are /* Set memory usage limits. Current, limits are
* System (kernel) memory - 3/8th System RAM * System (TTM + userptr) memory - 3/4th System RAM
* Userptr memory - 3/4th System RAM * TTM memory - 3/8th System RAM
*/ */
void amdgpu_amdkfd_gpuvm_init_mem_limits(void) void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
{ {
@@ -103,48 +103,54 @@ void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
mem *= si.mem_unit; mem *= si.mem_unit;
spin_lock_init(&kfd_mem_limit.mem_limit_lock); spin_lock_init(&kfd_mem_limit.mem_limit_lock);
kfd_mem_limit.max_system_mem_limit = (mem >> 1) - (mem >> 3); kfd_mem_limit.max_system_mem_limit = (mem >> 1) + (mem >> 2);
kfd_mem_limit.max_userptr_mem_limit = mem - (mem >> 2); kfd_mem_limit.max_ttm_mem_limit = (mem >> 1) - (mem >> 3);
pr_debug("Kernel memory limit %lluM, userptr limit %lluM\n", pr_debug("Kernel memory limit %lluM, TTM limit %lluM\n",
(kfd_mem_limit.max_system_mem_limit >> 20), (kfd_mem_limit.max_system_mem_limit >> 20),
(kfd_mem_limit.max_userptr_mem_limit >> 20)); (kfd_mem_limit.max_ttm_mem_limit >> 20));
} }
static int amdgpu_amdkfd_reserve_system_mem_limit(struct amdgpu_device *adev, static int amdgpu_amdkfd_reserve_system_mem_limit(struct amdgpu_device *adev,
uint64_t size, u32 domain) uint64_t size, u32 domain, bool sg)
{ {
size_t acc_size; size_t acc_size, system_mem_needed, ttm_mem_needed;
int ret = 0; int ret = 0;
acc_size = ttm_bo_dma_acc_size(&adev->mman.bdev, size, acc_size = ttm_bo_dma_acc_size(&adev->mman.bdev, size,
sizeof(struct amdgpu_bo)); sizeof(struct amdgpu_bo));
spin_lock(&kfd_mem_limit.mem_limit_lock); spin_lock(&kfd_mem_limit.mem_limit_lock);
if (domain == AMDGPU_GEM_DOMAIN_GTT) { if (domain == AMDGPU_GEM_DOMAIN_GTT) {
if (kfd_mem_limit.system_mem_used + (acc_size + size) > /* TTM GTT memory */
kfd_mem_limit.max_system_mem_limit) { system_mem_needed = acc_size + size;
ret = -ENOMEM; ttm_mem_needed = acc_size + size;
goto err_no_mem; } else if (domain == AMDGPU_GEM_DOMAIN_CPU && !sg) {
} /* Userptr */
kfd_mem_limit.system_mem_used += (acc_size + size); system_mem_needed = acc_size + size;
} else if (domain == AMDGPU_GEM_DOMAIN_CPU) { ttm_mem_needed = acc_size;
if ((kfd_mem_limit.system_mem_used + acc_size > } else {
kfd_mem_limit.max_system_mem_limit) || /* VRAM and SG */
(kfd_mem_limit.userptr_mem_used + (size + acc_size) > system_mem_needed = acc_size;
kfd_mem_limit.max_userptr_mem_limit)) { ttm_mem_needed = acc_size;
ret = -ENOMEM;
goto err_no_mem;
}
kfd_mem_limit.system_mem_used += acc_size;
kfd_mem_limit.userptr_mem_used += size;
} }
err_no_mem:
if ((kfd_mem_limit.system_mem_used + system_mem_needed >
kfd_mem_limit.max_system_mem_limit) ||
(kfd_mem_limit.ttm_mem_used + ttm_mem_needed >
kfd_mem_limit.max_ttm_mem_limit))
ret = -ENOMEM;
else {
kfd_mem_limit.system_mem_used += system_mem_needed;
kfd_mem_limit.ttm_mem_used += ttm_mem_needed;
}
spin_unlock(&kfd_mem_limit.mem_limit_lock); spin_unlock(&kfd_mem_limit.mem_limit_lock);
return ret; return ret;
} }
static void unreserve_system_mem_limit(struct amdgpu_device *adev, static void unreserve_system_mem_limit(struct amdgpu_device *adev,
uint64_t size, u32 domain) uint64_t size, u32 domain, bool sg)
{ {
size_t acc_size; size_t acc_size;
@@ -154,14 +160,18 @@ static void unreserve_system_mem_limit(struct amdgpu_device *adev,
spin_lock(&kfd_mem_limit.mem_limit_lock); spin_lock(&kfd_mem_limit.mem_limit_lock);
if (domain == AMDGPU_GEM_DOMAIN_GTT) { if (domain == AMDGPU_GEM_DOMAIN_GTT) {
kfd_mem_limit.system_mem_used -= (acc_size + size); kfd_mem_limit.system_mem_used -= (acc_size + size);
} else if (domain == AMDGPU_GEM_DOMAIN_CPU) { kfd_mem_limit.ttm_mem_used -= (acc_size + size);
} else if (domain == AMDGPU_GEM_DOMAIN_CPU && !sg) {
kfd_mem_limit.system_mem_used -= (acc_size + size);
kfd_mem_limit.ttm_mem_used -= acc_size;
} else {
kfd_mem_limit.system_mem_used -= acc_size; kfd_mem_limit.system_mem_used -= acc_size;
kfd_mem_limit.userptr_mem_used -= size; kfd_mem_limit.ttm_mem_used -= acc_size;
} }
WARN_ONCE(kfd_mem_limit.system_mem_used < 0, WARN_ONCE(kfd_mem_limit.system_mem_used < 0,
"kfd system memory accounting unbalanced"); "kfd system memory accounting unbalanced");
WARN_ONCE(kfd_mem_limit.userptr_mem_used < 0, WARN_ONCE(kfd_mem_limit.ttm_mem_used < 0,
"kfd userptr memory accounting unbalanced"); "kfd TTM memory accounting unbalanced");
spin_unlock(&kfd_mem_limit.mem_limit_lock); spin_unlock(&kfd_mem_limit.mem_limit_lock);
} }
@@ -171,16 +181,22 @@ void amdgpu_amdkfd_unreserve_system_memory_limit(struct amdgpu_bo *bo)
spin_lock(&kfd_mem_limit.mem_limit_lock); spin_lock(&kfd_mem_limit.mem_limit_lock);
if (bo->flags & AMDGPU_AMDKFD_USERPTR_BO) { if (bo->flags & AMDGPU_AMDKFD_USERPTR_BO) {
kfd_mem_limit.system_mem_used -= bo->tbo.acc_size; kfd_mem_limit.system_mem_used -=
kfd_mem_limit.userptr_mem_used -= amdgpu_bo_size(bo); (bo->tbo.acc_size + amdgpu_bo_size(bo));
kfd_mem_limit.ttm_mem_used -= bo->tbo.acc_size;
} else if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT) { } else if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT) {
kfd_mem_limit.system_mem_used -= kfd_mem_limit.system_mem_used -=
(bo->tbo.acc_size + amdgpu_bo_size(bo)); (bo->tbo.acc_size + amdgpu_bo_size(bo));
kfd_mem_limit.ttm_mem_used -=
(bo->tbo.acc_size + amdgpu_bo_size(bo));
} else {
kfd_mem_limit.system_mem_used -= bo->tbo.acc_size;
kfd_mem_limit.ttm_mem_used -= bo->tbo.acc_size;
} }
WARN_ONCE(kfd_mem_limit.system_mem_used < 0, WARN_ONCE(kfd_mem_limit.system_mem_used < 0,
"kfd system memory accounting unbalanced"); "kfd system memory accounting unbalanced");
WARN_ONCE(kfd_mem_limit.userptr_mem_used < 0, WARN_ONCE(kfd_mem_limit.ttm_mem_used < 0,
"kfd userptr memory accounting unbalanced"); "kfd TTM memory accounting unbalanced");
spin_unlock(&kfd_mem_limit.mem_limit_lock); spin_unlock(&kfd_mem_limit.mem_limit_lock);
} }
@@ -1201,10 +1217,11 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
amdgpu_sync_create(&(*mem)->sync); amdgpu_sync_create(&(*mem)->sync);
ret = amdgpu_amdkfd_reserve_system_mem_limit(adev, size, alloc_domain); ret = amdgpu_amdkfd_reserve_system_mem_limit(adev, size,
alloc_domain, false);
if (ret) { if (ret) {
pr_debug("Insufficient system memory\n"); pr_debug("Insufficient system memory\n");
goto err_reserve_system_mem; goto err_reserve_limit;
} }
pr_debug("\tcreate BO VA 0x%llx size 0x%llx domain %s\n", pr_debug("\tcreate BO VA 0x%llx size 0x%llx domain %s\n",
@@ -1252,10 +1269,11 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
allocate_init_user_pages_failed: allocate_init_user_pages_failed:
amdgpu_bo_unref(&bo); amdgpu_bo_unref(&bo);
/* Don't unreserve system mem limit twice */ /* Don't unreserve system mem limit twice */
goto err_reserve_system_mem; goto err_reserve_limit;
err_bo_create: err_bo_create:
unreserve_system_mem_limit(adev, size, alloc_domain); unreserve_system_mem_limit(adev, size, alloc_domain, false);
err_reserve_system_mem: err_reserve_limit:
amdgpu_sync_free(&(*mem)->sync);
mutex_destroy(&(*mem)->lock); mutex_destroy(&(*mem)->lock);
kfree(*mem); kfree(*mem);
return ret; return ret;

View File

@@ -2048,6 +2048,37 @@ static void amdgpu_vm_bo_insert_map(struct amdgpu_device *adev,
trace_amdgpu_vm_bo_map(bo_va, mapping); trace_amdgpu_vm_bo_map(bo_va, mapping);
} }
/* Validate operation parameters to prevent potential abuse */
static int amdgpu_vm_verify_parameters(struct amdgpu_device *adev,
struct amdgpu_bo *bo,
uint64_t saddr,
uint64_t offset,
uint64_t size)
{
uint64_t tmp, lpfn;
if (saddr & AMDGPU_GPU_PAGE_MASK
|| offset & AMDGPU_GPU_PAGE_MASK
|| size & AMDGPU_GPU_PAGE_MASK)
return -EINVAL;
if (check_add_overflow(saddr, size, &tmp)
|| check_add_overflow(offset, size, &tmp)
|| size == 0 /* which also leads to end < begin */)
return -EINVAL;
/* make sure object fit at this offset */
if (bo && offset + size > amdgpu_bo_size(bo))
return -EINVAL;
/* Ensure last pfn not exceed max_pfn */
lpfn = (saddr + size - 1) >> AMDGPU_GPU_PAGE_SHIFT;
if (lpfn >= adev->vm_manager.max_pfn)
return -EINVAL;
return 0;
}
/** /**
* amdgpu_vm_bo_map - map bo inside a vm * amdgpu_vm_bo_map - map bo inside a vm
* *
@@ -2074,20 +2105,14 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
struct amdgpu_bo *bo = bo_va->base.bo; struct amdgpu_bo *bo = bo_va->base.bo;
struct amdgpu_vm *vm = bo_va->base.vm; struct amdgpu_vm *vm = bo_va->base.vm;
uint64_t eaddr; uint64_t eaddr;
int r;
/* validate the parameters */ r = amdgpu_vm_verify_parameters(adev, bo, saddr, offset, size);
if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || if (r)
size == 0 || size & ~PAGE_MASK) return r;
return -EINVAL;
/* make sure object fit at this offset */
eaddr = saddr + size - 1;
if (saddr >= eaddr ||
(bo && offset + size > amdgpu_bo_size(bo)))
return -EINVAL;
saddr /= AMDGPU_GPU_PAGE_SIZE; saddr /= AMDGPU_GPU_PAGE_SIZE;
eaddr /= AMDGPU_GPU_PAGE_SIZE; eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
tmp = amdgpu_vm_it_iter_first(&vm->va, saddr, eaddr); tmp = amdgpu_vm_it_iter_first(&vm->va, saddr, eaddr);
if (tmp) { if (tmp) {
@@ -2140,16 +2165,9 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev,
uint64_t eaddr; uint64_t eaddr;
int r; int r;
/* validate the parameters */ r = amdgpu_vm_verify_parameters(adev, bo, saddr, offset, size);
if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || if (r)
size == 0 || size & ~PAGE_MASK) return r;
return -EINVAL;
/* make sure object fit at this offset */
eaddr = saddr + size - 1;
if (saddr >= eaddr ||
(bo && offset + size > amdgpu_bo_size(bo)))
return -EINVAL;
/* Allocate all the needed memory */ /* Allocate all the needed memory */
mapping = kmalloc(sizeof(*mapping), GFP_KERNEL); mapping = kmalloc(sizeof(*mapping), GFP_KERNEL);
@@ -2163,7 +2181,7 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev,
} }
saddr /= AMDGPU_GPU_PAGE_SIZE; saddr /= AMDGPU_GPU_PAGE_SIZE;
eaddr /= AMDGPU_GPU_PAGE_SIZE; eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
mapping->start = saddr; mapping->start = saddr;
mapping->last = eaddr; mapping->last = eaddr;
@@ -2250,10 +2268,14 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
struct amdgpu_bo_va_mapping *before, *after, *tmp, *next; struct amdgpu_bo_va_mapping *before, *after, *tmp, *next;
LIST_HEAD(removed); LIST_HEAD(removed);
uint64_t eaddr; uint64_t eaddr;
int r;
r = amdgpu_vm_verify_parameters(adev, NULL, saddr, 0, size);
if (r)
return r;
eaddr = saddr + size - 1;
saddr /= AMDGPU_GPU_PAGE_SIZE; saddr /= AMDGPU_GPU_PAGE_SIZE;
eaddr /= AMDGPU_GPU_PAGE_SIZE; eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
/* Allocate all the needed memory */ /* Allocate all the needed memory */
before = kzalloc(sizeof(*before), GFP_KERNEL); before = kzalloc(sizeof(*before), GFP_KERNEL);

View File

@@ -164,6 +164,8 @@ static void sumo_construct_vid_mapping_table(struct amdgpu_device *adev,
for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) { for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
if (table[i].ulSupportedSCLK != 0) { if (table[i].ulSupportedSCLK != 0) {
if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
continue;
vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit = vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
table[i].usVoltageID; table[i].usVoltageID;
vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit = vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =

View File

@@ -816,6 +816,7 @@ static int dm_resume(void *handle)
dc_stream_release(dm_new_crtc_state->stream); dc_stream_release(dm_new_crtc_state->stream);
dm_new_crtc_state->stream = NULL; dm_new_crtc_state->stream = NULL;
} }
dm_new_crtc_state->base.color_mgmt_changed = true;
} }
for_each_new_plane_in_state(dm->cached_state, plane, new_plane_state, i) { for_each_new_plane_in_state(dm->cached_state, plane, new_plane_state, i) {

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