Merge branch 'irq/urgent' into irq/msi

to pick up the PCI/MSI-x fixes.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
Thomas Gleixner 2021-12-14 13:30:34 +01:00
Родитель 60bf9b33c8 94185adbfa
Коммит 09eb3ad55f
383 изменённых файлов: 3709 добавлений и 1578 удалений

Просмотреть файл

@ -126,6 +126,8 @@ Greg Kroah-Hartman <gregkh@suse.de>
Greg Kroah-Hartman <greg@kroah.com> Greg Kroah-Hartman <greg@kroah.com>
Greg Kurz <groug@kaod.org> <gkurz@linux.vnet.ibm.com> Greg Kurz <groug@kaod.org> <gkurz@linux.vnet.ibm.com>
Gregory CLEMENT <gregory.clement@bootlin.com> <gregory.clement@free-electrons.com> Gregory CLEMENT <gregory.clement@bootlin.com> <gregory.clement@free-electrons.com>
Guo Ren <guoren@kernel.org> <guoren@linux.alibaba.com>
Guo Ren <guoren@kernel.org> <ren_guo@c-sky.com>
Gustavo Padovan <gustavo@las.ic.unicamp.br> Gustavo Padovan <gustavo@las.ic.unicamp.br>
Gustavo Padovan <padovan@profusion.mobi> Gustavo Padovan <padovan@profusion.mobi>
Hanjun Guo <guohanjun@huawei.com> <hanjun.guo@linaro.org> Hanjun Guo <guohanjun@huawei.com> <hanjun.guo@linaro.org>

Просмотреть файл

@ -25,6 +25,6 @@ Sub graphs of DRBD's state transitions
:alt: disk-states-8.dot :alt: disk-states-8.dot
:align: center :align: center
.. kernel-figure:: node-states-8.dot .. kernel-figure:: peer-states-8.dot
:alt: node-states-8.dot :alt: peer-states-8.dot
:align: center :align: center

Просмотреть файл

@ -1,8 +1,3 @@
digraph node_states {
Secondary -> Primary [ label = "ioctl_set_state()" ]
Primary -> Secondary [ label = "ioctl_set_state()" ]
}
digraph peer_states { digraph peer_states {
Secondary -> Primary [ label = "recv state packet" ] Secondary -> Primary [ label = "recv state packet" ]
Primary -> Secondary [ label = "recv state packet" ] Primary -> Secondary [ label = "recv state packet" ]

Просмотреть файл

@ -249,6 +249,11 @@ except ImportError:
html_static_path = ['sphinx-static'] html_static_path = ['sphinx-static']
html_css_files = [
'theme_overrides.css',
]
if major <= 1 and minor < 8:
html_context = { html_context = {
'css_files': [ 'css_files': [
'_static/theme_overrides.css', '_static/theme_overrides.css',

Просмотреть файл

@ -136,7 +136,7 @@ examples:
samsung,syscon-phandle = <&pmu_system_controller>; samsung,syscon-phandle = <&pmu_system_controller>;
/* NTC thermistor is a hwmon device */ /* NTC thermistor is a hwmon device */
ncp15wb473 { thermistor {
compatible = "murata,ncp15wb473"; compatible = "murata,ncp15wb473";
pullup-uv = <1800000>; pullup-uv = <1800000>;
pullup-ohm = <47000>; pullup-ohm = <47000>;

Просмотреть файл

@ -142,7 +142,7 @@ examples:
down { down {
label = "GPIO Key DOWN"; label = "GPIO Key DOWN";
linux,code = <108>; linux,code = <108>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
}; };
}; };

Просмотреть файл

@ -79,6 +79,8 @@ properties:
properties: properties:
data-lanes: data-lanes:
description:
Note that 'fsl,imx7-mipi-csi2' only supports up to 2 data lines.
items: items:
minItems: 1 minItems: 1
maxItems: 4 maxItems: 4
@ -91,18 +93,6 @@ properties:
required: required:
- data-lanes - data-lanes
allOf:
- if:
properties:
compatible:
contains:
const: fsl,imx7-mipi-csi2
then:
properties:
data-lanes:
items:
maxItems: 2
port@1: port@1:
$ref: /schemas/graph.yaml#/properties/port $ref: /schemas/graph.yaml#/properties/port
description: description:

Просмотреть файл

@ -91,6 +91,14 @@ properties:
compensate for the board being designed with the lanes compensate for the board being designed with the lanes
swapped. swapped.
enet-phy-lane-no-swap:
$ref: /schemas/types.yaml#/definitions/flag
description:
If set, indicates that PHY will disable swap of the
TX/RX lanes. This property allows the PHY to work correcly after
e.g. wrong bootstrap configuration caused by issues in PCB
layout design.
eee-broken-100tx: eee-broken-100tx:
$ref: /schemas/types.yaml#/definitions/flag $ref: /schemas/types.yaml#/definitions/flag
description: description:

Просмотреть файл

@ -29,7 +29,7 @@ properties:
- PHY_TYPE_PCIE - PHY_TYPE_PCIE
- PHY_TYPE_SATA - PHY_TYPE_SATA
- PHY_TYPE_SGMII - PHY_TYPE_SGMII
- PHY_TYPE_USB - PHY_TYPE_USB3
- description: The PHY instance - description: The PHY instance
minimum: 0 minimum: 0
maximum: 1 # for DP, SATA or USB maximum: 1 # for DP, SATA or USB

Просмотреть файл

@ -105,7 +105,7 @@ examples:
reg = <0x65>; reg = <0x65>;
interrupt-parent = <&gpio1>; interrupt-parent = <&gpio1>;
interrupts = <16 IRQ_TYPE_EDGE_FALLING>; interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
ti,watchdog-timer = <0>; ti,watchdog-timeout-ms = <0>;
ti,sc-ocp-limit-microamp = <2000000>; ti,sc-ocp-limit-microamp = <2000000>;
ti,sc-ovp-limit-microvolt = <17800000>; ti,sc-ovp-limit-microvolt = <17800000>;
monitored-battery = <&bat>; monitored-battery = <&bat>;

Просмотреть файл

@ -19,6 +19,9 @@ properties:
clocks: clocks:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
"#sound-dai-cells": "#sound-dai-cells":
const: 0 const: 0

Просмотреть файл

@ -33,6 +33,7 @@ properties:
- rockchip,rk3328-spi - rockchip,rk3328-spi
- rockchip,rk3368-spi - rockchip,rk3368-spi
- rockchip,rk3399-spi - rockchip,rk3399-spi
- rockchip,rk3568-spi
- rockchip,rv1126-spi - rockchip,rv1126-spi
- const: rockchip,rk3066-spi - const: rockchip,rk3066-spi

Просмотреть файл

@ -439,11 +439,9 @@ preemption. The following substitution works on both kernels::
spin_lock(&p->lock); spin_lock(&p->lock);
p->count += this_cpu_read(var2); p->count += this_cpu_read(var2);
On a non-PREEMPT_RT kernel migrate_disable() maps to preempt_disable()
which makes the above code fully equivalent. On a PREEMPT_RT kernel
migrate_disable() ensures that the task is pinned on the current CPU which migrate_disable() ensures that the task is pinned on the current CPU which
in turn guarantees that the per-CPU access to var1 and var2 are staying on in turn guarantees that the per-CPU access to var1 and var2 are staying on
the same CPU. the same CPU while the task remains preemptible.
The migrate_disable() substitution is not valid for the following The migrate_disable() substitution is not valid for the following
scenario:: scenario::
@ -456,9 +454,8 @@ scenario::
p = this_cpu_ptr(&var1); p = this_cpu_ptr(&var1);
p->val = func2(); p->val = func2();
While correct on a non-PREEMPT_RT kernel, this breaks on PREEMPT_RT because This breaks because migrate_disable() does not protect against reentrancy from
here migrate_disable() does not protect against reentrancy from a a preempting task. A correct substitution for this case is::
preempting task. A correct substitution for this case is::
func() func()
{ {

Просмотреть файл

@ -35,6 +35,7 @@ GNU make 3.81 make --version
binutils 2.23 ld -v binutils 2.23 ld -v
flex 2.5.35 flex --version flex 2.5.35 flex --version
bison 2.0 bison --version bison 2.0 bison --version
pahole 1.16 pahole --version
util-linux 2.10o fdformat --version util-linux 2.10o fdformat --version
kmod 13 depmod -V kmod 13 depmod -V
e2fsprogs 1.41.4 e2fsck -V e2fsprogs 1.41.4 e2fsck -V
@ -108,6 +109,16 @@ Bison
Since Linux 4.16, the build system generates parsers Since Linux 4.16, the build system generates parsers
during build. This requires bison 2.0 or later. during build. This requires bison 2.0 or later.
pahole:
-------
Since Linux 5.2, if CONFIG_DEBUG_INFO_BTF is selected, the build system
generates BTF (BPF Type Format) from DWARF in vmlinux, a bit later from kernel
modules as well. This requires pahole v1.16 or later.
It is found in the 'dwarves' or 'pahole' distro packages or from
https://fedorapeople.org/~acme/dwarves/.
Perl Perl
---- ----

Просмотреть файл

@ -14,7 +14,8 @@ works, see Documentation/process/development-process.rst. Also, read
Documentation/process/submit-checklist.rst Documentation/process/submit-checklist.rst
for a list of items to check before submitting code. If you are submitting for a list of items to check before submitting code. If you are submitting
a driver, also read Documentation/process/submitting-drivers.rst; for device a driver, also read Documentation/process/submitting-drivers.rst; for device
tree binding patches, read Documentation/process/submitting-patches.rst. tree binding patches, read
Documentation/devicetree/bindings/submitting-patches.rst.
This documentation assumes that you're using ``git`` to prepare your patches. This documentation assumes that you're using ``git`` to prepare your patches.
If you're unfamiliar with ``git``, you would be well-advised to learn how to If you're unfamiliar with ``git``, you would be well-advised to learn how to

Просмотреть файл

@ -9329,7 +9329,6 @@ S: Maintained
F: drivers/iio/pressure/dps310.c F: drivers/iio/pressure/dps310.c
INFINIBAND SUBSYSTEM INFINIBAND SUBSYSTEM
M: Doug Ledford <dledford@redhat.com>
M: Jason Gunthorpe <jgg@nvidia.com> M: Jason Gunthorpe <jgg@nvidia.com>
L: linux-rdma@vger.kernel.org L: linux-rdma@vger.kernel.org
S: Supported S: Supported
@ -10280,9 +10279,9 @@ F: lib/Kconfig.kcsan
F: scripts/Makefile.kcsan F: scripts/Makefile.kcsan
KDUMP KDUMP
M: Dave Young <dyoung@redhat.com>
M: Baoquan He <bhe@redhat.com> M: Baoquan He <bhe@redhat.com>
R: Vivek Goyal <vgoyal@redhat.com> R: Vivek Goyal <vgoyal@redhat.com>
R: Dave Young <dyoung@redhat.com>
L: kexec@lists.infradead.org L: kexec@lists.infradead.org
S: Maintained S: Maintained
W: http://lse.sourceforge.net/kdump/ W: http://lse.sourceforge.net/kdump/
@ -12180,8 +12179,8 @@ F: drivers/net/ethernet/mellanox/mlx5/core/fpga/*
F: include/linux/mlx5/mlx5_ifc_fpga.h F: include/linux/mlx5/mlx5_ifc_fpga.h
MELLANOX ETHERNET SWITCH DRIVERS MELLANOX ETHERNET SWITCH DRIVERS
M: Jiri Pirko <jiri@nvidia.com>
M: Ido Schimmel <idosch@nvidia.com> M: Ido Schimmel <idosch@nvidia.com>
M: Petr Machata <petrm@nvidia.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
S: Supported S: Supported
W: http://www.mellanox.com W: http://www.mellanox.com
@ -15771,6 +15770,15 @@ S: Maintained
F: Documentation/devicetree/bindings/net/qcom,ethqos.txt F: Documentation/devicetree/bindings/net/qcom,ethqos.txt
F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
QUALCOMM FASTRPC DRIVER
M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
M: Amol Maheshwari <amahesh@qti.qualcomm.com>
L: linux-arm-msm@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
F: drivers/misc/fastrpc.c
F: include/uapi/misc/fastrpc.h
QUALCOMM GENERIC INTERFACE I2C DRIVER QUALCOMM GENERIC INTERFACE I2C DRIVER
M: Akash Asthana <akashast@codeaurora.org> M: Akash Asthana <akashast@codeaurora.org>
M: Mukesh Savaliya <msavaliy@codeaurora.org> M: Mukesh Savaliya <msavaliy@codeaurora.org>
@ -16629,7 +16637,6 @@ W: http://www.ibm.com/developerworks/linux/linux390/
F: drivers/iommu/s390-iommu.c F: drivers/iommu/s390-iommu.c
S390 IUCV NETWORK LAYER S390 IUCV NETWORK LAYER
M: Julian Wiedmann <jwi@linux.ibm.com>
M: Alexandra Winter <wintera@linux.ibm.com> M: Alexandra Winter <wintera@linux.ibm.com>
M: Wenjia Zhang <wenjia@linux.ibm.com> M: Wenjia Zhang <wenjia@linux.ibm.com>
L: linux-s390@vger.kernel.org L: linux-s390@vger.kernel.org
@ -16641,7 +16648,6 @@ F: include/net/iucv/
F: net/iucv/ F: net/iucv/
S390 NETWORK DRIVERS S390 NETWORK DRIVERS
M: Julian Wiedmann <jwi@linux.ibm.com>
M: Alexandra Winter <wintera@linux.ibm.com> M: Alexandra Winter <wintera@linux.ibm.com>
M: Wenjia Zhang <wenjia@linux.ibm.com> M: Wenjia Zhang <wenjia@linux.ibm.com>
L: linux-s390@vger.kernel.org L: linux-s390@vger.kernel.org

Просмотреть файл

@ -2,7 +2,7 @@
VERSION = 5 VERSION = 5
PATCHLEVEL = 16 PATCHLEVEL = 16
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc4 EXTRAVERSION = -rc5
NAME = Gobble Gobble NAME = Gobble Gobble
# *DOCUMENTATION* # *DOCUMENTATION*
@ -789,7 +789,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong
KBUILD_CFLAGS += $(stackp-flags-y) KBUILD_CFLAGS += $(stackp-flags-y)
KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH) KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH:"%"=%)
ifdef CONFIG_CC_IS_CLANG ifdef CONFIG_CC_IS_CLANG
KBUILD_CPPFLAGS += -Qunused-arguments KBUILD_CPPFLAGS += -Qunused-arguments
@ -1374,17 +1374,17 @@ endif
ifneq ($(dtstree),) ifneq ($(dtstree),)
%.dtb: dt_binding_check include/config/kernel.release scripts_dtc %.dtb: include/config/kernel.release scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(dtstree)/$*.dt.yaml $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
%.dtbo: dt_binding_check include/config/kernel.release scripts_dtc %.dtbo: include/config/kernel.release scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(dtstree)/$*.dt.yaml $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
PHONY += dtbs dtbs_install dtbs_check PHONY += dtbs dtbs_install dtbs_check
dtbs: include/config/kernel.release scripts_dtc dtbs: include/config/kernel.release scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree) $(Q)$(MAKE) $(build)=$(dtstree)
ifneq ($(filter dtbs_check %.dtb %.dtbo, $(MAKECMDGOALS)),) ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
export CHECK_DTBS=y export CHECK_DTBS=y
dtbs: dt_binding_check dtbs: dt_binding_check
endif endif

Просмотреть файл

@ -7,6 +7,7 @@
* Copyright The Asahi Linux Contributors * Copyright The Asahi Linux Contributors
*/ */
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/apple-aic.h> #include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/apple.h> #include <dt-bindings/pinctrl/apple.h>
@ -281,7 +282,7 @@
port00: pci@0,0 { port00: pci@0,0 {
device_type = "pci"; device_type = "pci";
reg = <0x0 0x0 0x0 0x0 0x0>; reg = <0x0 0x0 0x0 0x0 0x0>;
reset-gpios = <&pinctrl_ap 152 0>; reset-gpios = <&pinctrl_ap 152 GPIO_ACTIVE_LOW>;
max-link-speed = <2>; max-link-speed = <2>;
#address-cells = <3>; #address-cells = <3>;
@ -301,7 +302,7 @@
port01: pci@1,0 { port01: pci@1,0 {
device_type = "pci"; device_type = "pci";
reg = <0x800 0x0 0x0 0x0 0x0>; reg = <0x800 0x0 0x0 0x0 0x0>;
reset-gpios = <&pinctrl_ap 153 0>; reset-gpios = <&pinctrl_ap 153 GPIO_ACTIVE_LOW>;
max-link-speed = <2>; max-link-speed = <2>;
#address-cells = <3>; #address-cells = <3>;
@ -321,7 +322,7 @@
port02: pci@2,0 { port02: pci@2,0 {
device_type = "pci"; device_type = "pci";
reg = <0x1000 0x0 0x0 0x0 0x0>; reg = <0x1000 0x0 0x0 0x0 0x0>;
reset-gpios = <&pinctrl_ap 33 0>; reset-gpios = <&pinctrl_ap 33 GPIO_ACTIVE_LOW>;
max-link-speed = <1>; max-link-speed = <1>;
#address-cells = <3>; #address-cells = <3>;

Просмотреть файл

@ -209,7 +209,7 @@ asmlinkage void do_trap_illinsn(struct pt_regs *regs)
asmlinkage void do_trap_fpe(struct pt_regs *regs) asmlinkage void do_trap_fpe(struct pt_regs *regs)
{ {
#ifdef CONFIG_CPU_HAS_FP #ifdef CONFIG_CPU_HAS_FPU
return fpu_fpe(regs); return fpu_fpe(regs);
#else #else
do_trap_error(regs, SIGILL, ILL_ILLOPC, regs->pc, do_trap_error(regs, SIGILL, ILL_ILLOPC, regs->pc,
@ -219,7 +219,7 @@ asmlinkage void do_trap_fpe(struct pt_regs *regs)
asmlinkage void do_trap_priv(struct pt_regs *regs) asmlinkage void do_trap_priv(struct pt_regs *regs)
{ {
#ifdef CONFIG_CPU_HAS_FP #ifdef CONFIG_CPU_HAS_FPU
if (user_mode(regs) && fpu_libc_helper(regs)) if (user_mode(regs) && fpu_libc_helper(regs))
return; return;
#endif #endif

Просмотреть файл

@ -98,7 +98,7 @@ do { \
#define emit(...) __emit(__VA_ARGS__) #define emit(...) __emit(__VA_ARGS__)
/* Workaround for R10000 ll/sc errata */ /* Workaround for R10000 ll/sc errata */
#ifdef CONFIG_WAR_R10000 #ifdef CONFIG_WAR_R10000_LLSC
#define LLSC_beqz beqzl #define LLSC_beqz beqzl
#else #else
#define LLSC_beqz beqz #define LLSC_beqz beqz

Просмотреть файл

@ -1932,6 +1932,7 @@ config EFI
depends on ACPI depends on ACPI
select UCS2_STRING select UCS2_STRING
select EFI_RUNTIME_WRAPPERS select EFI_RUNTIME_WRAPPERS
select ARCH_USE_MEMREMAP_PROT
help help
This enables the kernel to use EFI runtime services that are This enables the kernel to use EFI runtime services that are
available (such as the EFI variable services). available (such as the EFI variable services).

Просмотреть файл

@ -97,7 +97,7 @@
KVM_ARCH_REQ_FLAGS(25, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP) KVM_ARCH_REQ_FLAGS(25, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
#define KVM_REQ_TLB_FLUSH_CURRENT KVM_ARCH_REQ(26) #define KVM_REQ_TLB_FLUSH_CURRENT KVM_ARCH_REQ(26)
#define KVM_REQ_TLB_FLUSH_GUEST \ #define KVM_REQ_TLB_FLUSH_GUEST \
KVM_ARCH_REQ_FLAGS(27, KVM_REQUEST_NO_WAKEUP) KVM_ARCH_REQ_FLAGS(27, KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
#define KVM_REQ_APF_READY KVM_ARCH_REQ(28) #define KVM_REQ_APF_READY KVM_ARCH_REQ(28)
#define KVM_REQ_MSR_FILTER_CHANGED KVM_ARCH_REQ(29) #define KVM_REQ_MSR_FILTER_CHANGED KVM_ARCH_REQ(29)
#define KVM_REQ_UPDATE_CPU_DIRTY_LOGGING \ #define KVM_REQ_UPDATE_CPU_DIRTY_LOGGING \

Просмотреть файл

@ -579,6 +579,17 @@ static struct sched_domain_topology_level x86_numa_in_package_topology[] = {
{ NULL, }, { NULL, },
}; };
static struct sched_domain_topology_level x86_hybrid_topology[] = {
#ifdef CONFIG_SCHED_SMT
{ cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
#endif
#ifdef CONFIG_SCHED_MC
{ cpu_coregroup_mask, x86_core_flags, SD_INIT_NAME(MC) },
#endif
{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
{ NULL, },
};
static struct sched_domain_topology_level x86_topology[] = { static struct sched_domain_topology_level x86_topology[] = {
#ifdef CONFIG_SCHED_SMT #ifdef CONFIG_SCHED_SMT
{ cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) }, { cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
@ -1469,8 +1480,11 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
calculate_max_logical_packages(); calculate_max_logical_packages();
/* XXX for now assume numa-in-package and hybrid don't overlap */
if (x86_has_numa_in_package) if (x86_has_numa_in_package)
set_sched_topology(x86_numa_in_package_topology); set_sched_topology(x86_numa_in_package_topology);
if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
set_sched_topology(x86_hybrid_topology);
nmi_selftest(); nmi_selftest();
impress_friends(); impress_friends();

Просмотреть файл

@ -1922,11 +1922,13 @@ static u64 kvm_hv_send_ipi(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool
all_cpus = send_ipi_ex.vp_set.format == HV_GENERIC_SET_ALL; all_cpus = send_ipi_ex.vp_set.format == HV_GENERIC_SET_ALL;
if (all_cpus)
goto check_and_send_ipi;
if (!sparse_banks_len) if (!sparse_banks_len)
goto ret_success; goto ret_success;
if (!all_cpus && if (kvm_read_guest(kvm,
kvm_read_guest(kvm,
hc->ingpa + offsetof(struct hv_send_ipi_ex, hc->ingpa + offsetof(struct hv_send_ipi_ex,
vp_set.bank_contents), vp_set.bank_contents),
sparse_banks, sparse_banks,
@ -1934,6 +1936,7 @@ static u64 kvm_hv_send_ipi(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool
return HV_STATUS_INVALID_HYPERCALL_INPUT; return HV_STATUS_INVALID_HYPERCALL_INPUT;
} }
check_and_send_ipi:
if ((vector < HV_IPI_LOW_VECTOR) || (vector > HV_IPI_HIGH_VECTOR)) if ((vector < HV_IPI_LOW_VECTOR) || (vector > HV_IPI_HIGH_VECTOR))
return HV_STATUS_INVALID_HYPERCALL_INPUT; return HV_STATUS_INVALID_HYPERCALL_INPUT;

Просмотреть файл

@ -2646,15 +2646,6 @@ int alloc_loaded_vmcs(struct loaded_vmcs *loaded_vmcs)
if (!loaded_vmcs->msr_bitmap) if (!loaded_vmcs->msr_bitmap)
goto out_vmcs; goto out_vmcs;
memset(loaded_vmcs->msr_bitmap, 0xff, PAGE_SIZE); memset(loaded_vmcs->msr_bitmap, 0xff, PAGE_SIZE);
if (IS_ENABLED(CONFIG_HYPERV) &&
static_branch_unlikely(&enable_evmcs) &&
(ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {
struct hv_enlightened_vmcs *evmcs =
(struct hv_enlightened_vmcs *)loaded_vmcs->vmcs;
evmcs->hv_enlightenments_control.msr_bitmap = 1;
}
} }
memset(&loaded_vmcs->host_state, 0, sizeof(struct vmcs_host_state)); memset(&loaded_vmcs->host_state, 0, sizeof(struct vmcs_host_state));
@ -6842,6 +6833,19 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu)
if (err < 0) if (err < 0)
goto free_pml; goto free_pml;
/*
* Use Hyper-V 'Enlightened MSR Bitmap' feature when KVM runs as a
* nested (L1) hypervisor and Hyper-V in L0 supports it. Enable the
* feature only for vmcs01, KVM currently isn't equipped to realize any
* performance benefits from enabling it for vmcs02.
*/
if (IS_ENABLED(CONFIG_HYPERV) && static_branch_unlikely(&enable_evmcs) &&
(ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {
struct hv_enlightened_vmcs *evmcs = (void *)vmx->vmcs01.vmcs;
evmcs->hv_enlightenments_control.msr_bitmap = 1;
}
/* The MSR bitmap starts with all ones */ /* The MSR bitmap starts with all ones */
bitmap_fill(vmx->shadow_msr_intercept.read, MAX_POSSIBLE_PASSTHROUGH_MSRS); bitmap_fill(vmx->shadow_msr_intercept.read, MAX_POSSIBLE_PASSTHROUGH_MSRS);
bitmap_fill(vmx->shadow_msr_intercept.write, MAX_POSSIBLE_PASSTHROUGH_MSRS); bitmap_fill(vmx->shadow_msr_intercept.write, MAX_POSSIBLE_PASSTHROUGH_MSRS);

Просмотреть файл

@ -890,7 +890,8 @@ int kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
!load_pdptrs(vcpu, vcpu->arch.walk_mmu, kvm_read_cr3(vcpu))) !load_pdptrs(vcpu, vcpu->arch.walk_mmu, kvm_read_cr3(vcpu)))
return 1; return 1;
if (!(cr0 & X86_CR0_PG) && kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE)) if (!(cr0 & X86_CR0_PG) &&
(is_64_bit_mode(vcpu) || kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE)))
return 1; return 1;
static_call(kvm_x86_set_cr0)(vcpu, cr0); static_call(kvm_x86_set_cr0)(vcpu, cr0);
@ -7121,7 +7122,13 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size,
unsigned short port, void *val, unsigned int count) unsigned short port, void *val, unsigned int count)
{ {
if (vcpu->arch.pio.count) { if (vcpu->arch.pio.count) {
/* Complete previous iteration. */ /*
* Complete a previous iteration that required userspace I/O.
* Note, @count isn't guaranteed to match pio.count as userspace
* can modify ECX before rerunning the vCPU. Ignore any such
* shenanigans as KVM doesn't support modifying the rep count,
* and the emulator ensures @count doesn't overflow the buffer.
*/
} else { } else {
int r = __emulator_pio_in(vcpu, size, port, count); int r = __emulator_pio_in(vcpu, size, port, count);
if (!r) if (!r)
@ -7130,7 +7137,6 @@ static int emulator_pio_in(struct kvm_vcpu *vcpu, int size,
/* Results already available, fall through. */ /* Results already available, fall through. */
} }
WARN_ON(count != vcpu->arch.pio.count);
complete_emulator_pio_in(vcpu, val); complete_emulator_pio_in(vcpu, val);
return 1; return 1;
} }

Просмотреть файл

@ -277,7 +277,8 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
return; return;
} }
new = early_memremap(data.phys_map, data.size); new = early_memremap_prot(data.phys_map, data.size,
pgprot_val(pgprot_encrypted(FIXMAP_PAGE_NORMAL)));
if (!new) { if (!new) {
pr_err("Failed to map new boot services memmap\n"); pr_err("Failed to map new boot services memmap\n");
return; return;

Просмотреть файл

@ -15,6 +15,7 @@
#include <linux/falloc.h> #include <linux/falloc.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/module.h>
#include "blk.h" #include "blk.h"
static inline struct inode *bdev_file_inode(struct file *file) static inline struct inode *bdev_file_inode(struct file *file)
@ -340,8 +341,7 @@ static ssize_t __blkdev_direct_IO_async(struct kiocb *iocb,
} else { } else {
ret = bio_iov_iter_get_pages(bio, iter); ret = bio_iov_iter_get_pages(bio, iter);
if (unlikely(ret)) { if (unlikely(ret)) {
bio->bi_status = BLK_STS_IOERR; bio_put(bio);
bio_endio(bio);
return ret; return ret;
} }
} }

Просмотреть файл

@ -220,6 +220,7 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who)
pgrp = task_pgrp(current); pgrp = task_pgrp(current);
else else
pgrp = find_vpid(who); pgrp = find_vpid(who);
read_lock(&tasklist_lock);
do_each_pid_thread(pgrp, PIDTYPE_PGID, p) { do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
tmpio = get_task_ioprio(p); tmpio = get_task_ioprio(p);
if (tmpio < 0) if (tmpio < 0)
@ -229,6 +230,8 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who)
else else
ret = ioprio_best(ret, tmpio); ret = ioprio_best(ret, tmpio);
} while_each_pid_thread(pgrp, PIDTYPE_PGID, p); } while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
read_unlock(&tasklist_lock);
break; break;
case IOPRIO_WHO_USER: case IOPRIO_WHO_USER:
uid = make_kuid(current_user_ns(), who); uid = make_kuid(current_user_ns(), who);

Просмотреть файл

@ -4422,23 +4422,20 @@ static int binder_thread_release(struct binder_proc *proc,
__release(&t->lock); __release(&t->lock);
/* /*
* If this thread used poll, make sure we remove the waitqueue * If this thread used poll, make sure we remove the waitqueue from any
* from any epoll data structures holding it with POLLFREE. * poll data structures holding it.
* waitqueue_active() is safe to use here because we're holding
* the inner lock.
*/ */
if ((thread->looper & BINDER_LOOPER_STATE_POLL) && if (thread->looper & BINDER_LOOPER_STATE_POLL)
waitqueue_active(&thread->wait)) { wake_up_pollfree(&thread->wait);
wake_up_poll(&thread->wait, EPOLLHUP | POLLFREE);
}
binder_inner_proc_unlock(thread->proc); binder_inner_proc_unlock(thread->proc);
/* /*
* This is needed to avoid races between wake_up_poll() above and * This is needed to avoid races between wake_up_pollfree() above and
* and ep_remove_waitqueue() called for other reasons (eg the epoll file * someone else removing the last entry from the queue for other reasons
* descriptor being closed); ep_remove_waitqueue() holds an RCU read * (e.g. ep_remove_wait_queue() being called due to an epoll file
* lock, so we can be sure it's done after calling synchronize_rcu(). * descriptor being closed). Such other users hold an RCU read lock, so
* we can be sure they're done after we call synchronize_rcu().
*/ */
if (thread->looper & BINDER_LOOPER_STATE_POLL) if (thread->looper & BINDER_LOOPER_STATE_POLL)
synchronize_rcu(); synchronize_rcu();

Просмотреть файл

@ -94,6 +94,7 @@ struct ceva_ahci_priv {
static unsigned int ceva_ahci_read_id(struct ata_device *dev, static unsigned int ceva_ahci_read_id(struct ata_device *dev,
struct ata_taskfile *tf, u16 *id) struct ata_taskfile *tf, u16 *id)
{ {
__le16 *__id = (__le16 *)id;
u32 err_mask; u32 err_mask;
err_mask = ata_do_dev_read_id(dev, tf, id); err_mask = ata_do_dev_read_id(dev, tf, id);
@ -103,7 +104,7 @@ static unsigned int ceva_ahci_read_id(struct ata_device *dev,
* Since CEVA controller does not support device sleep feature, we * Since CEVA controller does not support device sleep feature, we
* need to clear DEVSLP (bit 8) in word78 of the IDENTIFY DEVICE data. * need to clear DEVSLP (bit 8) in word78 of the IDENTIFY DEVICE data.
*/ */
id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8)); __id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
return 0; return 0;
} }

Просмотреть файл

@ -3920,6 +3920,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "VRFDFC22048UCHC-TE*", NULL, ATA_HORKAGE_NODMA }, { "VRFDFC22048UCHC-TE*", NULL, ATA_HORKAGE_NODMA },
/* Odd clown on sil3726/4726 PMPs */ /* Odd clown on sil3726/4726 PMPs */
{ "Config Disk", NULL, ATA_HORKAGE_DISABLE }, { "Config Disk", NULL, ATA_HORKAGE_DISABLE },
/* Similar story with ASMedia 1092 */
{ "ASMT109x- Config", NULL, ATA_HORKAGE_DISABLE },
/* Weird ATAPI devices */ /* Weird ATAPI devices */
{ "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },

Просмотреть файл

@ -881,7 +881,7 @@ int mhi_pm_suspend(struct mhi_controller *mhi_cntrl)
} }
EXPORT_SYMBOL_GPL(mhi_pm_suspend); EXPORT_SYMBOL_GPL(mhi_pm_suspend);
int mhi_pm_resume(struct mhi_controller *mhi_cntrl) static int __mhi_pm_resume(struct mhi_controller *mhi_cntrl, bool force)
{ {
struct mhi_chan *itr, *tmp; struct mhi_chan *itr, *tmp;
struct device *dev = &mhi_cntrl->mhi_dev->dev; struct device *dev = &mhi_cntrl->mhi_dev->dev;
@ -898,8 +898,12 @@ int mhi_pm_resume(struct mhi_controller *mhi_cntrl)
if (MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state)) if (MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state))
return -EIO; return -EIO;
if (mhi_get_mhi_state(mhi_cntrl) != MHI_STATE_M3) if (mhi_get_mhi_state(mhi_cntrl) != MHI_STATE_M3) {
dev_warn(dev, "Resuming from non M3 state (%s)\n",
TO_MHI_STATE_STR(mhi_get_mhi_state(mhi_cntrl)));
if (!force)
return -EINVAL; return -EINVAL;
}
/* Notify clients about exiting LPM */ /* Notify clients about exiting LPM */
list_for_each_entry_safe(itr, tmp, &mhi_cntrl->lpm_chans, node) { list_for_each_entry_safe(itr, tmp, &mhi_cntrl->lpm_chans, node) {
@ -940,8 +944,19 @@ int mhi_pm_resume(struct mhi_controller *mhi_cntrl)
return 0; return 0;
} }
int mhi_pm_resume(struct mhi_controller *mhi_cntrl)
{
return __mhi_pm_resume(mhi_cntrl, false);
}
EXPORT_SYMBOL_GPL(mhi_pm_resume); EXPORT_SYMBOL_GPL(mhi_pm_resume);
int mhi_pm_resume_force(struct mhi_controller *mhi_cntrl)
{
return __mhi_pm_resume(mhi_cntrl, true);
}
EXPORT_SYMBOL_GPL(mhi_pm_resume_force);
int __mhi_device_get_sync(struct mhi_controller *mhi_cntrl) int __mhi_device_get_sync(struct mhi_controller *mhi_cntrl)
{ {
int ret; int ret;

Просмотреть файл

@ -20,7 +20,7 @@
#define MHI_PCI_DEFAULT_BAR_NUM 0 #define MHI_PCI_DEFAULT_BAR_NUM 0
#define MHI_POST_RESET_DELAY_MS 500 #define MHI_POST_RESET_DELAY_MS 2000
#define HEALTH_CHECK_PERIOD (HZ * 2) #define HEALTH_CHECK_PERIOD (HZ * 2)

Просмотреть файл

@ -370,7 +370,7 @@ static struct platform_driver imx8qxp_lpcg_clk_driver = {
.probe = imx8qxp_lpcg_clk_probe, .probe = imx8qxp_lpcg_clk_probe,
}; };
builtin_platform_driver(imx8qxp_lpcg_clk_driver); module_platform_driver(imx8qxp_lpcg_clk_driver);
MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>"); MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
MODULE_DESCRIPTION("NXP i.MX8QXP LPCG clock driver"); MODULE_DESCRIPTION("NXP i.MX8QXP LPCG clock driver");

Просмотреть файл

@ -308,7 +308,7 @@ static struct platform_driver imx8qxp_clk_driver = {
}, },
.probe = imx8qxp_clk_probe, .probe = imx8qxp_clk_probe,
}; };
builtin_platform_driver(imx8qxp_clk_driver); module_platform_driver(imx8qxp_clk_driver);
MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>"); MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
MODULE_DESCRIPTION("NXP i.MX8QXP clock driver"); MODULE_DESCRIPTION("NXP i.MX8QXP clock driver");

Просмотреть файл

@ -1429,6 +1429,15 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_fabia_ops);
void clk_trion_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, void clk_trion_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
const struct alpha_pll_config *config) const struct alpha_pll_config *config)
{ {
/*
* If the bootloader left the PLL enabled it's likely that there are
* RCGs that will lock up if we disable the PLL below.
*/
if (trion_pll_is_enabled(pll, regmap)) {
pr_debug("Trion PLL is already enabled, skipping configuration\n");
return;
}
clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l); clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
regmap_write(regmap, PLL_CAL_L_VAL(pll), TRION_PLL_CAL_VAL); regmap_write(regmap, PLL_CAL_L_VAL(pll), TRION_PLL_CAL_VAL);
clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha); clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);

Просмотреть файл

@ -28,7 +28,7 @@ static u8 mux_get_parent(struct clk_hw *hw)
val &= mask; val &= mask;
if (mux->parent_map) if (mux->parent_map)
return qcom_find_src_index(hw, mux->parent_map, val); return qcom_find_cfg_index(hw, mux->parent_map, val);
return val; return val;
} }

Просмотреть файл

@ -69,6 +69,18 @@ int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map, u8 src)
} }
EXPORT_SYMBOL_GPL(qcom_find_src_index); EXPORT_SYMBOL_GPL(qcom_find_src_index);
int qcom_find_cfg_index(struct clk_hw *hw, const struct parent_map *map, u8 cfg)
{
int i, num_parents = clk_hw_get_num_parents(hw);
for (i = 0; i < num_parents; i++)
if (cfg == map[i].cfg)
return i;
return -ENOENT;
}
EXPORT_SYMBOL_GPL(qcom_find_cfg_index);
struct regmap * struct regmap *
qcom_cc_map(struct platform_device *pdev, const struct qcom_cc_desc *desc) qcom_cc_map(struct platform_device *pdev, const struct qcom_cc_desc *desc)
{ {

Просмотреть файл

@ -49,6 +49,8 @@ extern void
qcom_pll_set_fsm_mode(struct regmap *m, u32 reg, u8 bias_count, u8 lock_count); qcom_pll_set_fsm_mode(struct regmap *m, u32 reg, u8 bias_count, u8 lock_count);
extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map, extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map,
u8 src); u8 src);
extern int qcom_find_cfg_index(struct clk_hw *hw, const struct parent_map *map,
u8 cfg);
extern int qcom_cc_register_board_clk(struct device *dev, const char *path, extern int qcom_cc_register_board_clk(struct device *dev, const char *path,
const char *name, unsigned long rate); const char *name, unsigned long rate);

Просмотреть файл

@ -1121,7 +1121,7 @@ static struct clk_rcg2 gcc_sdcc1_apps_clk_src = {
.name = "gcc_sdcc1_apps_clk_src", .name = "gcc_sdcc1_apps_clk_src",
.parent_data = gcc_parent_data_1, .parent_data = gcc_parent_data_1,
.num_parents = ARRAY_SIZE(gcc_parent_data_1), .num_parents = ARRAY_SIZE(gcc_parent_data_1),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_floor_ops,
}, },
}; };
@ -1143,7 +1143,7 @@ static struct clk_rcg2 gcc_sdcc1_ice_core_clk_src = {
.name = "gcc_sdcc1_ice_core_clk_src", .name = "gcc_sdcc1_ice_core_clk_src",
.parent_data = gcc_parent_data_0, .parent_data = gcc_parent_data_0,
.num_parents = ARRAY_SIZE(gcc_parent_data_0), .num_parents = ARRAY_SIZE(gcc_parent_data_0),
.ops = &clk_rcg2_floor_ops, .ops = &clk_rcg2_ops,
}, },
}; };

Просмотреть файл

@ -543,8 +543,8 @@ static void __init of_syscon_icst_setup(struct device_node *np)
regclk = icst_clk_setup(NULL, &icst_desc, name, parent_name, map, ctype); regclk = icst_clk_setup(NULL, &icst_desc, name, parent_name, map, ctype);
if (IS_ERR(regclk)) { if (IS_ERR(regclk)) {
kfree(name);
pr_err("error setting up syscon ICST clock %s\n", name); pr_err("error setting up syscon ICST clock %s\n", name);
kfree(name);
return; return;
} }
of_clk_add_provider(np, of_clk_src_simple_get, regclk); of_clk_add_provider(np, of_clk_src_simple_get, regclk);

Просмотреть файл

@ -394,7 +394,12 @@ EXPORT_SYMBOL_GPL(timer_unstable_counter_workaround);
static atomic_t timer_unstable_counter_workaround_in_use = ATOMIC_INIT(0); static atomic_t timer_unstable_counter_workaround_in_use = ATOMIC_INIT(0);
static void erratum_set_next_event_generic(const int access, unsigned long evt, /*
* Force the inlining of this function so that the register accesses
* can be themselves correctly inlined.
*/
static __always_inline
void erratum_set_next_event_generic(const int access, unsigned long evt,
struct clock_event_device *clk) struct clock_event_device *clk)
{ {
unsigned long ctrl; unsigned long ctrl;

Просмотреть файл

@ -47,7 +47,7 @@ static int __init timer_get_base_and_rate(struct device_node *np,
pr_warn("pclk for %pOFn is present, but could not be activated\n", pr_warn("pclk for %pOFn is present, but could not be activated\n",
np); np);
if (!of_property_read_u32(np, "clock-freq", rate) && if (!of_property_read_u32(np, "clock-freq", rate) ||
!of_property_read_u32(np, "clock-frequency", rate)) !of_property_read_u32(np, "clock-frequency", rate))
return 0; return 0;

Просмотреть файл

@ -2576,6 +2576,7 @@ static int dm_resume(void *handle)
*/ */
link_enc_cfg_init(dm->dc, dc_state); link_enc_cfg_init(dm->dc, dc_state);
if (dc_enable_dmub_notifications(adev->dm.dc))
amdgpu_dm_outbox_init(adev); amdgpu_dm_outbox_init(adev);
r = dm_dmub_hw_init(adev); r = dm_dmub_hw_init(adev);
@ -2625,6 +2626,10 @@ static int dm_resume(void *handle)
/* TODO: Remove dc_state->dccg, use dc->dccg directly. */ /* TODO: Remove dc_state->dccg, use dc->dccg directly. */
dc_resource_state_construct(dm->dc, dm_state->context); dc_resource_state_construct(dm->dc, dm_state->context);
/* Re-enable outbox interrupts for DPIA. */
if (dc_enable_dmub_notifications(adev->dm.dc))
amdgpu_dm_outbox_init(adev);
/* Before powering on DC we need to re-initialize DMUB. */ /* Before powering on DC we need to re-initialize DMUB. */
r = dm_dmub_hw_init(adev); r = dm_dmub_hw_init(adev);
if (r) if (r)

Просмотреть файл

@ -226,6 +226,8 @@ static inline void get_edp_links(const struct dc *dc,
*edp_num = 0; *edp_num = 0;
for (i = 0; i < dc->link_count; i++) { for (i = 0; i < dc->link_count; i++) {
// report any eDP links, even unconnected DDI's // report any eDP links, even unconnected DDI's
if (!dc->links[i])
continue;
if (dc->links[i]->connector_signal == SIGNAL_TYPE_EDP) { if (dc->links[i]->connector_signal == SIGNAL_TYPE_EDP) {
edp_links[*edp_num] = dc->links[i]; edp_links[*edp_num] = dc->links[i];
if (++(*edp_num) == MAX_NUM_EDP) if (++(*edp_num) == MAX_NUM_EDP)

Просмотреть файл

@ -9,6 +9,7 @@
#include <linux/shmem_fs.h> #include <linux/shmem_fs.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/module.h>
#ifdef CONFIG_X86 #ifdef CONFIG_X86
#include <asm/set_memory.h> #include <asm/set_memory.h>

Просмотреть файл

@ -404,8 +404,17 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
if (*fence) { if (*fence) {
ret = dma_fence_chain_find_seqno(fence, point); ret = dma_fence_chain_find_seqno(fence, point);
if (!ret) if (!ret) {
/* If the requested seqno is already signaled
* drm_syncobj_find_fence may return a NULL
* fence. To make sure the recipient gets
* signalled, use a new fence instead.
*/
if (!*fence)
*fence = dma_fence_get_stub();
goto out; goto out;
}
dma_fence_put(*fence); dma_fence_put(*fence);
} else { } else {
ret = -EINVAL; ret = -EINVAL;

Просмотреть файл

@ -3277,6 +3277,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
out_fence = eb_requests_create(&eb, in_fence, out_fence_fd); out_fence = eb_requests_create(&eb, in_fence, out_fence_fd);
if (IS_ERR(out_fence)) { if (IS_ERR(out_fence)) {
err = PTR_ERR(out_fence); err = PTR_ERR(out_fence);
out_fence = NULL;
if (eb.requests[0]) if (eb.requests[0])
goto err_request; goto err_request;
else else

Просмотреть файл

@ -6,6 +6,7 @@
#include <linux/slab.h> /* fault-inject.h is not standalone! */ #include <linux/slab.h> /* fault-inject.h is not standalone! */
#include <linux/fault-inject.h> #include <linux/fault-inject.h>
#include <linux/sched/mm.h>
#include "gem/i915_gem_lmem.h" #include "gem/i915_gem_lmem.h"
#include "i915_trace.h" #include "i915_trace.h"

Просмотреть файл

@ -1127,6 +1127,15 @@ icl_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
GAMT_CHKN_BIT_REG, GAMT_CHKN_BIT_REG,
GAMT_CHKN_DISABLE_L3_COH_PIPE); GAMT_CHKN_DISABLE_L3_COH_PIPE);
/* Wa_1407352427:icl,ehl */
wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE2,
PSDUNIT_CLKGATE_DIS);
/* Wa_1406680159:icl,ehl */
wa_write_or(wal,
SUBSLICE_UNIT_LEVEL_CLKGATE,
GWUNIT_CLKGATE_DIS);
/* Wa_1607087056:icl,ehl,jsl */ /* Wa_1607087056:icl,ehl,jsl */
if (IS_ICELAKE(i915) || if (IS_ICELAKE(i915) ||
IS_JSL_EHL_GT_STEP(i915, STEP_A0, STEP_B0)) IS_JSL_EHL_GT_STEP(i915, STEP_A0, STEP_B0))
@ -1852,15 +1861,6 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE, wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE,
VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS); VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS);
/* Wa_1407352427:icl,ehl */
wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE2,
PSDUNIT_CLKGATE_DIS);
/* Wa_1406680159:icl,ehl */
wa_write_or(wal,
SUBSLICE_UNIT_LEVEL_CLKGATE,
GWUNIT_CLKGATE_DIS);
/* /*
* Wa_1408767742:icl[a2..forever],ehl[all] * Wa_1408767742:icl[a2..forever],ehl[all]
* Wa_1605460711:icl[a0..c0] * Wa_1605460711:icl[a0..c0]

Просмотреть файл

@ -29,6 +29,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/sched/clock.h> #include <linux/sched/clock.h>
#include <linux/sched/signal.h> #include <linux/sched/signal.h>
#include <linux/sched/mm.h>
#include "gem/i915_gem_context.h" #include "gem/i915_gem_context.h"
#include "gt/intel_breadcrumbs.h" #include "gt/intel_breadcrumbs.h"

Просмотреть файл

@ -4,6 +4,7 @@
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>

Просмотреть файл

@ -5,6 +5,7 @@
*/ */
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/sched/mm.h>
#include "msm_drv.h" #include "msm_drv.h"
#include "msm_gem.h" #include "msm_gem.h"

Просмотреть файл

@ -1103,7 +1103,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
* as an indication that we're about to swap out. * as an indication that we're about to swap out.
*/ */
memset(&place, 0, sizeof(place)); memset(&place, 0, sizeof(place));
place.mem_type = TTM_PL_SYSTEM; place.mem_type = bo->resource->mem_type;
if (!ttm_bo_evict_swapout_allowable(bo, ctx, &place, &locked, NULL)) if (!ttm_bo_evict_swapout_allowable(bo, ctx, &place, &locked, NULL))
return -EBUSY; return -EBUSY;
@ -1135,6 +1135,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
struct ttm_place hop; struct ttm_place hop;
memset(&hop, 0, sizeof(hop)); memset(&hop, 0, sizeof(hop));
place.mem_type = TTM_PL_SYSTEM;
ret = ttm_resource_alloc(bo, &place, &evict_mem); ret = ttm_resource_alloc(bo, &place, &evict_mem);
if (unlikely(ret)) if (unlikely(ret))
goto out; goto out;

Просмотреть файл

@ -34,6 +34,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/shmem_fs.h> #include <linux/shmem_fs.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/module.h>
#include <drm/drm_cache.h> #include <drm/drm_cache.h>
#include <drm/ttm/ttm_bo_driver.h> #include <drm/ttm/ttm_bo_driver.h>

Просмотреть файл

@ -207,14 +207,14 @@ config HID_CHERRY
config HID_CHICONY config HID_CHICONY
tristate "Chicony devices" tristate "Chicony devices"
depends on HID depends on USB_HID
default !EXPERT default !EXPERT
help help
Support for Chicony Tactical pad and special keys on Chicony keyboards. Support for Chicony Tactical pad and special keys on Chicony keyboards.
config HID_CORSAIR config HID_CORSAIR
tristate "Corsair devices" tristate "Corsair devices"
depends on HID && USB && LEDS_CLASS depends on USB_HID && LEDS_CLASS
help help
Support for Corsair devices that are not fully compliant with the Support for Corsair devices that are not fully compliant with the
HID standard. HID standard.
@ -245,7 +245,7 @@ config HID_MACALLY
config HID_PRODIKEYS config HID_PRODIKEYS
tristate "Prodikeys PC-MIDI Keyboard support" tristate "Prodikeys PC-MIDI Keyboard support"
depends on HID && SND depends on USB_HID && SND
select SND_RAWMIDI select SND_RAWMIDI
help help
Support for Prodikeys PC-MIDI Keyboard device support. Support for Prodikeys PC-MIDI Keyboard device support.
@ -560,7 +560,7 @@ config HID_LENOVO
config HID_LOGITECH config HID_LOGITECH
tristate "Logitech devices" tristate "Logitech devices"
depends on HID depends on USB_HID
depends on LEDS_CLASS depends on LEDS_CLASS
default !EXPERT default !EXPERT
help help
@ -951,7 +951,7 @@ config HID_SAITEK
config HID_SAMSUNG config HID_SAMSUNG
tristate "Samsung InfraRed remote control or keyboards" tristate "Samsung InfraRed remote control or keyboards"
depends on HID depends on USB_HID
help help
Support for Samsung InfraRed remote control or keyboards. Support for Samsung InfraRed remote control or keyboards.

Просмотреть файл

@ -1028,8 +1028,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (drvdata->quirks & QUIRK_IS_MULTITOUCH) if (drvdata->quirks & QUIRK_IS_MULTITOUCH)
drvdata->tp = &asus_i2c_tp; drvdata->tp = &asus_i2c_tp;
if ((drvdata->quirks & QUIRK_T100_KEYBOARD) && if ((drvdata->quirks & QUIRK_T100_KEYBOARD) && hid_is_usb(hdev)) {
hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
struct usb_interface *intf = to_usb_interface(hdev->dev.parent); struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
if (intf->altsetting->desc.bInterfaceNumber == T100_TPAD_INTF) { if (intf->altsetting->desc.bInterfaceNumber == T100_TPAD_INTF) {
@ -1057,8 +1056,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
drvdata->tp = &asus_t100chi_tp; drvdata->tp = &asus_t100chi_tp;
} }
if ((drvdata->quirks & QUIRK_MEDION_E1239T) && if ((drvdata->quirks & QUIRK_MEDION_E1239T) && hid_is_usb(hdev)) {
hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
struct usb_host_interface *alt = struct usb_host_interface *alt =
to_usb_interface(hdev->dev.parent)->altsetting; to_usb_interface(hdev->dev.parent)->altsetting;

Просмотреть файл

@ -191,7 +191,7 @@ static void bigben_worker(struct work_struct *work)
struct bigben_device, worker); struct bigben_device, worker);
struct hid_field *report_field = bigben->report->field[0]; struct hid_field *report_field = bigben->report->field[0];
if (bigben->removed) if (bigben->removed || !report_field)
return; return;
if (bigben->work_led) { if (bigben->work_led) {

Просмотреть файл

@ -114,6 +114,9 @@ static int ch_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ {
int ret; int ret;
if (!hid_is_usb(hdev))
return -EINVAL;
hdev->quirks |= HID_QUIRK_INPUT_PER_APP; hdev->quirks |= HID_QUIRK_INPUT_PER_APP;
ret = hid_parse(hdev); ret = hid_parse(hdev);
if (ret) { if (ret) {

Просмотреть файл

@ -553,7 +553,12 @@ static int corsair_probe(struct hid_device *dev, const struct hid_device_id *id)
int ret; int ret;
unsigned long quirks = id->driver_data; unsigned long quirks = id->driver_data;
struct corsair_drvdata *drvdata; struct corsair_drvdata *drvdata;
struct usb_interface *usbif = to_usb_interface(dev->dev.parent); struct usb_interface *usbif;
if (!hid_is_usb(dev))
return -EINVAL;
usbif = to_usb_interface(dev->dev.parent);
drvdata = devm_kzalloc(&dev->dev, sizeof(struct corsair_drvdata), drvdata = devm_kzalloc(&dev->dev, sizeof(struct corsair_drvdata),
GFP_KERNEL); GFP_KERNEL);

Просмотреть файл

@ -50,7 +50,7 @@ struct elan_drvdata {
static int is_not_elan_touchpad(struct hid_device *hdev) static int is_not_elan_touchpad(struct hid_device *hdev)
{ {
if (hdev->bus == BUS_USB) { if (hid_is_usb(hdev)) {
struct usb_interface *intf = to_usb_interface(hdev->dev.parent); struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
return (intf->altsetting->desc.bInterfaceNumber != return (intf->altsetting->desc.bInterfaceNumber !=

Просмотреть файл

@ -230,6 +230,9 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
int ret; int ret;
struct usb_device *udev; struct usb_device *udev;
if (!hid_is_usb(hdev))
return -EINVAL;
priv = kzalloc(sizeof(*priv), GFP_KERNEL); priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;

Просмотреть файл

@ -915,6 +915,9 @@ static int ft260_probe(struct hid_device *hdev, const struct hid_device_id *id)
struct ft260_get_chip_version_report version; struct ft260_get_chip_version_report version;
int ret; int ret;
if (!hid_is_usb(hdev))
return -EINVAL;
dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL); dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;

Просмотреть файл

@ -585,6 +585,8 @@ static void hammer_remove(struct hid_device *hdev)
static const struct hid_device_id hammer_devices[] = { static const struct hid_device_id hammer_devices[] = {
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) }, USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) },
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_EEL) },
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) }, USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) },
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,

Просмотреть файл

@ -140,12 +140,17 @@ static int holtek_kbd_input_event(struct input_dev *dev, unsigned int type,
static int holtek_kbd_probe(struct hid_device *hdev, static int holtek_kbd_probe(struct hid_device *hdev,
const struct hid_device_id *id) const struct hid_device_id *id)
{ {
struct usb_interface *intf = to_usb_interface(hdev->dev.parent); struct usb_interface *intf;
int ret = hid_parse(hdev); int ret;
if (!hid_is_usb(hdev))
return -EINVAL;
ret = hid_parse(hdev);
if (!ret) if (!ret)
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
intf = to_usb_interface(hdev->dev.parent);
if (!ret && intf->cur_altsetting->desc.bInterfaceNumber == 1) { if (!ret && intf->cur_altsetting->desc.bInterfaceNumber == 1) {
struct hid_input *hidinput; struct hid_input *hidinput;
list_for_each_entry(hidinput, &hdev->inputs, list) { list_for_each_entry(hidinput, &hdev->inputs, list) {

Просмотреть файл

@ -62,6 +62,14 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
return rdesc; return rdesc;
} }
static int holtek_mouse_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{
if (!hid_is_usb(hdev))
return -EINVAL;
return 0;
}
static const struct hid_device_id holtek_mouse_devices[] = { static const struct hid_device_id holtek_mouse_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) }, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) },
@ -83,6 +91,7 @@ static struct hid_driver holtek_mouse_driver = {
.name = "holtek_mouse", .name = "holtek_mouse",
.id_table = holtek_mouse_devices, .id_table = holtek_mouse_devices,
.report_fixup = holtek_mouse_report_fixup, .report_fixup = holtek_mouse_report_fixup,
.probe = holtek_mouse_probe,
}; };
module_hid_driver(holtek_mouse_driver); module_hid_driver(holtek_mouse_driver);

Просмотреть файл

@ -399,6 +399,7 @@
#define USB_DEVICE_ID_HP_X2_10_COVER 0x0755 #define USB_DEVICE_ID_HP_X2_10_COVER 0x0755
#define I2C_DEVICE_ID_HP_ENVY_X360_15 0x2d05 #define I2C_DEVICE_ID_HP_ENVY_X360_15 0x2d05
#define I2C_DEVICE_ID_HP_SPECTRE_X360_15 0x2817 #define I2C_DEVICE_ID_HP_SPECTRE_X360_15 0x2817
#define USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN 0x2544
#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706 #define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706
#define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A #define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A
@ -501,6 +502,7 @@
#define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d
#define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044 #define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044
#define USB_DEVICE_ID_GOOGLE_DON 0x5050 #define USB_DEVICE_ID_GOOGLE_DON 0x5050
#define USB_DEVICE_ID_GOOGLE_EEL 0x5057
#define USB_VENDOR_ID_GOTOP 0x08f2 #define USB_VENDOR_ID_GOTOP 0x08f2
#define USB_DEVICE_ID_SUPER_Q2 0x007f #define USB_DEVICE_ID_SUPER_Q2 0x007f
@ -886,6 +888,7 @@
#define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7 #define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7
#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9 #define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9
#define USB_DEVICE_ID_MS_POWER_COVER 0x07da #define USB_DEVICE_ID_MS_POWER_COVER 0x07da
#define USB_DEVICE_ID_MS_SURFACE3_COVER 0x07de
#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd #define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd
#define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb #define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb
#define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0 #define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0

Просмотреть файл

@ -325,6 +325,8 @@ static const struct hid_device_id hid_battery_quirks[] = {
HID_BATTERY_QUIRK_IGNORE }, HID_BATTERY_QUIRK_IGNORE },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN), { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN),
HID_BATTERY_QUIRK_IGNORE }, HID_BATTERY_QUIRK_IGNORE },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN),
HID_BATTERY_QUIRK_IGNORE },
{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_ENVY_X360_15), { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_ENVY_X360_15),
HID_BATTERY_QUIRK_IGNORE }, HID_BATTERY_QUIRK_IGNORE },
{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_SPECTRE_X360_15), { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_SPECTRE_X360_15),

Просмотреть файл

@ -749,12 +749,18 @@ static int lg_raw_event(struct hid_device *hdev, struct hid_report *report,
static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ {
struct usb_interface *iface = to_usb_interface(hdev->dev.parent); struct usb_interface *iface;
__u8 iface_num = iface->cur_altsetting->desc.bInterfaceNumber; __u8 iface_num;
unsigned int connect_mask = HID_CONNECT_DEFAULT; unsigned int connect_mask = HID_CONNECT_DEFAULT;
struct lg_drv_data *drv_data; struct lg_drv_data *drv_data;
int ret; int ret;
if (!hid_is_usb(hdev))
return -EINVAL;
iface = to_usb_interface(hdev->dev.parent);
iface_num = iface->cur_altsetting->desc.bInterfaceNumber;
/* G29 only work with the 1st interface */ /* G29 only work with the 1st interface */
if ((hdev->product == USB_DEVICE_ID_LOGITECH_G29_WHEEL) && if ((hdev->product == USB_DEVICE_ID_LOGITECH_G29_WHEEL) &&
(iface_num != 0)) { (iface_num != 0)) {

Просмотреть файл

@ -1777,7 +1777,7 @@ static int logi_dj_probe(struct hid_device *hdev,
case recvr_type_bluetooth: no_dj_interfaces = 2; break; case recvr_type_bluetooth: no_dj_interfaces = 2; break;
case recvr_type_dinovo: no_dj_interfaces = 2; break; case recvr_type_dinovo: no_dj_interfaces = 2; break;
} }
if (hid_is_using_ll_driver(hdev, &usb_hid_driver)) { if (hid_is_usb(hdev)) {
intf = to_usb_interface(hdev->dev.parent); intf = to_usb_interface(hdev->dev.parent);
if (intf && intf->altsetting->desc.bInterfaceNumber >= if (intf && intf->altsetting->desc.bInterfaceNumber >=
no_dj_interfaces) { no_dj_interfaces) {

Просмотреть файл

@ -798,12 +798,18 @@ static int pk_raw_event(struct hid_device *hdev, struct hid_report *report,
static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ {
int ret; int ret;
struct usb_interface *intf = to_usb_interface(hdev->dev.parent); struct usb_interface *intf;
unsigned short ifnum = intf->cur_altsetting->desc.bInterfaceNumber; unsigned short ifnum;
unsigned long quirks = id->driver_data; unsigned long quirks = id->driver_data;
struct pk_device *pk; struct pk_device *pk;
struct pcmidi_snd *pm = NULL; struct pcmidi_snd *pm = NULL;
if (!hid_is_usb(hdev))
return -EINVAL;
intf = to_usb_interface(hdev->dev.parent);
ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
pk = kzalloc(sizeof(*pk), GFP_KERNEL); pk = kzalloc(sizeof(*pk), GFP_KERNEL);
if (pk == NULL) { if (pk == NULL) {
hid_err(hdev, "can't alloc descriptor\n"); hid_err(hdev, "can't alloc descriptor\n");

Просмотреть файл

@ -124,6 +124,7 @@ static const struct hid_device_id hid_quirks[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_MCS, USB_DEVICE_ID_MCS_GAMEPADBLOCK), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_MCS, USB_DEVICE_ID_MCS_GAMEPADBLOCK), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PIXART_MOUSE), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PIXART_MOUSE), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE3_COVER), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2), HID_QUIRK_NO_INIT_REPORTS },

Просмотреть файл

@ -344,6 +344,9 @@ static int arvo_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -324,6 +324,9 @@ static int isku_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -749,6 +749,9 @@ static int kone_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -431,6 +431,9 @@ static int koneplus_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -133,6 +133,9 @@ static int konepure_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -501,6 +501,9 @@ static int kovaplus_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -160,6 +160,9 @@ static int lua_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -449,6 +449,9 @@ static int pyra_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -141,6 +141,9 @@ static int ryos_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -113,6 +113,9 @@ static int savu_probe(struct hid_device *hdev,
{ {
int retval; int retval;
if (!hid_is_usb(hdev))
return -EINVAL;
retval = hid_parse(hdev); retval = hid_parse(hdev);
if (retval) { if (retval) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -152,6 +152,9 @@ static int samsung_probe(struct hid_device *hdev,
int ret; int ret;
unsigned int cmask = HID_CONNECT_DEFAULT; unsigned int cmask = HID_CONNECT_DEFAULT;
if (!hid_is_usb(hdev))
return -EINVAL;
ret = hid_parse(hdev); ret = hid_parse(hdev);
if (ret) { if (ret) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");

Просмотреть файл

@ -3000,7 +3000,6 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
sc->quirks = quirks; sc->quirks = quirks;
hid_set_drvdata(hdev, sc); hid_set_drvdata(hdev, sc);
sc->hdev = hdev; sc->hdev = hdev;
usbdev = to_usb_device(sc->hdev->dev.parent->parent);
ret = hid_parse(hdev); ret = hid_parse(hdev);
if (ret) { if (ret) {
@ -3038,14 +3037,23 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
*/ */
if (!(hdev->claimed & HID_CLAIMED_INPUT)) { if (!(hdev->claimed & HID_CLAIMED_INPUT)) {
hid_err(hdev, "failed to claim input\n"); hid_err(hdev, "failed to claim input\n");
hid_hw_stop(hdev); ret = -ENODEV;
return -ENODEV; goto err;
} }
if (sc->quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4)) { if (sc->quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4)) {
if (!hid_is_usb(hdev)) {
ret = -EINVAL;
goto err;
}
usbdev = to_usb_device(sc->hdev->dev.parent->parent);
sc->ghl_urb = usb_alloc_urb(0, GFP_ATOMIC); sc->ghl_urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!sc->ghl_urb) if (!sc->ghl_urb) {
return -ENOMEM; ret = -ENOMEM;
goto err;
}
if (sc->quirks & GHL_GUITAR_PS3WIIU) if (sc->quirks & GHL_GUITAR_PS3WIIU)
ret = ghl_init_urb(sc, usbdev, ghl_ps3wiiu_magic_data, ret = ghl_init_urb(sc, usbdev, ghl_ps3wiiu_magic_data,
@ -3055,7 +3063,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
ARRAY_SIZE(ghl_ps4_magic_data)); ARRAY_SIZE(ghl_ps4_magic_data));
if (ret) { if (ret) {
hid_err(hdev, "error preparing URB\n"); hid_err(hdev, "error preparing URB\n");
return ret; goto err;
} }
timer_setup(&sc->ghl_poke_timer, ghl_magic_poke, 0); timer_setup(&sc->ghl_poke_timer, ghl_magic_poke, 0);
@ -3064,6 +3072,10 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
} }
return ret; return ret;
err:
hid_hw_stop(hdev);
return ret;
} }
static void sony_remove(struct hid_device *hdev) static void sony_remove(struct hid_device *hdev)

Просмотреть файл

@ -274,6 +274,9 @@ static int thrustmaster_probe(struct hid_device *hdev, const struct hid_device_i
int ret = 0; int ret = 0;
struct tm_wheel *tm_wheel = NULL; struct tm_wheel *tm_wheel = NULL;
if (!hid_is_usb(hdev))
return -EINVAL;
ret = hid_parse(hdev); ret = hid_parse(hdev);
if (ret) { if (ret) {
hid_err(hdev, "parse failed with error %d\n", ret); hid_err(hdev, "parse failed with error %d\n", ret);

Просмотреть файл

@ -311,7 +311,7 @@ static int u2fzero_probe(struct hid_device *hdev,
unsigned int minor; unsigned int minor;
int ret; int ret;
if (!hid_is_using_ll_driver(hdev, &usb_hid_driver)) if (!hid_is_usb(hdev))
return -EINVAL; return -EINVAL;
dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL); dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);

Просмотреть файл

@ -164,6 +164,9 @@ static int uclogic_probe(struct hid_device *hdev,
struct uclogic_drvdata *drvdata = NULL; struct uclogic_drvdata *drvdata = NULL;
bool params_initialized = false; bool params_initialized = false;
if (!hid_is_usb(hdev))
return -EINVAL;
/* /*
* libinput requires the pad interface to be on a different node * libinput requires the pad interface to be on a different node
* than the pen, so use QUIRK_MULTI_INPUT for all tablets. * than the pen, so use QUIRK_MULTI_INPUT for all tablets.

Просмотреть файл

@ -843,8 +843,7 @@ int uclogic_params_init(struct uclogic_params *params,
struct uclogic_params p = {0, }; struct uclogic_params p = {0, };
/* Check arguments */ /* Check arguments */
if (params == NULL || hdev == NULL || if (params == NULL || hdev == NULL || !hid_is_usb(hdev)) {
!hid_is_using_ll_driver(hdev, &usb_hid_driver)) {
rc = -EINVAL; rc = -EINVAL;
goto cleanup; goto cleanup;
} }

Просмотреть файл

@ -266,6 +266,7 @@ static void __maybe_unused ish_resume_handler(struct work_struct *work)
if (ish_should_leave_d0i3(pdev) && !dev->suspend_flag if (ish_should_leave_d0i3(pdev) && !dev->suspend_flag
&& IPC_IS_ISH_ILUP(fwsts)) { && IPC_IS_ISH_ILUP(fwsts)) {
if (device_may_wakeup(&pdev->dev))
disable_irq_wake(pdev->irq); disable_irq_wake(pdev->irq);
ish_set_host_ready(dev); ish_set_host_ready(dev);
@ -337,6 +338,7 @@ static int __maybe_unused ish_suspend(struct device *device)
*/ */
pci_save_state(pdev); pci_save_state(pdev);
if (device_may_wakeup(&pdev->dev))
enable_irq_wake(pdev->irq); enable_irq_wake(pdev->irq);
} }
} else { } else {

Просмотреть файл

@ -726,7 +726,7 @@ static void wacom_retrieve_hid_descriptor(struct hid_device *hdev,
* Skip the query for this type and modify defaults based on * Skip the query for this type and modify defaults based on
* interface number. * interface number.
*/ */
if (features->type == WIRELESS) { if (features->type == WIRELESS && intf) {
if (intf->cur_altsetting->desc.bInterfaceNumber == 0) if (intf->cur_altsetting->desc.bInterfaceNumber == 0)
features->device_type = WACOM_DEVICETYPE_WL_MONITOR; features->device_type = WACOM_DEVICETYPE_WL_MONITOR;
else else
@ -2214,7 +2214,7 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix)
if ((features->type == HID_GENERIC) && !strcmp("Wacom HID", features->name)) { if ((features->type == HID_GENERIC) && !strcmp("Wacom HID", features->name)) {
char *product_name = wacom->hdev->name; char *product_name = wacom->hdev->name;
if (hid_is_using_ll_driver(wacom->hdev, &usb_hid_driver)) { if (hid_is_usb(wacom->hdev)) {
struct usb_interface *intf = to_usb_interface(wacom->hdev->dev.parent); struct usb_interface *intf = to_usb_interface(wacom->hdev->dev.parent);
struct usb_device *dev = interface_to_usbdev(intf); struct usb_device *dev = interface_to_usbdev(intf);
product_name = dev->product; product_name = dev->product;
@ -2451,6 +2451,9 @@ static void wacom_wireless_work(struct work_struct *work)
wacom_destroy_battery(wacom); wacom_destroy_battery(wacom);
if (!usbdev)
return;
/* Stylus interface */ /* Stylus interface */
hdev1 = usb_get_intfdata(usbdev->config->interface[1]); hdev1 = usb_get_intfdata(usbdev->config->interface[1]);
wacom1 = hid_get_drvdata(hdev1); wacom1 = hid_get_drvdata(hdev1);
@ -2730,8 +2733,6 @@ static void wacom_mode_change_work(struct work_struct *work)
static int wacom_probe(struct hid_device *hdev, static int wacom_probe(struct hid_device *hdev,
const struct hid_device_id *id) const struct hid_device_id *id)
{ {
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
struct usb_device *dev = interface_to_usbdev(intf);
struct wacom *wacom; struct wacom *wacom;
struct wacom_wac *wacom_wac; struct wacom_wac *wacom_wac;
struct wacom_features *features; struct wacom_features *features;
@ -2766,8 +2767,14 @@ static int wacom_probe(struct hid_device *hdev,
wacom_wac->hid_data.inputmode = -1; wacom_wac->hid_data.inputmode = -1;
wacom_wac->mode_report = -1; wacom_wac->mode_report = -1;
if (hid_is_usb(hdev)) {
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
struct usb_device *dev = interface_to_usbdev(intf);
wacom->usbdev = dev; wacom->usbdev = dev;
wacom->intf = intf; wacom->intf = intf;
}
mutex_init(&wacom->lock); mutex_init(&wacom->lock);
INIT_DELAYED_WORK(&wacom->init_work, wacom_init_work); INIT_DELAYED_WORK(&wacom->init_work, wacom_init_work);
INIT_WORK(&wacom->wireless_work, wacom_wireless_work); INIT_WORK(&wacom->wireless_work, wacom_wireless_work);

Просмотреть файл

@ -729,7 +729,7 @@ static int corsairpsu_probe(struct hid_device *hdev, const struct hid_device_id
corsairpsu_check_cmd_support(priv); corsairpsu_check_cmd_support(priv);
priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "corsairpsu", priv, priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "corsairpsu", priv,
&corsairpsu_chip_info, 0); &corsairpsu_chip_info, NULL);
if (IS_ERR(priv->hwmon_dev)) { if (IS_ERR(priv->hwmon_dev)) {
ret = PTR_ERR(priv->hwmon_dev); ret = PTR_ERR(priv->hwmon_dev);

Просмотреть файл

@ -627,9 +627,8 @@ static void __init i8k_init_procfs(struct device *dev)
{ {
struct dell_smm_data *data = dev_get_drvdata(dev); struct dell_smm_data *data = dev_get_drvdata(dev);
/* Register the proc entry */ /* Only register exit function if creation was successful */
proc_create_data("i8k", 0, NULL, &i8k_proc_ops, data); if (proc_create_data("i8k", 0, NULL, &i8k_proc_ops, data))
devm_add_action_or_reset(dev, i8k_exit_procfs, NULL); devm_add_action_or_reset(dev, i8k_exit_procfs, NULL);
} }

Просмотреть файл

@ -1527,7 +1527,7 @@ static u16 nct6775_wmi_read_value(struct nct6775_data *data, u16 reg)
nct6775_wmi_set_bank(data, reg); nct6775_wmi_set_bank(data, reg);
err = nct6775_asuswmi_read(data->bank, reg, &tmp); err = nct6775_asuswmi_read(data->bank, reg & 0xff, &tmp);
if (err) if (err)
return 0; return 0;

Просмотреть файл

@ -336,8 +336,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
return ret; return ret;
} }
ctx->pwm_value = MAX_PWM;
pwm_init_state(ctx->pwm, &ctx->pwm_state); pwm_init_state(ctx->pwm, &ctx->pwm_state);
/* /*

Просмотреть файл

@ -23,7 +23,7 @@
/* /*
* I2C command delays (in microseconds) * I2C command delays (in microseconds)
*/ */
#define SHT4X_MEAS_DELAY 1000 #define SHT4X_MEAS_DELAY_HPM 8200 /* see t_MEAS,h in datasheet */
#define SHT4X_DELAY_EXTRA 10000 #define SHT4X_DELAY_EXTRA 10000
/* /*
@ -90,7 +90,7 @@ static int sht4x_read_values(struct sht4x_data *data)
if (ret < 0) if (ret < 0)
goto unlock; goto unlock;
usleep_range(SHT4X_MEAS_DELAY, SHT4X_MEAS_DELAY + SHT4X_DELAY_EXTRA); usleep_range(SHT4X_MEAS_DELAY_HPM, SHT4X_MEAS_DELAY_HPM + SHT4X_DELAY_EXTRA);
ret = i2c_master_recv(client, raw_data, SHT4X_RESPONSE_LENGTH); ret = i2c_master_recv(client, raw_data, SHT4X_RESPONSE_LENGTH);
if (ret != SHT4X_RESPONSE_LENGTH) { if (ret != SHT4X_RESPONSE_LENGTH) {

Просмотреть файл

@ -636,7 +636,7 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
status = readb(i2c->base + MPC_I2C_SR); status = readb(i2c->base + MPC_I2C_SR);
if (status & CSR_MIF) { if (status & CSR_MIF) {
/* Wait up to 100us for transfer to properly complete */ /* Wait up to 100us for transfer to properly complete */
readb_poll_timeout(i2c->base + MPC_I2C_SR, status, !(status & CSR_MCF), 0, 100); readb_poll_timeout_atomic(i2c->base + MPC_I2C_SR, status, status & CSR_MCF, 0, 100);
writeb(0, i2c->base + MPC_I2C_SR); writeb(0, i2c->base + MPC_I2C_SR);
mpc_i2c_do_intr(i2c, status); mpc_i2c_do_intr(i2c, status);
return IRQ_HANDLED; return IRQ_HANDLED;

Просмотреть файл

@ -22,24 +22,24 @@
/** /**
* struct virtio_i2c - virtio I2C data * struct virtio_i2c - virtio I2C data
* @vdev: virtio device for this controller * @vdev: virtio device for this controller
* @completion: completion of virtio I2C message
* @adap: I2C adapter for this controller * @adap: I2C adapter for this controller
* @vq: the virtio virtqueue for communication * @vq: the virtio virtqueue for communication
*/ */
struct virtio_i2c { struct virtio_i2c {
struct virtio_device *vdev; struct virtio_device *vdev;
struct completion completion;
struct i2c_adapter adap; struct i2c_adapter adap;
struct virtqueue *vq; struct virtqueue *vq;
}; };
/** /**
* struct virtio_i2c_req - the virtio I2C request structure * struct virtio_i2c_req - the virtio I2C request structure
* @completion: completion of virtio I2C message
* @out_hdr: the OUT header of the virtio I2C message * @out_hdr: the OUT header of the virtio I2C message
* @buf: the buffer into which data is read, or from which it's written * @buf: the buffer into which data is read, or from which it's written
* @in_hdr: the IN header of the virtio I2C message * @in_hdr: the IN header of the virtio I2C message
*/ */
struct virtio_i2c_req { struct virtio_i2c_req {
struct completion completion;
struct virtio_i2c_out_hdr out_hdr ____cacheline_aligned; struct virtio_i2c_out_hdr out_hdr ____cacheline_aligned;
uint8_t *buf ____cacheline_aligned; uint8_t *buf ____cacheline_aligned;
struct virtio_i2c_in_hdr in_hdr ____cacheline_aligned; struct virtio_i2c_in_hdr in_hdr ____cacheline_aligned;
@ -47,9 +47,11 @@ struct virtio_i2c_req {
static void virtio_i2c_msg_done(struct virtqueue *vq) static void virtio_i2c_msg_done(struct virtqueue *vq)
{ {
struct virtio_i2c *vi = vq->vdev->priv; struct virtio_i2c_req *req;
unsigned int len;
complete(&vi->completion); while ((req = virtqueue_get_buf(vq, &len)))
complete(&req->completion);
} }
static int virtio_i2c_prepare_reqs(struct virtqueue *vq, static int virtio_i2c_prepare_reqs(struct virtqueue *vq,
@ -62,6 +64,8 @@ static int virtio_i2c_prepare_reqs(struct virtqueue *vq,
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
int outcnt = 0, incnt = 0; int outcnt = 0, incnt = 0;
init_completion(&reqs[i].completion);
/* /*
* Only 7-bit mode supported for this moment. For the address * Only 7-bit mode supported for this moment. For the address
* format, Please check the Virtio I2C Specification. * format, Please check the Virtio I2C Specification.
@ -106,21 +110,15 @@ static int virtio_i2c_complete_reqs(struct virtqueue *vq,
struct virtio_i2c_req *reqs, struct virtio_i2c_req *reqs,
struct i2c_msg *msgs, int num) struct i2c_msg *msgs, int num)
{ {
struct virtio_i2c_req *req;
bool failed = false; bool failed = false;
unsigned int len;
int i, j = 0; int i, j = 0;
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
/* Detach the ith request from the vq */ struct virtio_i2c_req *req = &reqs[i];
req = virtqueue_get_buf(vq, &len);
/* wait_for_completion(&req->completion);
* Condition req == &reqs[i] should always meet since we have
* total num requests in the vq. reqs[i] can never be NULL here. if (!failed && req->in_hdr.status != VIRTIO_I2C_MSG_OK)
*/
if (!failed && (WARN_ON(req != &reqs[i]) ||
req->in_hdr.status != VIRTIO_I2C_MSG_OK))
failed = true; failed = true;
i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], !failed); i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], !failed);
@ -156,12 +154,8 @@ static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
* remote here to clear the virtqueue, so we can try another set of * remote here to clear the virtqueue, so we can try another set of
* messages later on. * messages later on.
*/ */
reinit_completion(&vi->completion);
virtqueue_kick(vq); virtqueue_kick(vq);
wait_for_completion(&vi->completion);
count = virtio_i2c_complete_reqs(vq, reqs, msgs, count); count = virtio_i2c_complete_reqs(vq, reqs, msgs, count);
err_free: err_free:
@ -210,8 +204,6 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
vdev->priv = vi; vdev->priv = vi;
vi->vdev = vdev; vi->vdev = vdev;
init_completion(&vi->completion);
ret = virtio_i2c_setup_vqs(vi); ret = virtio_i2c_setup_vqs(vi);
if (ret) if (ret)
return ret; return ret;

Просмотреть файл

@ -1595,7 +1595,6 @@ static int kxcjk1013_probe(struct i2c_client *client,
return 0; return 0;
err_buffer_cleanup: err_buffer_cleanup:
if (data->dready_trig)
iio_triggered_buffer_cleanup(indio_dev); iio_triggered_buffer_cleanup(indio_dev);
err_trigger_unregister: err_trigger_unregister:
if (data->dready_trig) if (data->dready_trig)
@ -1618,8 +1617,8 @@ static int kxcjk1013_remove(struct i2c_client *client)
pm_runtime_disable(&client->dev); pm_runtime_disable(&client->dev);
pm_runtime_set_suspended(&client->dev); pm_runtime_set_suspended(&client->dev);
if (data->dready_trig) {
iio_triggered_buffer_cleanup(indio_dev); iio_triggered_buffer_cleanup(indio_dev);
if (data->dready_trig) {
iio_trigger_unregister(data->dready_trig); iio_trigger_unregister(data->dready_trig);
iio_trigger_unregister(data->motion_trig); iio_trigger_unregister(data->motion_trig);
} }

Просмотреть файл

@ -224,14 +224,14 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)
hw_values.chan, hw_values.chan,
sizeof(hw_values.chan)); sizeof(hw_values.chan));
if (ret) { if (ret) {
dev_err(st->dev, dev_err(st->dev, "error reading data: %d\n", ret);
"error reading data\n"); goto out;
return ret;
} }
iio_push_to_buffers_with_timestamp(indio_dev, iio_push_to_buffers_with_timestamp(indio_dev,
&hw_values, &hw_values,
iio_get_time_ns(indio_dev)); iio_get_time_ns(indio_dev));
out:
iio_trigger_notify_done(indio_dev->trig); iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED; return IRQ_HANDLED;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше