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.181 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl7Ey28ACgkQONu9yGCS aT5HHBAApSN5pEsCeogd9V1h20Gsx9TteDrn1qVqIxa4k7FczL7TuhGZw3SH9JjI oK7xvZK8JknVvr+GSnk+OO7oU64L3qtZ+icfrdqVecBIsxiyu3gopmazjLP+QxEo x+9xqR9clqTjOgQx3S8rH9s09fgsZMNAp1Ga8juyGZWxFkPoLiSyB+SDEIFwL43v IYeC2uJc5lnv8+vNGAcEHAJiphxKeWJLd/etmelIaFrp+kkmO0nIoszR9uLNkr8i yuCqt2tCSd3vVaQqjSOpg/3u1PnQpmMqvKqWXuDKBOkr9nz7cgOf+6uWeuo3Fvro Ji8q0Dtay1xNJLgwCGH3c98OsiRE5OMX0dIpadcDCteFwJOSryu7tkf5ODp7BA+Q EjZx5DIhvNa/7auqarqMJvblconocZnJ+8zcN2aGL8Yn57Q0bsfyiHyB6bMW98+/ J0dMSuXl0c9MPLKa28+31hrmeThs5kG15EpTUzBrkXcTbsLGxPoJVC4IFIACwqlg lyhokwuZ87slEZfnz91R3V2Ehdyl5d8ci2/DBzzZiPjgGsUoxWH1pwmb5WO2agNf K9l9VVsGCAl+gqY41kI9UCf3BNzv/sc2uScjlnOIjpGrNI4IVc/bGq1y1ktIY4UC WV3Qux5GvwHbS/Dbrapv7B5Tt9EtbLmAPbnCCJ93e1mXXEkUw3o= =6R5g -----END PGP SIGNATURE----- Merge 4.14.181 into android-4.14-stable Changes in 4.14.181 USB: serial: qcserial: Add DW5816e support dp83640: reverse arguments to list_add_tail fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks net: macsec: preserve ingress frame ordering net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc() net: usb: qmi_wwan: add support for DW5816e sch_choke: avoid potential panic in choke_reset() sch_sfq: validate silly quantum values bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features(). net/mlx5: Fix forced completion access non initialized command entry net/mlx5: Fix command entry leak in Internal Error State bnxt_en: Improve AER slot reset. bnxt_en: Fix VF anti-spoof filter setup. net: stricter validation of untrusted gso packets ipv6: fix cleanup ordering for ip6_mr failure HID: wacom: Read HID_DG_CONTACTMAX directly for non-generic devices geneve: only configure or fill UDP_ZERO_CSUM6_RX/TX info when CONFIG_IPV6 HID: usbhid: Fix race between usbhid_close() and usbhid_stop() USB: uas: add quirk for LaCie 2Big Quadra USB: serial: garmin_gps: add sanity checking for data length tracing: Add a vmalloc_sync_mappings() for safe measure KVM: arm: vgic: Fix limit condition when writing to GICD_I[CS]ACTIVER mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous() coredump: fix crash when umh is disabled batman-adv: fix batadv_nc_random_weight_tq batman-adv: Fix refcnt leak in batadv_show_throughput_override batman-adv: Fix refcnt leak in batadv_store_throughput_override batman-adv: Fix refcnt leak in batadv_v_ogm_process x86/entry/64: Fix unwind hints in kernel exit path x86/entry/64: Fix unwind hints in rewind_stack_do_exit() x86/unwind/orc: Don't skip the first frame for inactive tasks x86/unwind/orc: Prevent unwinding before ORC initialization x86/unwind/orc: Fix error path for bad ORC entry type netfilter: nat: never update the UDP checksum when it's 0 objtool: Fix stack offset tracking for indirect CFAs scripts/decodecode: fix trapping instruction formatting net: ipv6: add net argument to ip6_dst_lookup_flow net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup blktrace: fix unlocked access to init/start-stop/teardown blktrace: fix trace mutex deadlock blktrace: Protect q->blk_trace with RCU blktrace: fix dereference after null check f2fs: introduce read_inline_xattr f2fs: introduce read_xattr_block f2fs: sanity check of xattr entry size f2fs: fix to avoid accessing xattr across the boundary f2fs: fix to avoid memory leakage in f2fs_listxattr net: stmmac: Use mutex instead of spinlock shmem: fix possible deadlocks on shmlock_user_lock net/sonic: Fix a resource leak in an error handling path in 'jazz_sonic_probe()' net: moxa: Fix a potential double 'free_irq()' drop_monitor: work around gcc-10 stringop-overflow warning virtio-blk: handle block_device_operations callbacks after hot unplug scsi: sg: add sg_remove_request in sg_write dmaengine: pch_dma.c: Avoid data race between probe and irq handler dmaengine: mmp_tdma: Reset channel error on release cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once ALSA: hda/hdmi: fix race in monitor detection during probe drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper() ipc/util.c: sysvipc_find_ipc() incorrectly updates position index ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse x86/entry/64: Fix unwind hints in register clearing code ipmi: Fix NULL pointer dereference in ssif_probe pinctrl: baytrail: Enable pin configuration setting for GPIO chip pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler i40iw: Fix error handling in i40iw_manage_arp_cache() netfilter: conntrack: avoid gcc-10 zero-length-bounds warning IB/mlx4: Test return value of calls to ib_get_cached_pkey hwmon: (da9052) Synchronize access with mfd pnp: Use list_for_each_entry() instead of open coding gcc-10 warnings: fix low-hanging fruit kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig Stop the ad-hoc games with -Wno-maybe-initialized gcc-10: disable 'zero-length-bounds' warning for now gcc-10: disable 'array-bounds' warning for now gcc-10: disable 'stringop-overflow' warning for now gcc-10: disable 'restrict' warning for now gcc-10: avoid shadowing standard library 'free()' in crypto x86/asm: Add instruction suffixes to bitops net: phy: micrel: Use strlcpy() for ethtool::get_strings net: fix a potential recursive NETDEV_FEAT_CHANGE netlabel: cope with NULL catmap net: phy: fix aneg restart in phy_ethtool_set_eee Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu" hinic: fix a bug of ndo_stop net: dsa: loop: Add module soft dependency net: ipv4: really enforce backoff for redirects netprio_cgroup: Fix unlimited memory leak of v2 cgroups net: tcp: fix rx timestamp behavior for tcp_recvmsg ALSA: hda/realtek - Limit int mic boost for Thinkpad T530 ALSA: rawmidi: Initialize allocated buffers ALSA: rawmidi: Fix racy buffer resize under concurrent accesses ARM: dts: dra7: Fix bus_dma_limit for PCIe ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries x86: Fix early boot crash on gcc-10, third try ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset usb: core: hub: limit HUB_QUIRK_DISABLE_AUTOSUSPEND to USB5534B usb: host: xhci-plat: keep runtime active when removing host USB: gadget: fix illegal array access in binding with UDC usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list x86/unwind/orc: Fix error handling in __unwind_start() exec: Move would_dump into flush_old_exec clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()' usb: gadget: audio: Fix a missing error return value in audio_bind() usb: gadget: legacy: fix error return code in gncm_bind() usb: gadget: legacy: fix error return code in cdc_bind() Revert "ALSA: hda/realtek: Fix pop noise on ALC225" arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic" on rk3328 boards arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy ARM: dts: r8a73a4: Add missing CMT1 interrupts ARM: dts: r8a7740: Add missing extal2 to CPG node KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce Makefile: disallow data races on gcc-10 as well Linux 4.14.181 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ie1fb614d727dc6aad472bea0234073076eae8c8b
This commit is contained in:
commit
4f02b6c9ac
23
Makefile
23
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 180
|
||||
SUBLEVEL = 181
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
@ -684,20 +684,14 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
|
||||
|
||||
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
|
||||
KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
|
||||
else
|
||||
ifdef CONFIG_PROFILE_ALL_BRANCHES
|
||||
KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
|
||||
KBUILD_CFLAGS += -Os
|
||||
else
|
||||
KBUILD_CFLAGS += -O2
|
||||
endif
|
||||
endif
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
|
||||
$(call cc-disable-warning,maybe-uninitialized,))
|
||||
|
||||
# Tell gcc to never replace conditional load with a non-conditional one
|
||||
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
|
||||
|
||||
# check for 'asm goto'
|
||||
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
|
||||
@ -912,6 +906,17 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
|
||||
# disable stringop warnings in gcc 8+
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
|
||||
|
||||
# We'll want to enable this eventually, but it's not going away for 5.7 at least
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
|
||||
|
||||
# Another good warning that we'll want to enable eventually
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
|
||||
|
||||
# Enabled with W=2, disabled by default as noisy
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
|
||||
|
||||
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
|
||||
|
||||
|
@ -289,6 +289,7 @@
|
||||
#address-cells = <1>;
|
||||
ranges = <0x51000000 0x51000000 0x3000
|
||||
0x0 0x20000000 0x10000000>;
|
||||
dma-ranges;
|
||||
/**
|
||||
* To enable PCI endpoint mode, disable the pcie1_rc
|
||||
* node and enable pcie1_ep mode.
|
||||
@ -303,7 +304,6 @@
|
||||
device_type = "pci";
|
||||
ranges = <0x81000000 0 0 0x03000 0 0x00010000
|
||||
0x82000000 0 0x20013000 0x13000 0 0xffed000>;
|
||||
dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
|
||||
bus-range = <0x00 0xff>;
|
||||
#interrupt-cells = <1>;
|
||||
num-lanes = <1>;
|
||||
@ -347,6 +347,7 @@
|
||||
#address-cells = <1>;
|
||||
ranges = <0x51800000 0x51800000 0x3000
|
||||
0x0 0x30000000 0x10000000>;
|
||||
dma-ranges;
|
||||
status = "disabled";
|
||||
pcie@51800000 {
|
||||
compatible = "ti,dra7-pcie";
|
||||
@ -358,7 +359,6 @@
|
||||
device_type = "pci";
|
||||
ranges = <0x81000000 0 0 0x03000 0 0x00010000
|
||||
0x82000000 0 0x30013000 0x13000 0 0xffed000>;
|
||||
dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
|
||||
bus-range = <0x00 0xff>;
|
||||
#interrupt-cells = <1>;
|
||||
num-lanes = <1>;
|
||||
|
@ -81,8 +81,8 @@
|
||||
imx27-phycard-s-rdk {
|
||||
pinctrl_i2c1: i2c1grp {
|
||||
fsl,pins = <
|
||||
MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
|
||||
MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
|
||||
MX27_PAD_I2C_DATA__I2C_DATA 0x0
|
||||
MX27_PAD_I2C_CLK__I2C_CLK 0x0
|
||||
>;
|
||||
};
|
||||
|
||||
|
@ -133,7 +133,14 @@
|
||||
cmt1: timer@e6130000 {
|
||||
compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2";
|
||||
reg = <0 0xe6130000 0 0x1004>;
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&mstp3_clks R8A73A4_CLK_CMT1>;
|
||||
clock-names = "fck";
|
||||
power-domains = <&pd_c5>;
|
||||
|
@ -467,7 +467,7 @@
|
||||
cpg_clocks: cpg_clocks@e6150000 {
|
||||
compatible = "renesas,r8a7740-cpg-clocks";
|
||||
reg = <0xe6150000 0x10000>;
|
||||
clocks = <&extal1_clk>, <&extalr_clk>;
|
||||
clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>;
|
||||
#clock-cells = <1>;
|
||||
clock-output-names = "system", "pllc0", "pllc1",
|
||||
"pllc2", "r",
|
||||
|
@ -91,7 +91,7 @@
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
|
||||
rk805: rk805@18 {
|
||||
rk805: pmic@18 {
|
||||
compatible = "rockchip,rk805";
|
||||
reg = <0x18>;
|
||||
interrupt-parent = <&gpio2>;
|
||||
|
@ -149,7 +149,7 @@
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
|
||||
rk805: rk805@18 {
|
||||
rk805: pmic@18 {
|
||||
compatible = "rockchip,rk805";
|
||||
reg = <0x18>;
|
||||
interrupt-parent = <&gpio2>;
|
||||
|
@ -402,7 +402,7 @@
|
||||
"bus_clk", "grf_clk";
|
||||
status = "disabled";
|
||||
|
||||
usbdrd_dwc3_0: dwc3 {
|
||||
usbdrd_dwc3_0: usb@fe800000 {
|
||||
compatible = "snps,dwc3";
|
||||
reg = <0x0 0xfe800000 0x0 0x100000>;
|
||||
interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
@ -430,7 +430,7 @@
|
||||
"bus_clk", "grf_clk";
|
||||
status = "disabled";
|
||||
|
||||
usbdrd_dwc3_1: dwc3 {
|
||||
usbdrd_dwc3_1: usb@fe900000 {
|
||||
compatible = "snps,dwc3";
|
||||
reg = <0x0 0xfe900000 0x0 0x100000>;
|
||||
interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
|
@ -98,13 +98,6 @@ For 32-bit we have the following conventions - kernel is built with
|
||||
#define SIZEOF_PTREGS 21*8
|
||||
|
||||
.macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0
|
||||
/*
|
||||
* Push registers and sanitize registers of values that a
|
||||
* speculation attack might otherwise want to exploit. The
|
||||
* lower registers are likely clobbered well before they
|
||||
* could be put to use in a speculative execution gadget.
|
||||
* Interleave XOR with PUSH for better uop scheduling:
|
||||
*/
|
||||
.if \save_ret
|
||||
pushq %rsi /* pt_regs->si */
|
||||
movq 8(%rsp), %rsi /* temporarily store the return address in %rsi */
|
||||
@ -117,29 +110,40 @@ For 32-bit we have the following conventions - kernel is built with
|
||||
pushq %rcx /* pt_regs->cx */
|
||||
pushq \rax /* pt_regs->ax */
|
||||
pushq %r8 /* pt_regs->r8 */
|
||||
xorl %r8d, %r8d /* nospec r8 */
|
||||
pushq %r9 /* pt_regs->r9 */
|
||||
xorl %r9d, %r9d /* nospec r9 */
|
||||
pushq %r10 /* pt_regs->r10 */
|
||||
xorl %r10d, %r10d /* nospec r10 */
|
||||
pushq %r11 /* pt_regs->r11 */
|
||||
xorl %r11d, %r11d /* nospec r11*/
|
||||
pushq %rbx /* pt_regs->rbx */
|
||||
xorl %ebx, %ebx /* nospec rbx*/
|
||||
pushq %rbp /* pt_regs->rbp */
|
||||
xorl %ebp, %ebp /* nospec rbp*/
|
||||
pushq %r12 /* pt_regs->r12 */
|
||||
xorl %r12d, %r12d /* nospec r12*/
|
||||
pushq %r13 /* pt_regs->r13 */
|
||||
xorl %r13d, %r13d /* nospec r13*/
|
||||
pushq %r14 /* pt_regs->r14 */
|
||||
xorl %r14d, %r14d /* nospec r14*/
|
||||
pushq %r15 /* pt_regs->r15 */
|
||||
xorl %r15d, %r15d /* nospec r15*/
|
||||
UNWIND_HINT_REGS
|
||||
|
||||
.if \save_ret
|
||||
pushq %rsi /* return address on top of stack */
|
||||
.endif
|
||||
|
||||
/*
|
||||
* Sanitize registers of values that a speculation attack might
|
||||
* otherwise want to exploit. The lower registers are likely clobbered
|
||||
* well before they could be put to use in a speculative execution
|
||||
* gadget.
|
||||
*/
|
||||
xorl %edx, %edx /* nospec dx */
|
||||
xorl %ecx, %ecx /* nospec cx */
|
||||
xorl %r8d, %r8d /* nospec r8 */
|
||||
xorl %r9d, %r9d /* nospec r9 */
|
||||
xorl %r10d, %r10d /* nospec r10 */
|
||||
xorl %r11d, %r11d /* nospec r11 */
|
||||
xorl %ebx, %ebx /* nospec rbx */
|
||||
xorl %ebp, %ebp /* nospec rbp */
|
||||
xorl %r12d, %r12d /* nospec r12 */
|
||||
xorl %r13d, %r13d /* nospec r13 */
|
||||
xorl %r14d, %r14d /* nospec r14 */
|
||||
xorl %r15d, %r15d /* nospec r15 */
|
||||
|
||||
.endm
|
||||
|
||||
.macro POP_REGS pop_rdi=1 skip_r11rcx=0
|
||||
|
@ -302,7 +302,6 @@ GLOBAL(entry_SYSCALL_64_after_hwframe)
|
||||
*/
|
||||
syscall_return_via_sysret:
|
||||
/* rcx and r11 are already restored (see code above) */
|
||||
UNWIND_HINT_EMPTY
|
||||
POP_REGS pop_rdi=0 skip_r11rcx=1
|
||||
|
||||
/*
|
||||
@ -311,6 +310,7 @@ syscall_return_via_sysret:
|
||||
*/
|
||||
movq %rsp, %rdi
|
||||
movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp
|
||||
UNWIND_HINT_EMPTY
|
||||
|
||||
pushq RSP-RDI(%rdi) /* RSP */
|
||||
pushq (%rdi) /* RDI */
|
||||
@ -606,6 +606,7 @@ GLOBAL(swapgs_restore_regs_and_return_to_usermode)
|
||||
*/
|
||||
movq %rsp, %rdi
|
||||
movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp
|
||||
UNWIND_HINT_EMPTY
|
||||
|
||||
/* Copy the IRET frame to the trampoline stack. */
|
||||
pushq 6*8(%rdi) /* SS */
|
||||
@ -1648,7 +1649,7 @@ ENTRY(rewind_stack_do_exit)
|
||||
|
||||
movq PER_CPU_VAR(cpu_current_top_of_stack), %rax
|
||||
leaq -PTREGS_SIZE(%rax), %rsp
|
||||
UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE
|
||||
UNWIND_HINT_REGS
|
||||
|
||||
call do_exit
|
||||
END(rewind_stack_do_exit)
|
||||
|
@ -78,7 +78,7 @@ set_bit(long nr, volatile unsigned long *addr)
|
||||
: "iq" ((u8)CONST_MASK(nr))
|
||||
: "memory");
|
||||
} else {
|
||||
asm volatile(LOCK_PREFIX "bts %1,%0"
|
||||
asm volatile(LOCK_PREFIX __ASM_SIZE(bts) " %1,%0"
|
||||
: BITOP_ADDR(addr) : "Ir" (nr) : "memory");
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ set_bit(long nr, volatile unsigned long *addr)
|
||||
*/
|
||||
static __always_inline void __set_bit(long nr, volatile unsigned long *addr)
|
||||
{
|
||||
asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory");
|
||||
asm volatile(__ASM_SIZE(bts) " %1,%0" : ADDR : "Ir" (nr) : "memory");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -115,7 +115,7 @@ clear_bit(long nr, volatile unsigned long *addr)
|
||||
: CONST_MASK_ADDR(nr, addr)
|
||||
: "iq" ((u8)~CONST_MASK(nr)));
|
||||
} else {
|
||||
asm volatile(LOCK_PREFIX "btr %1,%0"
|
||||
asm volatile(LOCK_PREFIX __ASM_SIZE(btr) " %1,%0"
|
||||
: BITOP_ADDR(addr)
|
||||
: "Ir" (nr));
|
||||
}
|
||||
@ -137,7 +137,7 @@ static __always_inline void clear_bit_unlock(long nr, volatile unsigned long *ad
|
||||
|
||||
static __always_inline void __clear_bit(long nr, volatile unsigned long *addr)
|
||||
{
|
||||
asm volatile("btr %1,%0" : ADDR : "Ir" (nr));
|
||||
asm volatile(__ASM_SIZE(btr) " %1,%0" : ADDR : "Ir" (nr));
|
||||
}
|
||||
|
||||
static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)
|
||||
@ -182,7 +182,7 @@ static __always_inline void __clear_bit_unlock(long nr, volatile unsigned long *
|
||||
*/
|
||||
static __always_inline void __change_bit(long nr, volatile unsigned long *addr)
|
||||
{
|
||||
asm volatile("btc %1,%0" : ADDR : "Ir" (nr));
|
||||
asm volatile(__ASM_SIZE(btc) " %1,%0" : ADDR : "Ir" (nr));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -201,7 +201,7 @@ static __always_inline void change_bit(long nr, volatile unsigned long *addr)
|
||||
: CONST_MASK_ADDR(nr, addr)
|
||||
: "iq" ((u8)CONST_MASK(nr)));
|
||||
} else {
|
||||
asm volatile(LOCK_PREFIX "btc %1,%0"
|
||||
asm volatile(LOCK_PREFIX __ASM_SIZE(btc) " %1,%0"
|
||||
: BITOP_ADDR(addr)
|
||||
: "Ir" (nr));
|
||||
}
|
||||
@ -217,7 +217,8 @@ static __always_inline void change_bit(long nr, volatile unsigned long *addr)
|
||||
*/
|
||||
static __always_inline bool test_and_set_bit(long nr, volatile unsigned long *addr)
|
||||
{
|
||||
GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", c);
|
||||
GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(bts),
|
||||
*addr, "Ir", nr, "%0", c);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -246,7 +247,7 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long *
|
||||
{
|
||||
bool oldbit;
|
||||
|
||||
asm("bts %2,%1"
|
||||
asm(__ASM_SIZE(bts) " %2,%1"
|
||||
CC_SET(c)
|
||||
: CC_OUT(c) (oldbit), ADDR
|
||||
: "Ir" (nr));
|
||||
@ -263,7 +264,8 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long *
|
||||
*/
|
||||
static __always_inline bool test_and_clear_bit(long nr, volatile unsigned long *addr)
|
||||
{
|
||||
GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", c);
|
||||
GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btr),
|
||||
*addr, "Ir", nr, "%0", c);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -286,7 +288,7 @@ static __always_inline bool __test_and_clear_bit(long nr, volatile unsigned long
|
||||
{
|
||||
bool oldbit;
|
||||
|
||||
asm volatile("btr %2,%1"
|
||||
asm volatile(__ASM_SIZE(btr) " %2,%1"
|
||||
CC_SET(c)
|
||||
: CC_OUT(c) (oldbit), ADDR
|
||||
: "Ir" (nr));
|
||||
@ -298,7 +300,7 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon
|
||||
{
|
||||
bool oldbit;
|
||||
|
||||
asm volatile("btc %2,%1"
|
||||
asm volatile(__ASM_SIZE(btc) " %2,%1"
|
||||
CC_SET(c)
|
||||
: CC_OUT(c) (oldbit), ADDR
|
||||
: "Ir" (nr) : "memory");
|
||||
@ -316,7 +318,8 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon
|
||||
*/
|
||||
static __always_inline bool test_and_change_bit(long nr, volatile unsigned long *addr)
|
||||
{
|
||||
GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", c);
|
||||
GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btc),
|
||||
*addr, "Ir", nr, "%0", c);
|
||||
}
|
||||
|
||||
static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr)
|
||||
@ -329,7 +332,7 @@ static __always_inline bool variable_test_bit(long nr, volatile const unsigned l
|
||||
{
|
||||
bool oldbit;
|
||||
|
||||
asm volatile("bt %2,%1"
|
||||
asm volatile(__ASM_SIZE(bt) " %2,%1"
|
||||
CC_SET(c)
|
||||
: CC_OUT(c) (oldbit)
|
||||
: "m" (*(unsigned long *)addr), "Ir" (nr));
|
||||
|
@ -526,7 +526,7 @@ static inline bool x86_this_cpu_variable_test_bit(int nr,
|
||||
{
|
||||
bool oldbit;
|
||||
|
||||
asm volatile("bt "__percpu_arg(2)",%1"
|
||||
asm volatile("btl "__percpu_arg(2)",%1"
|
||||
CC_SET(c)
|
||||
: CC_OUT(c) (oldbit)
|
||||
: "m" (*(unsigned long __percpu *)addr), "Ir" (nr));
|
||||
|
@ -55,8 +55,13 @@
|
||||
/*
|
||||
* Initialize the stackprotector canary value.
|
||||
*
|
||||
* NOTE: this must only be called from functions that never return,
|
||||
* NOTE: this must only be called from functions that never return
|
||||
* and it must always be inlined.
|
||||
*
|
||||
* In addition, it should be called from a compilation unit for which
|
||||
* stack protector is disabled. Alternatively, the caller should not end
|
||||
* with a function call which gets tail-call optimized as that would
|
||||
* lead to checking a modified canary value.
|
||||
*/
|
||||
static __always_inline void boot_init_stack_canary(void)
|
||||
{
|
||||
|
@ -270,6 +270,14 @@ static void notrace start_secondary(void *unused)
|
||||
|
||||
wmb();
|
||||
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
|
||||
|
||||
/*
|
||||
* Prevent tail call to cpu_startup_entry() because the stack protector
|
||||
* guard has been changed a couple of function calls up, in
|
||||
* boot_init_stack_canary() and must not be checked before tail calling
|
||||
* another function.
|
||||
*/
|
||||
prevent_tail_call_optimization();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,9 +90,6 @@ static struct orc_entry null_orc_entry = {
|
||||
|
||||
static struct orc_entry *orc_find(unsigned long ip)
|
||||
{
|
||||
if (!orc_init)
|
||||
return NULL;
|
||||
|
||||
if (ip == 0)
|
||||
return &null_orc_entry;
|
||||
|
||||
@ -460,7 +457,7 @@ bool unwind_next_frame(struct unwind_state *state)
|
||||
default:
|
||||
orc_warn("unknown .orc_unwind entry type %d for ip %pB\n",
|
||||
orc->type, (void *)orig_ip);
|
||||
break;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Find BP: */
|
||||
@ -511,17 +508,20 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
|
||||
memset(state, 0, sizeof(*state));
|
||||
state->task = task;
|
||||
|
||||
if (!orc_init)
|
||||
goto err;
|
||||
|
||||
/*
|
||||
* Refuse to unwind the stack of a task while it's executing on another
|
||||
* CPU. This check is racy, but that's ok: the unwinder has other
|
||||
* checks to prevent it from going off the rails.
|
||||
*/
|
||||
if (task_on_another_cpu(task))
|
||||
goto done;
|
||||
goto err;
|
||||
|
||||
if (regs) {
|
||||
if (user_mode(regs))
|
||||
goto done;
|
||||
goto the_end;
|
||||
|
||||
state->ip = regs->ip;
|
||||
state->sp = kernel_stack_pointer(regs);
|
||||
@ -554,6 +554,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
|
||||
* generate some kind of backtrace if this happens.
|
||||
*/
|
||||
void *next_page = (void *)PAGE_ALIGN((unsigned long)state->sp);
|
||||
state->error = true;
|
||||
if (get_stack_info(next_page, state->task, &state->stack_info,
|
||||
&state->stack_mask))
|
||||
return;
|
||||
@ -574,13 +575,14 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
|
||||
/* Otherwise, skip ahead to the user-specified starting frame: */
|
||||
while (!unwind_done(state) &&
|
||||
(!on_stack(&state->stack_info, first_frame, sizeof(long)) ||
|
||||
state->sp <= (unsigned long)first_frame))
|
||||
state->sp < (unsigned long)first_frame))
|
||||
unwind_next_frame(state);
|
||||
|
||||
return;
|
||||
|
||||
done:
|
||||
err:
|
||||
state->error = true;
|
||||
the_end:
|
||||
state->stack_info.type = STACK_TYPE_UNKNOWN;
|
||||
return;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__unwind_start);
|
||||
|
@ -3214,7 +3214,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
|
||||
unsigned bank_num = mcg_cap & 0xff, bank;
|
||||
|
||||
r = -EINVAL;
|
||||
if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
|
||||
if (!bank_num || bank_num > KVM_MAX_MCE_BANKS)
|
||||
goto out;
|
||||
if (mcg_cap & ~(kvm_mce_cap_supported | 0xff | 0xff0000))
|
||||
goto out;
|
||||
|
@ -89,6 +89,7 @@ asmlinkage __visible void cpu_bringup_and_idle(void)
|
||||
{
|
||||
cpu_bringup();
|
||||
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
|
||||
prevent_tail_call_optimization();
|
||||
}
|
||||
|
||||
void xen_smp_intr_free_pv(unsigned int cpu)
|
||||
|
@ -531,7 +531,7 @@ static void exit_tfm(struct crypto_skcipher *tfm)
|
||||
crypto_free_skcipher(ctx->child);
|
||||
}
|
||||
|
||||
static void free(struct skcipher_instance *inst)
|
||||
static void free_inst(struct skcipher_instance *inst)
|
||||
{
|
||||
crypto_drop_skcipher(skcipher_instance_ctx(inst));
|
||||
kfree(inst);
|
||||
@ -642,7 +642,7 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb)
|
||||
inst->alg.encrypt = encrypt;
|
||||
inst->alg.decrypt = decrypt;
|
||||
|
||||
inst->free = free;
|
||||
inst->free = free_inst;
|
||||
|
||||
err = skcipher_register_instance(tmpl, inst);
|
||||
if (err)
|
||||
|
@ -469,7 +469,7 @@ static void exit_tfm(struct crypto_skcipher *tfm)
|
||||
crypto_free_cipher(ctx->tweak);
|
||||
}
|
||||
|
||||
static void free(struct skcipher_instance *inst)
|
||||
static void free_inst(struct skcipher_instance *inst)
|
||||
{
|
||||
crypto_drop_skcipher(skcipher_instance_ctx(inst));
|
||||
kfree(inst);
|
||||
@ -580,7 +580,7 @@ static int create(struct crypto_template *tmpl, struct rtattr **tb)
|
||||
inst->alg.encrypt = encrypt;
|
||||
inst->alg.decrypt = decrypt;
|
||||
|
||||
inst->free = free;
|
||||
inst->free = free_inst;
|
||||
|
||||
err = skcipher_register_instance(tmpl, inst);
|
||||
if (err)
|
||||
|
@ -31,6 +31,15 @@ struct virtio_blk_vq {
|
||||
} ____cacheline_aligned_in_smp;
|
||||
|
||||
struct virtio_blk {
|
||||
/*
|
||||
* This mutex must be held by anything that may run after
|
||||
* virtblk_remove() sets vblk->vdev to NULL.
|
||||
*
|
||||
* blk-mq, virtqueue processing, and sysfs attribute code paths are
|
||||
* shut down before vblk->vdev is set to NULL and therefore do not need
|
||||
* to hold this mutex.
|
||||
*/
|
||||
struct mutex vdev_mutex;
|
||||
struct virtio_device *vdev;
|
||||
|
||||
/* The disk structure for the kernel. */
|
||||
@ -42,6 +51,13 @@ struct virtio_blk {
|
||||
/* Process context for config space updates */
|
||||
struct work_struct config_work;
|
||||
|
||||
/*
|
||||
* Tracks references from block_device_operations open/release and
|
||||
* virtio_driver probe/remove so this object can be freed once no
|
||||
* longer in use.
|
||||
*/
|
||||
refcount_t refs;
|
||||
|
||||
/* What host tells us, plus 2 for header & tailer. */
|
||||
unsigned int sg_elems;
|
||||
|
||||
@ -315,10 +331,55 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void virtblk_get(struct virtio_blk *vblk)
|
||||
{
|
||||
refcount_inc(&vblk->refs);
|
||||
}
|
||||
|
||||
static void virtblk_put(struct virtio_blk *vblk)
|
||||
{
|
||||
if (refcount_dec_and_test(&vblk->refs)) {
|
||||
ida_simple_remove(&vd_index_ida, vblk->index);
|
||||
mutex_destroy(&vblk->vdev_mutex);
|
||||
kfree(vblk);
|
||||
}
|
||||
}
|
||||
|
||||
static int virtblk_open(struct block_device *bd, fmode_t mode)
|
||||
{
|
||||
struct virtio_blk *vblk = bd->bd_disk->private_data;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&vblk->vdev_mutex);
|
||||
|
||||
if (vblk->vdev)
|
||||
virtblk_get(vblk);
|
||||
else
|
||||
ret = -ENXIO;
|
||||
|
||||
mutex_unlock(&vblk->vdev_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void virtblk_release(struct gendisk *disk, fmode_t mode)
|
||||
{
|
||||
struct virtio_blk *vblk = disk->private_data;
|
||||
|
||||
virtblk_put(vblk);
|
||||
}
|
||||
|
||||
/* We provide getgeo only to please some old bootloader/partitioning tools */
|
||||
static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
|
||||
{
|
||||
struct virtio_blk *vblk = bd->bd_disk->private_data;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&vblk->vdev_mutex);
|
||||
|
||||
if (!vblk->vdev) {
|
||||
ret = -ENXIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* see if the host passed in geometry config */
|
||||
if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) {
|
||||
@ -334,12 +395,16 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
|
||||
geo->sectors = 1 << 5;
|
||||
geo->cylinders = get_capacity(bd->bd_disk) >> 11;
|
||||
}
|
||||
return 0;
|
||||
out:
|
||||
mutex_unlock(&vblk->vdev_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct block_device_operations virtblk_fops = {
|
||||
.ioctl = virtblk_ioctl,
|
||||
.owner = THIS_MODULE,
|
||||
.open = virtblk_open,
|
||||
.release = virtblk_release,
|
||||
.getgeo = virtblk_getgeo,
|
||||
};
|
||||
|
||||
@ -659,6 +724,10 @@ static int virtblk_probe(struct virtio_device *vdev)
|
||||
goto out_free_index;
|
||||
}
|
||||
|
||||
/* This reference is dropped in virtblk_remove(). */
|
||||
refcount_set(&vblk->refs, 1);
|
||||
mutex_init(&vblk->vdev_mutex);
|
||||
|
||||
vblk->vdev = vdev;
|
||||
vblk->sg_elems = sg_elems;
|
||||
|
||||
@ -821,8 +890,6 @@ out:
|
||||
static void virtblk_remove(struct virtio_device *vdev)
|
||||
{
|
||||
struct virtio_blk *vblk = vdev->priv;
|
||||
int index = vblk->index;
|
||||
int refc;
|
||||
|
||||
/* Make sure no work handler is accessing the device. */
|
||||
flush_work(&vblk->config_work);
|
||||
@ -832,18 +899,21 @@ static void virtblk_remove(struct virtio_device *vdev)
|
||||
|
||||
blk_mq_free_tag_set(&vblk->tag_set);
|
||||
|
||||
mutex_lock(&vblk->vdev_mutex);
|
||||
|
||||
/* Stop all the virtqueues. */
|
||||
vdev->config->reset(vdev);
|
||||
|
||||
refc = kref_read(&disk_to_dev(vblk->disk)->kobj.kref);
|
||||
/* Virtqueues are stopped, nothing can use vblk->vdev anymore. */
|
||||
vblk->vdev = NULL;
|
||||
|
||||
put_disk(vblk->disk);
|
||||
vdev->config->del_vqs(vdev);
|
||||
kfree(vblk->vqs);
|
||||
kfree(vblk);
|
||||
|
||||
/* Only free device id if we don't have any users */
|
||||
if (refc == 1)
|
||||
ida_simple_remove(&vd_index_ida, index);
|
||||
mutex_unlock(&vblk->vdev_mutex);
|
||||
|
||||
virtblk_put(vblk);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -1731,7 +1731,9 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
|
||||
out:
|
||||
if (rv) {
|
||||
addr_info->client = NULL;
|
||||
if (addr_info)
|
||||
addr_info->client = NULL;
|
||||
|
||||
dev_err(&client->dev, "Unable to start IPMI SSIF: %d\n", rv);
|
||||
kfree(ssif_info);
|
||||
}
|
||||
|
@ -163,8 +163,6 @@ PNAME(mux_i2s_out_p) = { "i2s1_pre", "xin12m" };
|
||||
PNAME(mux_i2s2_p) = { "i2s2_src", "i2s2_frac", "xin12m" };
|
||||
PNAME(mux_sclk_spdif_p) = { "sclk_spdif_src", "spdif_frac", "xin12m" };
|
||||
|
||||
PNAME(mux_aclk_gpu_pre_p) = { "cpll_gpu", "gpll_gpu", "hdmiphy_gpu", "usb480m_gpu" };
|
||||
|
||||
PNAME(mux_uart0_p) = { "uart0_src", "uart0_frac", "xin24m" };
|
||||
PNAME(mux_uart1_p) = { "uart1_src", "uart1_frac", "xin24m" };
|
||||
PNAME(mux_uart2_p) = { "uart2_src", "uart2_frac", "xin24m" };
|
||||
@ -475,16 +473,9 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
|
||||
RK2928_CLKSEL_CON(24), 6, 10, DFLAGS,
|
||||
RK2928_CLKGATE_CON(2), 8, GFLAGS),
|
||||
|
||||
GATE(0, "cpll_gpu", "cpll", 0,
|
||||
COMPOSITE(0, "aclk_gpu_pre", mux_pll_src_4plls_p, 0,
|
||||
RK2928_CLKSEL_CON(34), 5, 2, MFLAGS, 0, 5, DFLAGS,
|
||||
RK2928_CLKGATE_CON(3), 13, GFLAGS),
|
||||
GATE(0, "gpll_gpu", "gpll", 0,
|
||||
RK2928_CLKGATE_CON(3), 13, GFLAGS),
|
||||
GATE(0, "hdmiphy_gpu", "hdmiphy", 0,
|
||||
RK2928_CLKGATE_CON(3), 13, GFLAGS),
|
||||
GATE(0, "usb480m_gpu", "usb480m", 0,
|
||||
RK2928_CLKGATE_CON(3), 13, GFLAGS),
|
||||
COMPOSITE_NOGATE(0, "aclk_gpu_pre", mux_aclk_gpu_pre_p, 0,
|
||||
RK2928_CLKSEL_CON(34), 5, 2, MFLAGS, 0, 5, DFLAGS),
|
||||
|
||||
COMPOSITE(SCLK_SPI0, "sclk_spi0", mux_pll_src_2plls_p, 0,
|
||||
RK2928_CLKSEL_CON(25), 8, 1, MFLAGS, 0, 7, DFLAGS,
|
||||
@ -589,8 +580,8 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
|
||||
GATE(0, "pclk_peri_noc", "pclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(12), 2, GFLAGS),
|
||||
|
||||
/* PD_GPU */
|
||||
GATE(ACLK_GPU, "aclk_gpu", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(13), 14, GFLAGS),
|
||||
GATE(0, "aclk_gpu_noc", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(13), 15, GFLAGS),
|
||||
GATE(ACLK_GPU, "aclk_gpu", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(7), 14, GFLAGS),
|
||||
GATE(0, "aclk_gpu_noc", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(7), 15, GFLAGS),
|
||||
|
||||
/* PD_BUS */
|
||||
GATE(0, "sclk_initmem_mbist", "aclk_cpu", 0, RK2928_CLKGATE_CON(8), 1, GFLAGS),
|
||||
|
@ -935,7 +935,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b,
|
||||
|
||||
update_turbo_state();
|
||||
if (global.turbo_disabled) {
|
||||
pr_warn("Turbo disabled by BIOS or unavailable on processor\n");
|
||||
pr_notice_once("Turbo disabled by BIOS or unavailable on processor\n");
|
||||
mutex_unlock(&intel_pstate_limits_lock);
|
||||
mutex_unlock(&intel_pstate_driver_lock);
|
||||
return -EPERM;
|
||||
|
@ -362,6 +362,8 @@ static void mmp_tdma_free_descriptor(struct mmp_tdma_chan *tdmac)
|
||||
gen_pool_free(gpool, (unsigned long)tdmac->desc_arr,
|
||||
size);
|
||||
tdmac->desc_arr = NULL;
|
||||
if (tdmac->status == DMA_ERROR)
|
||||
tdmac->status = DMA_COMPLETE;
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -873,6 +873,7 @@ static int pch_dma_probe(struct pci_dev *pdev,
|
||||
}
|
||||
|
||||
pci_set_master(pdev);
|
||||
pd->dma.dev = &pdev->dev;
|
||||
|
||||
err = request_irq(pdev->irq, pd_irq, IRQF_SHARED, DRV_NAME, pd);
|
||||
if (err) {
|
||||
@ -888,7 +889,6 @@ static int pch_dma_probe(struct pci_dev *pdev,
|
||||
goto err_free_irq;
|
||||
}
|
||||
|
||||
pd->dma.dev = &pdev->dev;
|
||||
|
||||
INIT_LIST_HEAD(&pd->dma.channels);
|
||||
|
||||
|
@ -210,7 +210,8 @@ qxl_image_init_helper(struct qxl_device *qdev,
|
||||
break;
|
||||
default:
|
||||
DRM_ERROR("unsupported image bit depth\n");
|
||||
return -EINVAL; /* TODO: cleanup */
|
||||
qxl_bo_kunmap_atomic_page(qdev, image_bo, ptr);
|
||||
return -EINVAL;
|
||||
}
|
||||
image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN;
|
||||
image->u.bitmap.x = width;
|
||||
|
@ -680,16 +680,21 @@ static int usbhid_open(struct hid_device *hid)
|
||||
struct usbhid_device *usbhid = hid->driver_data;
|
||||
int res;
|
||||
|
||||
mutex_lock(&usbhid->mutex);
|
||||
|
||||
set_bit(HID_OPENED, &usbhid->iofl);
|
||||
|
||||
if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
|
||||
return 0;
|
||||
if (hid->quirks & HID_QUIRK_ALWAYS_POLL) {
|
||||
res = 0;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
res = usb_autopm_get_interface(usbhid->intf);
|
||||
/* the device must be awake to reliably request remote wakeup */
|
||||
if (res < 0) {
|
||||
clear_bit(HID_OPENED, &usbhid->iofl);
|
||||
return -EIO;
|
||||
res = -EIO;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
usbhid->intf->needs_remote_wakeup = 1;
|
||||
@ -723,6 +728,9 @@ static int usbhid_open(struct hid_device *hid)
|
||||
msleep(50);
|
||||
|
||||
clear_bit(HID_RESUME_RUNNING, &usbhid->iofl);
|
||||
|
||||
Done:
|
||||
mutex_unlock(&usbhid->mutex);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -730,6 +738,8 @@ static void usbhid_close(struct hid_device *hid)
|
||||
{
|
||||
struct usbhid_device *usbhid = hid->driver_data;
|
||||
|
||||
mutex_lock(&usbhid->mutex);
|
||||
|
||||
/*
|
||||
* Make sure we don't restart data acquisition due to
|
||||
* a resumption we no longer care about by avoiding racing
|
||||
@ -741,12 +751,13 @@ static void usbhid_close(struct hid_device *hid)
|
||||
clear_bit(HID_IN_POLLING, &usbhid->iofl);
|
||||
spin_unlock_irq(&usbhid->lock);
|
||||
|
||||
if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
|
||||
return;
|
||||
if (!(hid->quirks & HID_QUIRK_ALWAYS_POLL)) {
|
||||
hid_cancel_delayed_stuff(usbhid);
|
||||
usb_kill_urb(usbhid->urbin);
|
||||
usbhid->intf->needs_remote_wakeup = 0;
|
||||
}
|
||||
|
||||
hid_cancel_delayed_stuff(usbhid);
|
||||
usb_kill_urb(usbhid->urbin);
|
||||
usbhid->intf->needs_remote_wakeup = 0;
|
||||
mutex_unlock(&usbhid->mutex);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1056,6 +1067,8 @@ static int usbhid_start(struct hid_device *hid)
|
||||
unsigned int n, insize = 0;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&usbhid->mutex);
|
||||
|
||||
clear_bit(HID_DISCONNECTED, &usbhid->iofl);
|
||||
|
||||
usbhid->bufsize = HID_MIN_BUFFER_SIZE;
|
||||
@ -1170,6 +1183,8 @@ static int usbhid_start(struct hid_device *hid)
|
||||
usbhid_set_leds(hid);
|
||||
device_set_wakeup_enable(&dev->dev, 1);
|
||||
}
|
||||
|
||||
mutex_unlock(&usbhid->mutex);
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
@ -1180,6 +1195,7 @@ fail:
|
||||
usbhid->urbout = NULL;
|
||||
usbhid->urbctrl = NULL;
|
||||
hid_free_buffers(dev, hid);
|
||||
mutex_unlock(&usbhid->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1195,6 +1211,8 @@ static void usbhid_stop(struct hid_device *hid)
|
||||
usbhid->intf->needs_remote_wakeup = 0;
|
||||
}
|
||||
|
||||
mutex_lock(&usbhid->mutex);
|
||||
|
||||
clear_bit(HID_STARTED, &usbhid->iofl);
|
||||
spin_lock_irq(&usbhid->lock); /* Sync with error and led handlers */
|
||||
set_bit(HID_DISCONNECTED, &usbhid->iofl);
|
||||
@ -1215,6 +1233,8 @@ static void usbhid_stop(struct hid_device *hid)
|
||||
usbhid->urbout = NULL;
|
||||
|
||||
hid_free_buffers(hid_to_usb_dev(hid), hid);
|
||||
|
||||
mutex_unlock(&usbhid->mutex);
|
||||
}
|
||||
|
||||
static int usbhid_power(struct hid_device *hid, int lvl)
|
||||
@ -1375,6 +1395,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
|
||||
INIT_WORK(&usbhid->reset_work, hid_reset);
|
||||
setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
|
||||
spin_lock_init(&usbhid->lock);
|
||||
mutex_init(&usbhid->mutex);
|
||||
|
||||
ret = hid_add_device(hid);
|
||||
if (ret) {
|
||||
|
@ -93,6 +93,7 @@ struct usbhid_device {
|
||||
dma_addr_t outbuf_dma; /* Output buffer dma */
|
||||
unsigned long last_out; /* record of last output for timeouts */
|
||||
|
||||
struct mutex mutex; /* start/stop/open/close */
|
||||
spinlock_t lock; /* fifo spinlock */
|
||||
unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
|
||||
struct timer_list io_retry; /* Retry timer */
|
||||
|
@ -132,9 +132,11 @@ static void wacom_feature_mapping(struct hid_device *hdev,
|
||||
data[0] = field->report->id;
|
||||
ret = wacom_get_report(hdev, HID_FEATURE_REPORT,
|
||||
data, n, WAC_CMD_RETRIES);
|
||||
if (ret == n) {
|
||||
if (ret == n && features->type == HID_GENERIC) {
|
||||
ret = hid_report_raw_event(hdev,
|
||||
HID_FEATURE_REPORT, data, n, 0);
|
||||
} else if (ret == 2 && features->type != HID_GENERIC) {
|
||||
features->touch_max = data[1];
|
||||
} else {
|
||||
features->touch_max = 16;
|
||||
hid_warn(hdev, "wacom_feature_mapping: "
|
||||
|
@ -250,9 +250,9 @@ static ssize_t da9052_read_tsi(struct device *dev,
|
||||
int channel = to_sensor_dev_attr(devattr)->index;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&hwmon->hwmon_lock);
|
||||
mutex_lock(&hwmon->da9052->auxadc_lock);
|
||||
ret = __da9052_read_tsi(dev, channel);
|
||||
mutex_unlock(&hwmon->hwmon_lock);
|
||||
mutex_unlock(&hwmon->da9052->auxadc_lock);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -450,16 +450,15 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
|
||||
struct flowi6 fl6;
|
||||
struct dst_entry *dst;
|
||||
struct rt6_info *rt;
|
||||
int ret;
|
||||
|
||||
memset(&fl6, 0, sizeof fl6);
|
||||
fl6.daddr = dst_in->sin6_addr;
|
||||
fl6.saddr = src_in->sin6_addr;
|
||||
fl6.flowi6_oif = addr->bound_dev_if;
|
||||
|
||||
ret = ipv6_stub->ipv6_dst_lookup(addr->net, NULL, &dst, &fl6);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
dst = ipv6_stub->ipv6_dst_lookup_flow(addr->net, NULL, &fl6, NULL);
|
||||
if (IS_ERR(dst))
|
||||
return PTR_ERR(dst);
|
||||
|
||||
rt = (struct rt6_info *)dst;
|
||||
if (ipv6_addr_any(&src_in->sin6_addr)) {
|
||||
|
@ -483,7 +483,7 @@ void i40iw_manage_arp_cache(struct i40iw_device *iwdev,
|
||||
int arp_index;
|
||||
|
||||
arp_index = i40iw_arp_table(iwdev, ip_addr, ipv4, mac_addr, action);
|
||||
if (arp_index == -1)
|
||||
if (arp_index < 0)
|
||||
return;
|
||||
cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false);
|
||||
if (!cqp_request)
|
||||
|
@ -2917,6 +2917,7 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp,
|
||||
int send_size;
|
||||
int header_size;
|
||||
int spc;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
if (wr->wr.opcode != IB_WR_SEND)
|
||||
@ -2951,7 +2952,9 @@ static int build_sriov_qp0_header(struct mlx4_ib_sqp *sqp,
|
||||
|
||||
sqp->ud_header.lrh.virtual_lane = 0;
|
||||
sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED);
|
||||
ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey);
|
||||
err = ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey);
|
||||
if (err)
|
||||
return err;
|
||||
sqp->ud_header.bth.pkey = cpu_to_be16(pkey);
|
||||
if (sqp->qp.mlx4_ib_qp_type == MLX4_IB_QPT_TUN_SMI_OWNER)
|
||||
sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn);
|
||||
@ -3240,9 +3243,14 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr,
|
||||
}
|
||||
sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED);
|
||||
if (!sqp->qp.ibqp.qp_num)
|
||||
ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index, &pkey);
|
||||
err = ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index,
|
||||
&pkey);
|
||||
else
|
||||
ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index, &pkey);
|
||||
err = ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index,
|
||||
&pkey);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
sqp->ud_header.bth.pkey = cpu_to_be16(pkey);
|
||||
sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn);
|
||||
sqp->ud_header.bth.psn = cpu_to_be32((sqp->send_psn++) & ((1 << 24) - 1));
|
||||
|
@ -154,10 +154,12 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev,
|
||||
memcpy(&fl6.daddr, daddr, sizeof(*daddr));
|
||||
fl6.flowi6_proto = IPPROTO_UDP;
|
||||
|
||||
if (unlikely(ipv6_stub->ipv6_dst_lookup(sock_net(recv_sockets.sk6->sk),
|
||||
recv_sockets.sk6->sk, &ndst, &fl6))) {
|
||||
ndst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(recv_sockets.sk6->sk),
|
||||
recv_sockets.sk6->sk, &fl6,
|
||||
NULL);
|
||||
if (unlikely(IS_ERR(ndst))) {
|
||||
pr_err_ratelimited("no route to %pI6\n", daddr);
|
||||
goto put;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (unlikely(ndst->error)) {
|
||||
|
@ -357,6 +357,7 @@ static void __exit dsa_loop_exit(void)
|
||||
}
|
||||
module_exit(dsa_loop_exit);
|
||||
|
||||
MODULE_SOFTDEP("pre: dsa_loop_bdinfo");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Florian Fainelli");
|
||||
MODULE_DESCRIPTION("DSA loopback driver");
|
||||
|
@ -6827,6 +6827,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
|
||||
netdev_features_t features)
|
||||
{
|
||||
struct bnxt *bp = netdev_priv(dev);
|
||||
netdev_features_t vlan_features;
|
||||
|
||||
if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp))
|
||||
features &= ~NETIF_F_NTUPLE;
|
||||
@ -6834,12 +6835,14 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
|
||||
/* Both CTAG and STAG VLAN accelaration on the RX side have to be
|
||||
* turned on or off together.
|
||||
*/
|
||||
if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) !=
|
||||
(NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) {
|
||||
vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX |
|
||||
NETIF_F_HW_VLAN_STAG_RX);
|
||||
if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX |
|
||||
NETIF_F_HW_VLAN_STAG_RX)) {
|
||||
if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
|
||||
features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
|
||||
NETIF_F_HW_VLAN_STAG_RX);
|
||||
else
|
||||
else if (vlan_features)
|
||||
features |= NETIF_F_HW_VLAN_CTAG_RX |
|
||||
NETIF_F_HW_VLAN_STAG_RX;
|
||||
}
|
||||
@ -8420,8 +8423,11 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev))
|
||||
dev_close(netdev);
|
||||
if (result != PCI_ERS_RESULT_RECOVERED) {
|
||||
if (netif_running(netdev))
|
||||
dev_close(netdev);
|
||||
pci_disable_device(pdev);
|
||||
}
|
||||
|
||||
rtnl_unlock();
|
||||
|
||||
@ -8432,7 +8438,7 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
|
||||
err); /* non-fatal, continue */
|
||||
}
|
||||
|
||||
return PCI_ERS_RESULT_RECOVERED;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -774,7 +774,6 @@ struct bnxt_vf_info {
|
||||
#define BNXT_VF_SPOOFCHK 0x2
|
||||
#define BNXT_VF_LINK_FORCED 0x4
|
||||
#define BNXT_VF_LINK_UP 0x8
|
||||
u32 func_flags; /* func cfg flags */
|
||||
u32 min_tx_rate;
|
||||
u32 max_tx_rate;
|
||||
void *hwrm_cmd_req_addr;
|
||||
|
@ -99,11 +99,10 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting)
|
||||
if (old_setting == setting)
|
||||
return 0;
|
||||
|
||||
func_flags = vf->func_flags;
|
||||
if (setting)
|
||||
func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE;
|
||||
func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE;
|
||||
else
|
||||
func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE;
|
||||
func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE;
|
||||
/*TODO: if the driver supports VLAN filter on guest VLAN,
|
||||
* the spoof check should also include vlan anti-spoofing
|
||||
*/
|
||||
@ -112,7 +111,6 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting)
|
||||
req.flags = cpu_to_le32(func_flags);
|
||||
rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
|
||||
if (!rc) {
|
||||
vf->func_flags = func_flags;
|
||||
if (setting)
|
||||
vf->flags |= BNXT_VF_SPOOFCHK;
|
||||
else
|
||||
@ -176,7 +174,6 @@ int bnxt_set_vf_mac(struct net_device *dev, int vf_id, u8 *mac)
|
||||
memcpy(vf->mac_addr, mac, ETH_ALEN);
|
||||
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
|
||||
req.fid = cpu_to_le16(vf->fw_fid);
|
||||
req.flags = cpu_to_le32(vf->func_flags);
|
||||
req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR);
|
||||
memcpy(req.dflt_mac_addr, mac, ETH_ALEN);
|
||||
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
|
||||
@ -214,7 +211,6 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,
|
||||
|
||||
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
|
||||
req.fid = cpu_to_le16(vf->fw_fid);
|
||||
req.flags = cpu_to_le32(vf->func_flags);
|
||||
req.dflt_vlan = cpu_to_le16(vlan_tag);
|
||||
req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_VLAN);
|
||||
rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
|
||||
@ -253,7 +249,6 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,
|
||||
return 0;
|
||||
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
|
||||
req.fid = cpu_to_le16(vf->fw_fid);
|
||||
req.flags = cpu_to_le32(vf->func_flags);
|
||||
req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_MAX_BW);
|
||||
req.max_bw = cpu_to_le32(max_tx_rate);
|
||||
req.enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_MIN_BW);
|
||||
|
@ -54,6 +54,8 @@
|
||||
|
||||
#define MGMT_MSG_TIMEOUT 5000
|
||||
|
||||
#define SET_FUNC_PORT_MGMT_TIMEOUT 25000
|
||||
|
||||
#define mgmt_to_pfhwdev(pf_mgmt) \
|
||||
container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)
|
||||
|
||||
@ -247,12 +249,13 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt,
|
||||
u8 *buf_in, u16 in_size,
|
||||
u8 *buf_out, u16 *out_size,
|
||||
enum mgmt_direction_type direction,
|
||||
u16 resp_msg_id)
|
||||
u16 resp_msg_id, u32 timeout)
|
||||
{
|
||||
struct hinic_hwif *hwif = pf_to_mgmt->hwif;
|
||||
struct pci_dev *pdev = hwif->pdev;
|
||||
struct hinic_recv_msg *recv_msg;
|
||||
struct completion *recv_done;
|
||||
unsigned long timeo;
|
||||
u16 msg_id;
|
||||
int err;
|
||||
|
||||
@ -276,8 +279,9 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt,
|
||||
goto unlock_sync_msg;
|
||||
}
|
||||
|
||||
if (!wait_for_completion_timeout(recv_done,
|
||||
msecs_to_jiffies(MGMT_MSG_TIMEOUT))) {
|
||||
timeo = msecs_to_jiffies(timeout ? timeout : MGMT_MSG_TIMEOUT);
|
||||
|
||||
if (!wait_for_completion_timeout(recv_done, timeo)) {
|
||||
dev_err(&pdev->dev, "MGMT timeout, MSG id = %d\n", msg_id);
|
||||
err = -ETIMEDOUT;
|
||||
goto unlock_sync_msg;
|
||||
@ -351,6 +355,7 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
|
||||
{
|
||||
struct hinic_hwif *hwif = pf_to_mgmt->hwif;
|
||||
struct pci_dev *pdev = hwif->pdev;
|
||||
u32 timeout = 0;
|
||||
|
||||
if (sync != HINIC_MGMT_MSG_SYNC) {
|
||||
dev_err(&pdev->dev, "Invalid MGMT msg type\n");
|
||||
@ -362,9 +367,12 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
|
||||
timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
|
||||
|
||||
return msg_to_mgmt_sync(pf_to_mgmt, mod, cmd, buf_in, in_size,
|
||||
buf_out, out_size, MGMT_DIRECT_SEND,
|
||||
MSG_NOT_RESP);
|
||||
MSG_NOT_RESP, timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -473,7 +473,6 @@ static int hinic_close(struct net_device *netdev)
|
||||
{
|
||||
struct hinic_dev *nic_dev = netdev_priv(netdev);
|
||||
unsigned int flags;
|
||||
int err;
|
||||
|
||||
down(&nic_dev->mgmt_lock);
|
||||
|
||||
@ -487,20 +486,9 @@ static int hinic_close(struct net_device *netdev)
|
||||
|
||||
up(&nic_dev->mgmt_lock);
|
||||
|
||||
err = hinic_port_set_func_state(nic_dev, HINIC_FUNC_PORT_DISABLE);
|
||||
if (err) {
|
||||
netif_err(nic_dev, drv, netdev,
|
||||
"Failed to set func port state\n");
|
||||
nic_dev->flags |= (flags & HINIC_INTF_UP);
|
||||
return err;
|
||||
}
|
||||
hinic_port_set_state(nic_dev, HINIC_PORT_DISABLE);
|
||||
|
||||
err = hinic_port_set_state(nic_dev, HINIC_PORT_DISABLE);
|
||||
if (err) {
|
||||
netif_err(nic_dev, drv, netdev, "Failed to set port state\n");
|
||||
nic_dev->flags |= (flags & HINIC_INTF_UP);
|
||||
return err;
|
||||
}
|
||||
hinic_port_set_func_state(nic_dev, HINIC_FUNC_PORT_DISABLE);
|
||||
|
||||
free_rxqs(nic_dev);
|
||||
free_txqs(nic_dev);
|
||||
|
@ -2503,6 +2503,7 @@ static int mlx4_allocate_default_counters(struct mlx4_dev *dev)
|
||||
|
||||
if (!err || err == -ENOSPC) {
|
||||
priv->def_counter[port] = idx;
|
||||
err = 0;
|
||||
} else if (err == -ENOENT) {
|
||||
err = 0;
|
||||
continue;
|
||||
@ -2553,7 +2554,8 @@ int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx, u8 usage)
|
||||
MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
|
||||
if (!err)
|
||||
*idx = get_param_l(&out_param);
|
||||
|
||||
if (WARN_ON(err == -ENOSPC))
|
||||
err = -EINVAL;
|
||||
return err;
|
||||
}
|
||||
return __mlx4_counter_alloc(dev, idx);
|
||||
|
@ -831,7 +831,6 @@ static void cmd_work_handler(struct work_struct *work)
|
||||
}
|
||||
|
||||
cmd->ent_arr[ent->idx] = ent;
|
||||
set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state);
|
||||
lay = get_inst(cmd, ent->idx);
|
||||
ent->lay = lay;
|
||||
memset(lay, 0, sizeof(*lay));
|
||||
@ -853,6 +852,7 @@ static void cmd_work_handler(struct work_struct *work)
|
||||
|
||||
if (ent->callback)
|
||||
schedule_delayed_work(&ent->cb_timeout_work, cb_timeout);
|
||||
set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state);
|
||||
|
||||
/* Skip sending command to fw if internal error */
|
||||
if (pci_channel_offline(dev->pdev) ||
|
||||
@ -865,6 +865,10 @@ static void cmd_work_handler(struct work_struct *work)
|
||||
MLX5_SET(mbox_out, ent->out, syndrome, drv_synd);
|
||||
|
||||
mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true);
|
||||
/* no doorbell, no need to keep the entry */
|
||||
free_ent(cmd, ent->idx);
|
||||
if (ent->callback)
|
||||
free_cmd(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1550,12 +1550,11 @@ static int mlx5e_route_lookup_ipv6(struct mlx5e_priv *priv,
|
||||
|
||||
#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
|
||||
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
|
||||
int ret;
|
||||
|
||||
ret = ipv6_stub->ipv6_dst_lookup(dev_net(mirred_dev), NULL, &dst,
|
||||
fl6);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
dst = ipv6_stub->ipv6_dst_lookup_flow(dev_net(mirred_dev), NULL, fl6,
|
||||
NULL);
|
||||
if (IS_ERR(dst))
|
||||
return PTR_ERR(dst);
|
||||
|
||||
*out_ttl = ip6_dst_hoplimit(dst);
|
||||
|
||||
@ -1754,7 +1753,7 @@ static int mlx5e_create_encap_header_ipv6(struct mlx5e_priv *priv,
|
||||
int max_encap_size = MLX5_CAP_ESW(priv->mdev, max_encap_header_size);
|
||||
int ipv6_encap_size = ETH_HLEN + sizeof(struct ipv6hdr) + VXLAN_HLEN;
|
||||
struct ip_tunnel_key *tun_key = &e->tun_info.key;
|
||||
struct net_device *out_dev;
|
||||
struct net_device *out_dev = NULL;
|
||||
struct neighbour *n = NULL;
|
||||
struct flowi6 fl6 = {};
|
||||
char *encap_header;
|
||||
|
@ -561,7 +561,7 @@ static int moxart_remove(struct platform_device *pdev)
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
|
||||
unregister_netdev(ndev);
|
||||
free_irq(ndev->irq, ndev);
|
||||
devm_free_irq(&pdev->dev, ndev->irq, ndev);
|
||||
moxart_mac_free_memory(ndev);
|
||||
free_netdev(ndev);
|
||||
|
||||
|
@ -247,13 +247,15 @@ static int jazz_sonic_probe(struct platform_device *pdev)
|
||||
goto out;
|
||||
err = register_netdev(dev);
|
||||
if (err)
|
||||
goto out1;
|
||||
goto undo_probe1;
|
||||
|
||||
printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
|
||||
|
||||
return 0;
|
||||
|
||||
out1:
|
||||
undo_probe1:
|
||||
dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
|
||||
lp->descriptors, lp->descriptors_laddr);
|
||||
release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
|
||||
out:
|
||||
free_netdev(dev);
|
||||
|
@ -96,7 +96,7 @@ struct stmmac_priv {
|
||||
struct net_device *dev;
|
||||
struct device *device;
|
||||
struct mac_device_info *hw;
|
||||
spinlock_t lock;
|
||||
struct mutex lock;
|
||||
|
||||
/* RX Queue */
|
||||
struct stmmac_rx_queue rx_queue[MTL_MAX_RX_QUEUES];
|
||||
|
@ -392,13 +392,13 @@ stmmac_ethtool_set_link_ksettings(struct net_device *dev,
|
||||
ADVERTISED_10baseT_Half |
|
||||
ADVERTISED_10baseT_Full);
|
||||
|
||||
spin_lock(&priv->lock);
|
||||
mutex_lock(&priv->lock);
|
||||
|
||||
if (priv->hw->mac->pcs_ctrl_ane)
|
||||
priv->hw->mac->pcs_ctrl_ane(priv->ioaddr, 1,
|
||||
priv->hw->ps, 0);
|
||||
|
||||
spin_unlock(&priv->lock);
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -615,12 +615,12 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
|
||||
spin_lock_irq(&priv->lock);
|
||||
mutex_lock(&priv->lock);
|
||||
if (device_can_wakeup(priv->device)) {
|
||||
wol->supported = WAKE_MAGIC | WAKE_UCAST;
|
||||
wol->wolopts = priv->wolopts;
|
||||
}
|
||||
spin_unlock_irq(&priv->lock);
|
||||
mutex_unlock(&priv->lock);
|
||||
}
|
||||
|
||||
static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
||||
@ -649,9 +649,9 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
||||
disable_irq_wake(priv->wol_irq);
|
||||
}
|
||||
|
||||
spin_lock_irq(&priv->lock);
|
||||
mutex_lock(&priv->lock);
|
||||
priv->wolopts = wol->wolopts;
|
||||
spin_unlock_irq(&priv->lock);
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -365,7 +365,6 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
|
||||
{
|
||||
struct net_device *ndev = priv->dev;
|
||||
int interface = priv->plat->interface;
|
||||
unsigned long flags;
|
||||
bool ret = false;
|
||||
|
||||
if ((interface != PHY_INTERFACE_MODE_MII) &&
|
||||
@ -392,7 +391,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
|
||||
* changed).
|
||||
* In that case the driver disable own timers.
|
||||
*/
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
mutex_lock(&priv->lock);
|
||||
if (priv->eee_active) {
|
||||
netdev_dbg(priv->dev, "disable EEE\n");
|
||||
del_timer_sync(&priv->eee_ctrl_timer);
|
||||
@ -400,11 +399,11 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
|
||||
tx_lpi_timer);
|
||||
}
|
||||
priv->eee_active = 0;
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
mutex_unlock(&priv->lock);
|
||||
goto out;
|
||||
}
|
||||
/* Activate the EEE and start timers */
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
mutex_lock(&priv->lock);
|
||||
if (!priv->eee_active) {
|
||||
priv->eee_active = 1;
|
||||
setup_timer(&priv->eee_ctrl_timer,
|
||||
@ -421,7 +420,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
|
||||
priv->hw->mac->set_eee_pls(priv->hw, ndev->phydev->link);
|
||||
|
||||
ret = true;
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
netdev_dbg(priv->dev, "Energy-Efficient Ethernet initialized\n");
|
||||
}
|
||||
@ -799,13 +798,12 @@ static void stmmac_adjust_link(struct net_device *dev)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
struct phy_device *phydev = dev->phydev;
|
||||
unsigned long flags;
|
||||
bool new_state = false;
|
||||
|
||||
if (!phydev)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
mutex_lock(&priv->lock);
|
||||
|
||||
if (phydev->link) {
|
||||
u32 ctrl = readl(priv->ioaddr + MAC_CTRL_REG);
|
||||
@ -864,7 +862,7 @@ static void stmmac_adjust_link(struct net_device *dev)
|
||||
if (new_state && netif_msg_link(priv))
|
||||
phy_print_status(phydev);
|
||||
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
if (phydev->is_pseudo_fixed_link)
|
||||
/* Stop PHY layer to call the hook to adjust the link in case
|
||||
@ -4284,7 +4282,7 @@ int stmmac_dvr_probe(struct device *device,
|
||||
(8 * priv->plat->rx_queues_to_use));
|
||||
}
|
||||
|
||||
spin_lock_init(&priv->lock);
|
||||
mutex_init(&priv->lock);
|
||||
|
||||
/* If a specific clk_csr value is passed from the platform
|
||||
* this means that the CSR Clock Range selection cannot be
|
||||
@ -4375,6 +4373,7 @@ int stmmac_dvr_remove(struct device *dev)
|
||||
priv->hw->pcs != STMMAC_PCS_TBI &&
|
||||
priv->hw->pcs != STMMAC_PCS_RTBI)
|
||||
stmmac_mdio_unregister(ndev);
|
||||
mutex_destroy(&priv->lock);
|
||||
free_netdev(ndev);
|
||||
|
||||
return 0;
|
||||
@ -4392,7 +4391,6 @@ int stmmac_suspend(struct device *dev)
|
||||
{
|
||||
struct net_device *ndev = dev_get_drvdata(dev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
unsigned long flags;
|
||||
|
||||
if (!ndev || !netif_running(ndev))
|
||||
return 0;
|
||||
@ -4400,7 +4398,7 @@ int stmmac_suspend(struct device *dev)
|
||||
if (ndev->phydev)
|
||||
phy_stop(ndev->phydev);
|
||||
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
mutex_lock(&priv->lock);
|
||||
|
||||
netif_device_detach(ndev);
|
||||
stmmac_stop_all_queues(priv);
|
||||
@ -4423,7 +4421,7 @@ int stmmac_suspend(struct device *dev)
|
||||
clk_disable_unprepare(priv->plat->pclk);
|
||||
clk_disable_unprepare(priv->plat->stmmac_clk);
|
||||
}
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
priv->oldlink = false;
|
||||
priv->speed = SPEED_UNKNOWN;
|
||||
@ -4467,7 +4465,6 @@ int stmmac_resume(struct device *dev)
|
||||
{
|
||||
struct net_device *ndev = dev_get_drvdata(dev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
unsigned long flags;
|
||||
|
||||
if (!netif_running(ndev))
|
||||
return 0;
|
||||
@ -4479,9 +4476,9 @@ int stmmac_resume(struct device *dev)
|
||||
* from another devices (e.g. serial console).
|
||||
*/
|
||||
if (device_may_wakeup(priv->device)) {
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
mutex_lock(&priv->lock);
|
||||
priv->hw->mac->pmt(priv->hw, 0);
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
mutex_unlock(&priv->lock);
|
||||
priv->irq_wake = 0;
|
||||
} else {
|
||||
pinctrl_pm_select_default_state(priv->device);
|
||||
@ -4497,7 +4494,7 @@ int stmmac_resume(struct device *dev)
|
||||
|
||||
netif_device_attach(ndev);
|
||||
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
mutex_lock(&priv->lock);
|
||||
|
||||
stmmac_reset_queues_param(priv);
|
||||
|
||||
@ -4516,7 +4513,7 @@ int stmmac_resume(struct device *dev)
|
||||
|
||||
stmmac_start_all_queues(priv);
|
||||
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
if (ndev->phydev)
|
||||
phy_start(ndev->phydev);
|
||||
|
@ -796,7 +796,9 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
|
||||
if (dst)
|
||||
return dst;
|
||||
}
|
||||
if (ipv6_stub->ipv6_dst_lookup(geneve->net, gs6->sock->sk, &dst, fl6)) {
|
||||
dst = ipv6_stub->ipv6_dst_lookup_flow(geneve->net, gs6->sock->sk, fl6,
|
||||
NULL);
|
||||
if (IS_ERR(dst)) {
|
||||
netdev_dbg(dev, "no route to %pI6\n", &fl6->daddr);
|
||||
return ERR_PTR(-ENETUNREACH);
|
||||
}
|
||||
@ -1369,21 +1371,33 @@ static int geneve_nl2info(struct nlattr *tb[], struct nlattr *data[],
|
||||
}
|
||||
|
||||
if (data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX]) {
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
if (changelink) {
|
||||
attrtype = IFLA_GENEVE_UDP_ZERO_CSUM6_TX;
|
||||
goto change_notsup;
|
||||
}
|
||||
if (nla_get_u8(data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX]))
|
||||
info->key.tun_flags &= ~TUNNEL_CSUM;
|
||||
#else
|
||||
NL_SET_ERR_MSG_ATTR(extack, data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX],
|
||||
"IPv6 support not enabled in the kernel");
|
||||
return -EPFNOSUPPORT;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (data[IFLA_GENEVE_UDP_ZERO_CSUM6_RX]) {
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
if (changelink) {
|
||||
attrtype = IFLA_GENEVE_UDP_ZERO_CSUM6_RX;
|
||||
goto change_notsup;
|
||||
}
|
||||
if (nla_get_u8(data[IFLA_GENEVE_UDP_ZERO_CSUM6_RX]))
|
||||
*use_udp6_rx_checksums = false;
|
||||
#else
|
||||
NL_SET_ERR_MSG_ATTR(extack, data[IFLA_GENEVE_UDP_ZERO_CSUM6_RX],
|
||||
"IPv6 support not enabled in the kernel");
|
||||
return -EPFNOSUPPORT;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -1559,11 +1573,13 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (metadata && nla_put_flag(skb, IFLA_GENEVE_COLLECT_METADATA))
|
||||
goto nla_put_failure;
|
||||
goto nla_put_failure;
|
||||
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
if (nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
|
||||
!geneve->use_udp6_rx_checksums))
|
||||
goto nla_put_failure;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -1309,7 +1309,8 @@ static struct crypto_aead *macsec_alloc_tfm(char *key, int key_len, int icv_len)
|
||||
struct crypto_aead *tfm;
|
||||
int ret;
|
||||
|
||||
tfm = crypto_alloc_aead("gcm(aes)", 0, 0);
|
||||
/* Pick a sync gcm(aes) cipher to ensure order is preserved. */
|
||||
tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC);
|
||||
|
||||
if (IS_ERR(tfm))
|
||||
return tfm;
|
||||
|
@ -1110,7 +1110,7 @@ static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus)
|
||||
goto out;
|
||||
}
|
||||
dp83640_clock_init(clock, bus);
|
||||
list_add_tail(&phyter_clocks, &clock->list);
|
||||
list_add_tail(&clock->list, &phyter_clocks);
|
||||
out:
|
||||
mutex_unlock(&phyter_clocks_lock);
|
||||
|
||||
|
@ -674,8 +674,8 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(kszphy_hw_stats); i++) {
|
||||
memcpy(data + i * ETH_GSTRING_LEN,
|
||||
kszphy_hw_stats[i].string, ETH_GSTRING_LEN);
|
||||
strlcpy(data + i * ETH_GSTRING_LEN,
|
||||
kszphy_hw_stats[i].string, ETH_GSTRING_LEN);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1257,9 +1257,11 @@ int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data)
|
||||
/* Restart autonegotiation so the new modes get sent to the
|
||||
* link partner.
|
||||
*/
|
||||
ret = phy_restart_aneg(phydev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (phydev->autoneg == AUTONEG_ENABLE) {
|
||||
ret = phy_restart_aneg(phydev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1283,6 +1283,7 @@ static const struct usb_device_id products[] = {
|
||||
{QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */
|
||||
{QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/
|
||||
|
@ -1962,7 +1962,6 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
|
||||
bool use_cache = ip_tunnel_dst_cache_usable(skb, info);
|
||||
struct dst_entry *ndst;
|
||||
struct flowi6 fl6;
|
||||
int err;
|
||||
|
||||
if (!sock6)
|
||||
return ERR_PTR(-EIO);
|
||||
@ -1985,10 +1984,9 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
|
||||
fl6.fl6_dport = dport;
|
||||
fl6.fl6_sport = sport;
|
||||
|
||||
err = ipv6_stub->ipv6_dst_lookup(vxlan->net,
|
||||
sock6->sock->sk,
|
||||
&ndst, &fl6);
|
||||
if (unlikely(err < 0)) {
|
||||
ndst = ipv6_stub->ipv6_dst_lookup_flow(vxlan->net, sock6->sock->sk,
|
||||
&fl6, NULL);
|
||||
if (unlikely(IS_ERR(ndst))) {
|
||||
netdev_dbg(dev, "no route to %pI6\n", daddr);
|
||||
return ERR_PTR(-ENETUNREACH);
|
||||
}
|
||||
|
@ -1503,6 +1503,7 @@ static const struct gpio_chip byt_gpio_chip = {
|
||||
.direction_output = byt_gpio_direction_output,
|
||||
.get = byt_gpio_get,
|
||||
.set = byt_gpio_set,
|
||||
.set_config = gpiochip_generic_config,
|
||||
.dbg_show = byt_gpio_dbg_show,
|
||||
};
|
||||
|
||||
|
@ -1514,11 +1514,15 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)
|
||||
struct chv_pinctrl *pctrl = gpiochip_get_data(gc);
|
||||
struct irq_chip *chip = irq_desc_get_chip(desc);
|
||||
unsigned long pending;
|
||||
unsigned long flags;
|
||||
u32 intr_line;
|
||||
|
||||
chained_irq_enter(chip, desc);
|
||||
|
||||
raw_spin_lock_irqsave(&chv_lock, flags);
|
||||
pending = readl(pctrl->regs + CHV_INTSTAT);
|
||||
raw_spin_unlock_irqrestore(&chv_lock, flags);
|
||||
|
||||
for_each_set_bit(intr_line, &pending, pctrl->community->nirqs) {
|
||||
unsigned irq, offset;
|
||||
|
||||
|
@ -695,8 +695,10 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
|
||||
hp->flags = input_size; /* structure abuse ... */
|
||||
hp->pack_id = old_hdr.pack_id;
|
||||
hp->usr_ptr = NULL;
|
||||
if (__copy_from_user(cmnd, buf, cmd_size))
|
||||
if (__copy_from_user(cmnd, buf, cmd_size)) {
|
||||
sg_remove_request(sfp, srp);
|
||||
return -EFAULT;
|
||||
}
|
||||
/*
|
||||
* SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV,
|
||||
* but is is possible that the app intended SG_DXFER_TO_DEV, because there
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
#define USB_VENDOR_GENESYS_LOGIC 0x05e3
|
||||
#define USB_VENDOR_SMSC 0x0424
|
||||
#define USB_PRODUCT_USB5534B 0x5534
|
||||
#define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01
|
||||
#define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02
|
||||
|
||||
@ -5322,8 +5323,11 @@ out_hdev_lock:
|
||||
}
|
||||
|
||||
static const struct usb_device_id hub_id_table[] = {
|
||||
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_CLASS,
|
||||
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
|
||||
| USB_DEVICE_ID_MATCH_PRODUCT
|
||||
| USB_DEVICE_ID_MATCH_INT_CLASS,
|
||||
.idVendor = USB_VENDOR_SMSC,
|
||||
.idProduct = USB_PRODUCT_USB5534B,
|
||||
.bInterfaceClass = USB_CLASS_HUB,
|
||||
.driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
|
||||
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
|
||||
|
@ -290,6 +290,9 @@ static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,
|
||||
char *name;
|
||||
int ret;
|
||||
|
||||
if (strlen(page) < len)
|
||||
return -EOVERFLOW;
|
||||
|
||||
name = kstrdup(page, GFP_KERNEL);
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
|
@ -303,8 +303,10 @@ static int audio_bind(struct usb_composite_dev *cdev)
|
||||
struct usb_descriptor_header *usb_desc;
|
||||
|
||||
usb_desc = usb_otg_descriptor_alloc(cdev->gadget);
|
||||
if (!usb_desc)
|
||||
if (!usb_desc) {
|
||||
status = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
usb_otg_descriptor_init(cdev->gadget, usb_desc);
|
||||
otg_desc[0] = usb_desc;
|
||||
otg_desc[1] = NULL;
|
||||
|
@ -183,8 +183,10 @@ static int cdc_bind(struct usb_composite_dev *cdev)
|
||||
struct usb_descriptor_header *usb_desc;
|
||||
|
||||
usb_desc = usb_otg_descriptor_alloc(gadget);
|
||||
if (!usb_desc)
|
||||
if (!usb_desc) {
|
||||
status = -ENOMEM;
|
||||
goto fail1;
|
||||
}
|
||||
usb_otg_descriptor_init(gadget, usb_desc);
|
||||
otg_desc[0] = usb_desc;
|
||||
otg_desc[1] = NULL;
|
||||
|
@ -162,8 +162,10 @@ static int gncm_bind(struct usb_composite_dev *cdev)
|
||||
struct usb_descriptor_header *usb_desc;
|
||||
|
||||
usb_desc = usb_otg_descriptor_alloc(gadget);
|
||||
if (!usb_desc)
|
||||
if (!usb_desc) {
|
||||
status = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
usb_otg_descriptor_init(gadget, usb_desc);
|
||||
otg_desc[0] = usb_desc;
|
||||
otg_desc[1] = NULL;
|
||||
|
@ -2666,6 +2666,8 @@ net2272_plat_probe(struct platform_device *pdev)
|
||||
err_req:
|
||||
release_mem_region(base, len);
|
||||
err:
|
||||
kfree(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -334,6 +334,7 @@ static int xhci_plat_remove(struct platform_device *dev)
|
||||
struct clk *clk = xhci->clk;
|
||||
struct usb_hcd *shared_hcd = xhci->shared_hcd;
|
||||
|
||||
pm_runtime_get_sync(&dev->dev);
|
||||
xhci->xhc_state |= XHCI_STATE_REMOVING;
|
||||
|
||||
usb_remove_hcd(shared_hcd);
|
||||
@ -347,8 +348,9 @@ static int xhci_plat_remove(struct platform_device *dev)
|
||||
clk_disable_unprepare(clk);
|
||||
usb_put_hcd(hcd);
|
||||
|
||||
pm_runtime_set_suspended(&dev->dev);
|
||||
pm_runtime_disable(&dev->dev);
|
||||
pm_runtime_put_noidle(&dev->dev);
|
||||
pm_runtime_set_suspended(&dev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -3403,8 +3403,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
|
||||
/* New sg entry */
|
||||
--num_sgs;
|
||||
sent_len -= block_len;
|
||||
if (num_sgs != 0) {
|
||||
sg = sg_next(sg);
|
||||
sg = sg_next(sg);
|
||||
if (num_sgs != 0 && sg) {
|
||||
block_len = sg_dma_len(sg);
|
||||
addr = (u64) sg_dma_address(sg);
|
||||
addr += sent_len;
|
||||
|
@ -1161,8 +1161,8 @@ static void garmin_read_process(struct garmin_data *garmin_data_p,
|
||||
send it directly to the tty port */
|
||||
if (garmin_data_p->flags & FLAGS_QUEUING) {
|
||||
pkt_add(garmin_data_p, data, data_length);
|
||||
} else if (bulk_data ||
|
||||
getLayerId(data) == GARMIN_LAYERID_APPL) {
|
||||
} else if (bulk_data || (data_length >= sizeof(u32) &&
|
||||
getLayerId(data) == GARMIN_LAYERID_APPL)) {
|
||||
|
||||
spin_lock_irqsave(&garmin_data_p->lock, flags);
|
||||
garmin_data_p->flags |= APP_RESP_SEEN;
|
||||
|
@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
|
||||
{DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */
|
||||
{DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */
|
||||
{DEVICE_SWI(0x413c, 0x81cc)}, /* Dell Wireless 5816e */
|
||||
{DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */
|
||||
{DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */
|
||||
{DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
|
||||
|
@ -41,6 +41,13 @@
|
||||
* and don't forget to CC: the USB development list <linux-usb@vger.kernel.org>
|
||||
*/
|
||||
|
||||
/* Reported-by: Julian Groß <julian.g@posteo.de> */
|
||||
UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,
|
||||
"LaCie",
|
||||
"2Big Quadra USB3",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_NO_REPORT_OPCODES),
|
||||
|
||||
/*
|
||||
* Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
|
||||
* commands in UAS mode. Observed with the 1.28 firmware; are there others?
|
||||
|
@ -758,6 +758,14 @@ void do_coredump(const siginfo_t *siginfo)
|
||||
if (displaced)
|
||||
put_files_struct(displaced);
|
||||
if (!dump_interrupted()) {
|
||||
/*
|
||||
* umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would
|
||||
* have this set to NULL.
|
||||
*/
|
||||
if (!cprm.file) {
|
||||
pr_info("Core dump to |%s disabled\n", cn.corename);
|
||||
goto close_fail;
|
||||
}
|
||||
file_start_write(cprm.file);
|
||||
core_dumped = binfmt->core_dump(&cprm);
|
||||
file_end_write(cprm.file);
|
||||
|
@ -1264,6 +1264,8 @@ int flush_old_exec(struct linux_binprm * bprm)
|
||||
*/
|
||||
set_mm_exe_file(bprm->mm, bprm->file);
|
||||
|
||||
would_dump(bprm, bprm->file);
|
||||
|
||||
/*
|
||||
* Release all of the old mmap stuff
|
||||
*/
|
||||
@ -1797,8 +1799,6 @@ static int do_execveat_common(int fd, struct filename *filename,
|
||||
if (retval < 0)
|
||||
goto out;
|
||||
|
||||
would_dump(bprm, bprm->file);
|
||||
|
||||
retval = exec_binprm(bprm);
|
||||
if (retval < 0)
|
||||
goto out;
|
||||
|
@ -574,7 +574,7 @@ struct request_queue {
|
||||
unsigned int sg_reserved_size;
|
||||
int node;
|
||||
#ifdef CONFIG_BLK_DEV_IO_TRACE
|
||||
struct blk_trace *blk_trace;
|
||||
struct blk_trace __rcu *blk_trace;
|
||||
struct mutex blk_trace_mutex;
|
||||
#endif
|
||||
/*
|
||||
|
@ -51,9 +51,13 @@ void __trace_note_message(struct blk_trace *, struct blkcg *blkcg, const char *f
|
||||
**/
|
||||
#define blk_add_cgroup_trace_msg(q, cg, fmt, ...) \
|
||||
do { \
|
||||
struct blk_trace *bt = (q)->blk_trace; \
|
||||
struct blk_trace *bt; \
|
||||
\
|
||||
rcu_read_lock(); \
|
||||
bt = rcu_dereference((q)->blk_trace); \
|
||||
if (unlikely(bt)) \
|
||||
__trace_note_message(bt, cg, fmt, ##__VA_ARGS__);\
|
||||
rcu_read_unlock(); \
|
||||
} while (0)
|
||||
#define blk_add_trace_msg(q, fmt, ...) \
|
||||
blk_add_cgroup_trace_msg(q, NULL, fmt, ##__VA_ARGS__)
|
||||
@ -61,10 +65,14 @@ void __trace_note_message(struct blk_trace *, struct blkcg *blkcg, const char *f
|
||||
|
||||
static inline bool blk_trace_note_message_enabled(struct request_queue *q)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
if (likely(!bt))
|
||||
return false;
|
||||
return bt->act_mask & BLK_TC_NOTIFY;
|
||||
struct blk_trace *bt;
|
||||
bool ret;
|
||||
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
ret = bt && (bt->act_mask & BLK_TC_NOTIFY);
|
||||
rcu_read_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
|
||||
|
@ -382,4 +382,10 @@ unsigned long read_word_at_a_time(const void *addr)
|
||||
(_________p1); \
|
||||
})
|
||||
|
||||
/*
|
||||
* This is needed in functions which generate the stack canary, see
|
||||
* arch/x86/kernel/smpboot.c::start_secondary() for an example.
|
||||
*/
|
||||
#define prevent_tail_call_optimization() mb()
|
||||
|
||||
#endif /* __LINUX_COMPILER_H */
|
||||
|
@ -906,7 +906,7 @@ struct file_handle {
|
||||
__u32 handle_bytes;
|
||||
int handle_type;
|
||||
/* file identifier */
|
||||
unsigned char f_handle[0];
|
||||
unsigned char f_handle[];
|
||||
};
|
||||
|
||||
static inline struct file *get_file(struct file *f)
|
||||
|
@ -220,10 +220,8 @@ struct pnp_card {
|
||||
#define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list)
|
||||
#define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list)
|
||||
#define to_pnp_card(n) container_of(n, struct pnp_card, dev)
|
||||
#define pnp_for_each_card(card) \
|
||||
for((card) = global_to_pnp_card(pnp_cards.next); \
|
||||
(card) != global_to_pnp_card(&pnp_cards); \
|
||||
(card) = global_to_pnp_card((card)->global_list.next))
|
||||
#define pnp_for_each_card(card) \
|
||||
list_for_each_entry(card, &pnp_cards, global_list)
|
||||
|
||||
struct pnp_card_link {
|
||||
struct pnp_card *card;
|
||||
@ -276,14 +274,9 @@ struct pnp_dev {
|
||||
#define card_to_pnp_dev(n) list_entry(n, struct pnp_dev, card_list)
|
||||
#define protocol_to_pnp_dev(n) list_entry(n, struct pnp_dev, protocol_list)
|
||||
#define to_pnp_dev(n) container_of(n, struct pnp_dev, dev)
|
||||
#define pnp_for_each_dev(dev) \
|
||||
for((dev) = global_to_pnp_dev(pnp_global.next); \
|
||||
(dev) != global_to_pnp_dev(&pnp_global); \
|
||||
(dev) = global_to_pnp_dev((dev)->global_list.next))
|
||||
#define card_for_each_dev(card,dev) \
|
||||
for((dev) = card_to_pnp_dev((card)->devices.next); \
|
||||
(dev) != card_to_pnp_dev(&(card)->devices); \
|
||||
(dev) = card_to_pnp_dev((dev)->card_list.next))
|
||||
#define pnp_for_each_dev(dev) list_for_each_entry(dev, &pnp_global, global_list)
|
||||
#define card_for_each_dev(card, dev) \
|
||||
list_for_each_entry(dev, &(card)->devices, card_list)
|
||||
#define pnp_dev_name(dev) (dev)->name
|
||||
|
||||
static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
|
||||
@ -437,14 +430,10 @@ struct pnp_protocol {
|
||||
};
|
||||
|
||||
#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
|
||||
#define protocol_for_each_card(protocol,card) \
|
||||
for((card) = protocol_to_pnp_card((protocol)->cards.next); \
|
||||
(card) != protocol_to_pnp_card(&(protocol)->cards); \
|
||||
(card) = protocol_to_pnp_card((card)->protocol_list.next))
|
||||
#define protocol_for_each_dev(protocol,dev) \
|
||||
for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \
|
||||
(dev) != protocol_to_pnp_dev(&(protocol)->devices); \
|
||||
(dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
|
||||
#define protocol_for_each_card(protocol, card) \
|
||||
list_for_each_entry(card, &(protocol)->cards, protocol_list)
|
||||
#define protocol_for_each_dev(protocol, dev) \
|
||||
list_for_each_entry(dev, &(protocol)->devices, protocol_list)
|
||||
|
||||
extern struct bus_type pnp_bus_type;
|
||||
|
||||
|
@ -65,7 +65,7 @@ struct tty_buffer {
|
||||
int read;
|
||||
int flags;
|
||||
/* Data points here */
|
||||
unsigned long data[0];
|
||||
unsigned long data[];
|
||||
};
|
||||
|
||||
/* Values for .flags field of tty_buffer */
|
||||
|
@ -3,6 +3,8 @@
|
||||
#define _LINUX_VIRTIO_NET_H
|
||||
|
||||
#include <linux/if_vlan.h>
|
||||
#include <uapi/linux/tcp.h>
|
||||
#include <uapi/linux/udp.h>
|
||||
#include <uapi/linux/virtio_net.h>
|
||||
|
||||
static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
|
||||
@ -28,17 +30,25 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
|
||||
bool little_endian)
|
||||
{
|
||||
unsigned int gso_type = 0;
|
||||
unsigned int thlen = 0;
|
||||
unsigned int ip_proto;
|
||||
|
||||
if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
|
||||
switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
|
||||
case VIRTIO_NET_HDR_GSO_TCPV4:
|
||||
gso_type = SKB_GSO_TCPV4;
|
||||
ip_proto = IPPROTO_TCP;
|
||||
thlen = sizeof(struct tcphdr);
|
||||
break;
|
||||
case VIRTIO_NET_HDR_GSO_TCPV6:
|
||||
gso_type = SKB_GSO_TCPV6;
|
||||
ip_proto = IPPROTO_TCP;
|
||||
thlen = sizeof(struct tcphdr);
|
||||
break;
|
||||
case VIRTIO_NET_HDR_GSO_UDP:
|
||||
gso_type = SKB_GSO_UDP;
|
||||
ip_proto = IPPROTO_UDP;
|
||||
thlen = sizeof(struct udphdr);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
@ -57,16 +67,20 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
|
||||
|
||||
if (!skb_partial_csum_set(skb, start, off))
|
||||
return -EINVAL;
|
||||
|
||||
if (skb_transport_offset(skb) + thlen > skb_headlen(skb))
|
||||
return -EINVAL;
|
||||
} else {
|
||||
/* gso packets without NEEDS_CSUM do not set transport_offset.
|
||||
* probe and drop if does not match one of the above types.
|
||||
*/
|
||||
if (gso_type && skb->network_header) {
|
||||
struct flow_keys keys;
|
||||
|
||||
if (!skb->protocol)
|
||||
virtio_net_hdr_set_proto(skb, hdr);
|
||||
retry:
|
||||
skb_probe_transport_header(skb, -1);
|
||||
if (!skb_transport_header_was_set(skb)) {
|
||||
if (!skb_flow_dissect_flow_keys(skb, &keys, 0)) {
|
||||
/* UFO does not specify ipv4 or 6: try both */
|
||||
if (gso_type & SKB_GSO_UDP &&
|
||||
skb->protocol == htons(ETH_P_IP)) {
|
||||
@ -75,6 +89,12 @@ retry:
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (keys.control.thoff + thlen > skb_headlen(skb) ||
|
||||
keys.basic.ip_proto != ip_proto)
|
||||
return -EINVAL;
|
||||
|
||||
skb_set_transport_header(skb, keys.control.thoff);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,8 +223,10 @@ struct ipv6_stub {
|
||||
const struct in6_addr *addr);
|
||||
int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex,
|
||||
const struct in6_addr *addr);
|
||||
int (*ipv6_dst_lookup)(struct net *net, struct sock *sk,
|
||||
struct dst_entry **dst, struct flowi6 *fl6);
|
||||
struct dst_entry *(*ipv6_dst_lookup_flow)(struct net *net,
|
||||
const struct sock *sk,
|
||||
struct flowi6 *fl6,
|
||||
const struct in6_addr *final_dst);
|
||||
void (*udpv6_encap_enable)(void);
|
||||
void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr,
|
||||
const struct in6_addr *solicited_addr,
|
||||
|
@ -862,7 +862,7 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk)
|
||||
|
||||
int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
|
||||
struct flowi6 *fl6);
|
||||
struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
|
||||
struct dst_entry *ip6_dst_lookup_flow(struct net *net, const struct sock *sk, struct flowi6 *fl6,
|
||||
const struct in6_addr *final_dst);
|
||||
struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
|
||||
const struct in6_addr *final_dst);
|
||||
|
@ -80,7 +80,7 @@ struct nf_conn {
|
||||
struct hlist_node nat_bysource;
|
||||
#endif
|
||||
/* all members below initialized via memset */
|
||||
u8 __nfct_init_offset[0];
|
||||
struct { } __nfct_init_offset;
|
||||
|
||||
/* If we were expected by an expectation, this will be it */
|
||||
struct nf_conn *master;
|
||||
|
@ -76,6 +76,7 @@ struct snd_rawmidi_runtime {
|
||||
size_t avail_min; /* min avail for wakeup */
|
||||
size_t avail; /* max used buffer for wakeup */
|
||||
size_t xruns; /* over/underruns counter */
|
||||
int buffer_ref; /* buffer reference count */
|
||||
/* misc */
|
||||
spinlock_t lock;
|
||||
wait_queue_head_t sleep;
|
||||
|
@ -730,6 +730,8 @@ asmlinkage __visible void __init start_kernel(void)
|
||||
|
||||
/* Do the rest non-__init'ed, we're now alive */
|
||||
rest_init();
|
||||
|
||||
prevent_tail_call_optimization();
|
||||
}
|
||||
|
||||
/* Call all constructor functions linked into the kernel. */
|
||||
|
12
ipc/util.c
12
ipc/util.c
@ -750,21 +750,21 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
|
||||
total++;
|
||||
}
|
||||
|
||||
*new_pos = pos + 1;
|
||||
ipc = NULL;
|
||||
if (total >= ids->in_use)
|
||||
return NULL;
|
||||
goto out;
|
||||
|
||||
for (; pos < IPCMNI; pos++) {
|
||||
ipc = idr_find(&ids->ipcs_idr, pos);
|
||||
if (ipc != NULL) {
|
||||
rcu_read_lock();
|
||||
ipc_lock_object(ipc);
|
||||
return ipc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Out of range - return NULL to terminate iteration */
|
||||
return NULL;
|
||||
out:
|
||||
*new_pos = pos + 1;
|
||||
return ipc;
|
||||
}
|
||||
|
||||
static void *sysvipc_proc_next(struct seq_file *s, void *it, loff_t *pos)
|
||||
|
@ -348,11 +348,12 @@ static void put_probe_ref(void)
|
||||
|
||||
static void blk_trace_cleanup(struct blk_trace *bt)
|
||||
{
|
||||
synchronize_rcu();
|
||||
blk_trace_free(bt);
|
||||
put_probe_ref();
|
||||
}
|
||||
|
||||
int blk_trace_remove(struct request_queue *q)
|
||||
static int __blk_trace_remove(struct request_queue *q)
|
||||
{
|
||||
struct blk_trace *bt;
|
||||
|
||||
@ -365,6 +366,17 @@ int blk_trace_remove(struct request_queue *q)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int blk_trace_remove(struct request_queue *q)
|
||||
{
|
||||
int ret;
|
||||
|
||||
mutex_lock(&q->blk_trace_mutex);
|
||||
ret = __blk_trace_remove(q);
|
||||
mutex_unlock(&q->blk_trace_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_trace_remove);
|
||||
|
||||
static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
|
||||
@ -565,9 +577,8 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
|
||||
struct block_device *bdev,
|
||||
char __user *arg)
|
||||
static int __blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
|
||||
struct block_device *bdev, char __user *arg)
|
||||
{
|
||||
struct blk_user_trace_setup buts;
|
||||
int ret;
|
||||
@ -581,11 +592,24 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
|
||||
return ret;
|
||||
|
||||
if (copy_to_user(arg, &buts, sizeof(buts))) {
|
||||
blk_trace_remove(q);
|
||||
__blk_trace_remove(q);
|
||||
return -EFAULT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
|
||||
struct block_device *bdev,
|
||||
char __user *arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
mutex_lock(&q->blk_trace_mutex);
|
||||
ret = __blk_trace_setup(q, name, dev, bdev, arg);
|
||||
mutex_unlock(&q->blk_trace_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_trace_setup);
|
||||
|
||||
#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
|
||||
@ -614,7 +638,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
|
||||
return ret;
|
||||
|
||||
if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
|
||||
blk_trace_remove(q);
|
||||
__blk_trace_remove(q);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@ -622,11 +646,13 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
|
||||
}
|
||||
#endif
|
||||
|
||||
int blk_trace_startstop(struct request_queue *q, int start)
|
||||
static int __blk_trace_startstop(struct request_queue *q, int start)
|
||||
{
|
||||
int ret;
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
bt = rcu_dereference_protected(q->blk_trace,
|
||||
lockdep_is_held(&q->blk_trace_mutex));
|
||||
if (bt == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
@ -661,6 +687,17 @@ int blk_trace_startstop(struct request_queue *q, int start)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int blk_trace_startstop(struct request_queue *q, int start)
|
||||
{
|
||||
int ret;
|
||||
|
||||
mutex_lock(&q->blk_trace_mutex);
|
||||
ret = __blk_trace_startstop(q, start);
|
||||
mutex_unlock(&q->blk_trace_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_trace_startstop);
|
||||
|
||||
/*
|
||||
@ -691,7 +728,7 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
|
||||
switch (cmd) {
|
||||
case BLKTRACESETUP:
|
||||
bdevname(bdev, b);
|
||||
ret = blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
|
||||
ret = __blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
|
||||
break;
|
||||
#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
|
||||
case BLKTRACESETUP32:
|
||||
@ -702,10 +739,10 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
|
||||
case BLKTRACESTART:
|
||||
start = 1;
|
||||
case BLKTRACESTOP:
|
||||
ret = blk_trace_startstop(q, start);
|
||||
ret = __blk_trace_startstop(q, start);
|
||||
break;
|
||||
case BLKTRACETEARDOWN:
|
||||
ret = blk_trace_remove(q);
|
||||
ret = __blk_trace_remove(q);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
@ -723,18 +760,24 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
|
||||
**/
|
||||
void blk_trace_shutdown(struct request_queue *q)
|
||||
{
|
||||
if (q->blk_trace) {
|
||||
blk_trace_startstop(q, 0);
|
||||
blk_trace_remove(q);
|
||||
mutex_lock(&q->blk_trace_mutex);
|
||||
if (rcu_dereference_protected(q->blk_trace,
|
||||
lockdep_is_held(&q->blk_trace_mutex))) {
|
||||
__blk_trace_startstop(q, 0);
|
||||
__blk_trace_remove(q);
|
||||
}
|
||||
|
||||
mutex_unlock(&q->blk_trace_mutex);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
static union kernfs_node_id *
|
||||
blk_trace_bio_get_cgid(struct request_queue *q, struct bio *bio)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
/* We don't use the 'bt' value here except as an optimization... */
|
||||
bt = rcu_dereference_protected(q->blk_trace, 1);
|
||||
if (!bt || !(blk_tracer_flags.val & TRACE_BLK_OPT_CGROUP))
|
||||
return NULL;
|
||||
|
||||
@ -779,10 +822,14 @@ static void blk_add_trace_rq(struct request *rq, int error,
|
||||
unsigned int nr_bytes, u32 what,
|
||||
union kernfs_node_id *cgid)
|
||||
{
|
||||
struct blk_trace *bt = rq->q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
if (likely(!bt))
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(rq->q->blk_trace);
|
||||
if (likely(!bt)) {
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
if (blk_rq_is_passthrough(rq))
|
||||
what |= BLK_TC_ACT(BLK_TC_PC);
|
||||
@ -791,6 +838,7 @@ static void blk_add_trace_rq(struct request *rq, int error,
|
||||
|
||||
__blk_add_trace(bt, blk_rq_trace_sector(rq), nr_bytes, req_op(rq),
|
||||
rq->cmd_flags, what, error, 0, NULL, cgid);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static void blk_add_trace_rq_insert(void *ignore,
|
||||
@ -836,13 +884,18 @@ static void blk_add_trace_rq_complete(void *ignore, struct request *rq,
|
||||
static void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
|
||||
u32 what, int error, union kernfs_node_id *cgid)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
if (likely(!bt))
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (likely(!bt)) {
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
__blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size,
|
||||
bio_op(bio), bio->bi_opf, what, error, 0, NULL, cgid);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static void blk_add_trace_bio_bounce(void *ignore,
|
||||
@ -893,11 +946,14 @@ static void blk_add_trace_getrq(void *ignore,
|
||||
blk_add_trace_bio(q, bio, BLK_TA_GETRQ, 0,
|
||||
blk_trace_bio_get_cgid(q, bio));
|
||||
else {
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (bt)
|
||||
__blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_GETRQ, 0, 0,
|
||||
NULL, NULL);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@ -910,27 +966,35 @@ static void blk_add_trace_sleeprq(void *ignore,
|
||||
blk_add_trace_bio(q, bio, BLK_TA_SLEEPRQ, 0,
|
||||
blk_trace_bio_get_cgid(q, bio));
|
||||
else {
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (bt)
|
||||
__blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_SLEEPRQ,
|
||||
0, 0, NULL, NULL);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
static void blk_add_trace_plug(void *ignore, struct request_queue *q)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (bt)
|
||||
__blk_add_trace(bt, 0, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL, NULL);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static void blk_add_trace_unplug(void *ignore, struct request_queue *q,
|
||||
unsigned int depth, bool explicit)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (bt) {
|
||||
__be64 rpdu = cpu_to_be64(depth);
|
||||
u32 what;
|
||||
@ -942,14 +1006,17 @@ static void blk_add_trace_unplug(void *ignore, struct request_queue *q,
|
||||
|
||||
__blk_add_trace(bt, 0, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu, NULL);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static void blk_add_trace_split(void *ignore,
|
||||
struct request_queue *q, struct bio *bio,
|
||||
unsigned int pdu)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (bt) {
|
||||
__be64 rpdu = cpu_to_be64(pdu);
|
||||
|
||||
@ -958,6 +1025,7 @@ static void blk_add_trace_split(void *ignore,
|
||||
BLK_TA_SPLIT, bio->bi_status, sizeof(rpdu),
|
||||
&rpdu, blk_trace_bio_get_cgid(q, bio));
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -977,11 +1045,15 @@ static void blk_add_trace_bio_remap(void *ignore,
|
||||
struct request_queue *q, struct bio *bio,
|
||||
dev_t dev, sector_t from)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
struct blk_io_trace_remap r;
|
||||
|
||||
if (likely(!bt))
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (likely(!bt)) {
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
r.device_from = cpu_to_be32(dev);
|
||||
r.device_to = cpu_to_be32(bio_dev(bio));
|
||||
@ -990,6 +1062,7 @@ static void blk_add_trace_bio_remap(void *ignore,
|
||||
__blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size,
|
||||
bio_op(bio), bio->bi_opf, BLK_TA_REMAP, bio->bi_status,
|
||||
sizeof(r), &r, blk_trace_bio_get_cgid(q, bio));
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1010,11 +1083,15 @@ static void blk_add_trace_rq_remap(void *ignore,
|
||||
struct request *rq, dev_t dev,
|
||||
sector_t from)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
struct blk_io_trace_remap r;
|
||||
|
||||
if (likely(!bt))
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (likely(!bt)) {
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
r.device_from = cpu_to_be32(dev);
|
||||
r.device_to = cpu_to_be32(disk_devt(rq->rq_disk));
|
||||
@ -1023,6 +1100,7 @@ static void blk_add_trace_rq_remap(void *ignore,
|
||||
__blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq),
|
||||
rq_data_dir(rq), 0, BLK_TA_REMAP, 0,
|
||||
sizeof(r), &r, blk_trace_request_get_cgid(q, rq));
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1040,14 +1118,19 @@ void blk_add_driver_data(struct request_queue *q,
|
||||
struct request *rq,
|
||||
void *data, size_t len)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_trace *bt;
|
||||
|
||||
if (likely(!bt))
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (likely(!bt)) {
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
__blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0, 0,
|
||||
BLK_TA_DRV_DATA, 0, len, data,
|
||||
blk_trace_request_get_cgid(q, rq));
|
||||
rcu_read_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_add_driver_data);
|
||||
|
||||
@ -1574,6 +1657,7 @@ static int blk_trace_remove_queue(struct request_queue *q)
|
||||
return -EINVAL;
|
||||
|
||||
put_probe_ref();
|
||||
synchronize_rcu();
|
||||
blk_trace_free(bt);
|
||||
return 0;
|
||||
}
|
||||
@ -1735,6 +1819,7 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
|
||||
struct hd_struct *p = dev_to_part(dev);
|
||||
struct request_queue *q;
|
||||
struct block_device *bdev;
|
||||
struct blk_trace *bt;
|
||||
ssize_t ret = -ENXIO;
|
||||
|
||||
bdev = bdget(part_devt(p));
|
||||
@ -1747,21 +1832,23 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
|
||||
|
||||
mutex_lock(&q->blk_trace_mutex);
|
||||
|
||||
bt = rcu_dereference_protected(q->blk_trace,
|
||||
lockdep_is_held(&q->blk_trace_mutex));
|
||||
if (attr == &dev_attr_enable) {
|
||||
ret = sprintf(buf, "%u\n", !!q->blk_trace);
|
||||
ret = sprintf(buf, "%u\n", !!bt);
|
||||
goto out_unlock_bdev;
|
||||
}
|
||||
|
||||
if (q->blk_trace == NULL)
|
||||
if (bt == NULL)
|
||||
ret = sprintf(buf, "disabled\n");
|
||||
else if (attr == &dev_attr_act_mask)
|
||||
ret = blk_trace_mask2str(buf, q->blk_trace->act_mask);
|
||||
ret = blk_trace_mask2str(buf, bt->act_mask);
|
||||
else if (attr == &dev_attr_pid)
|
||||
ret = sprintf(buf, "%u\n", q->blk_trace->pid);
|
||||
ret = sprintf(buf, "%u\n", bt->pid);
|
||||
else if (attr == &dev_attr_start_lba)
|
||||
ret = sprintf(buf, "%llu\n", q->blk_trace->start_lba);
|
||||
ret = sprintf(buf, "%llu\n", bt->start_lba);
|
||||
else if (attr == &dev_attr_end_lba)
|
||||
ret = sprintf(buf, "%llu\n", q->blk_trace->end_lba);
|
||||
ret = sprintf(buf, "%llu\n", bt->end_lba);
|
||||
|
||||
out_unlock_bdev:
|
||||
mutex_unlock(&q->blk_trace_mutex);
|
||||
@ -1778,6 +1865,7 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
|
||||
struct block_device *bdev;
|
||||
struct request_queue *q;
|
||||
struct hd_struct *p;
|
||||
struct blk_trace *bt;
|
||||
u64 value;
|
||||
ssize_t ret = -EINVAL;
|
||||
|
||||
@ -1808,8 +1896,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
|
||||
|
||||
mutex_lock(&q->blk_trace_mutex);
|
||||
|
||||
bt = rcu_dereference_protected(q->blk_trace,
|
||||
lockdep_is_held(&q->blk_trace_mutex));
|
||||
if (attr == &dev_attr_enable) {
|
||||
if (!!value == !!q->blk_trace) {
|
||||
if (!!value == !!bt) {
|
||||
ret = 0;
|
||||
goto out_unlock_bdev;
|
||||
}
|
||||
@ -1821,18 +1911,21 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
if (q->blk_trace == NULL)
|
||||
if (bt == NULL) {
|
||||
ret = blk_trace_setup_queue(q, bdev);
|
||||
bt = rcu_dereference_protected(q->blk_trace,
|
||||
lockdep_is_held(&q->blk_trace_mutex));
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
if (attr == &dev_attr_act_mask)
|
||||
q->blk_trace->act_mask = value;
|
||||
bt->act_mask = value;
|
||||
else if (attr == &dev_attr_pid)
|
||||
q->blk_trace->pid = value;
|
||||
bt->pid = value;
|
||||
else if (attr == &dev_attr_start_lba)
|
||||
q->blk_trace->start_lba = value;
|
||||
bt->start_lba = value;
|
||||
else if (attr == &dev_attr_end_lba)
|
||||
q->blk_trace->end_lba = value;
|
||||
bt->end_lba = value;
|
||||
}
|
||||
|
||||
out_unlock_bdev:
|
||||
|
@ -7666,6 +7666,19 @@ static int allocate_trace_buffers(struct trace_array *tr, int size)
|
||||
*/
|
||||
allocate_snapshot = false;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Because of some magic with the way alloc_percpu() works on
|
||||
* x86_64, we need to synchronize the pgd of all the tables,
|
||||
* otherwise the trace events that happen in x86_64 page fault
|
||||
* handlers can't cope with accessing the chance that a
|
||||
* alloc_percpu()'d memory might be touched in the page fault trace
|
||||
* event. Oh, and we need to audit all other alloc_percpu() and vmalloc()
|
||||
* calls in tracing, because something might get triggered within a
|
||||
* page fault trace event!
|
||||
*/
|
||||
vmalloc_sync_mappings();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -404,6 +404,11 @@ EXPORT_SYMBOL(call_usermodehelper_setup);
|
||||
* Runs a user-space application. The application is started
|
||||
* asynchronously if wait is not set, and runs as a child of system workqueues.
|
||||
* (ie. it runs with full root capabilities and optimized affinity).
|
||||
*
|
||||
* Note: successful return value does not guarantee the helper was called at
|
||||
* all. You can't rely on sub_info->{init,cleanup} being called even for
|
||||
* UMH_WAIT_* wait modes as STATIC_USERMODEHELPER_PATH="" turns all helpers
|
||||
* into a successful no-op.
|
||||
*/
|
||||
int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
|
||||
{
|
||||
|
@ -1479,6 +1479,7 @@ void set_zone_contiguous(struct zone *zone)
|
||||
if (!__pageblock_pfn_to_page(block_start_pfn,
|
||||
block_end_pfn, zone))
|
||||
return;
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
/* We confirm that there is no hole */
|
||||
|
@ -2129,7 +2129,11 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user)
|
||||
struct shmem_inode_info *info = SHMEM_I(inode);
|
||||
int retval = -ENOMEM;
|
||||
|
||||
spin_lock_irq(&info->lock);
|
||||
/*
|
||||
* What serializes the accesses to info->flags?
|
||||
* ipc_lock_object() when called from shmctl_do_lock(),
|
||||
* no serialization needed when called from shm_destroy().
|
||||
*/
|
||||
if (lock && !(info->flags & VM_LOCKED)) {
|
||||
if (!user_shm_lock(inode->i_size, user))
|
||||
goto out_nomem;
|
||||
@ -2144,7 +2148,6 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user)
|
||||
retval = 0;
|
||||
|
||||
out_nomem:
|
||||
spin_unlock_irq(&info->lock);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -734,7 +734,7 @@ static void batadv_v_ogm_process(const struct sk_buff *skb, int ogm_offset,
|
||||
|
||||
orig_node = batadv_v_ogm_orig_get(bat_priv, ogm_packet->orig);
|
||||
if (!orig_node)
|
||||
return;
|
||||
goto out;
|
||||
|
||||
neigh_node = batadv_neigh_node_get_or_create(orig_node, if_incoming,
|
||||
ethhdr->h_source);
|
||||
|
@ -1017,15 +1017,8 @@ static struct batadv_nc_path *batadv_nc_get_path(struct batadv_priv *bat_priv,
|
||||
*/
|
||||
static u8 batadv_nc_random_weight_tq(u8 tq)
|
||||
{
|
||||
u8 rand_val, rand_tq;
|
||||
|
||||
get_random_bytes(&rand_val, sizeof(rand_val));
|
||||
|
||||
/* randomize the estimated packet loss (max TQ - estimated TQ) */
|
||||
rand_tq = rand_val * (BATADV_TQ_MAX_VALUE - tq);
|
||||
|
||||
/* normalize the randomized packet loss */
|
||||
rand_tq /= BATADV_TQ_MAX_VALUE;
|
||||
u8 rand_tq = prandom_u32_max(BATADV_TQ_MAX_VALUE + 1 - tq);
|
||||
|
||||
/* convert to (randomized) estimated tq again */
|
||||
return BATADV_TQ_MAX_VALUE - rand_tq;
|
||||
|
@ -1081,7 +1081,7 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj,
|
||||
ret = batadv_parse_throughput(net_dev, buff, "throughput_override",
|
||||
&tp_override);
|
||||
if (!ret)
|
||||
return count;
|
||||
goto out;
|
||||
|
||||
old_tp_override = atomic_read(&hard_iface->bat_v.throughput_override);
|
||||
if (old_tp_override == tp_override)
|
||||
@ -1114,6 +1114,7 @@ static ssize_t batadv_show_throughput_override(struct kobject *kobj,
|
||||
|
||||
tp_override = atomic_read(&hard_iface->bat_v.throughput_override);
|
||||
|
||||
batadv_hardif_put(hard_iface);
|
||||
return sprintf(buff, "%u.%u MBit\n", tp_override / 10,
|
||||
tp_override % 10);
|
||||
}
|
||||
|
@ -7282,11 +7282,13 @@ static void netdev_sync_lower_features(struct net_device *upper,
|
||||
netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n",
|
||||
&feature, lower->name);
|
||||
lower->wanted_features &= ~feature;
|
||||
netdev_update_features(lower);
|
||||
__netdev_update_features(lower);
|
||||
|
||||
if (unlikely(lower->features & feature))
|
||||
netdev_WARN(upper, "failed to disable %pNF on %s!\n",
|
||||
&feature, lower->name);
|
||||
else
|
||||
netdev_features_change(lower);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ static void sched_send_work(unsigned long _data)
|
||||
static void trace_drop_common(struct sk_buff *skb, void *location)
|
||||
{
|
||||
struct net_dm_alert_msg *msg;
|
||||
struct net_dm_drop_point *point;
|
||||
struct nlmsghdr *nlh;
|
||||
struct nlattr *nla;
|
||||
int i;
|
||||
@ -172,11 +173,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
|
||||
nlh = (struct nlmsghdr *)dskb->data;
|
||||
nla = genlmsg_data(nlmsg_data(nlh));
|
||||
msg = nla_data(nla);
|
||||
point = msg->points;
|
||||
for (i = 0; i < msg->entries; i++) {
|
||||
if (!memcmp(&location, msg->points[i].pc, sizeof(void *))) {
|
||||
msg->points[i].count++;
|
||||
if (!memcmp(&location, &point->pc, sizeof(void *))) {
|
||||
point->count++;
|
||||
goto out;
|
||||
}
|
||||
point++;
|
||||
}
|
||||
if (msg->entries == dm_hit_limit)
|
||||
goto out;
|
||||
@ -185,8 +188,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
|
||||
*/
|
||||
__nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
|
||||
nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
|
||||
memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
|
||||
msg->points[msg->entries].count = 1;
|
||||
memcpy(point->pc, &location, sizeof(void *));
|
||||
point->count = 1;
|
||||
msg->entries++;
|
||||
|
||||
if (!timer_pending(&data->send_timer)) {
|
||||
|
@ -241,6 +241,8 @@ static void net_prio_attach(struct cgroup_taskset *tset)
|
||||
struct task_struct *p;
|
||||
struct cgroup_subsys_state *css;
|
||||
|
||||
cgroup_sk_alloc_disable();
|
||||
|
||||
cgroup_taskset_for_each(p, css, tset) {
|
||||
void *v = (void *)(unsigned long)css->cgroup->id;
|
||||
|
||||
|
@ -211,7 +211,7 @@ static int dccp_v6_send_response(const struct sock *sk, struct request_sock *req
|
||||
final_p = fl6_update_dst(&fl6, rcu_dereference(np->opt), &final);
|
||||
rcu_read_unlock();
|
||||
|
||||
dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
|
||||
dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
|
||||
if (IS_ERR(dst)) {
|
||||
err = PTR_ERR(dst);
|
||||
dst = NULL;
|
||||
@ -282,7 +282,7 @@ static void dccp_v6_ctl_send_reset(const struct sock *sk, struct sk_buff *rxskb)
|
||||
security_skb_classify_flow(rxskb, flowi6_to_flowi(&fl6));
|
||||
|
||||
/* sk = NULL, but it is safe for now. RST socket required. */
|
||||
dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL);
|
||||
dst = ip6_dst_lookup_flow(sock_net(ctl_sk), ctl_sk, &fl6, NULL);
|
||||
if (!IS_ERR(dst)) {
|
||||
skb_dst_set(skb, dst);
|
||||
ip6_xmit(ctl_sk, skb, &fl6, 0, NULL, 0);
|
||||
@ -912,7 +912,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
|
||||
opt = rcu_dereference_protected(np->opt, lockdep_sock_is_held(sk));
|
||||
final_p = fl6_update_dst(&fl6, opt, &final);
|
||||
|
||||
dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
|
||||
dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
|
||||
if (IS_ERR(dst)) {
|
||||
err = PTR_ERR(dst);
|
||||
goto failure;
|
||||
|
@ -1272,7 +1272,8 @@ static int cipso_v4_parsetag_rbm(const struct cipso_v4_doi *doi_def,
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
secattr->flags |= NETLBL_SECATTR_MLS_CAT;
|
||||
if (secattr->attr.mls.cat)
|
||||
secattr->flags |= NETLBL_SECATTR_MLS_CAT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -1453,7 +1454,8 @@ static int cipso_v4_parsetag_rng(const struct cipso_v4_doi *doi_def,
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
secattr->flags |= NETLBL_SECATTR_MLS_CAT;
|
||||
if (secattr->attr.mls.cat)
|
||||
secattr->flags |= NETLBL_SECATTR_MLS_CAT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -921,7 +921,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)
|
||||
/* Check for load limit; set rate_last to the latest sent
|
||||
* redirect.
|
||||
*/
|
||||
if (peer->rate_tokens == 0 ||
|
||||
if (peer->n_redirects == 0 ||
|
||||
time_after(jiffies,
|
||||
(peer->rate_last +
|
||||
(ip_rt_redirect_load << peer->n_redirects)))) {
|
||||
|
@ -1977,13 +1977,15 @@ skip_copy:
|
||||
tp->urg_data = 0;
|
||||
tcp_fast_path_check(sk);
|
||||
}
|
||||
if (used + offset < skb->len)
|
||||
continue;
|
||||
|
||||
if (TCP_SKB_CB(skb)->has_rxtstamp) {
|
||||
tcp_update_recv_tstamps(skb, &tss);
|
||||
has_tss = true;
|
||||
}
|
||||
|
||||
if (used + offset < skb->len)
|
||||
continue;
|
||||
|
||||
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
|
||||
goto found_fin_ok;
|
||||
if (!(flags & MSG_PEEK))
|
||||
|
@ -126,15 +126,16 @@ int inet6addr_validator_notifier_call_chain(unsigned long val, void *v)
|
||||
}
|
||||
EXPORT_SYMBOL(inet6addr_validator_notifier_call_chain);
|
||||
|
||||
static int eafnosupport_ipv6_dst_lookup(struct net *net, struct sock *u1,
|
||||
struct dst_entry **u2,
|
||||
struct flowi6 *u3)
|
||||
static struct dst_entry *eafnosupport_ipv6_dst_lookup_flow(struct net *net,
|
||||
const struct sock *sk,
|
||||
struct flowi6 *fl6,
|
||||
const struct in6_addr *final_dst)
|
||||
{
|
||||
return -EAFNOSUPPORT;
|
||||
return ERR_PTR(-EAFNOSUPPORT);
|
||||
}
|
||||
|
||||
const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
|
||||
.ipv6_dst_lookup = eafnosupport_ipv6_dst_lookup,
|
||||
.ipv6_dst_lookup_flow = eafnosupport_ipv6_dst_lookup_flow,
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(ipv6_stub);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user