mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
This is the 4.14.113 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAly6xv4ACgkQONu9yGCS aT4RCw/+KeapZUb7jKuLeYCVUiP4NTkLB5TsgxidbaF1wQEpDuMaYXEiZftX0/IN iCnn6sBO/VIA1l0PA2cGcpBKFRHJVa+tBArj91Z4lJ4eorc0yQDK/iGTjQEZtkHR DMkMDJ7MTYlvIk97krg26+duVk6FCgy3SYHw8yOMBOI+fZTTmwL6OMMGl9n3MA5Q tGD+cppZtmsb59wXuEm2AkTnghd+NN2tl8ObKBd2hEym0lLO4gE9bWBwW6+M6eVx NrEUgHrP0ASXX7kgC6g7liXSuqq15t7GbdJZEXDRFOKgwYK8L15SnYAnYLpjyvnA 1GFSjje/hnFPD5TklNxojOFYT/yQ6a2fZNMb/ZHQMDgzmmXWggG1FXk0f5Otnh/1 2WRvZVPnZI9+GaArzo0uqPAwez7Q7Id5LzfyfZS5tWIyJSgA/pdit1C51vGLe1sB rmW+QM4DtLh8DLF/Nmpj7AmiwEdpJuAQF5Y4T4LPyXBTSaj1nBPKz77UFfr38Jew FzrIi9wZGHv48lTniK7wAErwtPcEg63C8WqEkM3W1gMHQWw2N5diN0OdAA5V8+Gt WF8u2xUtuT44FgOdG94IRwF1tQmJaHZYmJJcx4Bvq9FRTCLCZtMcI3YSkdxRZSB/ YHqjuOuOTH34nnL39vrryw+fyXPp2IQwrsYFiu7UrGR8JiNP3B4= =uZIa -----END PGP SIGNATURE----- Merge 4.14.113 into android-4.14 Changes in 4.14.113 ARC: u-boot args: check that magic number is correct arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM perf/core: Restore mmap record type correctly ext4: add missing brelse() in add_new_gdb_meta_bg() ext4: report real fs size after failed resize ALSA: echoaudio: add a check for ioremap_nocache ALSA: sb8: add a check for request_region auxdisplay: hd44780: Fix memory leak on ->remove() IB/mlx4: Fix race condition between catas error reset and aliasguid flows mmc: davinci: remove extraneous __init annotation ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration thermal/intel_powerclamp: fix __percpu declaration of worker_data thermal: bcm2835: Fix crash in bcm2835_thermal_debugfs thermal/int340x_thermal: Add additional UUIDs thermal/int340x_thermal: fix mode setting thermal/intel_powerclamp: fix truncated kthread name scsi: iscsi: flush running unbind operations when removing a session x86/mm: Don't leak kernel addresses tools/power turbostat: return the exit status of a command perf list: Don't forget to drop the reference to the allocated thread_map perf config: Fix an error in the config template documentation perf config: Fix a memory leak in collect_config() perf build-id: Fix memory leak in print_sdt_events() perf top: Fix error handling in cmd_top() perf hist: Add missing map__put() in error case perf evsel: Free evsel->counts in perf_evsel__exit() perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test perf tests: Fix memory leak by expr__find_other() in test__expr() perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() irqchip/mbigen: Don't clear eventid when freeing an MSI x86/hpet: Prevent potential NULL pointer dereference x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors drm/nouveau/debugfs: Fix check of pm_runtime_get_sync failure iommu/vt-d: Check capability before disabling protected memory x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error fix incorrect error code mapping for OBJECTID_NOT_FOUND ext4: prohibit fstrim in norecovery mode gpio: pxa: handle corner case of unprobed device rsi: improve kernel thread handling to fix kernel panic 9p: do not trust pdu content for stat item size 9p locks: add mount option for lock retry interval f2fs: fix to do sanity check with current segment number netfilter: xt_cgroup: shrink size of v2 path serial: uartps: console_setup() can't be placed to init section powerpc/pseries: Remove prrn_work workqueue media: au0828: cannot kfree dev before usb disconnect HID: i2c-hid: override HID descriptors for certain devices ARM: samsung: Limit SAMSUNG_PM_CHECK config option to non-Exynos platforms usbip: fix vhci_hcd controller counting ACPI / SBS: Fix GPE storm on recent MacBookPro's KVM: nVMX: restore host state in nested_vmx_vmexit for VMFail compiler.h: update definition of unreachable() cifs: fallback to older infolevels on findfirst queryinfo retry kernel: hung_task.c: disable on suspend crypto: sha256/arm - fix crash bug in Thumb2 build crypto: sha512/arm - fix crash bug in Thumb2 build iommu/dmar: Fix buffer overflow during PCI bus notification soc/tegra: pmc: Drop locking from tegra_powergate_is_powered() lkdtm: Print real addresses lkdtm: Add tests for NULL pointer dereference drm/panel: panel-innolux: set display off in innolux_panel_unprepare crypto: axis - fix for recursive locking from bottom half Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk" coresight: cpu-debug: Support for CA73 CPUs drm/nouveau/volt/gf117: fix speedo readout register ARM: 8839/1: kprobe: make patch_lock a raw_spinlock_t drm/amdkfd: use init_mqd function to allocate object for hid_mqd (CI) appletalk: Fix use-after-free in atalk_proc_exit lib/div64.c: off by one in shift include/linux/swap.h: use offsetof() instead of custom __swapoffset macro bpf: fix use after free in bpf_evict_inode dm: disable CRYPTO_TFM_REQ_MAY_SLEEP to fix a GFP_KERNEL recursion deadlock bpf: reduce verifier memory consumption bpf: fix verifier memory leaks bpf: fix verifier NULL pointer dereference bpf: fix stack state printing in verifier log bpf: move {prev_,}insn_idx into verifier env bpf: move tmp variable into ax register in interpreter bpf: enable access to ax register also from verifier rewrite bpf: restrict map value pointer arithmetic for unprivileged bpf: restrict stack pointer arithmetic for unprivileged bpf: restrict unknown scalars of mixed signed bounds for unprivileged bpf: fix check_map_access smin_value test when pointer contains offset bpf: prevent out of bounds speculation on pointer arithmetic bpf: fix sanitation of alu op with pointer / scalar type from different paths bpf: fix inner map masking to prevent oob under speculation bpf: do not restore dst_reg when cur_state is freed bpf: fix sanitation rewrite in case of non-pointers bpf: Fix selftests are changes for CVE 2019-7308 net: stmmac: Set dma ring length before enabling the DMA mm: hide incomplete nr_indirectly_reclaimable in sysfs appletalk: Fix compile regression Linux 4.14.113 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
fde41616bc
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 112
|
||||
SUBLEVEL = 113
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
@ -9,6 +9,7 @@ CONFIG_NAMESPACES=y
|
||||
# CONFIG_UTS_NS is not set
|
||||
# CONFIG_PID_NS is not set
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_EMBEDDED=y
|
||||
CONFIG_PERF_EVENTS=y
|
||||
# CONFIG_VM_EVENT_COUNTERS is not set
|
||||
|
@ -107,6 +107,7 @@ ENTRY(stext)
|
||||
; r2 = pointer to uboot provided cmdline or external DTB in mem
|
||||
; These are handled later in handle_uboot_args()
|
||||
st r0, [@uboot_tag]
|
||||
st r1, [@uboot_magic]
|
||||
st r2, [@uboot_arg]
|
||||
#endif
|
||||
|
||||
|
@ -35,6 +35,7 @@ unsigned int intr_to_DE_cnt;
|
||||
|
||||
/* Part of U-boot ABI: see head.S */
|
||||
int __initdata uboot_tag;
|
||||
int __initdata uboot_magic;
|
||||
char __initdata *uboot_arg;
|
||||
|
||||
const struct machine_desc *machine_desc;
|
||||
@ -433,6 +434,8 @@ static inline bool uboot_arg_invalid(unsigned long addr)
|
||||
#define UBOOT_TAG_NONE 0
|
||||
#define UBOOT_TAG_CMDLINE 1
|
||||
#define UBOOT_TAG_DTB 2
|
||||
/* We always pass 0 as magic from U-boot */
|
||||
#define UBOOT_MAGIC_VALUE 0
|
||||
|
||||
void __init handle_uboot_args(void)
|
||||
{
|
||||
@ -448,6 +451,11 @@ void __init handle_uboot_args(void)
|
||||
goto ignore_uboot_args;
|
||||
}
|
||||
|
||||
if (uboot_magic != UBOOT_MAGIC_VALUE) {
|
||||
pr_warn(IGNORE_ARGS "non zero uboot magic\n");
|
||||
goto ignore_uboot_args;
|
||||
}
|
||||
|
||||
if (uboot_tag != UBOOT_TAG_NONE &&
|
||||
uboot_arg_invalid((unsigned long)uboot_arg)) {
|
||||
pr_warn(IGNORE_ARGS "invalid uboot arg: '%px'\n", uboot_arg);
|
||||
|
@ -205,10 +205,11 @@ K256:
|
||||
.global sha256_block_data_order
|
||||
.type sha256_block_data_order,%function
|
||||
sha256_block_data_order:
|
||||
.Lsha256_block_data_order:
|
||||
#if __ARM_ARCH__<7
|
||||
sub r3,pc,#8 @ sha256_block_data_order
|
||||
#else
|
||||
adr r3,sha256_block_data_order
|
||||
adr r3,.Lsha256_block_data_order
|
||||
#endif
|
||||
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
|
||||
ldr r12,.LOPENSSL_armcap
|
||||
|
@ -86,10 +86,11 @@ K256:
|
||||
.global sha256_block_data_order
|
||||
.type sha256_block_data_order,%function
|
||||
sha256_block_data_order:
|
||||
.Lsha256_block_data_order:
|
||||
#if __ARM_ARCH__<7
|
||||
sub r3,pc,#8 @ sha256_block_data_order
|
||||
#else
|
||||
adr r3,sha256_block_data_order
|
||||
adr r3,.Lsha256_block_data_order
|
||||
#endif
|
||||
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
|
||||
ldr r12,.LOPENSSL_armcap
|
||||
|
@ -267,10 +267,11 @@ WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c,0x4a475817)
|
||||
.global sha512_block_data_order
|
||||
.type sha512_block_data_order,%function
|
||||
sha512_block_data_order:
|
||||
.Lsha512_block_data_order:
|
||||
#if __ARM_ARCH__<7
|
||||
sub r3,pc,#8 @ sha512_block_data_order
|
||||
#else
|
||||
adr r3,sha512_block_data_order
|
||||
adr r3,.Lsha512_block_data_order
|
||||
#endif
|
||||
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
|
||||
ldr r12,.LOPENSSL_armcap
|
||||
|
@ -134,10 +134,11 @@ WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c,0x4a475817)
|
||||
.global sha512_block_data_order
|
||||
.type sha512_block_data_order,%function
|
||||
sha512_block_data_order:
|
||||
.Lsha512_block_data_order:
|
||||
#if __ARM_ARCH__<7
|
||||
sub r3,pc,#8 @ sha512_block_data_order
|
||||
#else
|
||||
adr r3,sha512_block_data_order
|
||||
adr r3,.Lsha512_block_data_order
|
||||
#endif
|
||||
#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
|
||||
ldr r12,.LOPENSSL_armcap
|
||||
|
@ -16,7 +16,7 @@ struct patch {
|
||||
unsigned int insn;
|
||||
};
|
||||
|
||||
static DEFINE_SPINLOCK(patch_lock);
|
||||
static DEFINE_RAW_SPINLOCK(patch_lock);
|
||||
|
||||
static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
|
||||
__acquires(&patch_lock)
|
||||
@ -33,7 +33,7 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags)
|
||||
return addr;
|
||||
|
||||
if (flags)
|
||||
spin_lock_irqsave(&patch_lock, *flags);
|
||||
raw_spin_lock_irqsave(&patch_lock, *flags);
|
||||
else
|
||||
__acquire(&patch_lock);
|
||||
|
||||
@ -48,7 +48,7 @@ static void __kprobes patch_unmap(int fixmap, unsigned long *flags)
|
||||
clear_fixmap(fixmap);
|
||||
|
||||
if (flags)
|
||||
spin_unlock_irqrestore(&patch_lock, *flags);
|
||||
raw_spin_unlock_irqrestore(&patch_lock, *flags);
|
||||
else
|
||||
__release(&patch_lock);
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ config S3C_PM_DEBUG_LED_SMDK
|
||||
|
||||
config SAMSUNG_PM_CHECK
|
||||
bool "S3C2410 PM Suspend Memory CRC"
|
||||
depends on PM
|
||||
depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210)
|
||||
select CRC32
|
||||
help
|
||||
Enable the PM code's memory area checksum over sleep. This option
|
||||
|
@ -274,27 +274,16 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
static s32 prrn_update_scope;
|
||||
|
||||
static void prrn_work_fn(struct work_struct *work)
|
||||
static void handle_prrn_event(s32 scope)
|
||||
{
|
||||
/*
|
||||
* For PRRN, we must pass the negative of the scope value in
|
||||
* the RTAS event.
|
||||
*/
|
||||
pseries_devicetree_update(-prrn_update_scope);
|
||||
pseries_devicetree_update(-scope);
|
||||
numa_update_cpu_topology(false);
|
||||
}
|
||||
|
||||
static DECLARE_WORK(prrn_work, prrn_work_fn);
|
||||
|
||||
static void prrn_schedule_update(u32 scope)
|
||||
{
|
||||
flush_work(&prrn_work);
|
||||
prrn_update_scope = scope;
|
||||
schedule_work(&prrn_work);
|
||||
}
|
||||
|
||||
static void handle_rtas_event(const struct rtas_error_log *log)
|
||||
{
|
||||
if (rtas_error_type(log) != RTAS_TYPE_PRRN || !prrn_is_enabled())
|
||||
@ -303,7 +292,7 @@ static void handle_rtas_event(const struct rtas_error_log *log)
|
||||
/* For PRRN Events the extended log length is used to denote
|
||||
* the scope for calling rtas update-nodes.
|
||||
*/
|
||||
prrn_schedule_update(rtas_error_extended_log_length(log));
|
||||
handle_prrn_event(rtas_error_extended_log_length(log));
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -124,7 +124,7 @@ static void set_cx86_reorder(void)
|
||||
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
||||
|
||||
/* Load/Store Serialize to mem access disable (=reorder it) */
|
||||
setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
|
||||
setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
|
||||
/* set load/store serialize from 1GB to 4GB */
|
||||
ccr3 |= 0xe0;
|
||||
setCx86(CX86_CCR3, ccr3);
|
||||
@ -135,11 +135,11 @@ static void set_cx86_memwb(void)
|
||||
pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
|
||||
|
||||
/* CCR2 bit 2: unlock NW bit */
|
||||
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
|
||||
setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
|
||||
/* set 'Not Write-through' */
|
||||
write_cr0(read_cr0() | X86_CR0_NW);
|
||||
/* CCR2 bit 2: lock NW bit and set WT1 */
|
||||
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
|
||||
setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -153,14 +153,14 @@ static void geode_configure(void)
|
||||
local_irq_save(flags);
|
||||
|
||||
/* Suspend on halt power saving and enable #SUSP pin */
|
||||
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
|
||||
setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
|
||||
|
||||
ccr3 = getCx86(CX86_CCR3);
|
||||
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
||||
|
||||
|
||||
/* FPU fast, DTE cache, Mem bypass */
|
||||
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
|
||||
setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38);
|
||||
setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
|
||||
|
||||
set_cx86_memwb();
|
||||
@ -296,7 +296,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
|
||||
/* GXm supports extended cpuid levels 'ala' AMD */
|
||||
if (c->cpuid_level == 2) {
|
||||
/* Enable cxMMX extensions (GX1 Datasheet 54) */
|
||||
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
|
||||
setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1);
|
||||
|
||||
/*
|
||||
* GXm : 0x30 ... 0x5f GXm datasheet 51
|
||||
@ -319,7 +319,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
|
||||
if (dir1 > 7) {
|
||||
dir0_msn++; /* M II */
|
||||
/* Enable MMX extensions (App note 108) */
|
||||
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
|
||||
setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
|
||||
} else {
|
||||
/* A 6x86MX - it has the bug. */
|
||||
set_cpu_bug(c, X86_BUG_COMA);
|
||||
|
@ -909,6 +909,8 @@ int __init hpet_enable(void)
|
||||
return 0;
|
||||
|
||||
hpet_set_mapping();
|
||||
if (!hpet_virt_address)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Read the period and check for a sane value:
|
||||
|
@ -352,6 +352,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
|
||||
#endif
|
||||
default:
|
||||
WARN_ON_ONCE(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -596,8 +596,8 @@ static int __init smp_scan_config(unsigned long base, unsigned long length)
|
||||
mpf_base = base;
|
||||
mpf_found = true;
|
||||
|
||||
pr_info("found SMP MP-table at [mem %#010lx-%#010lx] mapped at [%p]\n",
|
||||
base, base + sizeof(*mpf) - 1, mpf);
|
||||
pr_info("found SMP MP-table at [mem %#010lx-%#010lx]\n",
|
||||
base, base + sizeof(*mpf) - 1);
|
||||
|
||||
memblock_reserve(base, sizeof(*mpf));
|
||||
if (mpf->physptr)
|
||||
|
@ -11846,24 +11846,6 @@ static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
|
||||
kvm_clear_interrupt_queue(vcpu);
|
||||
}
|
||||
|
||||
static void load_vmcs12_mmu_host_state(struct kvm_vcpu *vcpu,
|
||||
struct vmcs12 *vmcs12)
|
||||
{
|
||||
u32 entry_failure_code;
|
||||
|
||||
nested_ept_uninit_mmu_context(vcpu);
|
||||
|
||||
/*
|
||||
* Only PDPTE load can fail as the value of cr3 was checked on entry and
|
||||
* couldn't have changed.
|
||||
*/
|
||||
if (nested_vmx_load_cr3(vcpu, vmcs12->host_cr3, false, &entry_failure_code))
|
||||
nested_vmx_abort(vcpu, VMX_ABORT_LOAD_HOST_PDPTE_FAIL);
|
||||
|
||||
if (!enable_ept)
|
||||
vcpu->arch.walk_mmu->inject_page_fault = kvm_inject_page_fault;
|
||||
}
|
||||
|
||||
/*
|
||||
* A part of what we need to when the nested L2 guest exits and we want to
|
||||
* run its L1 parent, is to reset L1's guest state to the host state specified
|
||||
@ -11877,6 +11859,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
|
||||
struct vmcs12 *vmcs12)
|
||||
{
|
||||
struct kvm_segment seg;
|
||||
u32 entry_failure_code;
|
||||
|
||||
if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_EFER)
|
||||
vcpu->arch.efer = vmcs12->host_ia32_efer;
|
||||
@ -11903,7 +11886,17 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
|
||||
vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl(CR4_GUEST_HOST_MASK);
|
||||
vmx_set_cr4(vcpu, vmcs12->host_cr4);
|
||||
|
||||
load_vmcs12_mmu_host_state(vcpu, vmcs12);
|
||||
nested_ept_uninit_mmu_context(vcpu);
|
||||
|
||||
/*
|
||||
* Only PDPTE load can fail as the value of cr3 was checked on entry and
|
||||
* couldn't have changed.
|
||||
*/
|
||||
if (nested_vmx_load_cr3(vcpu, vmcs12->host_cr3, false, &entry_failure_code))
|
||||
nested_vmx_abort(vcpu, VMX_ABORT_LOAD_HOST_PDPTE_FAIL);
|
||||
|
||||
if (!enable_ept)
|
||||
vcpu->arch.walk_mmu->inject_page_fault = kvm_inject_page_fault;
|
||||
|
||||
if (enable_vpid) {
|
||||
/*
|
||||
@ -11994,6 +11987,140 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
|
||||
nested_vmx_abort(vcpu, VMX_ABORT_LOAD_HOST_MSR_FAIL);
|
||||
}
|
||||
|
||||
static inline u64 nested_vmx_get_vmcs01_guest_efer(struct vcpu_vmx *vmx)
|
||||
{
|
||||
struct shared_msr_entry *efer_msr;
|
||||
unsigned int i;
|
||||
|
||||
if (vm_entry_controls_get(vmx) & VM_ENTRY_LOAD_IA32_EFER)
|
||||
return vmcs_read64(GUEST_IA32_EFER);
|
||||
|
||||
if (cpu_has_load_ia32_efer)
|
||||
return host_efer;
|
||||
|
||||
for (i = 0; i < vmx->msr_autoload.guest.nr; ++i) {
|
||||
if (vmx->msr_autoload.guest.val[i].index == MSR_EFER)
|
||||
return vmx->msr_autoload.guest.val[i].value;
|
||||
}
|
||||
|
||||
efer_msr = find_msr_entry(vmx, MSR_EFER);
|
||||
if (efer_msr)
|
||||
return efer_msr->data;
|
||||
|
||||
return host_efer;
|
||||
}
|
||||
|
||||
static void nested_vmx_restore_host_state(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
|
||||
struct vcpu_vmx *vmx = to_vmx(vcpu);
|
||||
struct vmx_msr_entry g, h;
|
||||
struct msr_data msr;
|
||||
gpa_t gpa;
|
||||
u32 i, j;
|
||||
|
||||
vcpu->arch.pat = vmcs_read64(GUEST_IA32_PAT);
|
||||
|
||||
if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS) {
|
||||
/*
|
||||
* L1's host DR7 is lost if KVM_GUESTDBG_USE_HW_BP is set
|
||||
* as vmcs01.GUEST_DR7 contains a userspace defined value
|
||||
* and vcpu->arch.dr7 is not squirreled away before the
|
||||
* nested VMENTER (not worth adding a variable in nested_vmx).
|
||||
*/
|
||||
if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
|
||||
kvm_set_dr(vcpu, 7, DR7_FIXED_1);
|
||||
else
|
||||
WARN_ON(kvm_set_dr(vcpu, 7, vmcs_readl(GUEST_DR7)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that calling vmx_set_{efer,cr0,cr4} is important as they
|
||||
* handle a variety of side effects to KVM's software model.
|
||||
*/
|
||||
vmx_set_efer(vcpu, nested_vmx_get_vmcs01_guest_efer(vmx));
|
||||
|
||||
vcpu->arch.cr0_guest_owned_bits = X86_CR0_TS;
|
||||
vmx_set_cr0(vcpu, vmcs_readl(CR0_READ_SHADOW));
|
||||
|
||||
vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl(CR4_GUEST_HOST_MASK);
|
||||
vmx_set_cr4(vcpu, vmcs_readl(CR4_READ_SHADOW));
|
||||
|
||||
nested_ept_uninit_mmu_context(vcpu);
|
||||
vcpu->arch.cr3 = vmcs_readl(GUEST_CR3);
|
||||
__set_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail);
|
||||
|
||||
/*
|
||||
* Use ept_save_pdptrs(vcpu) to load the MMU's cached PDPTRs
|
||||
* from vmcs01 (if necessary). The PDPTRs are not loaded on
|
||||
* VMFail, like everything else we just need to ensure our
|
||||
* software model is up-to-date.
|
||||
*/
|
||||
ept_save_pdptrs(vcpu);
|
||||
|
||||
kvm_mmu_reset_context(vcpu);
|
||||
|
||||
if (cpu_has_vmx_msr_bitmap())
|
||||
vmx_update_msr_bitmap(vcpu);
|
||||
|
||||
/*
|
||||
* This nasty bit of open coding is a compromise between blindly
|
||||
* loading L1's MSRs using the exit load lists (incorrect emulation
|
||||
* of VMFail), leaving the nested VM's MSRs in the software model
|
||||
* (incorrect behavior) and snapshotting the modified MSRs (too
|
||||
* expensive since the lists are unbound by hardware). For each
|
||||
* MSR that was (prematurely) loaded from the nested VMEntry load
|
||||
* list, reload it from the exit load list if it exists and differs
|
||||
* from the guest value. The intent is to stuff host state as
|
||||
* silently as possible, not to fully process the exit load list.
|
||||
*/
|
||||
msr.host_initiated = false;
|
||||
for (i = 0; i < vmcs12->vm_entry_msr_load_count; i++) {
|
||||
gpa = vmcs12->vm_entry_msr_load_addr + (i * sizeof(g));
|
||||
if (kvm_vcpu_read_guest(vcpu, gpa, &g, sizeof(g))) {
|
||||
pr_debug_ratelimited(
|
||||
"%s read MSR index failed (%u, 0x%08llx)\n",
|
||||
__func__, i, gpa);
|
||||
goto vmabort;
|
||||
}
|
||||
|
||||
for (j = 0; j < vmcs12->vm_exit_msr_load_count; j++) {
|
||||
gpa = vmcs12->vm_exit_msr_load_addr + (j * sizeof(h));
|
||||
if (kvm_vcpu_read_guest(vcpu, gpa, &h, sizeof(h))) {
|
||||
pr_debug_ratelimited(
|
||||
"%s read MSR failed (%u, 0x%08llx)\n",
|
||||
__func__, j, gpa);
|
||||
goto vmabort;
|
||||
}
|
||||
if (h.index != g.index)
|
||||
continue;
|
||||
if (h.value == g.value)
|
||||
break;
|
||||
|
||||
if (nested_vmx_load_msr_check(vcpu, &h)) {
|
||||
pr_debug_ratelimited(
|
||||
"%s check failed (%u, 0x%x, 0x%x)\n",
|
||||
__func__, j, h.index, h.reserved);
|
||||
goto vmabort;
|
||||
}
|
||||
|
||||
msr.index = h.index;
|
||||
msr.data = h.value;
|
||||
if (kvm_set_msr(vcpu, &msr)) {
|
||||
pr_debug_ratelimited(
|
||||
"%s WRMSR failed (%u, 0x%x, 0x%llx)\n",
|
||||
__func__, j, h.index, h.value);
|
||||
goto vmabort;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
vmabort:
|
||||
nested_vmx_abort(vcpu, VMX_ABORT_LOAD_HOST_MSR_FAIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Emulate an exit from nested guest (L2) to L1, i.e., prepare to run L1
|
||||
* and modify vmcs12 to make it see what it would expect to see there if
|
||||
@ -12126,7 +12253,13 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason,
|
||||
*/
|
||||
nested_vmx_failValid(vcpu, VMXERR_ENTRY_INVALID_CONTROL_FIELD);
|
||||
|
||||
load_vmcs12_mmu_host_state(vcpu, vmcs12);
|
||||
/*
|
||||
* Restore L1's host state to KVM's software model. We're here
|
||||
* because a consistency check was caught by hardware, which
|
||||
* means some amount of guest state has been propagated to KVM's
|
||||
* model and needs to be unwound to the host's state.
|
||||
*/
|
||||
nested_vmx_restore_host_state(vcpu);
|
||||
|
||||
/*
|
||||
* The emulated instruction was already skipped in
|
||||
|
@ -194,6 +194,7 @@ static struct workqueue_struct *ec_query_wq;
|
||||
static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
|
||||
static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
|
||||
static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */
|
||||
static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Logging/Debugging
|
||||
@ -499,6 +500,26 @@ static inline void __acpi_ec_disable_event(struct acpi_ec *ec)
|
||||
ec_log_drv("event blocked");
|
||||
}
|
||||
|
||||
/*
|
||||
* Process _Q events that might have accumulated in the EC.
|
||||
* Run with locked ec mutex.
|
||||
*/
|
||||
static void acpi_ec_clear(struct acpi_ec *ec)
|
||||
{
|
||||
int i, status;
|
||||
u8 value = 0;
|
||||
|
||||
for (i = 0; i < ACPI_EC_CLEAR_MAX; i++) {
|
||||
status = acpi_ec_query(ec, &value);
|
||||
if (status || !value)
|
||||
break;
|
||||
}
|
||||
if (unlikely(i == ACPI_EC_CLEAR_MAX))
|
||||
pr_warn("Warning: Maximum of %d stale EC events cleared\n", i);
|
||||
else
|
||||
pr_info("%d stale EC events cleared\n", i);
|
||||
}
|
||||
|
||||
static void acpi_ec_enable_event(struct acpi_ec *ec)
|
||||
{
|
||||
unsigned long flags;
|
||||
@ -507,6 +528,10 @@ static void acpi_ec_enable_event(struct acpi_ec *ec)
|
||||
if (acpi_ec_started(ec))
|
||||
__acpi_ec_enable_event(ec);
|
||||
spin_unlock_irqrestore(&ec->lock, flags);
|
||||
|
||||
/* Drain additional events if hardware requires that */
|
||||
if (EC_FLAGS_CLEAR_ON_RESUME)
|
||||
acpi_ec_clear(ec);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
@ -1802,6 +1827,31 @@ static int ec_flag_query_handshake(const struct dmi_system_id *id)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* On some hardware it is necessary to clear events accumulated by the EC during
|
||||
* sleep. These ECs stop reporting GPEs until they are manually polled, if too
|
||||
* many events are accumulated. (e.g. Samsung Series 5/9 notebooks)
|
||||
*
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=44161
|
||||
*
|
||||
* Ideally, the EC should also be instructed NOT to accumulate events during
|
||||
* sleep (which Windows seems to do somehow), but the interface to control this
|
||||
* behaviour is not known at this time.
|
||||
*
|
||||
* Models known to be affected are Samsung 530Uxx/535Uxx/540Uxx/550Pxx/900Xxx,
|
||||
* however it is very likely that other Samsung models are affected.
|
||||
*
|
||||
* On systems which don't accumulate _Q events during sleep, this extra check
|
||||
* should be harmless.
|
||||
*/
|
||||
static int ec_clear_on_resume(const struct dmi_system_id *id)
|
||||
{
|
||||
pr_debug("Detected system needing EC poll on resume.\n");
|
||||
EC_FLAGS_CLEAR_ON_RESUME = 1;
|
||||
ec_event_clearing = ACPI_EC_EVT_TIMING_STATUS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some ECDTs contain wrong register addresses.
|
||||
* MSI MS-171F
|
||||
@ -1851,6 +1901,9 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
|
||||
ec_honor_ecdt_gpe, "ASUS X580VD", {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL},
|
||||
{
|
||||
ec_clear_on_resume, "Samsung hardware", {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
|
||||
{},
|
||||
};
|
||||
|
||||
|
@ -441,9 +441,13 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs)
|
||||
|
||||
/*
|
||||
* The spec requires that bit 4 always be 1. If it's not set, assume
|
||||
* that the implementation doesn't support an SBS charger
|
||||
* that the implementation doesn't support an SBS charger.
|
||||
*
|
||||
* And on some MacBooks a status of 0xffff is always returned, no
|
||||
* matter whether the charger is plugged in or not, which is also
|
||||
* wrong, so ignore the SBS charger for those too.
|
||||
*/
|
||||
if (!((status >> 4) & 0x1))
|
||||
if (!((status >> 4) & 0x1) || status == 0xffff)
|
||||
return -ENODEV;
|
||||
|
||||
sbs->charger_present = (status >> 15) & 0x1;
|
||||
|
@ -302,6 +302,8 @@ static int hd44780_remove(struct platform_device *pdev)
|
||||
struct charlcd *lcd = platform_get_drvdata(pdev);
|
||||
|
||||
charlcd_unregister(lcd);
|
||||
|
||||
kfree(lcd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -197,11 +197,16 @@ static ssize_t node_read_vmstat(struct device *dev,
|
||||
sum_zone_numa_state(nid, i));
|
||||
#endif
|
||||
|
||||
for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
|
||||
for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) {
|
||||
/* Skip hidden vmstat items. */
|
||||
if (*vmstat_text[i + NR_VM_ZONE_STAT_ITEMS +
|
||||
NR_VM_NUMA_STAT_ITEMS] == '\0')
|
||||
continue;
|
||||
n += sprintf(buf+n, "%s %lu\n",
|
||||
vmstat_text[i + NR_VM_ZONE_STAT_ITEMS +
|
||||
NR_VM_NUMA_STAT_ITEMS],
|
||||
node_page_state(pgdat, i));
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
@ -284,6 +284,7 @@ enum artpec6_crypto_hash_flags {
|
||||
|
||||
struct artpec6_crypto_req_common {
|
||||
struct list_head list;
|
||||
struct list_head complete_in_progress;
|
||||
struct artpec6_crypto_dma_descriptors *dma;
|
||||
struct crypto_async_request *req;
|
||||
void (*complete)(struct crypto_async_request *req);
|
||||
@ -2046,7 +2047,8 @@ static int artpec6_crypto_prepare_aead(struct aead_request *areq)
|
||||
return artpec6_crypto_dma_map_descs(common);
|
||||
}
|
||||
|
||||
static void artpec6_crypto_process_queue(struct artpec6_crypto *ac)
|
||||
static void artpec6_crypto_process_queue(struct artpec6_crypto *ac,
|
||||
struct list_head *completions)
|
||||
{
|
||||
struct artpec6_crypto_req_common *req;
|
||||
|
||||
@ -2057,7 +2059,7 @@ static void artpec6_crypto_process_queue(struct artpec6_crypto *ac)
|
||||
list_move_tail(&req->list, &ac->pending);
|
||||
artpec6_crypto_start_dma(req);
|
||||
|
||||
req->req->complete(req->req, -EINPROGRESS);
|
||||
list_add_tail(&req->complete_in_progress, completions);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2087,6 +2089,11 @@ static void artpec6_crypto_task(unsigned long data)
|
||||
struct artpec6_crypto *ac = (struct artpec6_crypto *)data;
|
||||
struct artpec6_crypto_req_common *req;
|
||||
struct artpec6_crypto_req_common *n;
|
||||
struct list_head complete_done;
|
||||
struct list_head complete_in_progress;
|
||||
|
||||
INIT_LIST_HEAD(&complete_done);
|
||||
INIT_LIST_HEAD(&complete_in_progress);
|
||||
|
||||
if (list_empty(&ac->pending)) {
|
||||
pr_debug("Spurious IRQ\n");
|
||||
@ -2120,19 +2127,30 @@ static void artpec6_crypto_task(unsigned long data)
|
||||
|
||||
pr_debug("Completing request %p\n", req);
|
||||
|
||||
list_del(&req->list);
|
||||
list_move_tail(&req->list, &complete_done);
|
||||
|
||||
artpec6_crypto_dma_unmap_all(req);
|
||||
artpec6_crypto_copy_bounce_buffers(req);
|
||||
|
||||
ac->pending_count--;
|
||||
artpec6_crypto_common_destroy(req);
|
||||
}
|
||||
|
||||
artpec6_crypto_process_queue(ac, &complete_in_progress);
|
||||
|
||||
spin_unlock_bh(&ac->queue_lock);
|
||||
|
||||
/* Perform the completion callbacks without holding the queue lock
|
||||
* to allow new request submissions from the callbacks.
|
||||
*/
|
||||
list_for_each_entry_safe(req, n, &complete_done, list) {
|
||||
req->complete(req->req);
|
||||
}
|
||||
|
||||
artpec6_crypto_process_queue(ac);
|
||||
|
||||
spin_unlock_bh(&ac->queue_lock);
|
||||
list_for_each_entry_safe(req, n, &complete_in_progress,
|
||||
complete_in_progress) {
|
||||
req->req->complete(req->req, -EINPROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
static void artpec6_crypto_complete_crypto(struct crypto_async_request *req)
|
||||
|
@ -776,6 +776,9 @@ static int pxa_gpio_suspend(void)
|
||||
struct pxa_gpio_bank *c;
|
||||
int gpio;
|
||||
|
||||
if (!pchip)
|
||||
return 0;
|
||||
|
||||
for_each_gpio_bank(gpio, c, pchip) {
|
||||
c->saved_gplr = readl_relaxed(c->regbase + GPLR_OFFSET);
|
||||
c->saved_gpdr = readl_relaxed(c->regbase + GPDR_OFFSET);
|
||||
@ -794,6 +797,9 @@ static void pxa_gpio_resume(void)
|
||||
struct pxa_gpio_bank *c;
|
||||
int gpio;
|
||||
|
||||
if (!pchip)
|
||||
return;
|
||||
|
||||
for_each_gpio_bank(gpio, c, pchip) {
|
||||
/* restore level with set/clear */
|
||||
writel_relaxed(c->saved_gplr, c->regbase + GPSR_OFFSET);
|
||||
|
@ -285,57 +285,7 @@ static int init_mqd_hiq(struct mqd_manager *mm, void **mqd,
|
||||
struct kfd_mem_obj **mqd_mem_obj, uint64_t *gart_addr,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
uint64_t addr;
|
||||
struct cik_mqd *m;
|
||||
int retval;
|
||||
|
||||
retval = kfd_gtt_sa_allocate(mm->dev, sizeof(struct cik_mqd),
|
||||
mqd_mem_obj);
|
||||
|
||||
if (retval != 0)
|
||||
return -ENOMEM;
|
||||
|
||||
m = (struct cik_mqd *) (*mqd_mem_obj)->cpu_ptr;
|
||||
addr = (*mqd_mem_obj)->gpu_addr;
|
||||
|
||||
memset(m, 0, ALIGN(sizeof(struct cik_mqd), 256));
|
||||
|
||||
m->header = 0xC0310800;
|
||||
m->compute_pipelinestat_enable = 1;
|
||||
m->compute_static_thread_mgmt_se0 = 0xFFFFFFFF;
|
||||
m->compute_static_thread_mgmt_se1 = 0xFFFFFFFF;
|
||||
m->compute_static_thread_mgmt_se2 = 0xFFFFFFFF;
|
||||
m->compute_static_thread_mgmt_se3 = 0xFFFFFFFF;
|
||||
|
||||
m->cp_hqd_persistent_state = DEFAULT_CP_HQD_PERSISTENT_STATE |
|
||||
PRELOAD_REQ;
|
||||
m->cp_hqd_quantum = QUANTUM_EN | QUANTUM_SCALE_1MS |
|
||||
QUANTUM_DURATION(10);
|
||||
|
||||
m->cp_mqd_control = MQD_CONTROL_PRIV_STATE_EN;
|
||||
m->cp_mqd_base_addr_lo = lower_32_bits(addr);
|
||||
m->cp_mqd_base_addr_hi = upper_32_bits(addr);
|
||||
|
||||
m->cp_hqd_ib_control = DEFAULT_MIN_IB_AVAIL_SIZE;
|
||||
|
||||
/*
|
||||
* Pipe Priority
|
||||
* Identifies the pipe relative priority when this queue is connected
|
||||
* to the pipeline. The pipe priority is against the GFX pipe and HP3D.
|
||||
* In KFD we are using a fixed pipe priority set to CS_MEDIUM.
|
||||
* 0 = CS_LOW (typically below GFX)
|
||||
* 1 = CS_MEDIUM (typically between HP3D and GFX
|
||||
* 2 = CS_HIGH (typically above HP3D)
|
||||
*/
|
||||
m->cp_hqd_pipe_priority = 1;
|
||||
m->cp_hqd_queue_priority = 15;
|
||||
|
||||
*mqd = m;
|
||||
if (gart_addr)
|
||||
*gart_addr = addr;
|
||||
retval = mm->update_mqd(mm, m, q);
|
||||
|
||||
return retval;
|
||||
return init_mqd(mm, mqd, mqd_mem_obj, gart_addr, q);
|
||||
}
|
||||
|
||||
static int update_mqd_hiq(struct mqd_manager *mm, void *mqd,
|
||||
|
@ -38,6 +38,7 @@ int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,
|
||||
|
||||
int nv40_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
|
||||
int gf100_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
|
||||
int gf117_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
|
||||
int gk104_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
|
||||
int gk20a_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
|
||||
int gm20b_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
|
||||
|
@ -161,7 +161,7 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf,
|
||||
}
|
||||
|
||||
ret = pm_runtime_get_sync(drm->dev);
|
||||
if (IS_ERR_VALUE(ret) && ret != -EACCES)
|
||||
if (ret < 0 && ret != -EACCES)
|
||||
return ret;
|
||||
ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args));
|
||||
pm_runtime_put_autosuspend(drm->dev);
|
||||
|
@ -1612,7 +1612,7 @@ nvd7_chipset = {
|
||||
.pci = gf106_pci_new,
|
||||
.therm = gf119_therm_new,
|
||||
.timer = nv41_timer_new,
|
||||
.volt = gf100_volt_new,
|
||||
.volt = gf117_volt_new,
|
||||
.ce[0] = gf100_ce_new,
|
||||
.disp = gf119_disp_new,
|
||||
.dma = gf119_dma_new,
|
||||
|
@ -2,6 +2,7 @@ nvkm-y += nvkm/subdev/volt/base.o
|
||||
nvkm-y += nvkm/subdev/volt/gpio.o
|
||||
nvkm-y += nvkm/subdev/volt/nv40.o
|
||||
nvkm-y += nvkm/subdev/volt/gf100.o
|
||||
nvkm-y += nvkm/subdev/volt/gf117.o
|
||||
nvkm-y += nvkm/subdev/volt/gk104.o
|
||||
nvkm-y += nvkm/subdev/volt/gk20a.o
|
||||
nvkm-y += nvkm/subdev/volt/gm20b.o
|
||||
|
60
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c
Normal file
60
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2019 Ilia Mirkin
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors: Ilia Mirkin
|
||||
*/
|
||||
#include "priv.h"
|
||||
|
||||
#include <subdev/fuse.h>
|
||||
|
||||
static int
|
||||
gf117_volt_speedo_read(struct nvkm_volt *volt)
|
||||
{
|
||||
struct nvkm_device *device = volt->subdev.device;
|
||||
struct nvkm_fuse *fuse = device->fuse;
|
||||
|
||||
if (!fuse)
|
||||
return -EINVAL;
|
||||
|
||||
return nvkm_fuse_read(fuse, 0x3a8);
|
||||
}
|
||||
|
||||
static const struct nvkm_volt_func
|
||||
gf117_volt = {
|
||||
.oneinit = gf100_volt_oneinit,
|
||||
.vid_get = nvkm_voltgpio_get,
|
||||
.vid_set = nvkm_voltgpio_set,
|
||||
.speedo_read = gf117_volt_speedo_read,
|
||||
};
|
||||
|
||||
int
|
||||
gf117_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
|
||||
{
|
||||
struct nvkm_volt *volt;
|
||||
int ret;
|
||||
|
||||
ret = nvkm_volt_new_(&gf117_volt, device, index, &volt);
|
||||
*pvolt = volt;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return nvkm_voltgpio_init(volt);
|
||||
}
|
@ -40,7 +40,6 @@ static inline struct innolux_panel *to_innolux_panel(struct drm_panel *panel)
|
||||
static int innolux_panel_disable(struct drm_panel *panel)
|
||||
{
|
||||
struct innolux_panel *innolux = to_innolux_panel(panel);
|
||||
int err;
|
||||
|
||||
if (!innolux->enabled)
|
||||
return 0;
|
||||
@ -48,11 +47,6 @@ static int innolux_panel_disable(struct drm_panel *panel)
|
||||
innolux->backlight->props.power = FB_BLANK_POWERDOWN;
|
||||
backlight_update_status(innolux->backlight);
|
||||
|
||||
err = mipi_dsi_dcs_set_display_off(innolux->link);
|
||||
if (err < 0)
|
||||
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
|
||||
err);
|
||||
|
||||
innolux->enabled = false;
|
||||
|
||||
return 0;
|
||||
@ -66,6 +60,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
|
||||
if (!innolux->prepared)
|
||||
return 0;
|
||||
|
||||
err = mipi_dsi_dcs_set_display_off(innolux->link);
|
||||
if (err < 0)
|
||||
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
|
||||
err);
|
||||
|
||||
err = mipi_dsi_dcs_enter_sleep_mode(innolux->link);
|
||||
if (err < 0) {
|
||||
DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n",
|
||||
|
@ -3,3 +3,6 @@
|
||||
#
|
||||
|
||||
obj-$(CONFIG_I2C_HID) += i2c-hid.o
|
||||
|
||||
i2c-hid-objs = i2c-hid-core.o
|
||||
i2c-hid-$(CONFIG_DMI) += i2c-hid-dmi-quirks.o
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <linux/platform_data/i2c-hid.h>
|
||||
|
||||
#include "../hid-ids.h"
|
||||
#include "i2c-hid.h"
|
||||
|
||||
/* quirks to control the device */
|
||||
#define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
|
||||
@ -663,6 +664,7 @@ static int i2c_hid_parse(struct hid_device *hid)
|
||||
char *rdesc;
|
||||
int ret;
|
||||
int tries = 3;
|
||||
char *use_override;
|
||||
|
||||
i2c_hid_dbg(ihid, "entering %s\n", __func__);
|
||||
|
||||
@ -681,26 +683,37 @@ static int i2c_hid_parse(struct hid_device *hid)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
rdesc = kzalloc(rsize, GFP_KERNEL);
|
||||
use_override = i2c_hid_get_dmi_hid_report_desc_override(client->name,
|
||||
&rsize);
|
||||
|
||||
if (!rdesc) {
|
||||
dbg_hid("couldn't allocate rdesc memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (use_override) {
|
||||
rdesc = use_override;
|
||||
i2c_hid_dbg(ihid, "Using a HID report descriptor override\n");
|
||||
} else {
|
||||
rdesc = kzalloc(rsize, GFP_KERNEL);
|
||||
|
||||
i2c_hid_dbg(ihid, "asking HID report descriptor\n");
|
||||
if (!rdesc) {
|
||||
dbg_hid("couldn't allocate rdesc memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
ret = i2c_hid_command(client, &hid_report_descr_cmd, rdesc, rsize);
|
||||
if (ret) {
|
||||
hid_err(hid, "reading report descriptor failed\n");
|
||||
kfree(rdesc);
|
||||
return -EIO;
|
||||
i2c_hid_dbg(ihid, "asking HID report descriptor\n");
|
||||
|
||||
ret = i2c_hid_command(client, &hid_report_descr_cmd,
|
||||
rdesc, rsize);
|
||||
if (ret) {
|
||||
hid_err(hid, "reading report descriptor failed\n");
|
||||
kfree(rdesc);
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
i2c_hid_dbg(ihid, "Report Descriptor: %*ph\n", rsize, rdesc);
|
||||
|
||||
ret = hid_parse_report(hid, rdesc, rsize);
|
||||
kfree(rdesc);
|
||||
if (!use_override)
|
||||
kfree(rdesc);
|
||||
|
||||
if (ret) {
|
||||
dbg_hid("parsing report descriptor failed\n");
|
||||
return ret;
|
||||
@ -827,12 +840,19 @@ static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
|
||||
int ret;
|
||||
|
||||
/* i2c hid fetch using a fixed descriptor size (30 bytes) */
|
||||
i2c_hid_dbg(ihid, "Fetching the HID descriptor\n");
|
||||
ret = i2c_hid_command(client, &hid_descr_cmd, ihid->hdesc_buffer,
|
||||
sizeof(struct i2c_hid_desc));
|
||||
if (ret) {
|
||||
dev_err(&client->dev, "hid_descr_cmd failed\n");
|
||||
return -ENODEV;
|
||||
if (i2c_hid_get_dmi_i2c_hid_desc_override(client->name)) {
|
||||
i2c_hid_dbg(ihid, "Using a HID descriptor override\n");
|
||||
ihid->hdesc =
|
||||
*i2c_hid_get_dmi_i2c_hid_desc_override(client->name);
|
||||
} else {
|
||||
i2c_hid_dbg(ihid, "Fetching the HID descriptor\n");
|
||||
ret = i2c_hid_command(client, &hid_descr_cmd,
|
||||
ihid->hdesc_buffer,
|
||||
sizeof(struct i2c_hid_desc));
|
||||
if (ret) {
|
||||
dev_err(&client->dev, "hid_descr_cmd failed\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
/* Validate the length of HID descriptor, the 4 first bytes:
|
376
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c
Normal file
376
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c
Normal file
@ -0,0 +1,376 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
/*
|
||||
* Quirks for I2C-HID devices that do not supply proper descriptors
|
||||
*
|
||||
* Copyright (c) 2018 Julian Sax <jsbc@gmx.de>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
|
||||
#include "i2c-hid.h"
|
||||
|
||||
|
||||
struct i2c_hid_desc_override {
|
||||
union {
|
||||
struct i2c_hid_desc *i2c_hid_desc;
|
||||
uint8_t *i2c_hid_desc_buffer;
|
||||
};
|
||||
uint8_t *hid_report_desc;
|
||||
unsigned int hid_report_desc_size;
|
||||
uint8_t *i2c_name;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* descriptors for the SIPODEV SP1064 touchpad
|
||||
*
|
||||
* This device does not supply any descriptors and on windows a filter
|
||||
* driver operates between the i2c-hid layer and the device and injects
|
||||
* these descriptors when the device is prompted. The descriptors were
|
||||
* extracted by listening to the i2c-hid traffic that occurs between the
|
||||
* windows filter driver and the windows i2c-hid driver.
|
||||
*/
|
||||
|
||||
static const struct i2c_hid_desc_override sipodev_desc = {
|
||||
.i2c_hid_desc_buffer = (uint8_t [])
|
||||
{0x1e, 0x00, /* Length of descriptor */
|
||||
0x00, 0x01, /* Version of descriptor */
|
||||
0xdb, 0x01, /* Length of report descriptor */
|
||||
0x21, 0x00, /* Location of report descriptor */
|
||||
0x24, 0x00, /* Location of input report */
|
||||
0x1b, 0x00, /* Max input report length */
|
||||
0x25, 0x00, /* Location of output report */
|
||||
0x11, 0x00, /* Max output report length */
|
||||
0x22, 0x00, /* Location of command register */
|
||||
0x23, 0x00, /* Location of data register */
|
||||
0x11, 0x09, /* Vendor ID */
|
||||
0x88, 0x52, /* Product ID */
|
||||
0x06, 0x00, /* Version ID */
|
||||
0x00, 0x00, 0x00, 0x00 /* Reserved */
|
||||
},
|
||||
|
||||
.hid_report_desc = (uint8_t [])
|
||||
{0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x09, 0x02, /* Usage (Mouse), */
|
||||
0xA1, 0x01, /* Collection (Application), */
|
||||
0x85, 0x01, /* Report ID (1), */
|
||||
0x09, 0x01, /* Usage (Pointer), */
|
||||
0xA1, 0x00, /* Collection (Physical), */
|
||||
0x05, 0x09, /* Usage Page (Button), */
|
||||
0x19, 0x01, /* Usage Minimum (01h), */
|
||||
0x29, 0x02, /* Usage Maximum (02h), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0x81, 0x01, /* Input (Constant), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x09, 0x30, /* Usage (X), */
|
||||
0x09, 0x31, /* Usage (Y), */
|
||||
0x15, 0x81, /* Logical Minimum (-127), */
|
||||
0x25, 0x7F, /* Logical Maximum (127), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x81, 0x06, /* Input (Variable, Relative), */
|
||||
0xC0, /* End Collection, */
|
||||
0xC0, /* End Collection, */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x09, 0x05, /* Usage (Touchpad), */
|
||||
0xA1, 0x01, /* Collection (Application), */
|
||||
0x85, 0x04, /* Report ID (4), */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x09, 0x22, /* Usage (Finger), */
|
||||
0xA1, 0x02, /* Collection (Logical), */
|
||||
0x15, 0x00, /* Logical Minimum (0), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x09, 0x47, /* Usage (Touch Valid), */
|
||||
0x09, 0x42, /* Usage (Tip Switch), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x75, 0x03, /* Report Size (3), */
|
||||
0x25, 0x05, /* Logical Maximum (5), */
|
||||
0x09, 0x51, /* Usage (Contact Identifier), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x03, /* Input (Constant, Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x26, 0x44, 0x0A, /* Logical Maximum (2628), */
|
||||
0x75, 0x10, /* Report Size (16), */
|
||||
0x55, 0x0E, /* Unit Exponent (14), */
|
||||
0x65, 0x11, /* Unit (Centimeter), */
|
||||
0x09, 0x30, /* Usage (X), */
|
||||
0x46, 0x1A, 0x04, /* Physical Maximum (1050), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x46, 0xBC, 0x02, /* Physical Maximum (700), */
|
||||
0x26, 0x34, 0x05, /* Logical Maximum (1332), */
|
||||
0x09, 0x31, /* Usage (Y), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0xC0, /* End Collection, */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x09, 0x22, /* Usage (Finger), */
|
||||
0xA1, 0x02, /* Collection (Logical), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x09, 0x47, /* Usage (Touch Valid), */
|
||||
0x09, 0x42, /* Usage (Tip Switch), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x75, 0x03, /* Report Size (3), */
|
||||
0x25, 0x05, /* Logical Maximum (5), */
|
||||
0x09, 0x51, /* Usage (Contact Identifier), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x03, /* Input (Constant, Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x26, 0x44, 0x0A, /* Logical Maximum (2628), */
|
||||
0x75, 0x10, /* Report Size (16), */
|
||||
0x09, 0x30, /* Usage (X), */
|
||||
0x46, 0x1A, 0x04, /* Physical Maximum (1050), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x46, 0xBC, 0x02, /* Physical Maximum (700), */
|
||||
0x26, 0x34, 0x05, /* Logical Maximum (1332), */
|
||||
0x09, 0x31, /* Usage (Y), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0xC0, /* End Collection, */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x09, 0x22, /* Usage (Finger), */
|
||||
0xA1, 0x02, /* Collection (Logical), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x09, 0x47, /* Usage (Touch Valid), */
|
||||
0x09, 0x42, /* Usage (Tip Switch), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x75, 0x03, /* Report Size (3), */
|
||||
0x25, 0x05, /* Logical Maximum (5), */
|
||||
0x09, 0x51, /* Usage (Contact Identifier), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x03, /* Input (Constant, Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x26, 0x44, 0x0A, /* Logical Maximum (2628), */
|
||||
0x75, 0x10, /* Report Size (16), */
|
||||
0x09, 0x30, /* Usage (X), */
|
||||
0x46, 0x1A, 0x04, /* Physical Maximum (1050), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x46, 0xBC, 0x02, /* Physical Maximum (700), */
|
||||
0x26, 0x34, 0x05, /* Logical Maximum (1332), */
|
||||
0x09, 0x31, /* Usage (Y), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0xC0, /* End Collection, */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x09, 0x22, /* Usage (Finger), */
|
||||
0xA1, 0x02, /* Collection (Logical), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x09, 0x47, /* Usage (Touch Valid), */
|
||||
0x09, 0x42, /* Usage (Tip Switch), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x75, 0x03, /* Report Size (3), */
|
||||
0x25, 0x05, /* Logical Maximum (5), */
|
||||
0x09, 0x51, /* Usage (Contact Identifier), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x03, /* Report Count (3), */
|
||||
0x81, 0x03, /* Input (Constant, Variable), */
|
||||
0x05, 0x01, /* Usage Page (Desktop), */
|
||||
0x26, 0x44, 0x0A, /* Logical Maximum (2628), */
|
||||
0x75, 0x10, /* Report Size (16), */
|
||||
0x09, 0x30, /* Usage (X), */
|
||||
0x46, 0x1A, 0x04, /* Physical Maximum (1050), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x46, 0xBC, 0x02, /* Physical Maximum (700), */
|
||||
0x26, 0x34, 0x05, /* Logical Maximum (1332), */
|
||||
0x09, 0x31, /* Usage (Y), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0xC0, /* End Collection, */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x55, 0x0C, /* Unit Exponent (12), */
|
||||
0x66, 0x01, 0x10, /* Unit (Seconds), */
|
||||
0x47, 0xFF, 0xFF, 0x00, 0x00,/* Physical Maximum (65535), */
|
||||
0x27, 0xFF, 0xFF, 0x00, 0x00,/* Logical Maximum (65535), */
|
||||
0x75, 0x10, /* Report Size (16), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x09, 0x56, /* Usage (Scan Time), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x09, 0x54, /* Usage (Contact Count), */
|
||||
0x25, 0x7F, /* Logical Maximum (127), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x05, 0x09, /* Usage Page (Button), */
|
||||
0x09, 0x01, /* Usage (01h), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x81, 0x02, /* Input (Variable), */
|
||||
0x95, 0x07, /* Report Count (7), */
|
||||
0x81, 0x03, /* Input (Constant, Variable), */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x85, 0x02, /* Report ID (2), */
|
||||
0x09, 0x55, /* Usage (Contact Count Maximum), */
|
||||
0x09, 0x59, /* Usage (59h), */
|
||||
0x75, 0x04, /* Report Size (4), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x25, 0x0F, /* Logical Maximum (15), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x85, 0x07, /* Report ID (7), */
|
||||
0x09, 0x60, /* Usage (60h), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x95, 0x07, /* Report Count (7), */
|
||||
0xB1, 0x03, /* Feature (Constant, Variable), */
|
||||
0x85, 0x06, /* Report ID (6), */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0xC5, /* Usage (C5h), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x96, 0x00, 0x01, /* Report Count (256), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0xC0, /* End Collection, */
|
||||
0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
|
||||
0x09, 0x01, /* Usage (01h), */
|
||||
0xA1, 0x01, /* Collection (Application), */
|
||||
0x85, 0x0D, /* Report ID (13), */
|
||||
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
|
||||
0x19, 0x01, /* Usage Minimum (01h), */
|
||||
0x29, 0x02, /* Usage Maximum (02h), */
|
||||
0x75, 0x08, /* Report Size (8), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0xC0, /* End Collection, */
|
||||
0x05, 0x0D, /* Usage Page (Digitizer), */
|
||||
0x09, 0x0E, /* Usage (Configuration), */
|
||||
0xA1, 0x01, /* Collection (Application), */
|
||||
0x85, 0x03, /* Report ID (3), */
|
||||
0x09, 0x22, /* Usage (Finger), */
|
||||
0xA1, 0x02, /* Collection (Logical), */
|
||||
0x09, 0x52, /* Usage (Device Mode), */
|
||||
0x25, 0x0A, /* Logical Maximum (10), */
|
||||
0x95, 0x01, /* Report Count (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0xC0, /* End Collection, */
|
||||
0x09, 0x22, /* Usage (Finger), */
|
||||
0xA1, 0x00, /* Collection (Physical), */
|
||||
0x85, 0x05, /* Report ID (5), */
|
||||
0x09, 0x57, /* Usage (57h), */
|
||||
0x09, 0x58, /* Usage (58h), */
|
||||
0x75, 0x01, /* Report Size (1), */
|
||||
0x95, 0x02, /* Report Count (2), */
|
||||
0x25, 0x01, /* Logical Maximum (1), */
|
||||
0xB1, 0x02, /* Feature (Variable), */
|
||||
0x95, 0x06, /* Report Count (6), */
|
||||
0xB1, 0x03, /* Feature (Constant, Variable),*/
|
||||
0xC0, /* End Collection, */
|
||||
0xC0 /* End Collection */
|
||||
},
|
||||
.hid_report_desc_size = 475,
|
||||
.i2c_name = "SYNA3602:00"
|
||||
};
|
||||
|
||||
|
||||
static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = {
|
||||
{
|
||||
.ident = "Teclast F6 Pro",
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TECLAST"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "F6 Pro"),
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
},
|
||||
{
|
||||
.ident = "Teclast F7",
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TECLAST"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "F7"),
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
},
|
||||
{
|
||||
.ident = "Trekstor Primebook C13",
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
},
|
||||
{
|
||||
.ident = "Trekstor Primebook C11",
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Primebook C11"),
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
},
|
||||
{
|
||||
.ident = "Direkt-Tek DTLAPY116-2",
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Direkt-Tek"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "DTLAPY116-2"),
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
},
|
||||
{
|
||||
.ident = "Mediacom Flexbook Edge 11",
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "MEDIACOM"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "FlexBook edge11 - M-FBE11"),
|
||||
},
|
||||
.driver_data = (void *)&sipodev_desc
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct i2c_hid_desc *i2c_hid_get_dmi_i2c_hid_desc_override(uint8_t *i2c_name)
|
||||
{
|
||||
struct i2c_hid_desc_override *override;
|
||||
const struct dmi_system_id *system_id;
|
||||
|
||||
system_id = dmi_first_match(i2c_hid_dmi_desc_override_table);
|
||||
if (!system_id)
|
||||
return NULL;
|
||||
|
||||
override = system_id->driver_data;
|
||||
if (strcmp(override->i2c_name, i2c_name))
|
||||
return NULL;
|
||||
|
||||
return override->i2c_hid_desc;
|
||||
}
|
||||
|
||||
char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,
|
||||
unsigned int *size)
|
||||
{
|
||||
struct i2c_hid_desc_override *override;
|
||||
const struct dmi_system_id *system_id;
|
||||
|
||||
system_id = dmi_first_match(i2c_hid_dmi_desc_override_table);
|
||||
if (!system_id)
|
||||
return NULL;
|
||||
|
||||
override = system_id->driver_data;
|
||||
if (strcmp(override->i2c_name, i2c_name))
|
||||
return NULL;
|
||||
|
||||
*size = override->hid_report_desc_size;
|
||||
return override->hid_report_desc;
|
||||
}
|
20
drivers/hid/i2c-hid/i2c-hid.h
Normal file
20
drivers/hid/i2c-hid/i2c-hid.h
Normal file
@ -0,0 +1,20 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
#ifndef I2C_HID_H
|
||||
#define I2C_HID_H
|
||||
|
||||
|
||||
#ifdef CONFIG_DMI
|
||||
struct i2c_hid_desc *i2c_hid_get_dmi_i2c_hid_desc_override(uint8_t *i2c_name);
|
||||
char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,
|
||||
unsigned int *size);
|
||||
#else
|
||||
static inline struct i2c_hid_desc
|
||||
*i2c_hid_get_dmi_i2c_hid_desc_override(uint8_t *i2c_name)
|
||||
{ return NULL; }
|
||||
static inline char *i2c_hid_get_dmi_hid_report_desc_override(uint8_t *i2c_name,
|
||||
unsigned int *size)
|
||||
{ return NULL; }
|
||||
#endif
|
||||
|
||||
#endif
|
@ -680,6 +680,10 @@ static const struct amba_id debug_ids[] = {
|
||||
.id = 0x000bbd08,
|
||||
.mask = 0x000fffff,
|
||||
},
|
||||
{ /* Debug for Cortex-A73 */
|
||||
.id = 0x000bbd09,
|
||||
.mask = 0x000fffff,
|
||||
},
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
|
@ -804,8 +804,8 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev)
|
||||
unsigned long flags;
|
||||
|
||||
for (i = 0 ; i < dev->num_ports; i++) {
|
||||
cancel_delayed_work(&dev->sriov.alias_guid.ports_guid[i].alias_guid_work);
|
||||
det = &sriov->alias_guid.ports_guid[i];
|
||||
cancel_delayed_work_sync(&det->alias_guid_work);
|
||||
spin_lock_irqsave(&sriov->alias_guid.ag_work_lock, flags);
|
||||
while (!list_empty(&det->cb_list)) {
|
||||
cb_ctx = list_entry(det->cb_list.next,
|
||||
|
@ -144,7 +144,7 @@ dmar_alloc_pci_notify_info(struct pci_dev *dev, unsigned long event)
|
||||
for (tmp = dev; tmp; tmp = tmp->bus->self)
|
||||
level++;
|
||||
|
||||
size = sizeof(*info) + level * sizeof(struct acpi_dmar_pci_path);
|
||||
size = sizeof(*info) + level * sizeof(info->path[0]);
|
||||
if (size <= sizeof(dmar_pci_notify_info_buf)) {
|
||||
info = (struct dmar_pci_notify_info *)dmar_pci_notify_info_buf;
|
||||
} else {
|
||||
|
@ -1646,6 +1646,9 @@ static void iommu_disable_protect_mem_regions(struct intel_iommu *iommu)
|
||||
u32 pmen;
|
||||
unsigned long flags;
|
||||
|
||||
if (!cap_plmr(iommu->cap) && !cap_phmr(iommu->cap))
|
||||
return;
|
||||
|
||||
raw_spin_lock_irqsave(&iommu->register_lock, flags);
|
||||
pmen = readl(iommu->reg + DMAR_PMEN_REG);
|
||||
pmen &= ~DMA_PMEN_EPM;
|
||||
|
@ -161,6 +161,9 @@ static void mbigen_write_msg(struct msi_desc *desc, struct msi_msg *msg)
|
||||
void __iomem *base = d->chip_data;
|
||||
u32 val;
|
||||
|
||||
if (!msg->address_lo && !msg->address_hi)
|
||||
return;
|
||||
|
||||
base += get_mbigen_vec_reg(d->hwirq);
|
||||
val = readl_relaxed(base);
|
||||
|
||||
|
@ -334,7 +334,7 @@ static int crypt_iv_essiv_init(struct crypt_config *cc)
|
||||
|
||||
sg_init_one(&sg, cc->key, cc->key_size);
|
||||
ahash_request_set_tfm(req, essiv->hash_tfm);
|
||||
ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP, NULL, NULL);
|
||||
ahash_request_set_callback(req, 0, NULL, NULL);
|
||||
ahash_request_set_crypt(req, &sg, essiv->salt, cc->key_size);
|
||||
|
||||
err = crypto_ahash_digest(req);
|
||||
@ -609,7 +609,7 @@ static int crypt_iv_lmk_one(struct crypt_config *cc, u8 *iv,
|
||||
int i, r;
|
||||
|
||||
desc->tfm = lmk->hash_tfm;
|
||||
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
desc->flags = 0;
|
||||
|
||||
r = crypto_shash_init(desc);
|
||||
if (r)
|
||||
@ -771,7 +771,7 @@ static int crypt_iv_tcw_whitening(struct crypt_config *cc,
|
||||
|
||||
/* calculate crc32 for every 32bit part and xor it */
|
||||
desc->tfm = tcw->crc32_tfm;
|
||||
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
desc->flags = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
r = crypto_shash_init(desc);
|
||||
if (r)
|
||||
@ -1254,7 +1254,7 @@ static void crypt_alloc_req_skcipher(struct crypt_config *cc,
|
||||
* requests if driver request queue is full.
|
||||
*/
|
||||
skcipher_request_set_callback(ctx->r.req,
|
||||
CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
CRYPTO_TFM_REQ_MAY_BACKLOG,
|
||||
kcryptd_async_done, dmreq_of_req(cc, ctx->r.req));
|
||||
}
|
||||
|
||||
@ -1271,7 +1271,7 @@ static void crypt_alloc_req_aead(struct crypt_config *cc,
|
||||
* requests if driver request queue is full.
|
||||
*/
|
||||
aead_request_set_callback(ctx->r.req_aead,
|
||||
CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
CRYPTO_TFM_REQ_MAY_BACKLOG,
|
||||
kcryptd_async_done, dmreq_of_req(cc, ctx->r.req_aead));
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ static void section_mac(struct dm_integrity_c *ic, unsigned section, __u8 result
|
||||
unsigned j, size;
|
||||
|
||||
desc->tfm = ic->journal_mac;
|
||||
desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
desc->flags = 0;
|
||||
|
||||
r = crypto_shash_init(desc);
|
||||
if (unlikely(r)) {
|
||||
@ -637,7 +637,7 @@ static void complete_journal_encrypt(struct crypto_async_request *req, int err)
|
||||
static bool do_crypt(bool encrypt, struct skcipher_request *req, struct journal_completion *comp)
|
||||
{
|
||||
int r;
|
||||
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
|
||||
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
|
||||
complete_journal_encrypt, comp);
|
||||
if (likely(encrypt))
|
||||
r = crypto_skcipher_encrypt(req);
|
||||
|
@ -629,7 +629,6 @@ static int au0828_usb_probe(struct usb_interface *interface,
|
||||
pr_err("%s() au0282_dev_register failed to register on V4L2\n",
|
||||
__func__);
|
||||
mutex_unlock(&dev->lock);
|
||||
kfree(dev);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,9 @@ void lkdtm_EXEC_KMALLOC(void);
|
||||
void lkdtm_EXEC_VMALLOC(void);
|
||||
void lkdtm_EXEC_RODATA(void);
|
||||
void lkdtm_EXEC_USERSPACE(void);
|
||||
void lkdtm_EXEC_NULL(void);
|
||||
void lkdtm_ACCESS_USERSPACE(void);
|
||||
void lkdtm_ACCESS_NULL(void);
|
||||
|
||||
/* lkdtm_refcount.c */
|
||||
void lkdtm_REFCOUNT_INC_OVERFLOW(void);
|
||||
|
@ -220,7 +220,9 @@ struct crashtype crashtypes[] = {
|
||||
CRASHTYPE(EXEC_VMALLOC),
|
||||
CRASHTYPE(EXEC_RODATA),
|
||||
CRASHTYPE(EXEC_USERSPACE),
|
||||
CRASHTYPE(EXEC_NULL),
|
||||
CRASHTYPE(ACCESS_USERSPACE),
|
||||
CRASHTYPE(ACCESS_NULL),
|
||||
CRASHTYPE(WRITE_RO),
|
||||
CRASHTYPE(WRITE_RO_AFTER_INIT),
|
||||
CRASHTYPE(WRITE_KERN),
|
||||
|
@ -47,7 +47,7 @@ static noinline void execute_location(void *dst, bool write)
|
||||
{
|
||||
void (*func)(void) = dst;
|
||||
|
||||
pr_info("attempting ok execution at %p\n", do_nothing);
|
||||
pr_info("attempting ok execution at %px\n", do_nothing);
|
||||
do_nothing();
|
||||
|
||||
if (write == CODE_WRITE) {
|
||||
@ -55,7 +55,7 @@ static noinline void execute_location(void *dst, bool write)
|
||||
flush_icache_range((unsigned long)dst,
|
||||
(unsigned long)dst + EXEC_SIZE);
|
||||
}
|
||||
pr_info("attempting bad execution at %p\n", func);
|
||||
pr_info("attempting bad execution at %px\n", func);
|
||||
func();
|
||||
}
|
||||
|
||||
@ -66,14 +66,14 @@ static void execute_user_location(void *dst)
|
||||
/* Intentionally crossing kernel/user memory boundary. */
|
||||
void (*func)(void) = dst;
|
||||
|
||||
pr_info("attempting ok execution at %p\n", do_nothing);
|
||||
pr_info("attempting ok execution at %px\n", do_nothing);
|
||||
do_nothing();
|
||||
|
||||
copied = access_process_vm(current, (unsigned long)dst, do_nothing,
|
||||
EXEC_SIZE, FOLL_WRITE);
|
||||
if (copied < EXEC_SIZE)
|
||||
return;
|
||||
pr_info("attempting bad execution at %p\n", func);
|
||||
pr_info("attempting bad execution at %px\n", func);
|
||||
func();
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ void lkdtm_WRITE_RO(void)
|
||||
/* Explicitly cast away "const" for the test. */
|
||||
unsigned long *ptr = (unsigned long *)&rodata;
|
||||
|
||||
pr_info("attempting bad rodata write at %p\n", ptr);
|
||||
pr_info("attempting bad rodata write at %px\n", ptr);
|
||||
*ptr ^= 0xabcd1234;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ void lkdtm_WRITE_RO_AFTER_INIT(void)
|
||||
return;
|
||||
}
|
||||
|
||||
pr_info("attempting bad ro_after_init write at %p\n", ptr);
|
||||
pr_info("attempting bad ro_after_init write at %px\n", ptr);
|
||||
*ptr ^= 0xabcd1234;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ void lkdtm_WRITE_KERN(void)
|
||||
size = (unsigned long)do_overwritten - (unsigned long)do_nothing;
|
||||
ptr = (unsigned char *)do_overwritten;
|
||||
|
||||
pr_info("attempting bad %zu byte write at %p\n", size, ptr);
|
||||
pr_info("attempting bad %zu byte write at %px\n", size, ptr);
|
||||
memcpy(ptr, (unsigned char *)do_nothing, size);
|
||||
flush_icache_range((unsigned long)ptr, (unsigned long)(ptr + size));
|
||||
|
||||
@ -164,6 +164,11 @@ void lkdtm_EXEC_USERSPACE(void)
|
||||
vm_munmap(user_addr, PAGE_SIZE);
|
||||
}
|
||||
|
||||
void lkdtm_EXEC_NULL(void)
|
||||
{
|
||||
execute_location(NULL, CODE_AS_IS);
|
||||
}
|
||||
|
||||
void lkdtm_ACCESS_USERSPACE(void)
|
||||
{
|
||||
unsigned long user_addr, tmp = 0;
|
||||
@ -185,16 +190,29 @@ void lkdtm_ACCESS_USERSPACE(void)
|
||||
|
||||
ptr = (unsigned long *)user_addr;
|
||||
|
||||
pr_info("attempting bad read at %p\n", ptr);
|
||||
pr_info("attempting bad read at %px\n", ptr);
|
||||
tmp = *ptr;
|
||||
tmp += 0xc0dec0de;
|
||||
|
||||
pr_info("attempting bad write at %p\n", ptr);
|
||||
pr_info("attempting bad write at %px\n", ptr);
|
||||
*ptr = tmp;
|
||||
|
||||
vm_munmap(user_addr, PAGE_SIZE);
|
||||
}
|
||||
|
||||
void lkdtm_ACCESS_NULL(void)
|
||||
{
|
||||
unsigned long tmp;
|
||||
unsigned long *ptr = (unsigned long *)NULL;
|
||||
|
||||
pr_info("attempting bad read at %px\n", ptr);
|
||||
tmp = *ptr;
|
||||
tmp += 0xc0dec0de;
|
||||
|
||||
pr_info("attempting bad write at %px\n", ptr);
|
||||
*ptr = tmp;
|
||||
}
|
||||
|
||||
void __init lkdtm_perms_init(void)
|
||||
{
|
||||
/* Make sure we can write to __ro_after_init values during __init */
|
||||
|
@ -1118,7 +1118,7 @@ static inline void mmc_davinci_cpufreq_deregister(struct mmc_davinci_host *host)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
static void __init init_mmcsd_host(struct mmc_davinci_host *host)
|
||||
static void init_mmcsd_host(struct mmc_davinci_host *host)
|
||||
{
|
||||
|
||||
mmc_davinci_reset_ctrl(host, 1);
|
||||
|
@ -76,9 +76,9 @@ nfp_bpf_goto_meta(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta,
|
||||
|
||||
static int
|
||||
nfp_bpf_check_exit(struct nfp_prog *nfp_prog,
|
||||
const struct bpf_verifier_env *env)
|
||||
struct bpf_verifier_env *env)
|
||||
{
|
||||
const struct bpf_reg_state *reg0 = &env->cur_state.regs[0];
|
||||
const struct bpf_reg_state *reg0 = cur_regs(env) + BPF_REG_0;
|
||||
u64 imm;
|
||||
|
||||
if (nfp_prog->act == NN_ACT_XDP)
|
||||
@ -113,9 +113,10 @@ nfp_bpf_check_exit(struct nfp_prog *nfp_prog,
|
||||
|
||||
static int
|
||||
nfp_bpf_check_ctx_ptr(struct nfp_prog *nfp_prog,
|
||||
const struct bpf_verifier_env *env, u8 reg)
|
||||
struct bpf_verifier_env *env, u8 reg_no)
|
||||
{
|
||||
if (env->cur_state.regs[reg].type != PTR_TO_CTX)
|
||||
const struct bpf_reg_state *reg = cur_regs(env) + reg_no;
|
||||
if (reg->type != PTR_TO_CTX)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
@ -2536,9 +2536,6 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
|
||||
netdev_warn(priv->dev, "%s: failed debugFS registration\n",
|
||||
__func__);
|
||||
#endif
|
||||
/* Start the ball rolling... */
|
||||
stmmac_start_all_dma(priv);
|
||||
|
||||
priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS;
|
||||
|
||||
if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) {
|
||||
@ -2558,6 +2555,9 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
|
||||
priv->hw->dma->enable_tso(priv->ioaddr, 1, chan);
|
||||
}
|
||||
|
||||
/* Start the ball rolling... */
|
||||
stmmac_start_all_dma(priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,6 @@ static inline int rsi_kill_thread(struct rsi_thread *handle)
|
||||
atomic_inc(&handle->thread_done);
|
||||
rsi_set_event(&handle->event);
|
||||
|
||||
wait_for_completion(&handle->completion);
|
||||
return kthread_stop(handle->task);
|
||||
}
|
||||
|
||||
|
@ -2185,6 +2185,8 @@ void iscsi_remove_session(struct iscsi_cls_session *session)
|
||||
scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE);
|
||||
/* flush running scans then delete devices */
|
||||
flush_work(&session->scan_work);
|
||||
/* flush running unbind operations */
|
||||
flush_work(&session->unbind_work);
|
||||
__iscsi_unbind_session(&session->unbind_work);
|
||||
|
||||
/* hw iscsi may not have removed all connections from session */
|
||||
|
@ -521,16 +521,10 @@ EXPORT_SYMBOL(tegra_powergate_power_off);
|
||||
*/
|
||||
int tegra_powergate_is_powered(unsigned int id)
|
||||
{
|
||||
int status;
|
||||
|
||||
if (!tegra_powergate_is_valid(id))
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&pmc->powergates_lock);
|
||||
status = tegra_powergate_state(id);
|
||||
mutex_unlock(&pmc->powergates_lock);
|
||||
|
||||
return status;
|
||||
return tegra_powergate_state(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -128,8 +128,7 @@ static const struct debugfs_reg32 bcm2835_thermal_regs[] = {
|
||||
|
||||
static void bcm2835_thermal_debugfs(struct platform_device *pdev)
|
||||
{
|
||||
struct thermal_zone_device *tz = platform_get_drvdata(pdev);
|
||||
struct bcm2835_thermal_data *data = tz->devdata;
|
||||
struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
|
||||
struct debugfs_regset32 *regset;
|
||||
|
||||
data->debugfsdir = debugfs_create_dir("bcm2835_thermal", NULL);
|
||||
@ -275,7 +274,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
|
||||
|
||||
data->tz = tz;
|
||||
|
||||
platform_set_drvdata(pdev, tz);
|
||||
platform_set_drvdata(pdev, data);
|
||||
|
||||
/*
|
||||
* Thermal_zone doesn't enable hwmon as default,
|
||||
@ -299,8 +298,8 @@ err_clk:
|
||||
|
||||
static int bcm2835_thermal_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct thermal_zone_device *tz = platform_get_drvdata(pdev);
|
||||
struct bcm2835_thermal_data *data = tz->devdata;
|
||||
struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
|
||||
struct thermal_zone_device *tz = data->tz;
|
||||
|
||||
debugfs_remove_recursive(data->debugfsdir);
|
||||
thermal_zone_of_sensor_unregister(&pdev->dev, tz);
|
||||
|
@ -22,6 +22,13 @@ enum int3400_thermal_uuid {
|
||||
INT3400_THERMAL_PASSIVE_1,
|
||||
INT3400_THERMAL_ACTIVE,
|
||||
INT3400_THERMAL_CRITICAL,
|
||||
INT3400_THERMAL_ADAPTIVE_PERFORMANCE,
|
||||
INT3400_THERMAL_EMERGENCY_CALL_MODE,
|
||||
INT3400_THERMAL_PASSIVE_2,
|
||||
INT3400_THERMAL_POWER_BOSS,
|
||||
INT3400_THERMAL_VIRTUAL_SENSOR,
|
||||
INT3400_THERMAL_COOLING_MODE,
|
||||
INT3400_THERMAL_HARDWARE_DUTY_CYCLING,
|
||||
INT3400_THERMAL_MAXIMUM_UUID,
|
||||
};
|
||||
|
||||
@ -29,6 +36,13 @@ static char *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = {
|
||||
"42A441D6-AE6A-462b-A84B-4A8CE79027D3",
|
||||
"3A95C389-E4B8-4629-A526-C52C88626BAE",
|
||||
"97C68AE7-15FA-499c-B8C9-5DA81D606E0A",
|
||||
"63BE270F-1C11-48FD-A6F7-3AF253FF3E2D",
|
||||
"5349962F-71E6-431D-9AE8-0A635B710AEE",
|
||||
"9E04115A-AE87-4D1C-9500-0F3E340BFE75",
|
||||
"F5A35014-C209-46A4-993A-EB56DE7530A1",
|
||||
"6ED722A7-9240-48A5-B479-31EEF723D7CF",
|
||||
"16CAF1B7-DD38-40ED-B1C1-1B8A1913D531",
|
||||
"BE84BABF-C4D4-403D-B495-3128FD44dAC1",
|
||||
};
|
||||
|
||||
struct int3400_thermal_priv {
|
||||
@ -302,10 +316,9 @@ static int int3400_thermal_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, priv);
|
||||
|
||||
if (priv->uuid_bitmap & 1 << INT3400_THERMAL_PASSIVE_1) {
|
||||
int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
|
||||
int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
|
||||
}
|
||||
int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
|
||||
int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
|
||||
|
||||
priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0,
|
||||
priv, &int3400_thermal_ops,
|
||||
&int3400_thermal_params, 0, 0);
|
||||
|
@ -101,7 +101,7 @@ struct powerclamp_worker_data {
|
||||
bool clamping;
|
||||
};
|
||||
|
||||
static struct powerclamp_worker_data * __percpu worker_data;
|
||||
static struct powerclamp_worker_data __percpu *worker_data;
|
||||
static struct thermal_cooling_device *cooling_dev;
|
||||
static unsigned long *cpu_clamping_mask; /* bit map for tracking per cpu
|
||||
* clamping kthread worker
|
||||
@ -494,7 +494,7 @@ static void start_power_clamp_worker(unsigned long cpu)
|
||||
struct powerclamp_worker_data *w_data = per_cpu_ptr(worker_data, cpu);
|
||||
struct kthread_worker *worker;
|
||||
|
||||
worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inject/%ld", cpu);
|
||||
worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inj/%ld", cpu);
|
||||
if (IS_ERR(worker))
|
||||
return;
|
||||
|
||||
|
@ -1270,7 +1270,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
|
||||
*
|
||||
* Return: 0 on success, negative errno otherwise.
|
||||
*/
|
||||
static int __init cdns_uart_console_setup(struct console *co, char *options)
|
||||
static int cdns_uart_console_setup(struct console *co, char *options)
|
||||
{
|
||||
struct uart_port *port = &cdns_uart_port[co->index];
|
||||
int baud = 9600;
|
||||
|
21
fs/9p/v9fs.c
21
fs/9p/v9fs.c
@ -61,6 +61,8 @@ enum {
|
||||
Opt_cache_loose, Opt_fscache, Opt_mmap,
|
||||
/* Access options */
|
||||
Opt_access, Opt_posixacl,
|
||||
/* Lock timeout option */
|
||||
Opt_locktimeout,
|
||||
/* Error token */
|
||||
Opt_err
|
||||
};
|
||||
@ -80,6 +82,7 @@ static const match_table_t tokens = {
|
||||
{Opt_cachetag, "cachetag=%s"},
|
||||
{Opt_access, "access=%s"},
|
||||
{Opt_posixacl, "posixacl"},
|
||||
{Opt_locktimeout, "locktimeout=%u"},
|
||||
{Opt_err, NULL}
|
||||
};
|
||||
|
||||
@ -187,6 +190,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
|
||||
#ifdef CONFIG_9P_FSCACHE
|
||||
v9ses->cachetag = NULL;
|
||||
#endif
|
||||
v9ses->session_lock_timeout = P9_LOCK_TIMEOUT;
|
||||
|
||||
if (!opts)
|
||||
return 0;
|
||||
@ -360,6 +364,23 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
|
||||
#endif
|
||||
break;
|
||||
|
||||
case Opt_locktimeout:
|
||||
r = match_int(&args[0], &option);
|
||||
if (r < 0) {
|
||||
p9_debug(P9_DEBUG_ERROR,
|
||||
"integer field, but no integer?\n");
|
||||
ret = r;
|
||||
continue;
|
||||
}
|
||||
if (option < 1) {
|
||||
p9_debug(P9_DEBUG_ERROR,
|
||||
"locktimeout must be a greater than zero integer.\n");
|
||||
ret = -EINVAL;
|
||||
continue;
|
||||
}
|
||||
v9ses->session_lock_timeout = (long)option * HZ;
|
||||
break;
|
||||
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
@ -116,6 +116,7 @@ struct v9fs_session_info {
|
||||
struct p9_client *clnt; /* 9p client */
|
||||
struct list_head slist; /* list of sessions registered with v9fs */
|
||||
struct rw_semaphore rename_sem;
|
||||
long session_lock_timeout; /* retry interval for blocking locks */
|
||||
};
|
||||
|
||||
/* cache_validity flags */
|
||||
|
@ -105,7 +105,6 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
|
||||
int err = 0;
|
||||
struct p9_fid *fid;
|
||||
int buflen;
|
||||
int reclen = 0;
|
||||
struct p9_rdir *rdir;
|
||||
struct kvec kvec;
|
||||
|
||||
@ -138,11 +137,10 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
|
||||
while (rdir->head < rdir->tail) {
|
||||
err = p9stat_read(fid->clnt, rdir->buf + rdir->head,
|
||||
rdir->tail - rdir->head, &st);
|
||||
if (err) {
|
||||
if (err <= 0) {
|
||||
p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
|
||||
return -EIO;
|
||||
}
|
||||
reclen = st.size+2;
|
||||
|
||||
over = !dir_emit(ctx, st.name, strlen(st.name),
|
||||
v9fs_qid2ino(&st.qid), dt_type(&st));
|
||||
@ -150,8 +148,8 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)
|
||||
if (over)
|
||||
return 0;
|
||||
|
||||
rdir->head += reclen;
|
||||
ctx->pos += reclen;
|
||||
rdir->head += err;
|
||||
ctx->pos += err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
|
||||
uint8_t status = P9_LOCK_ERROR;
|
||||
int res = 0;
|
||||
unsigned char fl_type;
|
||||
struct v9fs_session_info *v9ses;
|
||||
|
||||
fid = filp->private_data;
|
||||
BUG_ON(fid == NULL);
|
||||
@ -189,6 +190,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
|
||||
if (IS_SETLKW(cmd))
|
||||
flock.flags = P9_LOCK_FLAGS_BLOCK;
|
||||
|
||||
v9ses = v9fs_inode2v9ses(file_inode(filp));
|
||||
|
||||
/*
|
||||
* if its a blocked request and we get P9_LOCK_BLOCKED as the status
|
||||
* for lock request, keep on trying
|
||||
@ -202,7 +205,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
|
||||
break;
|
||||
if (status == P9_LOCK_BLOCKED && !IS_SETLKW(cmd))
|
||||
break;
|
||||
if (schedule_timeout_interruptible(P9_LOCK_TIMEOUT) != 0)
|
||||
if (schedule_timeout_interruptible(v9ses->session_lock_timeout)
|
||||
!= 0)
|
||||
break;
|
||||
/*
|
||||
* p9_client_lock_dotl overwrites flock.client_id with the
|
||||
|
@ -779,43 +779,50 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
|
||||
} else if ((rc == -EACCES) && backup_cred(cifs_sb) &&
|
||||
(strcmp(server->vals->version_string, SMB1_VERSION_STRING)
|
||||
== 0)) {
|
||||
/*
|
||||
* For SMB2 and later the backup intent flag is already
|
||||
* sent if needed on open and there is no path based
|
||||
* FindFirst operation to use to retry with
|
||||
*/
|
||||
/*
|
||||
* For SMB2 and later the backup intent flag is already
|
||||
* sent if needed on open and there is no path based
|
||||
* FindFirst operation to use to retry with
|
||||
*/
|
||||
|
||||
srchinf = kzalloc(sizeof(struct cifs_search_info),
|
||||
GFP_KERNEL);
|
||||
if (srchinf == NULL) {
|
||||
rc = -ENOMEM;
|
||||
goto cgii_exit;
|
||||
}
|
||||
srchinf = kzalloc(sizeof(struct cifs_search_info),
|
||||
GFP_KERNEL);
|
||||
if (srchinf == NULL) {
|
||||
rc = -ENOMEM;
|
||||
goto cgii_exit;
|
||||
}
|
||||
|
||||
srchinf->endOfSearch = false;
|
||||
srchinf->endOfSearch = false;
|
||||
if (tcon->unix_ext)
|
||||
srchinf->info_level = SMB_FIND_FILE_UNIX;
|
||||
else if ((tcon->ses->capabilities &
|
||||
tcon->ses->server->vals->cap_nt_find) == 0)
|
||||
srchinf->info_level = SMB_FIND_FILE_INFO_STANDARD;
|
||||
else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
|
||||
srchinf->info_level = SMB_FIND_FILE_ID_FULL_DIR_INFO;
|
||||
else /* no srvino useful for fallback to some netapp */
|
||||
srchinf->info_level = SMB_FIND_FILE_DIRECTORY_INFO;
|
||||
|
||||
srchflgs = CIFS_SEARCH_CLOSE_ALWAYS |
|
||||
CIFS_SEARCH_CLOSE_AT_END |
|
||||
CIFS_SEARCH_BACKUP_SEARCH;
|
||||
srchflgs = CIFS_SEARCH_CLOSE_ALWAYS |
|
||||
CIFS_SEARCH_CLOSE_AT_END |
|
||||
CIFS_SEARCH_BACKUP_SEARCH;
|
||||
|
||||
rc = CIFSFindFirst(xid, tcon, full_path,
|
||||
cifs_sb, NULL, srchflgs, srchinf, false);
|
||||
if (!rc) {
|
||||
data =
|
||||
(FILE_ALL_INFO *)srchinf->srch_entries_start;
|
||||
rc = CIFSFindFirst(xid, tcon, full_path,
|
||||
cifs_sb, NULL, srchflgs, srchinf, false);
|
||||
if (!rc) {
|
||||
data = (FILE_ALL_INFO *)srchinf->srch_entries_start;
|
||||
|
||||
cifs_dir_info_to_fattr(&fattr,
|
||||
(FILE_DIRECTORY_INFO *)data, cifs_sb);
|
||||
fattr.cf_uniqueid = le64_to_cpu(
|
||||
((SEARCH_ID_FULL_DIR_INFO *)data)->UniqueId);
|
||||
validinum = true;
|
||||
cifs_dir_info_to_fattr(&fattr,
|
||||
(FILE_DIRECTORY_INFO *)data, cifs_sb);
|
||||
fattr.cf_uniqueid = le64_to_cpu(
|
||||
((SEARCH_ID_FULL_DIR_INFO *)data)->UniqueId);
|
||||
validinum = true;
|
||||
|
||||
cifs_buf_release(srchinf->ntwrk_buf_start);
|
||||
}
|
||||
kfree(srchinf);
|
||||
if (rc)
|
||||
goto cgii_exit;
|
||||
cifs_buf_release(srchinf->ntwrk_buf_start);
|
||||
}
|
||||
kfree(srchinf);
|
||||
if (rc)
|
||||
goto cgii_exit;
|
||||
} else
|
||||
goto cgii_exit;
|
||||
|
||||
|
@ -1035,7 +1035,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
|
||||
{STATUS_UNFINISHED_CONTEXT_DELETED, -EIO,
|
||||
"STATUS_UNFINISHED_CONTEXT_DELETED"},
|
||||
{STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"},
|
||||
{STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"},
|
||||
/* Note that ENOATTTR and ENODATA are the same errno */
|
||||
{STATUS_OBJECTID_NOT_FOUND, -ENODATA, "STATUS_OBJECTID_NOT_FOUND"},
|
||||
{STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"},
|
||||
{STATUS_WRONG_CREDENTIAL_HANDLE, -EIO,
|
||||
"STATUS_WRONG_CREDENTIAL_HANDLE"},
|
||||
|
@ -940,6 +940,13 @@ resizefs_out:
|
||||
if (!blk_queue_discard(q))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/*
|
||||
* We haven't replayed the journal, so we cannot use our
|
||||
* block-bitmap-guided storage zapping commands.
|
||||
*/
|
||||
if (test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb))
|
||||
return -EROFS;
|
||||
|
||||
if (copy_from_user(&range, (struct fstrim_range __user *)arg,
|
||||
sizeof(range)))
|
||||
return -EFAULT;
|
||||
|
@ -907,11 +907,18 @@ static int add_new_gdb_meta_bg(struct super_block *sb,
|
||||
memcpy(n_group_desc, o_group_desc,
|
||||
EXT4_SB(sb)->s_gdb_count * sizeof(struct buffer_head *));
|
||||
n_group_desc[gdb_num] = gdb_bh;
|
||||
|
||||
BUFFER_TRACE(gdb_bh, "get_write_access");
|
||||
err = ext4_journal_get_write_access(handle, gdb_bh);
|
||||
if (err) {
|
||||
kvfree(n_group_desc);
|
||||
brelse(gdb_bh);
|
||||
return err;
|
||||
}
|
||||
|
||||
EXT4_SB(sb)->s_group_desc = n_group_desc;
|
||||
EXT4_SB(sb)->s_gdb_count++;
|
||||
kvfree(o_group_desc);
|
||||
BUFFER_TRACE(gdb_bh, "get_write_access");
|
||||
err = ext4_journal_get_write_access(handle, gdb_bh);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -2042,6 +2049,10 @@ out:
|
||||
free_flex_gd(flex_gd);
|
||||
if (resize_inode != NULL)
|
||||
iput(resize_inode);
|
||||
ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", n_blocks_count);
|
||||
if (err)
|
||||
ext4_warning(sb, "error (%d) occurred during "
|
||||
"file system resize", err);
|
||||
ext4_msg(sb, KERN_INFO, "resized filesystem to %llu",
|
||||
ext4_blocks_count(es));
|
||||
return err;
|
||||
}
|
||||
|
@ -151,19 +151,29 @@ extern int sysctl_aarp_retransmit_limit;
|
||||
extern int sysctl_aarp_resolve_time;
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
extern void atalk_register_sysctl(void);
|
||||
extern int atalk_register_sysctl(void);
|
||||
extern void atalk_unregister_sysctl(void);
|
||||
#else
|
||||
#define atalk_register_sysctl() do { } while(0)
|
||||
#define atalk_unregister_sysctl() do { } while(0)
|
||||
static inline int atalk_register_sysctl(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void atalk_unregister_sysctl(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
extern int atalk_proc_init(void);
|
||||
extern void atalk_proc_exit(void);
|
||||
#else
|
||||
#define atalk_proc_init() ({ 0; })
|
||||
#define atalk_proc_exit() do { } while(0)
|
||||
static inline int atalk_proc_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void atalk_proc_exit(void)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
#endif /* __LINUX_ATALK_H__ */
|
||||
|
@ -91,14 +91,20 @@ enum bpf_stack_slot_type {
|
||||
|
||||
#define BPF_REG_SIZE 8 /* size of eBPF register in bytes */
|
||||
|
||||
struct bpf_stack_state {
|
||||
struct bpf_reg_state spilled_ptr;
|
||||
u8 slot_type[BPF_REG_SIZE];
|
||||
};
|
||||
|
||||
/* state of the program:
|
||||
* type of all registers and stack info
|
||||
*/
|
||||
struct bpf_verifier_state {
|
||||
struct bpf_reg_state regs[MAX_BPF_REG];
|
||||
u8 stack_slot_type[MAX_BPF_STACK];
|
||||
struct bpf_reg_state spilled_regs[MAX_BPF_STACK / BPF_REG_SIZE];
|
||||
struct bpf_verifier_state *parent;
|
||||
int allocated_stack;
|
||||
struct bpf_stack_state *stack;
|
||||
bool speculative;
|
||||
};
|
||||
|
||||
/* linked list of verifier states used to prune search */
|
||||
@ -107,14 +113,24 @@ struct bpf_verifier_state_list {
|
||||
struct bpf_verifier_state_list *next;
|
||||
};
|
||||
|
||||
/* Possible states for alu_state member. */
|
||||
#define BPF_ALU_SANITIZE_SRC 1U
|
||||
#define BPF_ALU_SANITIZE_DST 2U
|
||||
#define BPF_ALU_NEG_VALUE (1U << 2)
|
||||
#define BPF_ALU_NON_POINTER (1U << 3)
|
||||
#define BPF_ALU_SANITIZE (BPF_ALU_SANITIZE_SRC | \
|
||||
BPF_ALU_SANITIZE_DST)
|
||||
|
||||
struct bpf_insn_aux_data {
|
||||
union {
|
||||
enum bpf_reg_type ptr_type; /* pointer type for load/store insns */
|
||||
struct bpf_map *map_ptr; /* pointer for call insn into lookup_elem */
|
||||
u32 alu_limit; /* limit for add/sub register with pointer */
|
||||
};
|
||||
int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
|
||||
int sanitize_stack_off; /* stack slot to be cleared */
|
||||
bool seen; /* this insn was processed by the verifier */
|
||||
u8 alu_state; /* used in combination with alu_limit */
|
||||
};
|
||||
|
||||
#define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */
|
||||
@ -129,11 +145,13 @@ struct bpf_ext_analyzer_ops {
|
||||
* one verifier_env per bpf_check() call
|
||||
*/
|
||||
struct bpf_verifier_env {
|
||||
u32 insn_idx;
|
||||
u32 prev_insn_idx;
|
||||
struct bpf_prog *prog; /* eBPF program being verified */
|
||||
struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */
|
||||
int stack_size; /* number of states to be processed */
|
||||
bool strict_alignment; /* perform strict pointer alignment checks */
|
||||
struct bpf_verifier_state cur_state; /* current verifier state */
|
||||
struct bpf_verifier_state *cur_state; /* current verifier state */
|
||||
struct bpf_verifier_state_list **explored_states; /* search pruning optimization */
|
||||
const struct bpf_ext_analyzer_ops *analyzer_ops; /* external analyzer ops */
|
||||
void *analyzer_priv; /* pointer to external analyzer's private data */
|
||||
@ -145,6 +163,11 @@ struct bpf_verifier_env {
|
||||
struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */
|
||||
};
|
||||
|
||||
static inline struct bpf_reg_state *cur_regs(struct bpf_verifier_env *env)
|
||||
{
|
||||
return env->cur_state->regs;
|
||||
}
|
||||
|
||||
int bpf_analyzer(struct bpf_prog *prog, const struct bpf_ext_analyzer_ops *ops,
|
||||
void *priv);
|
||||
|
||||
|
@ -119,7 +119,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
||||
# define ASM_UNREACHABLE
|
||||
#endif
|
||||
#ifndef unreachable
|
||||
# define unreachable() do { annotate_reachable(); do { } while (1); } while (0)
|
||||
# define unreachable() do { \
|
||||
annotate_unreachable(); \
|
||||
__builtin_unreachable(); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -46,14 +46,10 @@ struct bpf_prog_aux;
|
||||
#define BPF_REG_X BPF_REG_7
|
||||
#define BPF_REG_TMP BPF_REG_8
|
||||
|
||||
/* Kernel hidden auxiliary/helper register for hardening step.
|
||||
* Only used by eBPF JITs. It's nothing more than a temporary
|
||||
* register that JITs use internally, only that here it's part
|
||||
* of eBPF instructions that have been rewritten for blinding
|
||||
* constants. See JIT pre-step in bpf_jit_blind_constants().
|
||||
*/
|
||||
/* Kernel hidden auxiliary/helper register. */
|
||||
#define BPF_REG_AX MAX_BPF_REG
|
||||
#define MAX_BPF_JIT_REG (MAX_BPF_REG + 1)
|
||||
#define MAX_BPF_EXT_REG (MAX_BPF_REG + 1)
|
||||
#define MAX_BPF_JIT_REG MAX_BPF_EXT_REG
|
||||
|
||||
/* unused opcode to mark special call to bpf_tail_call() helper */
|
||||
#define BPF_TAIL_CALL 0xf0
|
||||
|
@ -155,9 +155,9 @@ struct swap_extent {
|
||||
/*
|
||||
* Max bad pages in the new format..
|
||||
*/
|
||||
#define __swapoffset(x) ((unsigned long)&((union swap_header *)0)->x)
|
||||
#define MAX_SWAP_BADPAGES \
|
||||
((__swapoffset(magic.magic) - __swapoffset(info.badpages)) / sizeof(int))
|
||||
((offsetof(union swap_header, magic.magic) - \
|
||||
offsetof(union swap_header, info.badpages)) / sizeof(int))
|
||||
|
||||
enum {
|
||||
SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
|
||||
|
@ -22,4 +22,20 @@ struct xt_cgroup_info_v1 {
|
||||
void *priv __attribute__((aligned(8)));
|
||||
};
|
||||
|
||||
#define XT_CGROUP_PATH_MAX 512
|
||||
|
||||
struct xt_cgroup_info_v2 {
|
||||
__u8 has_path;
|
||||
__u8 has_classid;
|
||||
__u8 invert_path;
|
||||
__u8 invert_classid;
|
||||
union {
|
||||
char path[XT_CGROUP_PATH_MAX];
|
||||
__u32 classid;
|
||||
};
|
||||
|
||||
/* kernel internal data */
|
||||
void *priv __attribute__((aligned(8)));
|
||||
};
|
||||
|
||||
#endif /* _UAPI_XT_CGROUP_H */
|
||||
|
@ -51,6 +51,7 @@
|
||||
#define DST regs[insn->dst_reg]
|
||||
#define SRC regs[insn->src_reg]
|
||||
#define FP regs[BPF_REG_FP]
|
||||
#define AX regs[BPF_REG_AX]
|
||||
#define ARG1 regs[BPF_REG_ARG1]
|
||||
#define CTX regs[BPF_REG_CTX]
|
||||
#define IMM insn->imm
|
||||
@ -552,6 +553,26 @@ static int bpf_jit_blind_insn(const struct bpf_insn *from,
|
||||
BUILD_BUG_ON(BPF_REG_AX + 1 != MAX_BPF_JIT_REG);
|
||||
BUILD_BUG_ON(MAX_BPF_REG + 1 != MAX_BPF_JIT_REG);
|
||||
|
||||
/* Constraints on AX register:
|
||||
*
|
||||
* AX register is inaccessible from user space. It is mapped in
|
||||
* all JITs, and used here for constant blinding rewrites. It is
|
||||
* typically "stateless" meaning its contents are only valid within
|
||||
* the executed instruction, but not across several instructions.
|
||||
* There are a few exceptions however which are further detailed
|
||||
* below.
|
||||
*
|
||||
* Constant blinding is only used by JITs, not in the interpreter.
|
||||
* The interpreter uses AX in some occasions as a local temporary
|
||||
* register e.g. in DIV or MOD instructions.
|
||||
*
|
||||
* In restricted circumstances, the verifier can also use the AX
|
||||
* register for rewrites as long as they do not interfere with
|
||||
* the above cases!
|
||||
*/
|
||||
if (from->dst_reg == BPF_REG_AX || from->src_reg == BPF_REG_AX)
|
||||
goto out;
|
||||
|
||||
if (from->imm == 0 &&
|
||||
(from->code == (BPF_ALU | BPF_MOV | BPF_K) ||
|
||||
from->code == (BPF_ALU64 | BPF_MOV | BPF_K))) {
|
||||
@ -939,22 +960,22 @@ select_insn:
|
||||
ALU64_MOD_X:
|
||||
if (unlikely(SRC == 0))
|
||||
return 0;
|
||||
div64_u64_rem(DST, SRC, &tmp);
|
||||
DST = tmp;
|
||||
div64_u64_rem(DST, SRC, &AX);
|
||||
DST = AX;
|
||||
CONT;
|
||||
ALU_MOD_X:
|
||||
if (unlikely((u32)SRC == 0))
|
||||
return 0;
|
||||
tmp = (u32) DST;
|
||||
DST = do_div(tmp, (u32) SRC);
|
||||
AX = (u32) DST;
|
||||
DST = do_div(AX, (u32) SRC);
|
||||
CONT;
|
||||
ALU64_MOD_K:
|
||||
div64_u64_rem(DST, IMM, &tmp);
|
||||
DST = tmp;
|
||||
div64_u64_rem(DST, IMM, &AX);
|
||||
DST = AX;
|
||||
CONT;
|
||||
ALU_MOD_K:
|
||||
tmp = (u32) DST;
|
||||
DST = do_div(tmp, (u32) IMM);
|
||||
AX = (u32) DST;
|
||||
DST = do_div(AX, (u32) IMM);
|
||||
CONT;
|
||||
ALU64_DIV_X:
|
||||
if (unlikely(SRC == 0))
|
||||
@ -964,17 +985,17 @@ select_insn:
|
||||
ALU_DIV_X:
|
||||
if (unlikely((u32)SRC == 0))
|
||||
return 0;
|
||||
tmp = (u32) DST;
|
||||
do_div(tmp, (u32) SRC);
|
||||
DST = (u32) tmp;
|
||||
AX = (u32) DST;
|
||||
do_div(AX, (u32) SRC);
|
||||
DST = (u32) AX;
|
||||
CONT;
|
||||
ALU64_DIV_K:
|
||||
DST = div64_u64(DST, IMM);
|
||||
CONT;
|
||||
ALU_DIV_K:
|
||||
tmp = (u32) DST;
|
||||
do_div(tmp, (u32) IMM);
|
||||
DST = (u32) tmp;
|
||||
AX = (u32) DST;
|
||||
do_div(AX, (u32) IMM);
|
||||
DST = (u32) AX;
|
||||
CONT;
|
||||
ALU_END_TO_BE:
|
||||
switch (IMM) {
|
||||
@ -1278,7 +1299,7 @@ STACK_FRAME_NON_STANDARD(___bpf_prog_run); /* jump table */
|
||||
static unsigned int PROG_NAME(stack_size)(const void *ctx, const struct bpf_insn *insn) \
|
||||
{ \
|
||||
u64 stack[stack_size / sizeof(u64)]; \
|
||||
u64 regs[MAX_BPF_REG]; \
|
||||
u64 regs[MAX_BPF_EXT_REG]; \
|
||||
\
|
||||
FP = (u64) (unsigned long) &stack[ARRAY_SIZE(stack)]; \
|
||||
ARG1 = (u64) (unsigned long) ctx; \
|
||||
|
@ -370,19 +370,6 @@ out:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(bpf_obj_get_user);
|
||||
|
||||
static void bpf_evict_inode(struct inode *inode)
|
||||
{
|
||||
enum bpf_type type;
|
||||
|
||||
truncate_inode_pages_final(&inode->i_data);
|
||||
clear_inode(inode);
|
||||
|
||||
if (S_ISLNK(inode->i_mode))
|
||||
kfree(inode->i_link);
|
||||
if (!bpf_inode_type(inode, &type))
|
||||
bpf_any_put(inode->i_private, type);
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the mount options in /proc/mounts.
|
||||
*/
|
||||
@ -395,11 +382,28 @@ static int bpf_show_options(struct seq_file *m, struct dentry *root)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bpf_destroy_inode_deferred(struct rcu_head *head)
|
||||
{
|
||||
struct inode *inode = container_of(head, struct inode, i_rcu);
|
||||
enum bpf_type type;
|
||||
|
||||
if (S_ISLNK(inode->i_mode))
|
||||
kfree(inode->i_link);
|
||||
if (!bpf_inode_type(inode, &type))
|
||||
bpf_any_put(inode->i_private, type);
|
||||
free_inode_nonrcu(inode);
|
||||
}
|
||||
|
||||
static void bpf_destroy_inode(struct inode *inode)
|
||||
{
|
||||
call_rcu(&inode->i_rcu, bpf_destroy_inode_deferred);
|
||||
}
|
||||
|
||||
static const struct super_operations bpf_super_ops = {
|
||||
.statfs = simple_statfs,
|
||||
.drop_inode = generic_delete_inode,
|
||||
.show_options = bpf_show_options,
|
||||
.evict_inode = bpf_evict_inode,
|
||||
.destroy_inode = bpf_destroy_inode,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -12,6 +12,7 @@
|
||||
struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
|
||||
{
|
||||
struct bpf_map *inner_map, *inner_map_meta;
|
||||
u32 inner_map_meta_size;
|
||||
struct fd f;
|
||||
|
||||
f = fdget(inner_map_ufd);
|
||||
@ -34,7 +35,12 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
inner_map_meta = kzalloc(sizeof(*inner_map_meta), GFP_USER);
|
||||
inner_map_meta_size = sizeof(*inner_map_meta);
|
||||
/* In some cases verifier needs to access beyond just base map. */
|
||||
if (inner_map->ops == &array_map_ops)
|
||||
inner_map_meta_size = sizeof(struct bpf_array);
|
||||
|
||||
inner_map_meta = kzalloc(inner_map_meta_size, GFP_USER);
|
||||
if (!inner_map_meta) {
|
||||
fdput(f);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
@ -44,9 +50,16 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
|
||||
inner_map_meta->key_size = inner_map->key_size;
|
||||
inner_map_meta->value_size = inner_map->value_size;
|
||||
inner_map_meta->map_flags = inner_map->map_flags;
|
||||
inner_map_meta->ops = inner_map->ops;
|
||||
inner_map_meta->max_entries = inner_map->max_entries;
|
||||
|
||||
/* Misc members not needed in bpf_map_meta_equal() check. */
|
||||
inner_map_meta->ops = inner_map->ops;
|
||||
if (inner_map->ops == &array_map_ops) {
|
||||
inner_map_meta->unpriv_array = inner_map->unpriv_array;
|
||||
container_of(inner_map_meta, struct bpf_array, map)->index_mask =
|
||||
container_of(inner_map, struct bpf_array, map)->index_mask;
|
||||
}
|
||||
|
||||
fdput(f);
|
||||
return inner_map_meta;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6928,6 +6928,7 @@ static void perf_event_mmap_output(struct perf_event *event,
|
||||
struct perf_output_handle handle;
|
||||
struct perf_sample_data sample;
|
||||
int size = mmap_event->event_id.header.size;
|
||||
u32 type = mmap_event->event_id.header.type;
|
||||
int ret;
|
||||
|
||||
if (!perf_event_mmap_match(event, data))
|
||||
@ -6971,6 +6972,7 @@ static void perf_event_mmap_output(struct perf_event *event,
|
||||
perf_output_end(&handle);
|
||||
out:
|
||||
mmap_event->event_id.header.size = size;
|
||||
mmap_event->event_id.header.type = type;
|
||||
}
|
||||
|
||||
static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <linux/lockdep.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/utsname.h>
|
||||
#include <linux/sched/signal.h>
|
||||
#include <linux/sched/debug.h>
|
||||
@ -232,6 +233,28 @@ void reset_hung_task_detector(void)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(reset_hung_task_detector);
|
||||
|
||||
static bool hung_detector_suspended;
|
||||
|
||||
static int hungtask_pm_notify(struct notifier_block *self,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
switch (action) {
|
||||
case PM_SUSPEND_PREPARE:
|
||||
case PM_HIBERNATION_PREPARE:
|
||||
case PM_RESTORE_PREPARE:
|
||||
hung_detector_suspended = true;
|
||||
break;
|
||||
case PM_POST_SUSPEND:
|
||||
case PM_POST_HIBERNATION:
|
||||
case PM_POST_RESTORE:
|
||||
hung_detector_suspended = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* kthread which checks for tasks stuck in D state
|
||||
*/
|
||||
@ -246,7 +269,8 @@ static int watchdog(void *dummy)
|
||||
long t = hung_timeout_jiffies(hung_last_checked, timeout);
|
||||
|
||||
if (t <= 0) {
|
||||
if (!atomic_xchg(&reset_hung_task, 0))
|
||||
if (!atomic_xchg(&reset_hung_task, 0) &&
|
||||
!hung_detector_suspended)
|
||||
check_hung_uninterruptible_tasks(timeout);
|
||||
hung_last_checked = jiffies;
|
||||
continue;
|
||||
@ -260,6 +284,10 @@ static int watchdog(void *dummy)
|
||||
static int __init hung_task_init(void)
|
||||
{
|
||||
atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
|
||||
|
||||
/* Disable hung task detector on suspend */
|
||||
pm_notifier(hungtask_pm_notify, 0);
|
||||
|
||||
watchdog_task = kthread_run(watchdog, NULL, "khungtaskd");
|
||||
|
||||
return 0;
|
||||
|
@ -103,7 +103,7 @@ u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
|
||||
quot = div_u64_rem(dividend, divisor, &rem32);
|
||||
*remainder = rem32;
|
||||
} else {
|
||||
int n = 1 + fls(high);
|
||||
int n = fls(high);
|
||||
quot = div_u64(dividend >> n, divisor >> n);
|
||||
|
||||
if (quot != 0)
|
||||
@ -141,7 +141,7 @@ u64 div64_u64(u64 dividend, u64 divisor)
|
||||
if (high == 0) {
|
||||
quot = div_u64(dividend, divisor);
|
||||
} else {
|
||||
int n = 1 + fls(high);
|
||||
int n = fls(high);
|
||||
quot = div_u64(dividend >> n, divisor >> n);
|
||||
|
||||
if (quot != 0)
|
||||
|
@ -570,9 +570,10 @@ int p9stat_read(struct p9_client *clnt, char *buf, int len, struct p9_wstat *st)
|
||||
if (ret) {
|
||||
p9_debug(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret);
|
||||
trace_9p_protocol_dump(clnt, &fake_pdu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return fake_pdu.offset;
|
||||
}
|
||||
EXPORT_SYMBOL(p9stat_read);
|
||||
|
||||
|
@ -293,7 +293,7 @@ out_interface:
|
||||
goto out;
|
||||
}
|
||||
|
||||
void __exit atalk_proc_exit(void)
|
||||
void atalk_proc_exit(void)
|
||||
{
|
||||
remove_proc_entry("interface", atalk_proc_dir);
|
||||
remove_proc_entry("route", atalk_proc_dir);
|
||||
|
@ -1912,12 +1912,16 @@ static const char atalk_err_snap[] __initconst =
|
||||
/* Called by proto.c on kernel start up */
|
||||
static int __init atalk_init(void)
|
||||
{
|
||||
int rc = proto_register(&ddp_proto, 0);
|
||||
int rc;
|
||||
|
||||
if (rc != 0)
|
||||
rc = proto_register(&ddp_proto, 0);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
(void)sock_register(&atalk_family_ops);
|
||||
rc = sock_register(&atalk_family_ops);
|
||||
if (rc)
|
||||
goto out_proto;
|
||||
|
||||
ddp_dl = register_snap_client(ddp_snap_id, atalk_rcv);
|
||||
if (!ddp_dl)
|
||||
printk(atalk_err_snap);
|
||||
@ -1925,12 +1929,33 @@ static int __init atalk_init(void)
|
||||
dev_add_pack(<alk_packet_type);
|
||||
dev_add_pack(&ppptalk_packet_type);
|
||||
|
||||
register_netdevice_notifier(&ddp_notifier);
|
||||
rc = register_netdevice_notifier(&ddp_notifier);
|
||||
if (rc)
|
||||
goto out_sock;
|
||||
|
||||
aarp_proto_init();
|
||||
atalk_proc_init();
|
||||
atalk_register_sysctl();
|
||||
rc = atalk_proc_init();
|
||||
if (rc)
|
||||
goto out_aarp;
|
||||
|
||||
rc = atalk_register_sysctl();
|
||||
if (rc)
|
||||
goto out_proc;
|
||||
out:
|
||||
return rc;
|
||||
out_proc:
|
||||
atalk_proc_exit();
|
||||
out_aarp:
|
||||
aarp_cleanup_module();
|
||||
unregister_netdevice_notifier(&ddp_notifier);
|
||||
out_sock:
|
||||
dev_remove_pack(&ppptalk_packet_type);
|
||||
dev_remove_pack(<alk_packet_type);
|
||||
unregister_snap_client(ddp_dl);
|
||||
sock_unregister(PF_APPLETALK);
|
||||
out_proto:
|
||||
proto_unregister(&ddp_proto);
|
||||
goto out;
|
||||
}
|
||||
module_init(atalk_init);
|
||||
|
||||
|
@ -45,9 +45,12 @@ static struct ctl_table atalk_table[] = {
|
||||
|
||||
static struct ctl_table_header *atalk_table_header;
|
||||
|
||||
void atalk_register_sysctl(void)
|
||||
int __init atalk_register_sysctl(void)
|
||||
{
|
||||
atalk_table_header = register_net_sysctl(&init_net, "net/appletalk", atalk_table);
|
||||
if (!atalk_table_header)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void atalk_unregister_sysctl(void)
|
||||
|
@ -66,6 +66,38 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)
|
||||
{
|
||||
struct xt_cgroup_info_v2 *info = par->matchinfo;
|
||||
struct cgroup *cgrp;
|
||||
|
||||
if ((info->invert_path & ~1) || (info->invert_classid & ~1))
|
||||
return -EINVAL;
|
||||
|
||||
if (!info->has_path && !info->has_classid) {
|
||||
pr_info("xt_cgroup: no path or classid specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (info->has_path && info->has_classid) {
|
||||
pr_info_ratelimited("path and classid specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
info->priv = NULL;
|
||||
if (info->has_path) {
|
||||
cgrp = cgroup_get_from_path(info->path);
|
||||
if (IS_ERR(cgrp)) {
|
||||
pr_info_ratelimited("invalid path, errno=%ld\n",
|
||||
PTR_ERR(cgrp));
|
||||
return -EINVAL;
|
||||
}
|
||||
info->priv = cgrp;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
cgroup_mt_v0(const struct sk_buff *skb, struct xt_action_param *par)
|
||||
{
|
||||
@ -95,6 +127,24 @@ static bool cgroup_mt_v1(const struct sk_buff *skb, struct xt_action_param *par)
|
||||
info->invert_classid;
|
||||
}
|
||||
|
||||
static bool cgroup_mt_v2(const struct sk_buff *skb, struct xt_action_param *par)
|
||||
{
|
||||
const struct xt_cgroup_info_v2 *info = par->matchinfo;
|
||||
struct sock_cgroup_data *skcd = &skb->sk->sk_cgrp_data;
|
||||
struct cgroup *ancestor = info->priv;
|
||||
struct sock *sk = skb->sk;
|
||||
|
||||
if (!sk || !sk_fullsock(sk) || !net_eq(xt_net(par), sock_net(sk)))
|
||||
return false;
|
||||
|
||||
if (ancestor)
|
||||
return cgroup_is_descendant(sock_cgroup_ptr(skcd), ancestor) ^
|
||||
info->invert_path;
|
||||
else
|
||||
return (info->classid == sock_cgroup_classid(skcd)) ^
|
||||
info->invert_classid;
|
||||
}
|
||||
|
||||
static void cgroup_mt_destroy_v1(const struct xt_mtdtor_param *par)
|
||||
{
|
||||
struct xt_cgroup_info_v1 *info = par->matchinfo;
|
||||
@ -103,6 +153,14 @@ static void cgroup_mt_destroy_v1(const struct xt_mtdtor_param *par)
|
||||
cgroup_put(info->priv);
|
||||
}
|
||||
|
||||
static void cgroup_mt_destroy_v2(const struct xt_mtdtor_param *par)
|
||||
{
|
||||
struct xt_cgroup_info_v2 *info = par->matchinfo;
|
||||
|
||||
if (info->priv)
|
||||
cgroup_put(info->priv);
|
||||
}
|
||||
|
||||
static struct xt_match cgroup_mt_reg[] __read_mostly = {
|
||||
{
|
||||
.name = "cgroup",
|
||||
@ -130,6 +188,20 @@ static struct xt_match cgroup_mt_reg[] __read_mostly = {
|
||||
(1 << NF_INET_POST_ROUTING) |
|
||||
(1 << NF_INET_LOCAL_IN),
|
||||
},
|
||||
{
|
||||
.name = "cgroup",
|
||||
.revision = 2,
|
||||
.family = NFPROTO_UNSPEC,
|
||||
.checkentry = cgroup_mt_check_v2,
|
||||
.match = cgroup_mt_v2,
|
||||
.matchsize = sizeof(struct xt_cgroup_info_v2),
|
||||
.usersize = offsetof(struct xt_cgroup_info_v2, priv),
|
||||
.destroy = cgroup_mt_destroy_v2,
|
||||
.me = THIS_MODULE,
|
||||
.hooks = (1 << NF_INET_LOCAL_OUT) |
|
||||
(1 << NF_INET_POST_ROUTING) |
|
||||
(1 << NF_INET_LOCAL_IN),
|
||||
},
|
||||
};
|
||||
|
||||
static int __init cgroup_mt_init(void)
|
||||
|
@ -41,7 +41,7 @@ void snd_opl3_timer_func(unsigned long data);
|
||||
|
||||
/* Prototypes for opl3_drums.c */
|
||||
void snd_opl3_load_drums(struct snd_opl3 *opl3);
|
||||
void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan);
|
||||
void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off, struct snd_midi_channel *chan);
|
||||
|
||||
/* Prototypes for opl3_oss.c */
|
||||
#if IS_ENABLED(CONFIG_SND_SEQUENCER_OSS)
|
||||
|
@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
|
||||
|
||||
/* block the 0x388 port to avoid PnP conflicts */
|
||||
acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
|
||||
if (!acard->fm_res) {
|
||||
err = -EBUSY;
|
||||
goto _err;
|
||||
}
|
||||
|
||||
if (port[dev] != SNDRV_AUTO_PORT) {
|
||||
if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
|
||||
|
@ -1953,6 +1953,11 @@ static int snd_echo_create(struct snd_card *card,
|
||||
}
|
||||
chip->dsp_registers = (volatile u32 __iomem *)
|
||||
ioremap_nocache(chip->dsp_registers_phys, sz);
|
||||
if (!chip->dsp_registers) {
|
||||
dev_err(chip->card->dev, "ioremap failed\n");
|
||||
snd_echo_free(chip);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED,
|
||||
KBUILD_MODNAME, chip)) {
|
||||
|
@ -114,7 +114,7 @@ Given a $HOME/.perfconfig like this:
|
||||
|
||||
[report]
|
||||
# Defaults
|
||||
sort-order = comm,dso,symbol
|
||||
sort_order = comm,dso,symbol
|
||||
percent-limit = 0
|
||||
queue-size = 0
|
||||
children = true
|
||||
|
@ -1345,8 +1345,9 @@ int cmd_top(int argc, const char **argv)
|
||||
goto out_delete_evlist;
|
||||
|
||||
symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
|
||||
if (symbol__init(NULL) < 0)
|
||||
return -1;
|
||||
status = symbol__init(NULL);
|
||||
if (status < 0)
|
||||
goto out_delete_evlist;
|
||||
|
||||
sort__setup_elide(stdout);
|
||||
|
||||
|
@ -85,5 +85,6 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes
|
||||
if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
|
||||
ret = -1;
|
||||
|
||||
perf_evsel__delete(evsel);
|
||||
return ret;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
|
||||
const char *p;
|
||||
const char **other;
|
||||
double val;
|
||||
int ret;
|
||||
int i, ret;
|
||||
struct parse_ctx ctx;
|
||||
int num_other;
|
||||
|
||||
@ -56,6 +56,9 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
|
||||
TEST_ASSERT_VAL("find other", !strcmp(other[1], "BAZ"));
|
||||
TEST_ASSERT_VAL("find other", !strcmp(other[2], "BOZO"));
|
||||
TEST_ASSERT_VAL("find other", other[3] == NULL);
|
||||
|
||||
for (i = 0; i < num_other; i++)
|
||||
free((void *)other[i]);
|
||||
free((void *)other);
|
||||
|
||||
return 0;
|
||||
|
@ -45,7 +45,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
|
||||
if (IS_ERR(evsel)) {
|
||||
tracing_path__strerror_open_tp(errno, errbuf, sizeof(errbuf), "syscalls", "sys_enter_openat");
|
||||
pr_debug("%s\n", errbuf);
|
||||
goto out_thread_map_delete;
|
||||
goto out_cpu_map_delete;
|
||||
}
|
||||
|
||||
if (perf_evsel__open(evsel, cpus, threads) < 0) {
|
||||
@ -119,6 +119,8 @@ out_close_fd:
|
||||
perf_evsel__close_fd(evsel);
|
||||
out_evsel_delete:
|
||||
perf_evsel__delete(evsel);
|
||||
out_cpu_map_delete:
|
||||
cpu_map__put(cpus);
|
||||
out_thread_map_delete:
|
||||
thread_map__put(threads);
|
||||
return err;
|
||||
|
@ -185,6 +185,7 @@ char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size)
|
||||
return bf;
|
||||
}
|
||||
|
||||
/* The caller is responsible to free the returned buffer. */
|
||||
char *build_id_cache__origname(const char *sbuild_id)
|
||||
{
|
||||
char *linkname;
|
||||
|
@ -628,11 +628,10 @@ static int collect_config(const char *var, const char *value,
|
||||
}
|
||||
|
||||
ret = set_value(item, value);
|
||||
return ret;
|
||||
|
||||
out_free:
|
||||
free(key);
|
||||
return -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int perf_config_set__collect(struct perf_config_set *set, const char *file_name,
|
||||
|
@ -1229,6 +1229,7 @@ void perf_evsel__exit(struct perf_evsel *evsel)
|
||||
{
|
||||
assert(list_empty(&evsel->node));
|
||||
assert(evsel->evlist == NULL);
|
||||
perf_evsel__free_counts(evsel);
|
||||
perf_evsel__free_fd(evsel);
|
||||
perf_evsel__free_id(evsel);
|
||||
perf_evsel__free_config_terms(evsel);
|
||||
|
@ -1040,8 +1040,10 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
|
||||
|
||||
err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent,
|
||||
iter->evsel, al, max_stack_depth);
|
||||
if (err)
|
||||
if (err) {
|
||||
map__put(alm);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = iter->ops->prepare_entry(iter, al);
|
||||
if (err)
|
||||
|
@ -2109,6 +2109,7 @@ static bool is_event_supported(u8 type, unsigned config)
|
||||
perf_evsel__delete(evsel);
|
||||
}
|
||||
|
||||
thread_map__put(tmap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2179,6 +2180,7 @@ void print_sdt_events(const char *subsys_glob, const char *event_glob,
|
||||
printf(" %-50s [%s]\n", buf, "SDT event");
|
||||
free(buf);
|
||||
}
|
||||
free(path);
|
||||
} else
|
||||
printf(" %-50s [%s]\n", nd->s, "SDT event");
|
||||
if (nd2) {
|
||||
|
@ -4588,6 +4588,9 @@ int fork_it(char **argv)
|
||||
signal(SIGQUIT, SIG_IGN);
|
||||
if (waitpid(child_pid, &status, 0) == -1)
|
||||
err(status, "waitpid");
|
||||
|
||||
if (WIFEXITED(status))
|
||||
status = WEXITSTATUS(status);
|
||||
}
|
||||
/*
|
||||
* n.b. fork_it() does not check for errors from for_all_cpus()
|
||||
|
@ -1860,6 +1860,7 @@ static struct bpf_test tests[] = {
|
||||
},
|
||||
.result = REJECT,
|
||||
.errstr = "invalid stack off=-79992 size=8",
|
||||
.errstr_unpriv = "R1 stack pointer arithmetic goes out of range",
|
||||
},
|
||||
{
|
||||
"PTR_TO_STACK store/load - out of bounds high",
|
||||
@ -2243,6 +2244,8 @@ static struct bpf_test tests[] = {
|
||||
BPF_EXIT_INSN(),
|
||||
},
|
||||
.result = ACCEPT,
|
||||
.result_unpriv = REJECT,
|
||||
.errstr_unpriv = "R1 stack pointer arithmetic goes out of range",
|
||||
},
|
||||
{
|
||||
"unpriv: cmp of stack pointer",
|
||||
@ -7013,6 +7016,7 @@ static struct bpf_test tests[] = {
|
||||
},
|
||||
.fixup_map1 = { 3 },
|
||||
.errstr = "pointer offset 1073741822",
|
||||
.errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
|
||||
.result = REJECT
|
||||
},
|
||||
{
|
||||
@ -7034,6 +7038,7 @@ static struct bpf_test tests[] = {
|
||||
},
|
||||
.fixup_map1 = { 3 },
|
||||
.errstr = "pointer offset -1073741822",
|
||||
.errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
|
||||
.result = REJECT
|
||||
},
|
||||
{
|
||||
@ -7203,6 +7208,7 @@ static struct bpf_test tests[] = {
|
||||
BPF_EXIT_INSN()
|
||||
},
|
||||
.errstr = "fp pointer offset 1073741822",
|
||||
.errstr_unpriv = "R1 stack pointer arithmetic goes out of range",
|
||||
.result = REJECT
|
||||
},
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ static int get_nports(struct udev_device *hc_device)
|
||||
|
||||
static int vhci_hcd_filter(const struct dirent *dirent)
|
||||
{
|
||||
return strcmp(dirent->d_name, "vhci_hcd") >= 0;
|
||||
return !strncmp(dirent->d_name, "vhci_hcd.", 9);
|
||||
}
|
||||
|
||||
static int get_ncontrollers(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user