Merge remote-tracking branch 'qcom_sm8250/lineage-20' into lineage-21
Change-Id: I3159ae2c81329a81f9f6d4feba3fd1324a86b4f6
This commit is contained in:
@@ -94,7 +94,6 @@ class KernelInclude(Include):
|
||||
# HINT: this is the only line I had to change / commented out:
|
||||
#path = utils.relative_path(None, path)
|
||||
|
||||
path = nodes.reprunicode(path)
|
||||
encoding = self.options.get(
|
||||
'encoding', self.state.document.settings.input_encoding)
|
||||
e_handler=self.state.document.settings.input_encoding_error_handler
|
||||
|
||||
2
Kconfig
2
Kconfig
@@ -5,8 +5,6 @@
|
||||
#
|
||||
mainmenu "Linux/$(ARCH) $(KERNELVERSION) Kernel Configuration"
|
||||
|
||||
comment "Compiler: $(CC_VERSION_TEXT)"
|
||||
|
||||
source "scripts/Kconfig.include"
|
||||
|
||||
source "init/Kconfig"
|
||||
|
||||
8
Makefile
8
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 312
|
||||
SUBLEVEL = 318
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
@@ -519,8 +519,6 @@ endif
|
||||
ifneq ($(LLVM_IAS),1)
|
||||
CLANG_FLAGS += -no-integrated-as
|
||||
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 += $(call cc-option, -Wno-unsequenced)
|
||||
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
|
||||
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)
|
||||
endif
|
||||
|
||||
|
||||
@@ -964,7 +964,7 @@ put_tv32(struct timeval32 __user *o, struct timespec64 *i)
|
||||
}
|
||||
|
||||
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){
|
||||
.tv_sec = i->tv_sec,
|
||||
|
||||
@@ -170,7 +170,6 @@
|
||||
};
|
||||
|
||||
gmac: ethernet@8000 {
|
||||
#interrupt-cells = <1>;
|
||||
compatible = "snps,dwmac";
|
||||
reg = <0x8000 0x2000>;
|
||||
interrupts = <10>;
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
&keypad {
|
||||
samsung,keypad-num-rows = <2>;
|
||||
samsung,keypad-num-columns = <8>;
|
||||
linux,keypad-no-autorepeat;
|
||||
linux,input-no-autorepeat;
|
||||
wakeup-source;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&keypad_rows &keypad_cols>;
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
&keypad {
|
||||
samsung,keypad-num-rows = <3>;
|
||||
samsung,keypad-num-columns = <2>;
|
||||
linux,keypad-no-autorepeat;
|
||||
linux,input-no-autorepeat;
|
||||
wakeup-source;
|
||||
pinctrl-0 = <&keypad_rows &keypad_cols>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
&keypad {
|
||||
samsung,keypad-num-rows = <3>;
|
||||
samsung,keypad-num-columns = <8>;
|
||||
linux,keypad-no-autorepeat;
|
||||
linux,input-no-autorepeat;
|
||||
wakeup-source;
|
||||
pinctrl-0 = <&keypad_rows &keypad_cols>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
@@ -65,7 +65,7 @@ static void davinci_pm_suspend(void)
|
||||
|
||||
/* Configure sleep count in deep sleep register */
|
||||
val = __raw_readl(pm_config.deepsleep_reg);
|
||||
val &= ~DEEPSLEEP_SLEEPCOUNT_MASK,
|
||||
val &= ~DEEPSLEEP_SLEEPCOUNT_MASK;
|
||||
val |= pm_config.sleepcount;
|
||||
__raw_writel(val, pm_config.deepsleep_reg);
|
||||
|
||||
|
||||
@@ -49,11 +49,7 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(cc-name),clang)
|
||||
KBUILD_CFLAGS += -mno-implicit-float
|
||||
else
|
||||
KBUILD_CFLAGS += -mgeneral-regs-only
|
||||
endif
|
||||
KBUILD_CFLAGS += $(lseinstr) $(brokengasinst) $(compat_vdso)
|
||||
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
gic: interrupt-controller@f1001000 {
|
||||
compatible = "arm,gic-400";
|
||||
reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */
|
||||
<0x0 0xf1002000 0x0 0x100>; /* GICC */
|
||||
<0x0 0xf1002000 0x0 0x2000>; /* GICC */
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <3>;
|
||||
interrupt-controller;
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
clock-names = "hif_sel";
|
||||
};
|
||||
|
||||
cir: cir@10009000 {
|
||||
cir: ir-receiver@10009000 {
|
||||
compatible = "mediatek,mt7622-cir";
|
||||
reg = <0 0x10009000 0 0x1000>;
|
||||
interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_LOW>;
|
||||
@@ -459,7 +459,6 @@
|
||||
<&pericfg CLK_PERI_AUXADC_PD>;
|
||||
clock-names = "therm", "auxadc";
|
||||
resets = <&pericfg MT7622_PERI_THERM_SW_RST>;
|
||||
reset-names = "therm";
|
||||
mediatek,auxadc = <&auxadc>;
|
||||
mediatek,apmixedsys = <&apmixedsys>;
|
||||
nvmem-cells = <&thermal_calibration>;
|
||||
@@ -846,9 +845,7 @@
|
||||
};
|
||||
|
||||
eth: ethernet@1b100000 {
|
||||
compatible = "mediatek,mt7622-eth",
|
||||
"mediatek,mt2701-eth",
|
||||
"syscon";
|
||||
compatible = "mediatek,mt7622-eth";
|
||||
reg = <0 0x1b100000 0 0x20000>;
|
||||
interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_LOW>,
|
||||
<GIC_SPI 224 IRQ_TYPE_LEVEL_LOW>,
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
compatible = "nvidia,norrin", "nvidia,tegra132", "nvidia,tegra124";
|
||||
|
||||
aliases {
|
||||
rtc0 = "/i2c@7000d000/as3722@40";
|
||||
rtc1 = "/rtc@7000e000";
|
||||
rtc0 = &as3722;
|
||||
rtc1 = &tegra_rtc;
|
||||
serial0 = &uarta;
|
||||
};
|
||||
|
||||
|
||||
@@ -569,7 +569,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
rtc@7000e000 {
|
||||
tegra_rtc: rtc@7000e000 {
|
||||
compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc";
|
||||
reg = <0x0 0x7000e000 0x0 0x100>;
|
||||
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
@@ -677,6 +677,7 @@
|
||||
dma-names = "tx";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spdif_tx>;
|
||||
#sound-dai-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -688,6 +689,7 @@
|
||||
clocks = <&cru SCLK_I2S_2CH>, <&cru HCLK_I2S_2CH>;
|
||||
dmas = <&dmac_bus 6>, <&dmac_bus 7>;
|
||||
dma-names = "tx", "rx";
|
||||
#sound-dai-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -701,6 +703,7 @@
|
||||
dma-names = "tx", "rx";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2s_8ch_bus>;
|
||||
#sound-dai-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
@@ -426,16 +426,22 @@
|
||||
gpio1830-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
&pmu_io_domains {
|
||||
status = "okay";
|
||||
pmu1830-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
&pwm2 {
|
||||
status = "okay";
|
||||
&pcie_clkreqn_cpm {
|
||||
rockchip,pins =
|
||||
<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
|
||||
&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_xfer_a: i2c8-xfer {
|
||||
rockchip,pins =
|
||||
@@ -466,6 +472,15 @@
|
||||
};
|
||||
};
|
||||
|
||||
&pmu_io_domains {
|
||||
status = "okay";
|
||||
pmu1830-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
&pwm2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
/*
|
||||
* Signal integrity isn't great at 200MHz but 100MHz has proven stable
|
||||
|
||||
@@ -16,6 +16,11 @@ Optional properties:
|
||||
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.
|
||||
|
||||
- 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
|
||||
Boolean. Indicate MIC2 input are differential, rather than single-ended.
|
||||
|
||||
@@ -64,6 +69,7 @@ codec: rt5650@1a {
|
||||
compatible = "realtek,rt5650";
|
||||
reg = <0x1a>;
|
||||
hp-detect-gpios = <&gpio 19 0>;
|
||||
cbj-sleeve-gpios = <&gpio 20 0>;
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
|
||||
realtek,dmic-en = "true";
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
14470: .long 14471f - 14470b; \
|
||||
_BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
|
||||
.short flags; \
|
||||
.align 2; \
|
||||
.popsection; \
|
||||
14471:
|
||||
#else
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/task_stack.h>
|
||||
|
||||
#include <asm-generic/compat.h>
|
||||
|
||||
#define COMPAT_USER_HZ 100
|
||||
#ifdef __AARCH64EB__
|
||||
#define COMPAT_UTS_MACHINE "armv8b\0\0"
|
||||
@@ -32,10 +34,6 @@
|
||||
#define COMPAT_UTS_MACHINE "armv8l\0\0"
|
||||
#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_gid_t;
|
||||
typedef u16 __compat_uid16_t;
|
||||
@@ -43,27 +41,13 @@ typedef u16 __compat_gid16_t;
|
||||
typedef u32 __compat_uid32_t;
|
||||
typedef u32 __compat_gid32_t;
|
||||
typedef u16 compat_mode_t;
|
||||
typedef u32 compat_ino_t;
|
||||
typedef u32 compat_dev_t;
|
||||
typedef s32 compat_off_t;
|
||||
typedef s64 compat_loff_t;
|
||||
typedef s32 compat_nlink_t;
|
||||
typedef u16 compat_ipc_pid_t;
|
||||
typedef s32 compat_daddr_t;
|
||||
typedef u32 compat_caddr_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 u16 compat_ushort_t;
|
||||
typedef u32 compat_uint_t;
|
||||
typedef u32 compat_ulong_t;
|
||||
typedef u64 compat_u64;
|
||||
typedef u32 compat_uptr_t;
|
||||
|
||||
struct compat_stat {
|
||||
#ifdef __AARCH64EB__
|
||||
|
||||
@@ -134,6 +134,7 @@ SECTIONS
|
||||
IDMAP_TEXT
|
||||
HIBERNATE_TEXT
|
||||
TRAMP_TEXT
|
||||
*(.text..L.cfi.jumptable .text..L.cfi.jumptable.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
. = ALIGN(16);
|
||||
|
||||
@@ -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_ABT:
|
||||
case PSR_AA32_MODE_UND:
|
||||
case PSR_AA32_MODE_SYS:
|
||||
if (!vcpu_el1_is_32bit(vcpu))
|
||||
return -EINVAL;
|
||||
break;
|
||||
|
||||
6
arch/hexagon/include/asm/syscalls.h
Normal file
6
arch/hexagon/include/asm/syscalls.h
Normal 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);
|
||||
@@ -27,6 +27,13 @@
|
||||
#undef __SYSCALL
|
||||
#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] = {
|
||||
#include <asm/unistd.h>
|
||||
};
|
||||
|
||||
@@ -425,7 +425,9 @@ resume:
|
||||
movec %a0,%dfc
|
||||
|
||||
/* restore status register */
|
||||
movew %a1@(TASK_THREAD+THREAD_SR),%sr
|
||||
movew %a1@(TASK_THREAD+THREAD_SR),%d0
|
||||
oriw #0x0700,%d0
|
||||
movew %d0,%sr
|
||||
|
||||
rts
|
||||
|
||||
|
||||
@@ -462,40 +462,18 @@ void mac_poweroff(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
|
||||
} else if (macintosh_config->adb_type == MAC_ADB_EGRET ||
|
||||
if (macintosh_config->adb_type == MAC_ADB_EGRET ||
|
||||
macintosh_config->adb_type == MAC_ADB_CUDA) {
|
||||
cuda_restart();
|
||||
} else
|
||||
#endif
|
||||
#ifdef CONFIG_ADB_PMU
|
||||
} else if (macintosh_config->adb_type == MAC_ADB_PB2) {
|
||||
if (macintosh_config->adb_type == MAC_ADB_PB2) {
|
||||
pmu_restart();
|
||||
} else
|
||||
#endif
|
||||
} else if (CPU_IS_030) {
|
||||
|
||||
if (CPU_IS_030) {
|
||||
/* 030-specific reset routine. The idea is general, but the
|
||||
* specific registers to reset are '030-specific. Until I
|
||||
* 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 */
|
||||
".chip 68k"
|
||||
: : "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 */
|
||||
|
||||
@@ -7,7 +7,6 @@ ifdef CONFIG_FUNCTION_TRACER
|
||||
# Do not trace early boot code and low level code
|
||||
CFLAGS_REMOVE_timer.o = -pg
|
||||
CFLAGS_REMOVE_intc.o = -pg
|
||||
CFLAGS_REMOVE_early_printk.o = -pg
|
||||
CFLAGS_REMOVE_ftrace.o = -pg
|
||||
CFLAGS_REMOVE_process.o = -pg
|
||||
endif
|
||||
|
||||
@@ -18,7 +18,7 @@ static const char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
|
||||
static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
|
||||
|
||||
#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)
|
||||
{
|
||||
|
||||
@@ -9,43 +9,25 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
#include <asm-generic/compat.h>
|
||||
|
||||
#define COMPAT_USER_HZ 100
|
||||
#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_gid_t;
|
||||
typedef __compat_uid_t __compat_uid32_t;
|
||||
typedef __compat_gid_t __compat_gid32_t;
|
||||
typedef u32 compat_mode_t;
|
||||
typedef u32 compat_ino_t;
|
||||
typedef u32 compat_dev_t;
|
||||
typedef s32 compat_off_t;
|
||||
typedef s64 compat_loff_t;
|
||||
typedef u32 compat_nlink_t;
|
||||
typedef s32 compat_ipc_pid_t;
|
||||
typedef s32 compat_daddr_t;
|
||||
typedef s32 compat_caddr_t;
|
||||
typedef struct {
|
||||
s32 val[2];
|
||||
} 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 u16 compat_ushort_t;
|
||||
typedef u32 compat_uint_t;
|
||||
typedef u32 compat_ulong_t;
|
||||
typedef u64 compat_u64;
|
||||
typedef u32 compat_uptr_t;
|
||||
|
||||
struct compat_stat {
|
||||
compat_dev_t st_dev;
|
||||
|
||||
@@ -112,8 +112,8 @@ static int read_config_dword(struct pci_bus *bus, unsigned int devfn,
|
||||
* gives them time to settle
|
||||
*/
|
||||
if (where == PCI_VENDOR_ID) {
|
||||
if (ret == 0xffffffff || ret == 0x00000000 ||
|
||||
ret == 0x0000ffff || ret == 0xffff0000) {
|
||||
if (*val == 0xffffffff || *val == 0x00000000 ||
|
||||
*val == 0x0000ffff || *val == 0xffff0000) {
|
||||
if (delay > 4)
|
||||
return 0;
|
||||
delay *= 2;
|
||||
|
||||
6
arch/mips/pci/pcie-octeon.c
Normal file → Executable file
6
arch/mips/pci/pcie-octeon.c
Normal file → Executable 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_pciercx_cfg006 pciercx_cfg006;
|
||||
union cvmx_pciercx_cfg032 pciercx_cfg032;
|
||||
|
||||
pciercx_cfg006.u32 =
|
||||
cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG006(pcie_port));
|
||||
if ((bus <= pciercx_cfg006.s.pbnum) && (dev != 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.config.upper = 2;
|
||||
pcie_addr.config.io = 1;
|
||||
|
||||
@@ -8,36 +8,22 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
#include <asm-generic/compat.h>
|
||||
|
||||
#define COMPAT_USER_HZ 100
|
||||
#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_gid_t;
|
||||
typedef u32 __compat_uid32_t;
|
||||
typedef u32 __compat_gid32_t;
|
||||
typedef u16 compat_mode_t;
|
||||
typedef u32 compat_ino_t;
|
||||
typedef u32 compat_dev_t;
|
||||
typedef s32 compat_off_t;
|
||||
typedef s64 compat_loff_t;
|
||||
typedef u16 compat_nlink_t;
|
||||
typedef u16 compat_ipc_pid_t;
|
||||
typedef s32 compat_daddr_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 u32 compat_uint_t;
|
||||
typedef u32 compat_ulong_t;
|
||||
typedef u64 compat_u64;
|
||||
typedef u32 compat_uptr_t;
|
||||
|
||||
struct compat_stat {
|
||||
compat_dev_t st_dev; /* dev_t is 32 bits on parisc */
|
||||
|
||||
@@ -34,6 +34,7 @@ EXPORT_SYMBOL(memset);
|
||||
#include <linux/atomic.h>
|
||||
EXPORT_SYMBOL(__xchg8);
|
||||
EXPORT_SYMBOL(__xchg32);
|
||||
EXPORT_SYMBOL(__cmpxchg_u8);
|
||||
EXPORT_SYMBOL(__cmpxchg_u32);
|
||||
EXPORT_SYMBOL(__cmpxchg_u64);
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
#include <asm-generic/compat.h>
|
||||
|
||||
#define COMPAT_USER_HZ 100
|
||||
#ifdef __BIG_ENDIAN__
|
||||
#define COMPAT_UTS_MACHINE "ppc\0\0"
|
||||
@@ -15,34 +17,18 @@
|
||||
#define COMPAT_UTS_MACHINE "ppcle\0\0"
|
||||
#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_gid_t;
|
||||
typedef u32 __compat_uid32_t;
|
||||
typedef u32 __compat_gid32_t;
|
||||
typedef u32 compat_mode_t;
|
||||
typedef u32 compat_ino_t;
|
||||
typedef u32 compat_dev_t;
|
||||
typedef s32 compat_off_t;
|
||||
typedef s64 compat_loff_t;
|
||||
typedef s16 compat_nlink_t;
|
||||
typedef u16 compat_ipc_pid_t;
|
||||
typedef s32 compat_daddr_t;
|
||||
typedef u32 compat_caddr_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 u32 compat_uint_t;
|
||||
typedef u32 compat_ulong_t;
|
||||
typedef u64 compat_u64;
|
||||
typedef u32 compat_uptr_t;
|
||||
|
||||
struct compat_stat {
|
||||
compat_dev_t st_dev;
|
||||
|
||||
@@ -383,7 +383,7 @@ long plpar_hcall_norets(unsigned long opcode, ...);
|
||||
* Used for all but the craziest of phyp interfaces (see plpar_hcall9)
|
||||
*/
|
||||
#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
|
||||
@@ -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
|
||||
* 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
|
||||
@@ -408,8 +408,8 @@ long plpar_hcall_raw(unsigned long opcode, unsigned long *retbuf, ...);
|
||||
* PLPAR_HCALL9_BUFSIZE to size the return argument buffer.
|
||||
*/
|
||||
#define PLPAR_HCALL9_BUFSIZE 9
|
||||
long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...);
|
||||
long plpar_hcall9_raw(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[static PLPAR_HCALL9_BUFSIZE], ...);
|
||||
|
||||
struct hvcall_mpp_data {
|
||||
unsigned long entitled_mem;
|
||||
@@ -424,7 +424,7 @@ struct hvcall_mpp_data {
|
||||
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 {
|
||||
unsigned long coalesced_bytes;
|
||||
|
||||
@@ -47,7 +47,7 @@ extern struct pci_dev *isa_bridge_pcidev;
|
||||
* define properly based on the platform
|
||||
*/
|
||||
#ifndef CONFIG_PCI
|
||||
#define _IO_BASE 0
|
||||
#define _IO_BASE POISON_POINTER_DELTA
|
||||
#define _ISA_MEM_BASE 0
|
||||
#define PCI_DRAM_OFFSET 0
|
||||
#elif defined(CONFIG_PPC32)
|
||||
@@ -569,12 +569,12 @@ __do_out_asm(_rec_outl, "stwbrx")
|
||||
#define __do_inw(port) _rec_inw(port)
|
||||
#define __do_inl(port) _rec_inl(port)
|
||||
#else /* CONFIG_PPC32 */
|
||||
#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_outl(val, port) writel(val,(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_inl(port) readl((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_outl(val, port) writel(val,(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_inl(port) readl((PCI_IO_ADDR)(_IO_BASE + port));
|
||||
#endif /* !CONFIG_PPC32 */
|
||||
|
||||
#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_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_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_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_outsl(p, b, n) writesl((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_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_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_memset_io(addr, c, n) \
|
||||
_memset_io(PCI_FIX_ADDR(addr), c, n)
|
||||
|
||||
@@ -933,10 +933,10 @@ void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf)
|
||||
* h_get_mpp
|
||||
* 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];
|
||||
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
|
||||
long rc;
|
||||
|
||||
rc = plpar_hcall9(H_GET_MPP, retbuf);
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@ struct hvcall_ppp_data {
|
||||
*/
|
||||
static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
|
||||
{
|
||||
unsigned long rc;
|
||||
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
|
||||
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
|
||||
long rc;
|
||||
|
||||
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 device_node *root;
|
||||
const __be32 *perf_level;
|
||||
int rc;
|
||||
long rc;
|
||||
|
||||
rc = h_get_ppp(&ppp_data);
|
||||
if (rc)
|
||||
|
||||
@@ -578,10 +578,12 @@ static const struct fsl_msi_feature ipic_msi_feature = {
|
||||
.msiir_offset = 0x38,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_EPAPR_PARAVIRT
|
||||
static const struct fsl_msi_feature vmpic_msi_feature = {
|
||||
.fsl_pic_ip = FSL_PIC_IP_VMPIC,
|
||||
.msiir_offset = 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
static const struct of_device_id fsl_of_msi_ids[] = {
|
||||
{
|
||||
|
||||
@@ -1154,7 +1154,7 @@ static int cpu_cmd(void)
|
||||
unsigned long cpu, first_cpu, last_cpu;
|
||||
int timeout;
|
||||
|
||||
if (!scanhex(&cpu)) {
|
||||
if (!scanhex(&cpu) || cpu >= num_possible_cpus()) {
|
||||
/* print cpus waiting or in xmon */
|
||||
printf("cpus stopped:");
|
||||
last_cpu = first_cpu = NR_CPUS;
|
||||
@@ -2485,7 +2485,7 @@ static void dump_pacas(void)
|
||||
|
||||
termch = c; /* Put c back, it wasn't 'a' */
|
||||
|
||||
if (scanhex(&num))
|
||||
if (scanhex(&num) && num < num_possible_cpus())
|
||||
dump_one_paca(num);
|
||||
else
|
||||
dump_one_paca(xmon_owner);
|
||||
@@ -2568,7 +2568,7 @@ static void dump_xives(void)
|
||||
|
||||
termch = c; /* Put c back, it wasn't 'a' */
|
||||
|
||||
if (scanhex(&num))
|
||||
if (scanhex(&num) && num < num_possible_cpus())
|
||||
dump_one_xive(num);
|
||||
else
|
||||
dump_one_xive(xmon_owner);
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <linux/sched/task_stack.h>
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
#include <asm-generic/compat.h>
|
||||
|
||||
#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \
|
||||
typeof(0?(__force t)0:0ULL), u64))
|
||||
|
||||
@@ -51,34 +53,18 @@
|
||||
#define COMPAT_USER_HZ 100
|
||||
#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_gid_t;
|
||||
typedef u32 __compat_uid32_t;
|
||||
typedef u32 __compat_gid32_t;
|
||||
typedef u16 compat_mode_t;
|
||||
typedef u32 compat_ino_t;
|
||||
typedef u16 compat_dev_t;
|
||||
typedef s32 compat_off_t;
|
||||
typedef s64 compat_loff_t;
|
||||
typedef u16 compat_nlink_t;
|
||||
typedef u16 compat_ipc_pid_t;
|
||||
typedef s32 compat_daddr_t;
|
||||
typedef u32 compat_caddr_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 u32 compat_uint_t;
|
||||
typedef u32 compat_ulong_t;
|
||||
typedef u64 compat_u64;
|
||||
typedef u32 compat_uptr_t;
|
||||
|
||||
typedef struct {
|
||||
u32 mask;
|
||||
|
||||
@@ -2583,7 +2583,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr,
|
||||
return 0;
|
||||
|
||||
start = pmd_val(*pmd) & HPAGE_MASK;
|
||||
end = start + HPAGE_SIZE - 1;
|
||||
end = start + HPAGE_SIZE;
|
||||
__storage_key_init_range(start, end);
|
||||
set_bit(PG_arch_1, &page->flags);
|
||||
return 0;
|
||||
|
||||
@@ -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))
|
||||
__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,
|
||||
|
||||
@@ -47,17 +47,12 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
|
||||
if (OPCODE_RTE(opcode))
|
||||
return -EFAULT; /* Bad breakpoint */
|
||||
|
||||
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
|
||||
p->opcode = opcode;
|
||||
|
||||
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)
|
||||
{
|
||||
*p->addr = BREAKPOINT_INSTRUCTION;
|
||||
|
||||
@@ -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
|
||||
@@ -48,31 +49,11 @@ ENTRY(csum_partial)
|
||||
* Fortunately, it is easy to convert 2-byte alignment to 4-byte
|
||||
* alignment for the unrolled loop.
|
||||
*/
|
||||
mov r5, r1
|
||||
mov r4, r0
|
||||
tst #3, r0 ! Check alignment.
|
||||
bt/s 2f ! Jump if alignment is ok.
|
||||
mov r4, r7 ! Keep a copy to check for alignment
|
||||
tst #2, r0 ! Check alignment.
|
||||
bt 2f ! Jump if alignment is ok.
|
||||
!
|
||||
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.
|
||||
cmp/pz r5 !
|
||||
bt/s 1f ! Jump if we had at least two bytes.
|
||||
@@ -80,17 +61,16 @@ ENTRY(csum_partial)
|
||||
bra 6f
|
||||
add #2, r5 ! r5 was < 2. Deal with it.
|
||||
1:
|
||||
mov r5, r1 ! Save new len for later use.
|
||||
mov.w @r4+, r0
|
||||
extu.w r0, r0
|
||||
addc r0, r6
|
||||
bf 2f
|
||||
add #1, r6
|
||||
2:
|
||||
! buf is 4 byte aligned (len could be 0)
|
||||
mov r5, r1
|
||||
mov #-5, r0
|
||||
shld r0, r1
|
||||
tst r1, r1
|
||||
shld r0, r5
|
||||
tst r5, r5
|
||||
bt/s 4f ! if it's =0, go to 4f
|
||||
clrt
|
||||
.align 2
|
||||
@@ -112,31 +92,30 @@ ENTRY(csum_partial)
|
||||
addc r0, r6
|
||||
addc r2, r6
|
||||
movt r0
|
||||
dt r1
|
||||
dt r5
|
||||
bf/s 3b
|
||||
cmp/eq #1, r0
|
||||
! here, we know r1==0
|
||||
addc r1, r6 ! add carry to r6
|
||||
! here, we know r5==0
|
||||
addc r5, r6 ! add carry to r6
|
||||
4:
|
||||
mov r5, r0
|
||||
mov r1, r0
|
||||
and #0x1c, r0
|
||||
tst r0, r0
|
||||
bt 6f
|
||||
! 4 bytes or more remaining
|
||||
mov r0, r1
|
||||
shlr2 r1
|
||||
bt/s 6f
|
||||
mov r0, r5
|
||||
shlr2 r5
|
||||
mov #0, r2
|
||||
5:
|
||||
addc r2, r6
|
||||
mov.l @r4+, r2
|
||||
movt r0
|
||||
dt r1
|
||||
dt r5
|
||||
bf/s 5b
|
||||
cmp/eq #1, r0
|
||||
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:
|
||||
! 3 bytes or less remaining
|
||||
mov r1, r5
|
||||
mov #3, r0
|
||||
and r0, r5
|
||||
tst r5, r5
|
||||
@@ -162,16 +141,6 @@ ENTRY(csum_partial)
|
||||
mov #0, r0
|
||||
addc r0, r6
|
||||
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
|
||||
mov r6, r0
|
||||
|
||||
|
||||
@@ -6,38 +6,23 @@
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm-generic/compat.h>
|
||||
|
||||
#define COMPAT_USER_HZ 100
|
||||
#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_gid_t;
|
||||
typedef u32 __compat_uid32_t;
|
||||
typedef u32 __compat_gid32_t;
|
||||
typedef u16 compat_mode_t;
|
||||
typedef u32 compat_ino_t;
|
||||
typedef u16 compat_dev_t;
|
||||
typedef s32 compat_off_t;
|
||||
typedef s64 compat_loff_t;
|
||||
typedef s16 compat_nlink_t;
|
||||
typedef u16 compat_ipc_pid_t;
|
||||
typedef s32 compat_daddr_t;
|
||||
typedef u32 compat_caddr_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 u32 compat_uint_t;
|
||||
typedef u32 compat_ulong_t;
|
||||
typedef u64 compat_u64;
|
||||
typedef u32 compat_uptr_t;
|
||||
|
||||
struct compat_stat {
|
||||
compat_dev_t st_dev;
|
||||
compat_ino_t st_ino;
|
||||
|
||||
@@ -47,7 +47,6 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask);
|
||||
int hard_smp_processor_id(void);
|
||||
#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 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_fetch_global_regs() 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 scheduler_poke() do { } while (0)
|
||||
|
||||
|
||||
@@ -13,16 +13,6 @@ typedef unsigned int tcflag_t;
|
||||
typedef unsigned long tcflag_t;
|
||||
#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
|
||||
struct termios {
|
||||
tcflag_t c_iflag; /* input mode flags */
|
||||
|
||||
@@ -40,5 +40,14 @@ struct winsize {
|
||||
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 */
|
||||
|
||||
@@ -479,6 +479,8 @@ static void *record_one_cpu(struct device_node *dp, int cpuid, int arg)
|
||||
ncpus_probed++;
|
||||
#ifdef CONFIG_SMP
|
||||
set_cpu_present(cpuid, true);
|
||||
|
||||
if (num_possible_cpus() < nr_cpu_ids)
|
||||
set_cpu_possible(cpuid, true);
|
||||
#endif
|
||||
return NULL;
|
||||
|
||||
@@ -690,7 +690,6 @@ void __init setup_arch(char **cmdline_p)
|
||||
|
||||
paging_init();
|
||||
init_sparc64_elf_hwcap();
|
||||
smp_fill_in_cpu_possible_map();
|
||||
/*
|
||||
* 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
|
||||
|
||||
@@ -1213,20 +1213,6 @@ void __init smp_setup_processor_id(void)
|
||||
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)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -683,24 +683,26 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
*winch = ((struct winch) { .list = LIST_HEAD_INIT(winch->list),
|
||||
.fd = fd,
|
||||
*winch = ((struct winch) { .fd = fd,
|
||||
.tty_fd = tty_fd,
|
||||
.pid = pid,
|
||||
.port = port,
|
||||
.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,
|
||||
IRQF_SHARED, "winch", winch) < 0) {
|
||||
printk(KERN_ERR "register_winch_irq - failed to register "
|
||||
"IRQ\n");
|
||||
spin_lock(&winch_handler_lock);
|
||||
list_del(&winch->list);
|
||||
spin_unlock(&winch_handler_lock);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
spin_lock(&winch_handler_lock);
|
||||
list_add(&winch->list, &winch_handlers);
|
||||
spin_unlock(&winch_handler_lock);
|
||||
|
||||
return;
|
||||
|
||||
out_free:
|
||||
|
||||
@@ -1135,7 +1135,7 @@ static int __init ubd_init(void)
|
||||
|
||||
if (irq_req_buffer == NULL) {
|
||||
printk(KERN_ERR "Failed to initialize ubd buffering\n");
|
||||
return -1;
|
||||
return -ENOMEM;
|
||||
}
|
||||
io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE,
|
||||
sizeof(struct io_thread_req *),
|
||||
@@ -1146,7 +1146,7 @@ static int __init ubd_init(void)
|
||||
|
||||
if (io_req_buffer == NULL) {
|
||||
printk(KERN_ERR "Failed to initialize ubd buffering\n");
|
||||
return -1;
|
||||
return -ENOMEM;
|
||||
}
|
||||
platform_driver_register(&ubd_driver);
|
||||
mutex_lock(&ubd_lock);
|
||||
|
||||
@@ -15,8 +15,6 @@ typedef struct mm_context {
|
||||
struct page *stub_pages[2];
|
||||
} mm_context_t;
|
||||
|
||||
extern void __switch_mm(struct mm_id * mm_idp);
|
||||
|
||||
/* Avoid tangled inclusion with asm/ldt.h */
|
||||
extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm);
|
||||
extern void free_ldt(struct mm_context *mm);
|
||||
|
||||
@@ -14,4 +14,6 @@ struct mm_id {
|
||||
unsigned long stack;
|
||||
};
|
||||
|
||||
void __switch_mm(struct mm_id *mm_idp);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -376,6 +376,7 @@ config UNWINDER_ORC
|
||||
|
||||
config UNWINDER_FRAME_POINTER
|
||||
bool "Frame pointer unwinder"
|
||||
select ARCH_WANT_FRAME_POINTERS
|
||||
select FRAME_POINTER
|
||||
---help---
|
||||
This option enables the frame pointer unwinder for unwinding kernel
|
||||
@@ -403,7 +404,3 @@ config UNWINDER_GUESS
|
||||
overhead.
|
||||
|
||||
endchoice
|
||||
|
||||
config FRAME_POINTER
|
||||
depends on !UNWINDER_ORC && !UNWINDER_GUESS
|
||||
bool
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <asm/mpspec.h>
|
||||
#include <asm/msr.h>
|
||||
#include <asm/hardirq.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#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)
|
||||
{
|
||||
return *((volatile u32 *)(APIC_BASE + reg));
|
||||
return readl((void __iomem *)(APIC_BASE + reg));
|
||||
}
|
||||
|
||||
extern void native_apic_wait_icr_idle(void);
|
||||
|
||||
@@ -12,38 +12,23 @@
|
||||
#include <asm/user32.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
#include <asm-generic/compat.h>
|
||||
|
||||
#define COMPAT_USER_HZ 100
|
||||
#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_gid_t;
|
||||
typedef u32 __compat_uid32_t;
|
||||
typedef u32 __compat_gid32_t;
|
||||
typedef u16 compat_mode_t;
|
||||
typedef u32 compat_ino_t;
|
||||
typedef u16 compat_dev_t;
|
||||
typedef s32 compat_off_t;
|
||||
typedef s64 compat_loff_t;
|
||||
typedef u16 compat_nlink_t;
|
||||
typedef u16 compat_ipc_pid_t;
|
||||
typedef s32 compat_daddr_t;
|
||||
typedef u32 compat_caddr_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 u32 compat_uint_t;
|
||||
typedef u32 compat_ulong_t;
|
||||
typedef u32 compat_u32;
|
||||
typedef u64 __attribute__((aligned(4))) compat_u64;
|
||||
typedef u32 compat_uptr_t;
|
||||
|
||||
struct compat_stat {
|
||||
u32 st_dev;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
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);
|
||||
|
||||
|
||||
@@ -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));
|
||||
apic->send_IPI(cpu, IRQ_MOVE_CLEANUP_VECTOR);
|
||||
} 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);
|
||||
}
|
||||
@@ -951,6 +952,7 @@ void irq_complete_move(struct irq_cfg *cfg)
|
||||
*/
|
||||
void irq_force_complete_move(struct irq_desc *desc)
|
||||
{
|
||||
unsigned int cpu = smp_processor_id();
|
||||
struct apic_chip_data *apicd;
|
||||
struct irq_data *irqd;
|
||||
unsigned int vector;
|
||||
@@ -975,10 +977,11 @@ void irq_force_complete_move(struct irq_desc *desc)
|
||||
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;
|
||||
if (!vector)
|
||||
if (!vector || (apicd->cpu != cpu && apicd->prev_cpu != cpu))
|
||||
goto unlock;
|
||||
|
||||
/*
|
||||
|
||||
@@ -26,26 +26,7 @@
|
||||
|
||||
unsigned long profile_pc(struct pt_regs *regs)
|
||||
{
|
||||
unsigned long pc = 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;
|
||||
return instruction_pointer(regs);
|
||||
}
|
||||
EXPORT_SYMBOL(profile_pc);
|
||||
|
||||
|
||||
@@ -151,10 +151,8 @@ bool tsc_store_and_check_tsc_adjust(bool bootcpu)
|
||||
cur->warned = false;
|
||||
|
||||
/*
|
||||
* If a non-zero TSC value for socket 0 may be valid then the default
|
||||
* adjusted value cannot assumed to be zero either.
|
||||
* The default adjust value cannot be assumed to be zero on any socket.
|
||||
*/
|
||||
if (tsc_async_resets)
|
||||
cur->adjusted = bootval;
|
||||
|
||||
/*
|
||||
|
||||
@@ -148,7 +148,7 @@ AVXcode:
|
||||
65: SEG=GS (Prefix)
|
||||
66: Operand-Size (Prefix)
|
||||
67: Address-Size (Prefix)
|
||||
68: PUSH Iz (d64)
|
||||
68: PUSH Iz
|
||||
69: IMUL Gv,Ev,Iz
|
||||
6a: PUSH Ib (d64)
|
||||
6b: IMUL Gv,Ev,Ib
|
||||
|
||||
@@ -30,7 +30,8 @@ KCOV_INSTRUMENT := n
|
||||
# make up the standalone purgatory.ro
|
||||
|
||||
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
|
||||
|
||||
# Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
|
||||
|
||||
@@ -673,6 +673,15 @@ static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
|
||||
if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) {
|
||||
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;
|
||||
sym_strtab = sec_symtab->link->strtab;
|
||||
for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {
|
||||
|
||||
@@ -236,7 +236,6 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
|
||||
}
|
||||
|
||||
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))
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
ccflags-y := -D_LINUX -DBUILDING_ACPICA
|
||||
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
|
||||
obj-y += acpi.o
|
||||
|
||||
@@ -43,7 +43,6 @@ acpi_ex_system_memory_space_handler(u32 function,
|
||||
struct acpi_mem_space_context *mem_info = region_context;
|
||||
u32 length;
|
||||
acpi_size map_length;
|
||||
acpi_size page_boundary_map_length;
|
||||
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
|
||||
u32 remainder;
|
||||
#endif
|
||||
@@ -120,26 +119,8 @@ acpi_ex_system_memory_space_handler(u32 function,
|
||||
map_length = (acpi_size)
|
||||
((mem_info->address + mem_info->length) - address);
|
||||
|
||||
/*
|
||||
* If mapping the entire remaining portion of the region will cross
|
||||
* 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;
|
||||
}
|
||||
if (map_length > ACPI_DEFAULT_PAGE_SIZE)
|
||||
map_length = ACPI_DEFAULT_PAGE_SIZE;
|
||||
|
||||
/* Create a new mapping starting at the address given */
|
||||
|
||||
|
||||
@@ -519,7 +519,7 @@ struct binder_proc {
|
||||
struct list_head todo;
|
||||
struct binder_stats stats;
|
||||
struct list_head delivered_death;
|
||||
int max_threads;
|
||||
u32 max_threads;
|
||||
int requested_threads;
|
||||
int requested_threads_started;
|
||||
int tmp_ref;
|
||||
@@ -5034,7 +5034,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
goto err;
|
||||
break;
|
||||
case BINDER_SET_MAX_THREADS: {
|
||||
int max_threads;
|
||||
u32 max_threads;
|
||||
|
||||
if (copy_from_user(&max_threads, ubuf,
|
||||
sizeof(max_threads))) {
|
||||
|
||||
@@ -6212,8 +6212,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
|
||||
if (!host)
|
||||
return NULL;
|
||||
|
||||
if (!devres_open_group(dev, NULL, GFP_KERNEL))
|
||||
goto err_free;
|
||||
if (!devres_open_group(dev, NULL, GFP_KERNEL)) {
|
||||
kfree(host);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL);
|
||||
if (!dr)
|
||||
@@ -6245,8 +6247,6 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
|
||||
|
||||
err_out:
|
||||
devres_release_group(dev, NULL);
|
||||
err_free:
|
||||
kfree(host);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -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_data legacy_data[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 ht6560a; /* HT 6560A on primary 1, second 2, both 3 */
|
||||
@@ -1253,8 +1251,10 @@ static __exit void legacy_exit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nr_legacy_host; i++) {
|
||||
for (i = 0; i < NR_HOST; i++) {
|
||||
struct legacy_data *ld = &legacy_data[i];
|
||||
|
||||
if (legacy_host[i])
|
||||
ata_host_detach(legacy_host[i]);
|
||||
platform_device_unregister(ld->platform_dev);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
|
||||
pclk = sg->sata0_pclk;
|
||||
else
|
||||
pclk = sg->sata1_pclk;
|
||||
clk_enable(pclk);
|
||||
ret = clk_enable(pclk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
msleep(10);
|
||||
|
||||
/* Do not keep clocking a bridge that is not online */
|
||||
|
||||
@@ -1684,8 +1684,11 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr,
|
||||
if (!env)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Synchronize with really_probe() */
|
||||
device_lock(dev);
|
||||
/* let the kset specific function add its keys */
|
||||
retval = kset->uevent_ops->uevent(kset, &dev->kobj, env);
|
||||
device_unlock(dev);
|
||||
if (retval)
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -1967,10 +1967,13 @@ static void __exit null_exit(void)
|
||||
|
||||
if (g_queue_mode == NULL_Q_MQ && shared_tags)
|
||||
blk_mq_free_tag_set(&tag_set);
|
||||
|
||||
mutex_destroy(&lock);
|
||||
}
|
||||
|
||||
module_init(null_init);
|
||||
module_exit(null_exit);
|
||||
|
||||
MODULE_AUTHOR("Jens Axboe <axboe@kernel.dk>");
|
||||
MODULE_DESCRIPTION("multi queue aware block test driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -307,8 +307,13 @@ hpet_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
|
||||
if (!devp->hd_ireqfreq)
|
||||
return -EIO;
|
||||
|
||||
if (in_compat_syscall()) {
|
||||
if (count < sizeof(compat_ulong_t))
|
||||
return -EINVAL;
|
||||
} else {
|
||||
if (count < sizeof(unsigned long))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
if (in_compat_syscall()) {
|
||||
retval = put_user(data, (compat_ulong_t __user *)buf);
|
||||
if (!retval)
|
||||
retval = sizeof(compat_ulong_t);
|
||||
} else {
|
||||
retval = put_user(data, (unsigned long __user *)buf);
|
||||
if (!retval)
|
||||
retval = sizeof(unsigned long);
|
||||
}
|
||||
|
||||
out:
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&devp->hd_waitqueue, &wait);
|
||||
@@ -689,12 +701,24 @@ struct compat_hpet_info {
|
||||
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
|
||||
hpet_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct hpet_info info;
|
||||
int err;
|
||||
|
||||
if (cmd == COMPAT_HPET_INFO)
|
||||
cmd = HPET_INFO;
|
||||
|
||||
if (cmd == COMPAT_HPET_IRQFREQ)
|
||||
cmd = HPET_IRQFREQ;
|
||||
|
||||
mutex_lock(&hpet_mutex);
|
||||
err = hpet_ioctl_common(file->private_data, cmd, arg, &info);
|
||||
mutex_unlock(&hpet_mutex);
|
||||
|
||||
@@ -300,28 +300,35 @@ static int register_device(int minor, struct pp_struct *pp)
|
||||
if (!port) {
|
||||
pr_warn("%s: no associated port!\n", name);
|
||||
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));
|
||||
ppdev_cb.irq_func = pp_irq;
|
||||
ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0;
|
||||
ppdev_cb.private = pp;
|
||||
pdev = parport_register_dev_model(port, name, &ppdev_cb, index);
|
||||
parport_put_port(port);
|
||||
|
||||
if (!pdev) {
|
||||
pr_warn("%s: failed to register device!\n", name);
|
||||
rc = -ENXIO;
|
||||
ida_simple_remove(&ida_index, index);
|
||||
goto err;
|
||||
ida_free(&ida_index, index);
|
||||
goto err_put_port;
|
||||
}
|
||||
|
||||
pp->pdev = pdev;
|
||||
pp->index = index;
|
||||
dev_dbg(&pdev->dev, "registered pardevice\n");
|
||||
err:
|
||||
err_put_port:
|
||||
parport_put_port(port);
|
||||
err_free_name:
|
||||
kfree(name);
|
||||
return rc;
|
||||
}
|
||||
@@ -766,7 +773,7 @@ static int pp_release(struct inode *inode, struct file *file)
|
||||
|
||||
if (pp->pdev) {
|
||||
parport_unregister_device(pp->pdev);
|
||||
ida_simple_remove(&ida_index, pp->index);
|
||||
ida_free(&ida_index, pp->index);
|
||||
pp->pdev = NULL;
|
||||
pr_debug(CHRDEV "%x: unregistered pardevice\n", minor);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ menu "CPU Idle"
|
||||
config CPU_IDLE
|
||||
bool "CPU idle PM support"
|
||||
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
|
||||
CPU idle is a generic framework for supporting software-controlled
|
||||
idle processor power management. It includes modular cross-platform
|
||||
|
||||
@@ -506,7 +506,7 @@ static void spu2_dump_omd(u8 *omd, u16 hash_key_len, u16 ciph_key_len,
|
||||
if (hash_iv_len) {
|
||||
packet_log(" Hash IV Length %u bytes\n", hash_iv_len);
|
||||
packet_dump(" hash IV: ", ptr, hash_iv_len);
|
||||
ptr += ciph_key_len;
|
||||
ptr += hash_iv_len;
|
||||
}
|
||||
|
||||
if (ciph_iv_len) {
|
||||
|
||||
@@ -33,30 +33,47 @@ struct sp_platform {
|
||||
unsigned int irq_count;
|
||||
};
|
||||
|
||||
static const struct acpi_device_id sp_acpi_match[];
|
||||
static const struct of_device_id sp_of_match[];
|
||||
static const struct sp_dev_vdata dev_vdata[] = {
|
||||
{
|
||||
.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)
|
||||
{
|
||||
#ifdef CONFIG_OF
|
||||
const struct of_device_id *match;
|
||||
|
||||
match = of_match_node(sp_of_match, pdev->dev.of_node);
|
||||
if (match && match->data)
|
||||
return (struct sp_dev_vdata *)match->data;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev)
|
||||
{
|
||||
#ifdef CONFIG_ACPI
|
||||
const struct acpi_device_id *match;
|
||||
|
||||
match = acpi_match_device(sp_acpi_match, &pdev->dev);
|
||||
if (match && match->driver_data)
|
||||
return (struct sp_dev_vdata *)match->driver_data;
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -201,41 +218,11 @@ static int sp_platform_resume(struct platform_device *pdev)
|
||||
}
|
||||
#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 = {
|
||||
.driver = {
|
||||
.name = "ccp",
|
||||
#ifdef CONFIG_ACPI
|
||||
.acpi_match_table = sp_acpi_match,
|
||||
#endif
|
||||
#ifdef CONFIG_OF
|
||||
.of_match_table = sp_of_match,
|
||||
#endif
|
||||
},
|
||||
.probe = sp_platform_probe,
|
||||
.remove = sp_platform_remove,
|
||||
|
||||
@@ -4875,7 +4875,7 @@ static int select_mode(struct qce_device *pce_dev,
|
||||
pce_dev->intr_cadence = 0;
|
||||
atomic_set(&pce_dev->bunch_cmd_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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,14 +80,14 @@ static dev_t qcedev_device_no;
|
||||
static struct class *driver_class;
|
||||
static struct device *class_dev;
|
||||
|
||||
MODULE_DEVICE_TABLE(of, qcedev_match);
|
||||
|
||||
static const struct of_device_id qcedev_match[] = {
|
||||
{ .compatible = "qcom,qcedev"},
|
||||
{ .compatible = "qcom,qcedev,context-bank"},
|
||||
{}
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, qcedev_match);
|
||||
|
||||
static uint32_t qcedev_get_block_size(enum qcedev_sha_alg_enum alg)
|
||||
{
|
||||
switch (alg) {
|
||||
@@ -1876,6 +1876,7 @@ static inline long qcedev_ioctl(struct file *file,
|
||||
err = -ENOTTY;
|
||||
goto exit_free_qcedev_areq;
|
||||
}
|
||||
/* Fall-through */
|
||||
case QCEDEV_IOCTL_SHA_UPDATE_REQ:
|
||||
{
|
||||
struct scatterlist sg_src;
|
||||
@@ -1926,10 +1927,11 @@ static inline long qcedev_ioctl(struct file *file,
|
||||
handle->sha_ctxt.diglen);
|
||||
mutex_unlock(&hash_access_lock);
|
||||
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;
|
||||
goto exit_free_qcedev_areq;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case QCEDEV_IOCTL_SHA_FINAL_REQ:
|
||||
@@ -2018,10 +2020,11 @@ static inline long qcedev_ioctl(struct file *file,
|
||||
handle->sha_ctxt.diglen);
|
||||
mutex_unlock(&hash_access_lock);
|
||||
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;
|
||||
goto exit_free_qcedev_areq;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case QCEDEV_IOCTL_MAP_BUF_REQ:
|
||||
|
||||
@@ -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)) {
|
||||
/* The device hanged and we can't restart it so stop here */
|
||||
dev_err(&GET_DEV(accel_dev), "Restart device failed\n");
|
||||
if (reset_data->mode == ADF_DEV_RESET_ASYNC ||
|
||||
completion_done(&reset_data->compl))
|
||||
if (reset_data->mode == ADF_DEV_RESET_ASYNC)
|
||||
kfree(reset_data);
|
||||
WARN(1, "QAT: device restart failed. Device is unusable\n");
|
||||
return;
|
||||
@@ -148,16 +147,8 @@ static void adf_device_reset_worker(struct work_struct *work)
|
||||
adf_dev_restarted_notify(accel_dev);
|
||||
clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
|
||||
|
||||
/*
|
||||
* The dev is back alive. Notify the caller if in sync mode
|
||||
*
|
||||
* 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))
|
||||
/* The dev is back alive. Notify the caller if in sync mode */
|
||||
if (reset_data->mode == ADF_DEV_RESET_ASYNC)
|
||||
kfree(reset_data);
|
||||
else
|
||||
complete(&reset_data->compl);
|
||||
@@ -192,10 +183,10 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,
|
||||
if (!timeout) {
|
||||
dev_err(&GET_DEV(accel_dev),
|
||||
"Reset device timeout expired\n");
|
||||
cancel_work_sync(&reset_data->reset_work);
|
||||
ret = -EFAULT;
|
||||
} else {
|
||||
kfree(reset_data);
|
||||
}
|
||||
kfree(reset_data);
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -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);
|
||||
|
||||
spin_lock_irq(&obj->lock);
|
||||
spin_lock(&obj->lock); /* Caller already disabled IRQ. */
|
||||
list_for_each(pos, &obj->pt_list) {
|
||||
struct sync_pt *pt = container_of(pos, struct sync_pt, link);
|
||||
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,
|
||||
|
||||
@@ -710,8 +710,8 @@ static int axi_dmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct axi_dmac *dmac = platform_get_drvdata(pdev);
|
||||
|
||||
of_dma_controller_free(pdev->dev.of_node);
|
||||
free_irq(dmac->irq, dmac);
|
||||
of_dma_controller_free(pdev->dev.of_node);
|
||||
tasklet_kill(&dmac->chan.vchan.task);
|
||||
dma_async_device_unregister(&dmac->dma_dev);
|
||||
clk_disable_unprepare(dmac->clk);
|
||||
|
||||
@@ -172,6 +172,10 @@ static irqreturn_t idma64_irq(int irq, void *dev)
|
||||
u32 status_err;
|
||||
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);
|
||||
|
||||
/* 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;
|
||||
|
||||
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);
|
||||
if (ret)
|
||||
|
||||
@@ -1429,6 +1429,7 @@ module_init(ioat_init_module);
|
||||
static void __exit ioat_exit_module(void)
|
||||
{
|
||||
pci_unregister_driver(&ioat_pci_driver);
|
||||
kmem_cache_destroy(ioat_sed_cache);
|
||||
kmem_cache_destroy(ioat_cache);
|
||||
}
|
||||
module_exit(ioat_exit_module);
|
||||
|
||||
@@ -230,7 +230,7 @@ static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
|
||||
else
|
||||
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)
|
||||
@@ -254,7 +254,7 @@ static void dma_update(struct owl_dma *od, u32 reg, u32 val, bool state)
|
||||
else
|
||||
regval &= ~val;
|
||||
|
||||
writel(val, od->base + reg);
|
||||
writel(regval, od->base + reg);
|
||||
}
|
||||
|
||||
static void dma_writel(struct owl_dma *od, u32 reg, u32 data)
|
||||
|
||||
@@ -101,7 +101,8 @@ config EXTCON_MAX77843
|
||||
|
||||
config EXTCON_MAX8997
|
||||
tristate "Maxim MAX8997 EXTCON Support"
|
||||
depends on MFD_MAX8997 && IRQ_DOMAIN
|
||||
depends on MFD_MAX8997
|
||||
select IRQ_DOMAIN
|
||||
help
|
||||
If you say yes here you get support for the MUIC device of
|
||||
Maxim MAX8997 PMIC. The MAX8997 MUIC is a USB port accessory
|
||||
|
||||
@@ -161,10 +161,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length)
|
||||
if (atomic_read(&buffer->size) == 0)
|
||||
return -ENODEV;
|
||||
|
||||
/* FIXME: Check length <= user_length. */
|
||||
length = buffer->head->length;
|
||||
|
||||
if (length > user_length)
|
||||
return 0;
|
||||
|
||||
end = buffer->data + buffer->capacity;
|
||||
length = buffer->head->length;
|
||||
|
||||
if (&buffer->head->data[length] < end) {
|
||||
if (copy_to_user(data, buffer->head->data, length))
|
||||
|
||||
@@ -2066,6 +2066,8 @@ static void bus_reset_work(struct work_struct *work)
|
||||
|
||||
ohci->generation = generation;
|
||||
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)
|
||||
ohci->request_generation = generation;
|
||||
@@ -2132,12 +2134,14 @@ static irqreturn_t irq_handler(int irq, void *data)
|
||||
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)
|
||||
*/
|
||||
reg_write(ohci, OHCI1394_IntEventClear,
|
||||
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
|
||||
log_irqs(ohci, event);
|
||||
if (event & OHCI1394_busReset)
|
||||
reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
|
||||
|
||||
if (event & OHCI1394_selfIDComplete)
|
||||
queue_work(selfid_workqueue, &ohci->bus_reset_work);
|
||||
|
||||
@@ -161,9 +161,14 @@ static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dmi_dev_release(struct device *dev)
|
||||
{
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static struct class dmi_class = {
|
||||
.name = "dmi",
|
||||
.dev_release = (void(*)(struct device *)) kfree,
|
||||
.dev_release = dmi_dev_release,
|
||||
.dev_uevent = dmi_dev_uevent,
|
||||
};
|
||||
|
||||
|
||||
@@ -95,6 +95,17 @@ static void dmi_decode_table(u8 *buf,
|
||||
(data - buf + sizeof(struct dmi_header)) <= dmi_len) {
|
||||
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
|
||||
* strings) before decoding to make sure we won't run off the
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/mailbox_client.h>
|
||||
#include <linux/mailbox_controller.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
@@ -91,8 +92,8 @@ int rpi_firmware_property_list(struct rpi_firmware *fw,
|
||||
if (size & 3)
|
||||
return -EINVAL;
|
||||
|
||||
buf = dma_alloc_coherent(fw->cl.dev, PAGE_ALIGN(size), &bus_addr,
|
||||
GFP_ATOMIC);
|
||||
buf = dma_alloc_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size),
|
||||
&bus_addr, GFP_ATOMIC);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -120,7 +121,7 @@ int rpi_firmware_property_list(struct rpi_firmware *fw,
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
|
||||
case 0x5e:
|
||||
return GPIOPANELCTL;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,11 @@ static int davinci_gpio_probe(struct platform_device *pdev)
|
||||
else
|
||||
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);
|
||||
chips = devm_kcalloc(dev,
|
||||
nbank, sizeof(struct davinci_gpio_controller),
|
||||
|
||||
@@ -110,7 +110,7 @@ static inline unsigned int to_reg(int gpio, enum ctrl_register reg_type)
|
||||
unsigned int reg;
|
||||
|
||||
if (gpio >= WCOVE_GPIO_NUM)
|
||||
return -EOPNOTSUPP;
|
||||
return -ENOTSUPP;
|
||||
|
||||
if (reg_type == CTRL_IN)
|
||||
reg = GPIO_IN_CTRL_BASE + gpio;
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
/* Impose limit on how much memory KFD can use */
|
||||
static struct {
|
||||
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 userptr_mem_used;
|
||||
int64_t ttm_mem_used;
|
||||
spinlock_t mem_limit_lock;
|
||||
} 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
|
||||
* System (kernel) memory - 3/8th System RAM
|
||||
* Userptr memory - 3/4th System RAM
|
||||
* System (TTM + userptr) memory - 3/4th System RAM
|
||||
* TTM memory - 3/8th System RAM
|
||||
*/
|
||||
void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
|
||||
{
|
||||
@@ -103,48 +103,54 @@ void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
|
||||
mem *= si.mem_unit;
|
||||
|
||||
spin_lock_init(&kfd_mem_limit.mem_limit_lock);
|
||||
kfd_mem_limit.max_system_mem_limit = (mem >> 1) - (mem >> 3);
|
||||
kfd_mem_limit.max_userptr_mem_limit = mem - (mem >> 2);
|
||||
pr_debug("Kernel memory limit %lluM, userptr limit %lluM\n",
|
||||
kfd_mem_limit.max_system_mem_limit = (mem >> 1) + (mem >> 2);
|
||||
kfd_mem_limit.max_ttm_mem_limit = (mem >> 1) - (mem >> 3);
|
||||
pr_debug("Kernel memory limit %lluM, TTM limit %lluM\n",
|
||||
(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,
|
||||
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;
|
||||
|
||||
acc_size = ttm_bo_dma_acc_size(&adev->mman.bdev, size,
|
||||
sizeof(struct amdgpu_bo));
|
||||
|
||||
spin_lock(&kfd_mem_limit.mem_limit_lock);
|
||||
|
||||
if (domain == AMDGPU_GEM_DOMAIN_GTT) {
|
||||
if (kfd_mem_limit.system_mem_used + (acc_size + size) >
|
||||
kfd_mem_limit.max_system_mem_limit) {
|
||||
ret = -ENOMEM;
|
||||
goto err_no_mem;
|
||||
/* TTM GTT memory */
|
||||
system_mem_needed = acc_size + size;
|
||||
ttm_mem_needed = acc_size + size;
|
||||
} else if (domain == AMDGPU_GEM_DOMAIN_CPU && !sg) {
|
||||
/* Userptr */
|
||||
system_mem_needed = acc_size + size;
|
||||
ttm_mem_needed = acc_size;
|
||||
} else {
|
||||
/* VRAM and SG */
|
||||
system_mem_needed = acc_size;
|
||||
ttm_mem_needed = acc_size;
|
||||
}
|
||||
kfd_mem_limit.system_mem_used += (acc_size + size);
|
||||
} else if (domain == AMDGPU_GEM_DOMAIN_CPU) {
|
||||
if ((kfd_mem_limit.system_mem_used + acc_size >
|
||||
|
||||
if ((kfd_mem_limit.system_mem_used + system_mem_needed >
|
||||
kfd_mem_limit.max_system_mem_limit) ||
|
||||
(kfd_mem_limit.userptr_mem_used + (size + acc_size) >
|
||||
kfd_mem_limit.max_userptr_mem_limit)) {
|
||||
(kfd_mem_limit.ttm_mem_used + ttm_mem_needed >
|
||||
kfd_mem_limit.max_ttm_mem_limit))
|
||||
ret = -ENOMEM;
|
||||
goto err_no_mem;
|
||||
else {
|
||||
kfd_mem_limit.system_mem_used += system_mem_needed;
|
||||
kfd_mem_limit.ttm_mem_used += ttm_mem_needed;
|
||||
}
|
||||
kfd_mem_limit.system_mem_used += acc_size;
|
||||
kfd_mem_limit.userptr_mem_used += size;
|
||||
}
|
||||
err_no_mem:
|
||||
|
||||
spin_unlock(&kfd_mem_limit.mem_limit_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -154,14 +160,18 @@ static void unreserve_system_mem_limit(struct amdgpu_device *adev,
|
||||
spin_lock(&kfd_mem_limit.mem_limit_lock);
|
||||
if (domain == AMDGPU_GEM_DOMAIN_GTT) {
|
||||
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.userptr_mem_used -= size;
|
||||
kfd_mem_limit.ttm_mem_used -= acc_size;
|
||||
}
|
||||
WARN_ONCE(kfd_mem_limit.system_mem_used < 0,
|
||||
"kfd system memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.userptr_mem_used < 0,
|
||||
"kfd userptr memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.ttm_mem_used < 0,
|
||||
"kfd TTM memory accounting unbalanced");
|
||||
|
||||
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);
|
||||
|
||||
if (bo->flags & AMDGPU_AMDKFD_USERPTR_BO) {
|
||||
kfd_mem_limit.system_mem_used -= bo->tbo.acc_size;
|
||||
kfd_mem_limit.userptr_mem_used -= amdgpu_bo_size(bo);
|
||||
kfd_mem_limit.system_mem_used -=
|
||||
(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) {
|
||||
kfd_mem_limit.system_mem_used -=
|
||||
(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,
|
||||
"kfd system memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.userptr_mem_used < 0,
|
||||
"kfd userptr memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.ttm_mem_used < 0,
|
||||
"kfd TTM memory accounting unbalanced");
|
||||
|
||||
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);
|
||||
|
||||
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) {
|
||||
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",
|
||||
@@ -1252,10 +1269,11 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
|
||||
allocate_init_user_pages_failed:
|
||||
amdgpu_bo_unref(&bo);
|
||||
/* Don't unreserve system mem limit twice */
|
||||
goto err_reserve_system_mem;
|
||||
goto err_reserve_limit;
|
||||
err_bo_create:
|
||||
unreserve_system_mem_limit(adev, size, alloc_domain);
|
||||
err_reserve_system_mem:
|
||||
unreserve_system_mem_limit(adev, size, alloc_domain, false);
|
||||
err_reserve_limit:
|
||||
amdgpu_sync_free(&(*mem)->sync);
|
||||
mutex_destroy(&(*mem)->lock);
|
||||
kfree(*mem);
|
||||
return ret;
|
||||
|
||||
@@ -2048,6 +2048,37 @@ static void amdgpu_vm_bo_insert_map(struct amdgpu_device *adev,
|
||||
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
|
||||
*
|
||||
@@ -2074,20 +2105,14 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
|
||||
struct amdgpu_bo *bo = bo_va->base.bo;
|
||||
struct amdgpu_vm *vm = bo_va->base.vm;
|
||||
uint64_t eaddr;
|
||||
int r;
|
||||
|
||||
/* validate the parameters */
|
||||
if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK ||
|
||||
size == 0 || size & ~PAGE_MASK)
|
||||
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;
|
||||
r = amdgpu_vm_verify_parameters(adev, bo, saddr, offset, size);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
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);
|
||||
if (tmp) {
|
||||
@@ -2140,16 +2165,9 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev,
|
||||
uint64_t eaddr;
|
||||
int r;
|
||||
|
||||
/* validate the parameters */
|
||||
if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK ||
|
||||
size == 0 || size & ~PAGE_MASK)
|
||||
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;
|
||||
r = amdgpu_vm_verify_parameters(adev, bo, saddr, offset, size);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
/* Allocate all the needed memory */
|
||||
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;
|
||||
eaddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
|
||||
|
||||
mapping->start = saddr;
|
||||
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;
|
||||
LIST_HEAD(removed);
|
||||
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;
|
||||
eaddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
|
||||
|
||||
/* Allocate all the needed memory */
|
||||
before = kzalloc(sizeof(*before), GFP_KERNEL);
|
||||
|
||||
@@ -164,6 +164,8 @@ static void sumo_construct_vid_mapping_table(struct amdgpu_device *adev,
|
||||
|
||||
for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
|
||||
if (table[i].ulSupportedSCLK != 0) {
|
||||
if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
|
||||
continue;
|
||||
vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
|
||||
table[i].usVoltageID;
|
||||
vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =
|
||||
|
||||
@@ -816,6 +816,7 @@ static int dm_resume(void *handle)
|
||||
dc_stream_release(dm_new_crtc_state->stream);
|
||||
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) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user