Merge 4.19.196 into android-4.19-stable
Changes in 4.19.196 net: ieee802154: fix null deref in parse dev addr HID: quirks: Set INCREMENT_USAGE_ON_DUPLICATE for Saitek X65 HID: hid-sensor-hub: Return error for hid_set_field() failure HID: Add BUS_VIRTUAL to hid_connect logging HID: usbhid: fix info leak in hid_submit_ctrl ARM: OMAP2+: Fix build warning when mmc_omap is not built gfs2: Prevent direct-I/O write fallback errors from getting lost HID: gt683r: add missing MODULE_DEVICE_TABLE gfs2: Fix use-after-free in gfs2_glock_shrink_scan scsi: target: core: Fix warning on realtime kernels ethernet: myri10ge: Fix missing error code in myri10ge_probe() scsi: scsi_devinfo: Add blacklist entry for HPE OPEN-V nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues() nvme-loop: clear NVME_LOOP_Q_LIVE when nvme_loop_configure_admin_queue() fails nvme-loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue() net: ipconfig: Don't override command-line hostnames or domains rtnetlink: Fix missing error code in rtnl_bridge_notify() net/x25: Return the correct errno code net: Return the correct errno code fib: Return the correct errno code dmaengine: ALTERA_MSGDMA depends on HAS_IOMEM dmaengine: QCOM_HIDMA_MGMT depends on HAS_IOMEM dmaengine: stedma40: add missing iounmap() on error in d40_probe() afs: Fix an IS_ERR() vs NULL check mm/memory-failure: make sure wait for page writeback in memory_failure batman-adv: Avoid WARN_ON timing related checks net: ipv4: fix memory leak in netlbl_cipsov4_add_std net: rds: fix memory leak in rds_recvmsg udp: fix race between close() and udp_abort() rtnetlink: Fix regression in bridge VLAN configuration net/mlx5e: Remove dependency in IPsec initialization flows net/mlx5e: Block offload of outer header csum for UDP tunnels netfilter: synproxy: Fix out of bounds when parsing TCP options sch_cake: Fix out of bounds when parsing TCP options and header alx: Fix an error handling path in 'alx_probe()' net: stmmac: dwmac1000: Fix extended MAC address registers definition net: add documentation to socket.c net: make get_net_ns return error if NET_NS is disabled qlcnic: Fix an error handling path in 'qlcnic_probe()' netxen_nic: Fix an error handling path in 'netxen_nic_probe()' net: qrtr: fix OOB Read in qrtr_endpoint_post ptp: ptp_clock: Publish scaled_ppm_to_ppb ptp: improve max_adj check against unreasonable values net: cdc_ncm: switch to eth%d interface naming net: usb: fix possible use-after-free in smsc75xx_bind net: fec_ptp: fix issue caused by refactor the fec_devtype net: ipv4: fix memory leak in ip_mc_add1_src net/af_unix: fix a data-race in unix_dgram_sendmsg / unix_release_sock be2net: Fix an error handling path in 'be_probe()' net: hamradio: fix memory leak in mkiss_close net: cdc_eem: fix tx fixup skb leak icmp: don't send out ICMP messages with a source address of 0.0.0.0 net: ethernet: fix potential use-after-free in ec_bhf_remove ASoC: rt5659: Fix the lost powers for the HDA header pinctrl: ralink: rt2880: avoid to error in calls is pin is already enabled radeon: use memcpy_to/fromio for UVD fw upload hwmon: (scpi-hwmon) shows the negative temperature properly can: bcm: fix infoleak in struct bcm_msg_head can: mcba_usb: fix memory leak in mcba_usb usb: core: hub: Disable autosuspend for Cypress CY7C65632 tracing: Do not stop recording cmdlines when tracing is off tracing: Do not stop recording comms if the trace file is being read tracing: Do no increment trace_clock_global() by one PCI: Mark TI C667X to avoid bus reset PCI: Mark some NVIDIA GPUs to avoid bus reset PCI: Add ACS quirk for Broadcom BCM57414 NIC PCI: Work around Huawei Intelligent NIC VF FLR erratum ARCv2: save ABI registers across signal handling dmaengine: pl330: fix wrong usage of spinlock flags in dma_cyclc cfg80211: make certificate generation more robust net: bridge: fix vlan tunnel dst null pointer dereference net: bridge: fix vlan tunnel dst refcnt when egressing mm/slub: clarify verification reporting mm/slub.c: include swab.h net: fec_ptp: add clock rate zero check tools headers UAPI: Sync linux/in.h copy with the kernel sources KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read can: bcm/raw/isotp: use per module netdevice notifier inet: use bigger hash table for IP ID generation usb: dwc3: debugfs: Add and remove endpoint dirs dynamically usb: dwc3: core: fix kernel panic when do reboot x86/fpu: Reset state for all signal restore failures module: limit enabling module.sig_enforce drm/nouveau: wait for moving fence after pinning v2 drm/radeon: wait for moving fence after pinning ARM: 9081/1: fix gcc-10 thumb2-kernel regression Makefile: Move -Wno-unused-but-set-variable out of GCC only block MIPS: generic: Update node names to avoid unit addresses Revert "PCI: PM: Do not read power state in pci_enable_device_flags()" mac80211: remove warning in ieee80211_get_sband() cfg80211: call cfg80211_leave_ocb when switching away from OCB mac80211: drop multicast fragments net: ethtool: clear heap allocations for ethtool function ping: Check return value of function 'ping_queue_rcv_skb' inet: annotate date races around sk->sk_txhash net: caif: fix memory leak in ldisc_open net/packet: annotate accesses to po->bind net/packet: annotate accesses to po->ifindex r8152: Avoid memcpy() over-reading of ETH_SS_STATS sh_eth: Avoid memcpy() over-reading of ETH_SS_STATS r8169: Avoid memcpy() over-reading of ETH_SS_STATS KVM: selftests: Fix kvm_check_cap() assertion net: qed: Fix memcpy() overflow of qed_dcbx_params() PCI: Add AMD RS690 quirk to enable 64-bit DMA net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY pinctrl: stm32: fix the reported number of GPIO lines per bank nilfs2: fix memory leak in nilfs_sysfs_delete_device_group i2c: robotfuzz-osif: fix control-request directions Linux 4.19.196 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I50d641505bc18d2dc4b4131643de3bfd8e8a8e6e
This commit is contained in:
@@ -154,7 +154,7 @@ SLUB Debug output
|
||||
Here is a sample of slub debug output::
|
||||
|
||||
====================================================================
|
||||
BUG kmalloc-8: Redzone overwritten
|
||||
BUG kmalloc-8: Right Redzone overwritten
|
||||
--------------------------------------------------------------------
|
||||
|
||||
INFO: 0xc90f6d28-0xc90f6d2b. First byte 0x00 instead of 0xcc
|
||||
@@ -162,10 +162,10 @@ Here is a sample of slub debug output::
|
||||
INFO: Object 0xc90f6d20 @offset=3360 fp=0xc90f6d58
|
||||
INFO: Allocated in get_modalias+0x61/0xf5 age=53 cpu=1 pid=554
|
||||
|
||||
Bytes b4 0xc90f6d10: 00 00 00 00 00 00 00 00 5a 5a 5a 5a 5a 5a 5a 5a ........ZZZZZZZZ
|
||||
Object 0xc90f6d20: 31 30 31 39 2e 30 30 35 1019.005
|
||||
Redzone 0xc90f6d28: 00 cc cc cc .
|
||||
Padding 0xc90f6d50: 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZ
|
||||
Bytes b4 (0xc90f6d10): 00 00 00 00 00 00 00 00 5a 5a 5a 5a 5a 5a 5a 5a ........ZZZZZZZZ
|
||||
Object (0xc90f6d20): 31 30 31 39 2e 30 30 35 1019.005
|
||||
Redzone (0xc90f6d28): 00 cc cc cc .
|
||||
Padding (0xc90f6d50): 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZ
|
||||
|
||||
[<c010523d>] dump_trace+0x63/0x1eb
|
||||
[<c01053df>] show_trace_log_lvl+0x1a/0x2f
|
||||
|
||||
5
Makefile
5
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 195
|
||||
SUBLEVEL = 196
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
@@ -732,12 +732,11 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
|
||||
# See modpost pattern 2
|
||||
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
|
||||
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
|
||||
else
|
||||
endif
|
||||
|
||||
# These warnings generated too much noise in a regular build.
|
||||
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
|
||||
endif
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
|
||||
ifdef CONFIG_FRAME_POINTER
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
struct sigcontext {
|
||||
struct user_regs_struct regs;
|
||||
struct user_regs_arcv2 v2abi;
|
||||
};
|
||||
|
||||
#endif /* _ASM_ARC_SIGCONTEXT_H */
|
||||
|
||||
@@ -64,6 +64,41 @@ struct rt_sigframe {
|
||||
unsigned int sigret_magic;
|
||||
};
|
||||
|
||||
static int save_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
|
||||
{
|
||||
int err = 0;
|
||||
#ifndef CONFIG_ISA_ARCOMPACT
|
||||
struct user_regs_arcv2 v2abi;
|
||||
|
||||
v2abi.r30 = regs->r30;
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
v2abi.r58 = regs->r58;
|
||||
v2abi.r59 = regs->r59;
|
||||
#else
|
||||
v2abi.r58 = v2abi.r59 = 0;
|
||||
#endif
|
||||
err = __copy_to_user(&mctx->v2abi, &v2abi, sizeof(v2abi));
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
||||
static int restore_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
|
||||
{
|
||||
int err = 0;
|
||||
#ifndef CONFIG_ISA_ARCOMPACT
|
||||
struct user_regs_arcv2 v2abi;
|
||||
|
||||
err = __copy_from_user(&v2abi, &mctx->v2abi, sizeof(v2abi));
|
||||
|
||||
regs->r30 = v2abi.r30;
|
||||
#ifdef CONFIG_ARC_HAS_ACCL_REGS
|
||||
regs->r58 = v2abi.r58;
|
||||
regs->r59 = v2abi.r59;
|
||||
#endif
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
|
||||
sigset_t *set)
|
||||
@@ -97,6 +132,10 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
|
||||
|
||||
err = __copy_to_user(&(sf->uc.uc_mcontext.regs.scratch), &uregs.scratch,
|
||||
sizeof(sf->uc.uc_mcontext.regs.scratch));
|
||||
|
||||
if (is_isa_arcv2())
|
||||
err |= save_arcv2_regs(&(sf->uc.uc_mcontext), regs);
|
||||
|
||||
err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
|
||||
|
||||
return err ? -EFAULT : 0;
|
||||
@@ -112,6 +151,10 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
|
||||
err |= __copy_from_user(&uregs.scratch,
|
||||
&(sf->uc.uc_mcontext.regs.scratch),
|
||||
sizeof(sf->uc.uc_mcontext.regs.scratch));
|
||||
|
||||
if (is_isa_arcv2())
|
||||
err |= restore_arcv2_regs(&(sf->uc.uc_mcontext), regs);
|
||||
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
|
||||
|
||||
@@ -558,9 +558,11 @@ void notrace cpu_init(void)
|
||||
* In Thumb-2, msr with an immediate value is not allowed.
|
||||
*/
|
||||
#ifdef CONFIG_THUMB2_KERNEL
|
||||
#define PLC "r"
|
||||
#define PLC_l "l"
|
||||
#define PLC_r "r"
|
||||
#else
|
||||
#define PLC "I"
|
||||
#define PLC_l "I"
|
||||
#define PLC_r "I"
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -582,15 +584,15 @@ void notrace cpu_init(void)
|
||||
"msr cpsr_c, %9"
|
||||
:
|
||||
: "r" (stk),
|
||||
PLC (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
|
||||
PLC_r (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
|
||||
"I" (offsetof(struct stack, irq[0])),
|
||||
PLC (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
|
||||
PLC_r (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
|
||||
"I" (offsetof(struct stack, abt[0])),
|
||||
PLC (PSR_F_BIT | PSR_I_BIT | UND_MODE),
|
||||
PLC_r (PSR_F_BIT | PSR_I_BIT | UND_MODE),
|
||||
"I" (offsetof(struct stack, und[0])),
|
||||
PLC (PSR_F_BIT | PSR_I_BIT | FIQ_MODE),
|
||||
PLC_r (PSR_F_BIT | PSR_I_BIT | FIQ_MODE),
|
||||
"I" (offsetof(struct stack, fiq[0])),
|
||||
PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
|
||||
PLC_l (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
|
||||
: "r14");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -325,6 +325,7 @@ static int n8x0_mmc_get_cover_state(struct device *dev, int slot)
|
||||
|
||||
static void n8x0_mmc_callback(void *data, u8 card_mask)
|
||||
{
|
||||
#ifdef CONFIG_MMC_OMAP
|
||||
int bit, *openp, index;
|
||||
|
||||
if (board_is_n800()) {
|
||||
@@ -342,7 +343,6 @@ static void n8x0_mmc_callback(void *data, u8 card_mask)
|
||||
else
|
||||
*openp = 0;
|
||||
|
||||
#ifdef CONFIG_MMC_OMAP
|
||||
omap_mmc_notify_cover_event(mmc_device, index, *openp);
|
||||
#else
|
||||
pr_warn("MMC: notify cover event not available\n");
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/ {
|
||||
images {
|
||||
fdt@boston {
|
||||
fdt-boston {
|
||||
description = "img,boston Device Tree";
|
||||
data = /incbin/("boot/dts/img/boston.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "mips";
|
||||
compression = "none";
|
||||
hash@0 {
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
conf@boston {
|
||||
conf-boston {
|
||||
description = "Boston Linux kernel";
|
||||
kernel = "kernel@0";
|
||||
fdt = "fdt@boston";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-boston";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/ {
|
||||
images {
|
||||
fdt@ni169445 {
|
||||
fdt-ni169445 {
|
||||
description = "NI 169445 device tree";
|
||||
data = /incbin/("boot/dts/ni/169445.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "mips";
|
||||
compression = "none";
|
||||
hash@0 {
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
conf@ni169445 {
|
||||
conf-ni169445 {
|
||||
description = "NI 169445 Linux Kernel";
|
||||
kernel = "kernel@0";
|
||||
fdt = "fdt@ni169445";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-ni169445";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/ {
|
||||
images {
|
||||
fdt@xilfpga {
|
||||
fdt-xilfpga {
|
||||
description = "MIPSfpga (xilfpga) Device Tree";
|
||||
data = /incbin/("boot/dts/xilfpga/nexys4ddr.dtb");
|
||||
type = "flat_dt";
|
||||
arch = "mips";
|
||||
compression = "none";
|
||||
hash@0 {
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
conf@xilfpga {
|
||||
conf-xilfpga {
|
||||
description = "MIPSfpga Linux kernel";
|
||||
kernel = "kernel@0";
|
||||
fdt = "fdt@xilfpga";
|
||||
kernel = "kernel";
|
||||
fdt = "fdt-xilfpga";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#address-cells = <ADDR_CELLS>;
|
||||
|
||||
images {
|
||||
kernel@0 {
|
||||
kernel {
|
||||
description = KERNEL_NAME;
|
||||
data = /incbin/(VMLINUX_BINARY);
|
||||
type = "kernel";
|
||||
@@ -15,18 +15,18 @@
|
||||
compression = VMLINUX_COMPRESSION;
|
||||
load = /bits/ ADDR_BITS <VMLINUX_LOAD_ADDRESS>;
|
||||
entry = /bits/ ADDR_BITS <VMLINUX_ENTRY_ADDRESS>;
|
||||
hash@0 {
|
||||
hash {
|
||||
algo = "sha1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf@default";
|
||||
default = "conf-default";
|
||||
|
||||
conf@default {
|
||||
conf-default {
|
||||
description = "Generic Linux kernel";
|
||||
kernel = "kernel@0";
|
||||
kernel = "kernel";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -272,6 +272,7 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
|
||||
int state_size = fpu_kernel_xstate_size;
|
||||
u64 xfeatures = 0;
|
||||
int fx_only = 0;
|
||||
int ret = 0;
|
||||
|
||||
ia32_fxstate &= (IS_ENABLED(CONFIG_X86_32) ||
|
||||
IS_ENABLED(CONFIG_IA32_EMULATION));
|
||||
@@ -281,15 +282,21 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!access_ok(VERIFY_READ, buf, size))
|
||||
return -EACCES;
|
||||
if (!access_ok(VERIFY_READ, buf, size)) {
|
||||
ret = -EACCES;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
fpu__initialize(fpu);
|
||||
|
||||
if (!static_cpu_has(X86_FEATURE_FPU))
|
||||
return fpregs_soft_set(current, NULL,
|
||||
0, sizeof(struct user_i387_ia32_struct),
|
||||
NULL, buf) != 0;
|
||||
if (!static_cpu_has(X86_FEATURE_FPU)) {
|
||||
ret = fpregs_soft_set(current, NULL,
|
||||
0, sizeof(struct user_i387_ia32_struct),
|
||||
NULL, buf) != 0;
|
||||
if (ret)
|
||||
goto out_err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (use_xsave()) {
|
||||
struct _fpx_sw_bytes fx_sw_user;
|
||||
@@ -349,6 +356,7 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
|
||||
fpu__restore(fpu);
|
||||
local_bh_enable();
|
||||
|
||||
/* Failure is already handled */
|
||||
return err;
|
||||
} else {
|
||||
/*
|
||||
@@ -356,13 +364,14 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
|
||||
* state to the registers directly (with exceptions handled).
|
||||
*/
|
||||
user_fpu_begin();
|
||||
if (copy_user_to_fpregs_zeroing(buf_fx, xfeatures, fx_only)) {
|
||||
fpu__clear(fpu);
|
||||
return -1;
|
||||
}
|
||||
if (!copy_user_to_fpregs_zeroing(buf_fx, xfeatures, fx_only))
|
||||
return 0;
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
out_err:
|
||||
fpu__clear(fpu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int xstate_sigframe_size(void)
|
||||
|
||||
@@ -779,4 +779,48 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, 0x1571, pci_amd_enable_64bit_bar);
|
||||
DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, 0x15b1, pci_amd_enable_64bit_bar);
|
||||
DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD, 0x1601, pci_amd_enable_64bit_bar);
|
||||
|
||||
#define RS690_LOWER_TOP_OF_DRAM2 0x30
|
||||
#define RS690_LOWER_TOP_OF_DRAM2_VALID 0x1
|
||||
#define RS690_UPPER_TOP_OF_DRAM2 0x31
|
||||
#define RS690_HTIU_NB_INDEX 0xA8
|
||||
#define RS690_HTIU_NB_INDEX_WR_ENABLE 0x100
|
||||
#define RS690_HTIU_NB_DATA 0xAC
|
||||
|
||||
/*
|
||||
* Some BIOS implementations support RAM above 4GB, but do not configure the
|
||||
* PCI host to respond to bus master accesses for these addresses. These
|
||||
* implementations set the TOP_OF_DRAM_SLOT1 register correctly, so PCI DMA
|
||||
* works as expected for addresses below 4GB.
|
||||
*
|
||||
* Reference: "AMD RS690 ASIC Family Register Reference Guide" (pg. 2-57)
|
||||
* https://www.amd.com/system/files/TechDocs/43372_rs690_rrg_3.00o.pdf
|
||||
*/
|
||||
static void rs690_fix_64bit_dma(struct pci_dev *pdev)
|
||||
{
|
||||
u32 val = 0;
|
||||
phys_addr_t top_of_dram = __pa(high_memory - 1) + 1;
|
||||
|
||||
if (top_of_dram <= (1ULL << 32))
|
||||
return;
|
||||
|
||||
pci_write_config_dword(pdev, RS690_HTIU_NB_INDEX,
|
||||
RS690_LOWER_TOP_OF_DRAM2);
|
||||
pci_read_config_dword(pdev, RS690_HTIU_NB_DATA, &val);
|
||||
|
||||
if (val)
|
||||
return;
|
||||
|
||||
pci_info(pdev, "Adjusting top of DRAM to %pa for 64-bit DMA support\n", &top_of_dram);
|
||||
|
||||
pci_write_config_dword(pdev, RS690_HTIU_NB_INDEX,
|
||||
RS690_UPPER_TOP_OF_DRAM2 | RS690_HTIU_NB_INDEX_WR_ENABLE);
|
||||
pci_write_config_dword(pdev, RS690_HTIU_NB_DATA, top_of_dram >> 32);
|
||||
|
||||
pci_write_config_dword(pdev, RS690_HTIU_NB_INDEX,
|
||||
RS690_LOWER_TOP_OF_DRAM2 | RS690_HTIU_NB_INDEX_WR_ENABLE);
|
||||
pci_write_config_dword(pdev, RS690_HTIU_NB_DATA,
|
||||
top_of_dram | RS690_LOWER_TOP_OF_DRAM2_VALID);
|
||||
}
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7910, rs690_fix_64bit_dma);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,6 +58,7 @@ config DMA_OF
|
||||
#devices
|
||||
config ALTERA_MSGDMA
|
||||
tristate "Altera / Intel mSGDMA Engine"
|
||||
depends on HAS_IOMEM
|
||||
select DMA_ENGINE
|
||||
help
|
||||
Enable support for Altera / Intel mSGDMA controller.
|
||||
|
||||
@@ -2671,13 +2671,15 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
for (i = 0; i < len / period_len; i++) {
|
||||
desc = pl330_get_desc(pch);
|
||||
if (!desc) {
|
||||
unsigned long iflags;
|
||||
|
||||
dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n",
|
||||
__func__, __LINE__);
|
||||
|
||||
if (!first)
|
||||
return NULL;
|
||||
|
||||
spin_lock_irqsave(&pl330->pool_lock, flags);
|
||||
spin_lock_irqsave(&pl330->pool_lock, iflags);
|
||||
|
||||
while (!list_empty(&first->node)) {
|
||||
desc = list_entry(first->node.next,
|
||||
@@ -2687,7 +2689,7 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
|
||||
|
||||
list_move_tail(&first->node, &pl330->desc_pool);
|
||||
|
||||
spin_unlock_irqrestore(&pl330->pool_lock, flags);
|
||||
spin_unlock_irqrestore(&pl330->pool_lock, iflags);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ config QCOM_BAM_DMA
|
||||
|
||||
config QCOM_HIDMA_MGMT
|
||||
tristate "Qualcomm Technologies HIDMA Management support"
|
||||
depends on HAS_IOMEM
|
||||
select DMA_ENGINE
|
||||
help
|
||||
Enable support for the Qualcomm Technologies HIDMA Management.
|
||||
|
||||
@@ -3663,6 +3663,9 @@ static int __init d40_probe(struct platform_device *pdev)
|
||||
|
||||
kfree(base->lcla_pool.base_unaligned);
|
||||
|
||||
if (base->lcpa_base)
|
||||
iounmap(base->lcpa_base);
|
||||
|
||||
if (base->phy_lcpa)
|
||||
release_mem_region(base->phy_lcpa,
|
||||
base->lcpa_size);
|
||||
|
||||
@@ -98,7 +98,22 @@ int nouveau_gem_prime_pin(struct drm_gem_object *obj)
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
ret = ttm_bo_reserve(&nvbo->bo, false, false, NULL);
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
if (nvbo->bo.moving)
|
||||
ret = dma_fence_wait(nvbo->bo.moving, true);
|
||||
|
||||
ttm_bo_unreserve(&nvbo->bo);
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
return ret;
|
||||
|
||||
error:
|
||||
nouveau_bo_unpin(nvbo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void nouveau_gem_prime_unpin(struct drm_gem_object *obj)
|
||||
|
||||
@@ -92,9 +92,19 @@ int radeon_gem_prime_pin(struct drm_gem_object *obj)
|
||||
|
||||
/* pin buffer into GTT */
|
||||
ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL);
|
||||
if (likely(ret == 0))
|
||||
bo->prime_shared_count++;
|
||||
if (unlikely(ret))
|
||||
goto error;
|
||||
|
||||
if (bo->tbo.moving) {
|
||||
ret = dma_fence_wait(bo->tbo.moving, false);
|
||||
if (unlikely(ret)) {
|
||||
radeon_bo_unpin(bo);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
bo->prime_shared_count++;
|
||||
error:
|
||||
radeon_bo_unreserve(bo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ int radeon_uvd_resume(struct radeon_device *rdev)
|
||||
if (rdev->uvd.vcpu_bo == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(rdev->uvd.cpu_addr, rdev->uvd_fw->data, rdev->uvd_fw->size);
|
||||
memcpy_toio((void __iomem *)rdev->uvd.cpu_addr, rdev->uvd_fw->data, rdev->uvd_fw->size);
|
||||
|
||||
size = radeon_bo_size(rdev->uvd.vcpu_bo);
|
||||
size -= rdev->uvd_fw->size;
|
||||
@@ -294,7 +294,7 @@ int radeon_uvd_resume(struct radeon_device *rdev)
|
||||
ptr = rdev->uvd.cpu_addr;
|
||||
ptr += rdev->uvd_fw->size;
|
||||
|
||||
memset(ptr, 0, size);
|
||||
memset_io((void __iomem *)ptr, 0, size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1823,6 +1823,9 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
|
||||
case BUS_I2C:
|
||||
bus = "I2C";
|
||||
break;
|
||||
case BUS_VIRTUAL:
|
||||
bus = "VIRTUAL";
|
||||
break;
|
||||
default:
|
||||
bus = "<UNKNOWN>";
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ static const struct hid_device_id gt683r_led_id[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(hid, gt683r_led_id);
|
||||
|
||||
static void gt683r_brightness_set(struct led_classdev *led_cdev,
|
||||
enum led_brightness brightness)
|
||||
|
||||
@@ -1002,6 +1002,7 @@
|
||||
#define USB_DEVICE_ID_SAITEK_X52 0x075c
|
||||
#define USB_DEVICE_ID_SAITEK_X52_2 0x0255
|
||||
#define USB_DEVICE_ID_SAITEK_X52_PRO 0x0762
|
||||
#define USB_DEVICE_ID_SAITEK_X65 0x0b6a
|
||||
|
||||
#define USB_VENDOR_ID_SAMSUNG 0x0419
|
||||
#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
|
||||
|
||||
@@ -155,6 +155,7 @@ static const struct hid_device_id hid_quirks[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52_2), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52_PRO), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X65), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD2), HID_QUIRK_NO_INIT_REPORTS },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD), HID_QUIRK_NO_INIT_REPORTS },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB), HID_QUIRK_NOGET },
|
||||
|
||||
@@ -223,16 +223,21 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
|
||||
buffer_size = buffer_size / sizeof(__s32);
|
||||
if (buffer_size) {
|
||||
for (i = 0; i < buffer_size; ++i) {
|
||||
hid_set_field(report->field[field_index], i,
|
||||
(__force __s32)cpu_to_le32(*buf32));
|
||||
ret = hid_set_field(report->field[field_index], i,
|
||||
(__force __s32)cpu_to_le32(*buf32));
|
||||
if (ret)
|
||||
goto done_proc;
|
||||
|
||||
++buf32;
|
||||
}
|
||||
}
|
||||
if (remaining_bytes) {
|
||||
value = 0;
|
||||
memcpy(&value, (u8 *)buf32, remaining_bytes);
|
||||
hid_set_field(report->field[field_index], i,
|
||||
(__force __s32)cpu_to_le32(value));
|
||||
ret = hid_set_field(report->field[field_index], i,
|
||||
(__force __s32)cpu_to_le32(value));
|
||||
if (ret)
|
||||
goto done_proc;
|
||||
}
|
||||
hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT);
|
||||
hid_hw_wait(hsdev->hdev);
|
||||
|
||||
@@ -377,7 +377,7 @@ static int hid_submit_ctrl(struct hid_device *hid)
|
||||
raw_report = usbhid->ctrl[usbhid->ctrltail].raw_report;
|
||||
dir = usbhid->ctrl[usbhid->ctrltail].dir;
|
||||
|
||||
len = ((report->size - 1) >> 3) + 1 + (report->id > 0);
|
||||
len = hid_report_len(report);
|
||||
if (dir == USB_DIR_OUT) {
|
||||
usbhid->urbctrl->pipe = usb_sndctrlpipe(hid_to_usb_dev(hid), 0);
|
||||
usbhid->urbctrl->transfer_buffer_length = len;
|
||||
|
||||
@@ -107,6 +107,15 @@ scpi_show_sensor(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
|
||||
scpi_scale_reading(&value, sensor);
|
||||
|
||||
/*
|
||||
* Temperature sensor values are treated as signed values based on
|
||||
* observation even though that is not explicitly specified, and
|
||||
* because an unsigned u64 temperature does not really make practical
|
||||
* sense especially when the temperature is below zero degrees Celsius.
|
||||
*/
|
||||
if (sensor->info.class == TEMPERATURE)
|
||||
return sprintf(buf, "%lld\n", (s64)value);
|
||||
|
||||
return sprintf(buf, "%llu\n", value);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ static int osif_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
|
||||
}
|
||||
}
|
||||
|
||||
ret = osif_usb_read(adapter, OSIFI2C_STOP, 0, 0, NULL, 0);
|
||||
ret = osif_usb_write(adapter, OSIFI2C_STOP, 0, 0, NULL, 0);
|
||||
if (ret) {
|
||||
dev_err(&adapter->dev, "failure sending STOP\n");
|
||||
return -EREMOTEIO;
|
||||
@@ -156,7 +156,7 @@ static int osif_probe(struct usb_interface *interface,
|
||||
* Set bus frequency. The frequency is:
|
||||
* 120,000,000 / ( 16 + 2 * div * 4^prescale).
|
||||
* Using dev = 52, prescale = 0 give 100KHz */
|
||||
ret = osif_usb_read(&priv->adapter, OSIFI2C_SET_BIT_RATE, 52, 0,
|
||||
ret = osif_usb_write(&priv->adapter, OSIFI2C_SET_BIT_RATE, 52, 0,
|
||||
NULL, 0);
|
||||
if (ret) {
|
||||
dev_err(&interface->dev, "failure sending bit rate");
|
||||
|
||||
@@ -360,6 +360,7 @@ static int ldisc_open(struct tty_struct *tty)
|
||||
rtnl_lock();
|
||||
result = register_netdevice(dev);
|
||||
if (result) {
|
||||
tty_kref_put(tty);
|
||||
rtnl_unlock();
|
||||
free_netdev(dev);
|
||||
return -ENODEV;
|
||||
|
||||
@@ -93,6 +93,8 @@ struct mcba_priv {
|
||||
bool can_ka_first_pass;
|
||||
bool can_speed_check;
|
||||
atomic_t free_ctx_cnt;
|
||||
void *rxbuf[MCBA_MAX_RX_URBS];
|
||||
dma_addr_t rxbuf_dma[MCBA_MAX_RX_URBS];
|
||||
};
|
||||
|
||||
/* CAN frame */
|
||||
@@ -644,6 +646,7 @@ static int mcba_usb_start(struct mcba_priv *priv)
|
||||
for (i = 0; i < MCBA_MAX_RX_URBS; i++) {
|
||||
struct urb *urb = NULL;
|
||||
u8 *buf;
|
||||
dma_addr_t buf_dma;
|
||||
|
||||
/* create a URB, and a buffer for it */
|
||||
urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
@@ -653,7 +656,7 @@ static int mcba_usb_start(struct mcba_priv *priv)
|
||||
}
|
||||
|
||||
buf = usb_alloc_coherent(priv->udev, MCBA_USB_RX_BUFF_SIZE,
|
||||
GFP_KERNEL, &urb->transfer_dma);
|
||||
GFP_KERNEL, &buf_dma);
|
||||
if (!buf) {
|
||||
netdev_err(netdev, "No memory left for USB buffer\n");
|
||||
usb_free_urb(urb);
|
||||
@@ -672,11 +675,14 @@ static int mcba_usb_start(struct mcba_priv *priv)
|
||||
if (err) {
|
||||
usb_unanchor_urb(urb);
|
||||
usb_free_coherent(priv->udev, MCBA_USB_RX_BUFF_SIZE,
|
||||
buf, urb->transfer_dma);
|
||||
buf, buf_dma);
|
||||
usb_free_urb(urb);
|
||||
break;
|
||||
}
|
||||
|
||||
priv->rxbuf[i] = buf;
|
||||
priv->rxbuf_dma[i] = buf_dma;
|
||||
|
||||
/* Drop reference, USB core will take care of freeing it */
|
||||
usb_free_urb(urb);
|
||||
}
|
||||
@@ -719,7 +725,14 @@ static int mcba_usb_open(struct net_device *netdev)
|
||||
|
||||
static void mcba_urb_unlink(struct mcba_priv *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
usb_kill_anchored_urbs(&priv->rx_submitted);
|
||||
|
||||
for (i = 0; i < MCBA_MAX_RX_URBS; ++i)
|
||||
usb_free_coherent(priv->udev, MCBA_USB_RX_BUFF_SIZE,
|
||||
priv->rxbuf[i], priv->rxbuf_dma[i]);
|
||||
|
||||
usb_kill_anchored_urbs(&priv->tx_submitted);
|
||||
}
|
||||
|
||||
|
||||
@@ -1855,6 +1855,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
free_netdev(netdev);
|
||||
out_pci_release:
|
||||
pci_release_mem_regions(pdev);
|
||||
pci_disable_pcie_error_reporting(pdev);
|
||||
out_pci_disable:
|
||||
pci_disable_device(pdev);
|
||||
return err;
|
||||
|
||||
@@ -585,10 +585,12 @@ static void ec_bhf_remove(struct pci_dev *dev)
|
||||
struct ec_bhf_priv *priv = netdev_priv(net_dev);
|
||||
|
||||
unregister_netdev(net_dev);
|
||||
free_netdev(net_dev);
|
||||
|
||||
pci_iounmap(dev, priv->dma_io);
|
||||
pci_iounmap(dev, priv->io);
|
||||
|
||||
free_netdev(net_dev);
|
||||
|
||||
pci_release_regions(dev);
|
||||
pci_clear_master(dev);
|
||||
pci_disable_device(dev);
|
||||
|
||||
@@ -6029,6 +6029,7 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
|
||||
unmap_bars:
|
||||
be_unmap_pci_bars(adapter);
|
||||
free_netdev:
|
||||
pci_disable_pcie_error_reporting(pdev);
|
||||
free_netdev(netdev);
|
||||
rel_reg:
|
||||
pci_release_regions(pdev);
|
||||
|
||||
@@ -220,15 +220,13 @@ static u64 fec_ptp_read(const struct cyclecounter *cc)
|
||||
{
|
||||
struct fec_enet_private *fep =
|
||||
container_of(cc, struct fec_enet_private, cc);
|
||||
const struct platform_device_id *id_entry =
|
||||
platform_get_device_id(fep->pdev);
|
||||
u32 tempval;
|
||||
|
||||
tempval = readl(fep->hwp + FEC_ATIME_CTRL);
|
||||
tempval |= FEC_T_CTRL_CAPTURE;
|
||||
writel(tempval, fep->hwp + FEC_ATIME_CTRL);
|
||||
|
||||
if (id_entry->driver_data & FEC_QUIRK_BUG_CAPTURE)
|
||||
if (fep->quirks & FEC_QUIRK_BUG_CAPTURE)
|
||||
udelay(1);
|
||||
|
||||
return readl(fep->hwp + FEC_ATIME);
|
||||
@@ -599,6 +597,10 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
|
||||
fep->ptp_caps.enable = fec_ptp_enable;
|
||||
|
||||
fep->cycle_speed = clk_get_rate(fep->clk_ptp);
|
||||
if (!fep->cycle_speed) {
|
||||
fep->cycle_speed = NSEC_PER_SEC;
|
||||
dev_err(&fep->pdev->dev, "clk_ptp clock rate is zero\n");
|
||||
}
|
||||
fep->ptp_inc = NSEC_PER_SEC / fep->cycle_speed;
|
||||
|
||||
spin_lock_init(&fep->tmreg_lock);
|
||||
|
||||
@@ -515,9 +515,6 @@ void mlx5e_ipsec_build_netdev(struct mlx5e_priv *priv)
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
struct net_device *netdev = priv->netdev;
|
||||
|
||||
if (!priv->ipsec)
|
||||
return;
|
||||
|
||||
if (!(mlx5_accel_ipsec_device_caps(mdev) & MLX5_ACCEL_IPSEC_CAP_ESP) ||
|
||||
!MLX5_CAP_ETH(mdev, swp)) {
|
||||
mlx5_core_dbg(mdev, "mlx5e: ESP and SWP offload not supported\n");
|
||||
|
||||
@@ -4679,11 +4679,8 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
|
||||
}
|
||||
|
||||
if (mlx5_vxlan_allowed(mdev->vxlan)) {
|
||||
netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL |
|
||||
NETIF_F_GSO_UDP_TUNNEL_CSUM;
|
||||
netdev->hw_enc_features |= NETIF_F_GSO_UDP_TUNNEL |
|
||||
NETIF_F_GSO_UDP_TUNNEL_CSUM;
|
||||
netdev->gso_partial_features = NETIF_F_GSO_UDP_TUNNEL_CSUM;
|
||||
netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
|
||||
netdev->hw_enc_features |= NETIF_F_GSO_UDP_TUNNEL;
|
||||
}
|
||||
|
||||
if (MLX5_CAP_ETH(mdev, tunnel_stateless_gre)) {
|
||||
|
||||
@@ -3853,6 +3853,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
dev_err(&pdev->dev,
|
||||
"invalid sram_size %dB or board span %ldB\n",
|
||||
mgp->sram_size, mgp->board_span);
|
||||
status = -EINVAL;
|
||||
goto abort_with_ioremap;
|
||||
}
|
||||
memcpy_fromio(mgp->eeprom_strings,
|
||||
|
||||
@@ -1618,6 +1618,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
free_netdev(netdev);
|
||||
|
||||
err_out_free_res:
|
||||
if (NX_IS_REVISION_P3(pdev->revision))
|
||||
pci_disable_pcie_error_reporting(pdev);
|
||||
pci_release_regions(pdev);
|
||||
|
||||
err_out_disable_pdev:
|
||||
|
||||
@@ -1294,9 +1294,11 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,
|
||||
p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_STATIC;
|
||||
|
||||
p_hwfn->p_dcbx_info->set.enabled = dcbx_info->operational.enabled;
|
||||
BUILD_BUG_ON(sizeof(dcbx_info->operational.params) !=
|
||||
sizeof(p_hwfn->p_dcbx_info->set.config.params));
|
||||
memcpy(&p_hwfn->p_dcbx_info->set.config.params,
|
||||
&dcbx_info->operational.params,
|
||||
sizeof(struct qed_dcbx_admin_params));
|
||||
sizeof(p_hwfn->p_dcbx_info->set.config.params));
|
||||
p_hwfn->p_dcbx_info->set.config.valid = true;
|
||||
|
||||
memcpy(params, &p_hwfn->p_dcbx_info->set, sizeof(struct qed_dcbx_set));
|
||||
|
||||
@@ -2708,6 +2708,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
kfree(ahw);
|
||||
|
||||
err_out_free_res:
|
||||
pci_disable_pcie_error_reporting(pdev);
|
||||
pci_release_regions(pdev);
|
||||
|
||||
err_out_disable_pdev:
|
||||
|
||||
@@ -1823,7 +1823,7 @@ static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
|
||||
{
|
||||
switch(stringset) {
|
||||
case ETH_SS_STATS:
|
||||
memcpy(data, *rtl8169_gstrings, sizeof(rtl8169_gstrings));
|
||||
memcpy(data, rtl8169_gstrings, sizeof(rtl8169_gstrings));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2302,7 +2302,7 @@ static void sh_eth_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
|
||||
{
|
||||
switch (stringset) {
|
||||
case ETH_SS_STATS:
|
||||
memcpy(data, *sh_eth_gstrings_stats,
|
||||
memcpy(data, sh_eth_gstrings_stats,
|
||||
sizeof(sh_eth_gstrings_stats));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -86,10 +86,10 @@ enum power_event {
|
||||
#define LPI_CTRL_STATUS_TLPIEN 0x00000001 /* Transmit LPI Entry */
|
||||
|
||||
/* GMAC HW ADDR regs */
|
||||
#define GMAC_ADDR_HIGH(reg) (((reg > 15) ? 0x00000800 : 0x00000040) + \
|
||||
(reg * 8))
|
||||
#define GMAC_ADDR_LOW(reg) (((reg > 15) ? 0x00000804 : 0x00000044) + \
|
||||
(reg * 8))
|
||||
#define GMAC_ADDR_HIGH(reg) ((reg > 15) ? 0x00000800 + (reg - 16) * 8 : \
|
||||
0x00000040 + (reg * 8))
|
||||
#define GMAC_ADDR_LOW(reg) ((reg > 15) ? 0x00000804 + (reg - 16) * 8 : \
|
||||
0x00000044 + (reg * 8))
|
||||
#define GMAC_MAX_PERFECT_ADDRESSES 1
|
||||
|
||||
#define GMAC_PCS_BASE 0x000000c0 /* PCS register base */
|
||||
|
||||
@@ -736,6 +736,11 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
/* Kick off the transfer */
|
||||
lp->dma_out(lp, TX_TAILDESC_PTR, tail_p); /* DMA start */
|
||||
|
||||
if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) {
|
||||
netdev_info(ndev, "%s -> netif_stop_queue\n", __func__);
|
||||
netif_stop_queue(ndev);
|
||||
}
|
||||
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -810,6 +810,7 @@ static void mkiss_close(struct tty_struct *tty)
|
||||
ax->tty = NULL;
|
||||
|
||||
unregister_netdev(ax->dev);
|
||||
free_netdev(ax->dev);
|
||||
}
|
||||
|
||||
/* Perform I/O control on an active ax25 channel. */
|
||||
|
||||
@@ -135,10 +135,10 @@ static struct sk_buff *eem_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
|
||||
}
|
||||
|
||||
skb2 = skb_copy_expand(skb, EEM_HEAD, ETH_FCS_LEN + padlen, flags);
|
||||
dev_kfree_skb_any(skb);
|
||||
if (!skb2)
|
||||
return NULL;
|
||||
|
||||
dev_kfree_skb_any(skb);
|
||||
skb = skb2;
|
||||
|
||||
done:
|
||||
|
||||
@@ -1666,7 +1666,7 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
|
||||
static const struct driver_info cdc_ncm_info = {
|
||||
.description = "CDC NCM",
|
||||
.flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET
|
||||
| FLAG_LINK_INTR,
|
||||
| FLAG_LINK_INTR | FLAG_ETHER,
|
||||
.bind = cdc_ncm_bind,
|
||||
.unbind = cdc_ncm_unbind,
|
||||
.manage_power = usbnet_manage_power,
|
||||
|
||||
@@ -4649,7 +4649,7 @@ static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data)
|
||||
{
|
||||
switch (stringset) {
|
||||
case ETH_SS_STATS:
|
||||
memcpy(data, *rtl8152_gstrings, sizeof(rtl8152_gstrings));
|
||||
memcpy(data, rtl8152_gstrings, sizeof(rtl8152_gstrings));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1495,7 +1495,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
ret = smsc75xx_wait_ready(dev, 0);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "device not ready in smsc75xx_bind\n");
|
||||
goto err;
|
||||
goto free_pdata;
|
||||
}
|
||||
|
||||
smsc75xx_init_mac_address(dev);
|
||||
@@ -1504,7 +1504,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
ret = smsc75xx_reset(dev);
|
||||
if (ret < 0) {
|
||||
netdev_warn(dev->net, "smsc75xx_reset error %d\n", ret);
|
||||
goto err;
|
||||
goto cancel_work;
|
||||
}
|
||||
|
||||
dev->net->netdev_ops = &smsc75xx_netdev_ops;
|
||||
@@ -1515,8 +1515,11 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
dev->net->max_mtu = MAX_SINGLE_PACKET_SIZE;
|
||||
return 0;
|
||||
|
||||
err:
|
||||
cancel_work:
|
||||
cancel_work_sync(&pdata->set_multicast);
|
||||
free_pdata:
|
||||
kfree(pdata);
|
||||
dev->data[0] = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1527,7 +1530,6 @@ static void smsc75xx_unbind(struct usbnet *dev, struct usb_interface *intf)
|
||||
cancel_work_sync(&pdata->set_multicast);
|
||||
netif_dbg(dev, ifdown, dev->net, "free pdata\n");
|
||||
kfree(pdata);
|
||||
pdata = NULL;
|
||||
dev->data[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +274,8 @@ static const struct blk_mq_ops nvme_loop_admin_mq_ops = {
|
||||
|
||||
static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl)
|
||||
{
|
||||
clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags);
|
||||
if (!test_and_clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags))
|
||||
return;
|
||||
nvmet_sq_destroy(&ctrl->queues[0].nvme_sq);
|
||||
blk_cleanup_queue(ctrl->ctrl.admin_q);
|
||||
blk_mq_free_tag_set(&ctrl->admin_tag_set);
|
||||
@@ -309,6 +310,7 @@ static void nvme_loop_destroy_io_queues(struct nvme_loop_ctrl *ctrl)
|
||||
clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[i].flags);
|
||||
nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
|
||||
}
|
||||
ctrl->ctrl.queue_count = 1;
|
||||
}
|
||||
|
||||
static int nvme_loop_init_io_queues(struct nvme_loop_ctrl *ctrl)
|
||||
@@ -417,6 +419,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
|
||||
return 0;
|
||||
|
||||
out_cleanup_queue:
|
||||
clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags);
|
||||
blk_cleanup_queue(ctrl->ctrl.admin_q);
|
||||
out_free_tagset:
|
||||
blk_mq_free_tag_set(&ctrl->admin_tag_set);
|
||||
|
||||
@@ -1585,11 +1585,21 @@ static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
|
||||
int err;
|
||||
int i, bars = 0;
|
||||
|
||||
if (atomic_inc_return(&dev->enable_cnt) > 1) {
|
||||
pci_update_current_state(dev, dev->current_state);
|
||||
return 0; /* already enabled */
|
||||
/*
|
||||
* Power state could be unknown at this point, either due to a fresh
|
||||
* boot or a device removal call. So get the current power state
|
||||
* so that things like MSI message writing will behave as expected
|
||||
* (e.g. if the device really is in D0 at enable time).
|
||||
*/
|
||||
if (dev->pm_cap) {
|
||||
u16 pmcsr;
|
||||
pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
|
||||
dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
|
||||
}
|
||||
|
||||
if (atomic_inc_return(&dev->enable_cnt) > 1)
|
||||
return 0; /* already enabled */
|
||||
|
||||
bridge = pci_upstream_bridge(dev);
|
||||
if (bridge)
|
||||
pci_enable_bridge(bridge);
|
||||
|
||||
@@ -3463,6 +3463,18 @@ static void quirk_no_bus_reset(struct pci_dev *dev)
|
||||
dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some NVIDIA GPU devices do not work with bus reset, SBR needs to be
|
||||
* prevented for those affected devices.
|
||||
*/
|
||||
static void quirk_nvidia_no_bus_reset(struct pci_dev *dev)
|
||||
{
|
||||
if ((dev->device & 0xffc0) == 0x2340)
|
||||
quirk_no_bus_reset(dev);
|
||||
}
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
|
||||
quirk_nvidia_no_bus_reset);
|
||||
|
||||
/*
|
||||
* Some Atheros AR9xxx and QCA988x chips do not behave after a bus reset.
|
||||
* The device will throw a Link Down error on AER-capable systems and
|
||||
@@ -3483,6 +3495,16 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0034, quirk_no_bus_reset);
|
||||
*/
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CAVIUM, 0xa100, quirk_no_bus_reset);
|
||||
|
||||
/*
|
||||
* Some TI KeyStone C667X devices do not support bus/hot reset. The PCIESS
|
||||
* automatically disables LTSSM when Secondary Bus Reset is received and
|
||||
* the device stops working. Prevent bus reset for these devices. With
|
||||
* this change, the device can be assigned to VMs with VFIO, but it will
|
||||
* leak state between VMs. Reference
|
||||
* https://e2e.ti.com/support/processors/f/791/t/954382
|
||||
*/
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, 0xb005, quirk_no_bus_reset);
|
||||
|
||||
static void quirk_no_pm_reset(struct pci_dev *dev)
|
||||
{
|
||||
/*
|
||||
@@ -3875,6 +3897,69 @@ static int delay_250ms_after_flr(struct pci_dev *dev, int probe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define PCI_DEVICE_ID_HINIC_VF 0x375E
|
||||
#define HINIC_VF_FLR_TYPE 0x1000
|
||||
#define HINIC_VF_FLR_CAP_BIT (1UL << 30)
|
||||
#define HINIC_VF_OP 0xE80
|
||||
#define HINIC_VF_FLR_PROC_BIT (1UL << 18)
|
||||
#define HINIC_OPERATION_TIMEOUT 15000 /* 15 seconds */
|
||||
|
||||
/* Device-specific reset method for Huawei Intelligent NIC virtual functions */
|
||||
static int reset_hinic_vf_dev(struct pci_dev *pdev, int probe)
|
||||
{
|
||||
unsigned long timeout;
|
||||
void __iomem *bar;
|
||||
u32 val;
|
||||
|
||||
if (probe)
|
||||
return 0;
|
||||
|
||||
bar = pci_iomap(pdev, 0, 0);
|
||||
if (!bar)
|
||||
return -ENOTTY;
|
||||
|
||||
/* Get and check firmware capabilities */
|
||||
val = ioread32be(bar + HINIC_VF_FLR_TYPE);
|
||||
if (!(val & HINIC_VF_FLR_CAP_BIT)) {
|
||||
pci_iounmap(pdev, bar);
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
/* Set HINIC_VF_FLR_PROC_BIT for the start of FLR */
|
||||
val = ioread32be(bar + HINIC_VF_OP);
|
||||
val = val | HINIC_VF_FLR_PROC_BIT;
|
||||
iowrite32be(val, bar + HINIC_VF_OP);
|
||||
|
||||
pcie_flr(pdev);
|
||||
|
||||
/*
|
||||
* The device must recapture its Bus and Device Numbers after FLR
|
||||
* in order generate Completions. Issue a config write to let the
|
||||
* device capture this information.
|
||||
*/
|
||||
pci_write_config_word(pdev, PCI_VENDOR_ID, 0);
|
||||
|
||||
/* Firmware clears HINIC_VF_FLR_PROC_BIT when reset is complete */
|
||||
timeout = jiffies + msecs_to_jiffies(HINIC_OPERATION_TIMEOUT);
|
||||
do {
|
||||
val = ioread32be(bar + HINIC_VF_OP);
|
||||
if (!(val & HINIC_VF_FLR_PROC_BIT))
|
||||
goto reset_complete;
|
||||
msleep(20);
|
||||
} while (time_before(jiffies, timeout));
|
||||
|
||||
val = ioread32be(bar + HINIC_VF_OP);
|
||||
if (!(val & HINIC_VF_FLR_PROC_BIT))
|
||||
goto reset_complete;
|
||||
|
||||
pci_warn(pdev, "Reset dev timeout, FLR ack reg: %#010x\n", val);
|
||||
|
||||
reset_complete:
|
||||
pci_iounmap(pdev, bar);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
|
||||
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
|
||||
reset_intel_82599_sfp_virtfn },
|
||||
@@ -3886,6 +3971,8 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
|
||||
{ PCI_VENDOR_ID_INTEL, 0x0953, delay_250ms_after_flr },
|
||||
{ PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
|
||||
reset_chelsio_generic_dev },
|
||||
{ PCI_VENDOR_ID_HUAWEI, PCI_DEVICE_ID_HINIC_VF,
|
||||
reset_hinic_vf_dev },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
@@ -4689,6 +4776,8 @@ static const struct pci_dev_acs_enabled {
|
||||
{ PCI_VENDOR_ID_AMPERE, 0xE00A, pci_quirk_xgene_acs },
|
||||
{ PCI_VENDOR_ID_AMPERE, 0xE00B, pci_quirk_xgene_acs },
|
||||
{ PCI_VENDOR_ID_AMPERE, 0xE00C, pci_quirk_xgene_acs },
|
||||
/* Broadcom multi-function device */
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0x16D7, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0xD714, pci_quirk_brcm_acs },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
@@ -978,7 +978,7 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl,
|
||||
struct resource res;
|
||||
struct reset_control *rstc;
|
||||
int npins = STM32_GPIO_PINS_PER_BANK;
|
||||
int bank_nr, err;
|
||||
int bank_nr, err, i = 0;
|
||||
|
||||
rstc = of_reset_control_get_exclusive(np, NULL);
|
||||
if (!IS_ERR(rstc))
|
||||
@@ -1007,9 +1007,14 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl,
|
||||
|
||||
of_property_read_string(np, "st,bank-name", &bank->gpio_chip.label);
|
||||
|
||||
if (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, &args)) {
|
||||
if (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, i, &args)) {
|
||||
bank_nr = args.args[1] / STM32_GPIO_PINS_PER_BANK;
|
||||
bank->gpio_chip.base = args.args[1];
|
||||
|
||||
npins = args.args[2];
|
||||
while (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3,
|
||||
++i, &args))
|
||||
npins += args.args[2];
|
||||
} else {
|
||||
bank_nr = pctl->nbanks;
|
||||
bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK;
|
||||
|
||||
@@ -76,7 +76,7 @@ static void enqueue_external_timestamp(struct timestamp_event_queue *queue,
|
||||
spin_unlock_irqrestore(&queue->lock, flags);
|
||||
}
|
||||
|
||||
static s32 scaled_ppm_to_ppb(long ppm)
|
||||
long scaled_ppm_to_ppb(long ppm)
|
||||
{
|
||||
/*
|
||||
* The 'freq' field in the 'struct timex' is in parts per
|
||||
@@ -93,8 +93,9 @@ static s32 scaled_ppm_to_ppb(long ppm)
|
||||
s64 ppb = 1 + ppm;
|
||||
ppb *= 125;
|
||||
ppb >>= 13;
|
||||
return (s32) ppb;
|
||||
return (long) ppb;
|
||||
}
|
||||
EXPORT_SYMBOL(scaled_ppm_to_ppb);
|
||||
|
||||
/* posix clock implementation */
|
||||
|
||||
@@ -147,7 +148,7 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
|
||||
delta = ktime_to_ns(kt);
|
||||
err = ops->adjtime(ops, delta);
|
||||
} else if (tx->modes & ADJ_FREQUENCY) {
|
||||
s32 ppb = scaled_ppm_to_ppb(tx->freq);
|
||||
long ppb = scaled_ppm_to_ppb(tx->freq);
|
||||
if (ppb > ops->max_adj || ppb < -ops->max_adj)
|
||||
return -ERANGE;
|
||||
if (ops->adjfine)
|
||||
|
||||
@@ -184,6 +184,7 @@ static struct {
|
||||
{"HP", "C3323-300", "4269", BLIST_NOTQ},
|
||||
{"HP", "C5713A", NULL, BLIST_NOREPORTLUN},
|
||||
{"HP", "DISK-SUBSYSTEM", "*", BLIST_REPORTLUN2},
|
||||
{"HPE", "OPEN-", "*", BLIST_REPORTLUN2 | BLIST_TRY_VPD_PAGES},
|
||||
{"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
|
||||
{"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
|
||||
{"IBM", "2105", NULL, BLIST_RETRY_HWERROR},
|
||||
|
||||
@@ -127,7 +127,7 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
|
||||
if (p->groups[group].enabled) {
|
||||
dev_err(p->dev, "%s is already enabled\n",
|
||||
p->groups[group].name);
|
||||
return -EBUSY;
|
||||
return 0;
|
||||
}
|
||||
|
||||
p->groups[group].enabled = 1;
|
||||
|
||||
@@ -2982,9 +2982,7 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop,
|
||||
__releases(&cmd->t_state_lock)
|
||||
__acquires(&cmd->t_state_lock)
|
||||
{
|
||||
|
||||
assert_spin_locked(&cmd->t_state_lock);
|
||||
WARN_ON_ONCE(!irqs_disabled());
|
||||
lockdep_assert_held(&cmd->t_state_lock);
|
||||
|
||||
if (fabric_stop)
|
||||
cmd->transport_state |= CMD_T_FABRIC_STOP;
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
#define USB_VENDOR_GENESYS_LOGIC 0x05e3
|
||||
#define USB_VENDOR_SMSC 0x0424
|
||||
#define USB_PRODUCT_USB5534B 0x5534
|
||||
#define USB_VENDOR_CYPRESS 0x04b4
|
||||
#define USB_PRODUCT_CY7C65632 0x6570
|
||||
#define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01
|
||||
#define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02
|
||||
|
||||
@@ -5447,6 +5449,11 @@ static const struct usb_device_id hub_id_table[] = {
|
||||
.idProduct = USB_PRODUCT_USB5534B,
|
||||
.bInterfaceClass = USB_CLASS_HUB,
|
||||
.driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
|
||||
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
|
||||
| USB_DEVICE_ID_MATCH_PRODUCT,
|
||||
.idVendor = USB_VENDOR_CYPRESS,
|
||||
.idProduct = USB_PRODUCT_CY7C65632,
|
||||
.driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
|
||||
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
|
||||
| USB_DEVICE_ID_MATCH_INT_CLASS,
|
||||
.idVendor = USB_VENDOR_GENESYS_LOGIC,
|
||||
|
||||
@@ -1550,8 +1550,8 @@ static int dwc3_remove(struct platform_device *pdev)
|
||||
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
|
||||
dwc3_debugfs_exit(dwc);
|
||||
dwc3_core_exit_mode(dwc);
|
||||
dwc3_debugfs_exit(dwc);
|
||||
|
||||
dwc3_core_exit(dwc);
|
||||
dwc3_ulpi_exit(dwc);
|
||||
|
||||
@@ -653,9 +653,12 @@ static inline const char *dwc3_gadget_generic_cmd_status_string(int status)
|
||||
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
extern void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep);
|
||||
extern void dwc3_debugfs_init(struct dwc3 *);
|
||||
extern void dwc3_debugfs_exit(struct dwc3 *);
|
||||
#else
|
||||
static inline void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep)
|
||||
{ }
|
||||
static inline void dwc3_debugfs_init(struct dwc3 *d)
|
||||
{ }
|
||||
static inline void dwc3_debugfs_exit(struct dwc3 *d)
|
||||
|
||||
@@ -725,30 +725,14 @@ static void dwc3_debugfs_create_endpoint_files(struct dwc3_ep *dep,
|
||||
}
|
||||
}
|
||||
|
||||
static void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep,
|
||||
struct dentry *parent)
|
||||
void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep)
|
||||
{
|
||||
struct dentry *dir;
|
||||
|
||||
dir = debugfs_create_dir(dep->name, parent);
|
||||
dir = debugfs_create_dir(dep->name, dep->dwc->root);
|
||||
dwc3_debugfs_create_endpoint_files(dep, dir);
|
||||
}
|
||||
|
||||
static void dwc3_debugfs_create_endpoint_dirs(struct dwc3 *dwc,
|
||||
struct dentry *parent)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dwc->num_eps; i++) {
|
||||
struct dwc3_ep *dep = dwc->eps[i];
|
||||
|
||||
if (!dep)
|
||||
continue;
|
||||
|
||||
dwc3_debugfs_create_endpoint_dir(dep, parent);
|
||||
}
|
||||
}
|
||||
|
||||
void dwc3_debugfs_init(struct dwc3 *dwc)
|
||||
{
|
||||
struct dentry *root;
|
||||
@@ -777,7 +761,6 @@ void dwc3_debugfs_init(struct dwc3 *dwc)
|
||||
&dwc3_testmode_fops);
|
||||
debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root, dwc,
|
||||
&dwc3_link_state_fops);
|
||||
dwc3_debugfs_create_endpoint_dirs(dwc, root);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2255,6 +2255,8 @@ static int dwc3_gadget_init_endpoint(struct dwc3 *dwc, u8 epnum)
|
||||
INIT_LIST_HEAD(&dep->started_list);
|
||||
INIT_LIST_HEAD(&dep->cancelled_list);
|
||||
|
||||
dwc3_debugfs_create_endpoint_dir(dep);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2298,6 +2300,7 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
|
||||
list_del(&dep->endpoint.ep_list);
|
||||
}
|
||||
|
||||
debugfs_remove_recursive(debugfs_lookup(dep->name, dwc->root));
|
||||
kfree(dep);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ static int __init afs_init(void)
|
||||
goto error_fs;
|
||||
|
||||
afs_proc_symlink = proc_symlink("fs/afs", NULL, "../self/net/afs");
|
||||
if (IS_ERR(afs_proc_symlink)) {
|
||||
ret = PTR_ERR(afs_proc_symlink);
|
||||
if (!afs_proc_symlink) {
|
||||
ret = -ENOMEM;
|
||||
goto error_proc;
|
||||
}
|
||||
|
||||
|
||||
@@ -822,8 +822,11 @@ static ssize_t gfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
||||
current->backing_dev_info = inode_to_bdi(inode);
|
||||
buffered = iomap_file_buffered_write(iocb, from, &gfs2_iomap_ops);
|
||||
current->backing_dev_info = NULL;
|
||||
if (unlikely(buffered <= 0))
|
||||
if (unlikely(buffered <= 0)) {
|
||||
if (!ret)
|
||||
ret = buffered;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to ensure that the page cache pages are written to
|
||||
|
||||
@@ -1457,6 +1457,7 @@ __acquires(&lru_lock)
|
||||
while(!list_empty(list)) {
|
||||
gl = list_entry(list->next, struct gfs2_glock, gl_lru);
|
||||
list_del_init(&gl->gl_lru);
|
||||
clear_bit(GLF_LRU, &gl->gl_flags);
|
||||
if (!spin_trylock(&gl->gl_lockref.lock)) {
|
||||
add_back_to_lru:
|
||||
list_add(&gl->gl_lru, &lru_list);
|
||||
@@ -1502,7 +1503,6 @@ static long gfs2_scan_glock_lru(int nr)
|
||||
if (!test_bit(GLF_LOCK, &gl->gl_flags)) {
|
||||
list_move(&gl->gl_lru, &dispose);
|
||||
atomic_dec(&lru_count);
|
||||
clear_bit(GLF_LRU, &gl->gl_flags);
|
||||
freed++;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1054,6 +1054,7 @@ void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs)
|
||||
nilfs_sysfs_delete_superblock_group(nilfs);
|
||||
nilfs_sysfs_delete_segctor_group(nilfs);
|
||||
kobject_del(&nilfs->ns_dev_kobj);
|
||||
kobject_put(&nilfs->ns_dev_kobj);
|
||||
kfree(nilfs->ns_dev_subgroups);
|
||||
}
|
||||
|
||||
|
||||
@@ -1151,8 +1151,7 @@ static inline void hid_hw_wait(struct hid_device *hdev)
|
||||
*/
|
||||
static inline u32 hid_report_len(struct hid_report *report)
|
||||
{
|
||||
/* equivalent to DIV_ROUND_UP(report->size, 8) + !!(report->id > 0) */
|
||||
return ((report->size - 1) >> 3) + 1 + (report->id > 0);
|
||||
return DIV_ROUND_UP(report->size, 8) + (report->id > 0);
|
||||
}
|
||||
|
||||
int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
|
||||
|
||||
@@ -84,6 +84,12 @@ enum sock_type {
|
||||
|
||||
#endif /* ARCH_HAS_SOCKET_TYPES */
|
||||
|
||||
/**
|
||||
* enum sock_shutdown_cmd - Shutdown types
|
||||
* @SHUT_RD: shutdown receptions
|
||||
* @SHUT_WR: shutdown transmissions
|
||||
* @SHUT_RDWR: shutdown receptions/transmissions
|
||||
*/
|
||||
enum sock_shutdown_cmd {
|
||||
SHUT_RD,
|
||||
SHUT_WR,
|
||||
|
||||
@@ -204,6 +204,14 @@ extern void ptp_clock_event(struct ptp_clock *ptp,
|
||||
|
||||
extern int ptp_clock_index(struct ptp_clock *ptp);
|
||||
|
||||
/**
|
||||
* scaled_ppm_to_ppb() - convert scaled ppm to ppb
|
||||
*
|
||||
* @ppm: Parts per million, but with a 16 bit binary fractional field
|
||||
*/
|
||||
|
||||
extern long scaled_ppm_to_ppb(long ppm);
|
||||
|
||||
/**
|
||||
* ptp_find_pin() - obtain the pin index of a given auxiliary function
|
||||
*
|
||||
|
||||
@@ -384,6 +384,4 @@ extern int __sys_getpeername(int fd, struct sockaddr __user *usockaddr,
|
||||
extern int __sys_socketpair(int family, int type, int protocol,
|
||||
int __user *usockvec);
|
||||
extern int __sys_shutdown(int fd, int how);
|
||||
|
||||
extern struct ns_common *get_net_ns(struct ns_common *ns);
|
||||
#endif /* _LINUX_SOCKET_H */
|
||||
|
||||
@@ -173,6 +173,8 @@ struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns,
|
||||
void net_ns_get_ownership(const struct net *net, kuid_t *uid, kgid_t *gid);
|
||||
|
||||
void net_ns_barrier(void);
|
||||
|
||||
struct ns_common *get_net_ns(struct ns_common *ns);
|
||||
#else /* CONFIG_NET_NS */
|
||||
#include <linux/sched.h>
|
||||
#include <linux/nsproxy.h>
|
||||
@@ -192,6 +194,11 @@ static inline void net_ns_get_ownership(const struct net *net,
|
||||
}
|
||||
|
||||
static inline void net_ns_barrier(void) {}
|
||||
|
||||
static inline struct ns_common *get_net_ns(struct ns_common *ns)
|
||||
{
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
#endif /* CONFIG_NET_NS */
|
||||
|
||||
|
||||
|
||||
@@ -1842,7 +1842,8 @@ static inline u32 net_tx_rndhash(void)
|
||||
|
||||
static inline void sk_set_txhash(struct sock *sk)
|
||||
{
|
||||
sk->sk_txhash = net_tx_rndhash();
|
||||
/* This pairs with READ_ONCE() in skb_set_hash_from_sk() */
|
||||
WRITE_ONCE(sk->sk_txhash, net_tx_rndhash());
|
||||
}
|
||||
|
||||
static inline void sk_rethink_txhash(struct sock *sk)
|
||||
@@ -2113,9 +2114,12 @@ static inline void sock_poll_wait(struct file *filp, struct socket *sock,
|
||||
|
||||
static inline void skb_set_hash_from_sk(struct sk_buff *skb, struct sock *sk)
|
||||
{
|
||||
if (sk->sk_txhash) {
|
||||
/* This pairs with WRITE_ONCE() in sk_set_txhash() */
|
||||
u32 txhash = READ_ONCE(sk->sk_txhash);
|
||||
|
||||
if (txhash) {
|
||||
skb->l4_hash = 1;
|
||||
skb->hash = sk->sk_txhash;
|
||||
skb->hash = txhash;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +280,9 @@ struct sockaddr_in {
|
||||
/* Address indicating an error return. */
|
||||
#define INADDR_NONE ((unsigned long int) 0xffffffff)
|
||||
|
||||
/* Dummy address for src of ICMP replies if no real address is set (RFC7600). */
|
||||
#define INADDR_DUMMY ((unsigned long int) 0xc0000008)
|
||||
|
||||
/* Network number for local host loopback. */
|
||||
#define IN_LOOPBACKNET 127
|
||||
|
||||
|
||||
@@ -268,9 +268,18 @@ static void module_assert_mutex_or_preempt(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MODULE_SIG
|
||||
static bool sig_enforce = IS_ENABLED(CONFIG_MODULE_SIG_FORCE);
|
||||
module_param(sig_enforce, bool_enable_only, 0644);
|
||||
|
||||
void set_module_sig_enforced(void)
|
||||
{
|
||||
sig_enforce = true;
|
||||
}
|
||||
#else
|
||||
#define sig_enforce false
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Export sig_enforce kernel cmdline parameter to allow other subsystems rely
|
||||
* on that instead of directly to CONFIG_MODULE_SIG_FORCE config.
|
||||
|
||||
@@ -1743,9 +1743,6 @@ struct saved_cmdlines_buffer {
|
||||
};
|
||||
static struct saved_cmdlines_buffer *savedcmd;
|
||||
|
||||
/* temporary disable recording */
|
||||
static atomic_t trace_record_taskinfo_disabled __read_mostly;
|
||||
|
||||
static inline char *get_saved_cmdlines(int idx)
|
||||
{
|
||||
return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN];
|
||||
@@ -2031,8 +2028,6 @@ static bool tracing_record_taskinfo_skip(int flags)
|
||||
{
|
||||
if (unlikely(!(flags & (TRACE_RECORD_CMDLINE | TRACE_RECORD_TGID))))
|
||||
return true;
|
||||
if (atomic_read(&trace_record_taskinfo_disabled) || !tracing_is_on())
|
||||
return true;
|
||||
if (!__this_cpu_read(trace_taskinfo_save))
|
||||
return true;
|
||||
return false;
|
||||
@@ -3261,9 +3256,6 @@ static void *s_start(struct seq_file *m, loff_t *pos)
|
||||
return ERR_PTR(-EBUSY);
|
||||
#endif
|
||||
|
||||
if (!iter->snapshot)
|
||||
atomic_inc(&trace_record_taskinfo_disabled);
|
||||
|
||||
if (*pos != iter->pos) {
|
||||
iter->ent = NULL;
|
||||
iter->cpu = 0;
|
||||
@@ -3306,9 +3298,6 @@ static void s_stop(struct seq_file *m, void *p)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (!iter->snapshot)
|
||||
atomic_dec(&trace_record_taskinfo_disabled);
|
||||
|
||||
trace_access_unlock(iter->cpu_file);
|
||||
trace_event_read_unlock();
|
||||
}
|
||||
|
||||
@@ -115,9 +115,9 @@ u64 notrace trace_clock_global(void)
|
||||
prev_time = READ_ONCE(trace_clock_struct.prev_time);
|
||||
now = sched_clock_cpu(this_cpu);
|
||||
|
||||
/* Make sure that now is always greater than prev_time */
|
||||
/* Make sure that now is always greater than or equal to prev_time */
|
||||
if ((s64)(now - prev_time) < 0)
|
||||
now = prev_time + 1;
|
||||
now = prev_time;
|
||||
|
||||
/*
|
||||
* If in an NMI context then dont risk lockups and simply return
|
||||
@@ -131,7 +131,7 @@ u64 notrace trace_clock_global(void)
|
||||
/* Reread prev_time in case it was already updated */
|
||||
prev_time = READ_ONCE(trace_clock_struct.prev_time);
|
||||
if ((s64)(now - prev_time) < 0)
|
||||
now = prev_time + 1;
|
||||
now = prev_time;
|
||||
|
||||
trace_clock_struct.prev_time = now;
|
||||
|
||||
|
||||
@@ -1387,7 +1387,12 @@ int memory_failure(unsigned long pfn, int flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!PageTransTail(p) && !PageLRU(p))
|
||||
/*
|
||||
* __munlock_pagevec may clear a writeback page's LRU flag without
|
||||
* page_lock. We need wait writeback completion for this page or it
|
||||
* may trigger vfs BUG while evict inode.
|
||||
*/
|
||||
if (!PageTransTail(p) && !PageLRU(p) && !PageWriteback(p))
|
||||
goto identify_page_state;
|
||||
|
||||
/*
|
||||
|
||||
15
mm/slub.c
15
mm/slub.c
@@ -15,6 +15,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/bit_spinlock.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/swab.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/slab.h>
|
||||
#include "slab.h"
|
||||
@@ -679,15 +680,15 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
|
||||
p, p - addr, get_freepointer(s, p));
|
||||
|
||||
if (s->flags & SLAB_RED_ZONE)
|
||||
print_section(KERN_ERR, "Redzone ", p - s->red_left_pad,
|
||||
print_section(KERN_ERR, "Redzone ", p - s->red_left_pad,
|
||||
s->red_left_pad);
|
||||
else if (p > addr + 16)
|
||||
print_section(KERN_ERR, "Bytes b4 ", p - 16, 16);
|
||||
|
||||
print_section(KERN_ERR, "Object ", p,
|
||||
print_section(KERN_ERR, "Object ", p,
|
||||
min_t(unsigned int, s->object_size, PAGE_SIZE));
|
||||
if (s->flags & SLAB_RED_ZONE)
|
||||
print_section(KERN_ERR, "Redzone ", p + s->object_size,
|
||||
print_section(KERN_ERR, "Redzone ", p + s->object_size,
|
||||
s->inuse - s->object_size);
|
||||
|
||||
if (s->offset)
|
||||
@@ -702,7 +703,7 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
|
||||
|
||||
if (off != size_from_object(s))
|
||||
/* Beginning of the filler is the free pointer */
|
||||
print_section(KERN_ERR, "Padding ", p + off,
|
||||
print_section(KERN_ERR, "Padding ", p + off,
|
||||
size_from_object(s) - off);
|
||||
|
||||
dump_stack();
|
||||
@@ -880,11 +881,11 @@ static int check_object(struct kmem_cache *s, struct page *page,
|
||||
u8 *endobject = object + s->object_size;
|
||||
|
||||
if (s->flags & SLAB_RED_ZONE) {
|
||||
if (!check_bytes_and_report(s, page, object, "Redzone",
|
||||
if (!check_bytes_and_report(s, page, object, "Left Redzone",
|
||||
object - s->red_left_pad, val, s->red_left_pad))
|
||||
return 0;
|
||||
|
||||
if (!check_bytes_and_report(s, page, object, "Redzone",
|
||||
if (!check_bytes_and_report(s, page, object, "Right Redzone",
|
||||
endobject, val, s->inuse - s->object_size))
|
||||
return 0;
|
||||
} else {
|
||||
@@ -899,7 +900,7 @@ static int check_object(struct kmem_cache *s, struct page *page,
|
||||
if (val != SLUB_RED_ACTIVE && (s->flags & __OBJECT_POISON) &&
|
||||
(!check_bytes_and_report(s, page, p, "Poison", p,
|
||||
POISON_FREE, s->object_size - 1) ||
|
||||
!check_bytes_and_report(s, page, p, "Poison",
|
||||
!check_bytes_and_report(s, page, p, "End Poison",
|
||||
p + s->object_size - 1, POISON_END, 1)))
|
||||
return 0;
|
||||
/*
|
||||
|
||||
@@ -594,8 +594,10 @@ static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet)
|
||||
if (WARN_ON(!forw_packet->if_outgoing))
|
||||
return;
|
||||
|
||||
if (WARN_ON(forw_packet->if_outgoing->soft_iface != soft_iface))
|
||||
if (forw_packet->if_outgoing->soft_iface != soft_iface) {
|
||||
pr_warn("%s: soft interface switch for queued OGM\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (forw_packet->if_incoming->if_status != BATADV_IF_ACTIVE)
|
||||
return;
|
||||
|
||||
@@ -100,8 +100,8 @@ struct br_vlan_stats {
|
||||
};
|
||||
|
||||
struct br_tunnel_info {
|
||||
__be64 tunnel_id;
|
||||
struct metadata_dst *tunnel_dst;
|
||||
__be64 tunnel_id;
|
||||
struct metadata_dst __rcu *tunnel_dst;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,26 +46,33 @@ static struct net_bridge_vlan *br_vlan_tunnel_lookup(struct rhashtable *tbl,
|
||||
br_vlan_tunnel_rht_params);
|
||||
}
|
||||
|
||||
static void vlan_tunnel_info_release(struct net_bridge_vlan *vlan)
|
||||
{
|
||||
struct metadata_dst *tdst = rtnl_dereference(vlan->tinfo.tunnel_dst);
|
||||
|
||||
WRITE_ONCE(vlan->tinfo.tunnel_id, 0);
|
||||
RCU_INIT_POINTER(vlan->tinfo.tunnel_dst, NULL);
|
||||
dst_release(&tdst->dst);
|
||||
}
|
||||
|
||||
void vlan_tunnel_info_del(struct net_bridge_vlan_group *vg,
|
||||
struct net_bridge_vlan *vlan)
|
||||
{
|
||||
if (!vlan->tinfo.tunnel_dst)
|
||||
if (!rcu_access_pointer(vlan->tinfo.tunnel_dst))
|
||||
return;
|
||||
rhashtable_remove_fast(&vg->tunnel_hash, &vlan->tnode,
|
||||
br_vlan_tunnel_rht_params);
|
||||
vlan->tinfo.tunnel_id = 0;
|
||||
dst_release(&vlan->tinfo.tunnel_dst->dst);
|
||||
vlan->tinfo.tunnel_dst = NULL;
|
||||
vlan_tunnel_info_release(vlan);
|
||||
}
|
||||
|
||||
static int __vlan_tunnel_info_add(struct net_bridge_vlan_group *vg,
|
||||
struct net_bridge_vlan *vlan, u32 tun_id)
|
||||
{
|
||||
struct metadata_dst *metadata = NULL;
|
||||
struct metadata_dst *metadata = rtnl_dereference(vlan->tinfo.tunnel_dst);
|
||||
__be64 key = key32_to_tunnel_id(cpu_to_be32(tun_id));
|
||||
int err;
|
||||
|
||||
if (vlan->tinfo.tunnel_dst)
|
||||
if (metadata)
|
||||
return -EEXIST;
|
||||
|
||||
metadata = __ip_tun_set_dst(0, 0, 0, 0, 0, TUNNEL_KEY,
|
||||
@@ -74,8 +81,8 @@ static int __vlan_tunnel_info_add(struct net_bridge_vlan_group *vg,
|
||||
return -EINVAL;
|
||||
|
||||
metadata->u.tun_info.mode |= IP_TUNNEL_INFO_TX | IP_TUNNEL_INFO_BRIDGE;
|
||||
vlan->tinfo.tunnel_dst = metadata;
|
||||
vlan->tinfo.tunnel_id = key;
|
||||
rcu_assign_pointer(vlan->tinfo.tunnel_dst, metadata);
|
||||
WRITE_ONCE(vlan->tinfo.tunnel_id, key);
|
||||
|
||||
err = rhashtable_lookup_insert_fast(&vg->tunnel_hash, &vlan->tnode,
|
||||
br_vlan_tunnel_rht_params);
|
||||
@@ -84,9 +91,7 @@ static int __vlan_tunnel_info_add(struct net_bridge_vlan_group *vg,
|
||||
|
||||
return 0;
|
||||
out:
|
||||
dst_release(&vlan->tinfo.tunnel_dst->dst);
|
||||
vlan->tinfo.tunnel_dst = NULL;
|
||||
vlan->tinfo.tunnel_id = 0;
|
||||
vlan_tunnel_info_release(vlan);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -186,12 +191,15 @@ int br_handle_ingress_vlan_tunnel(struct sk_buff *skb,
|
||||
int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
|
||||
struct net_bridge_vlan *vlan)
|
||||
{
|
||||
struct metadata_dst *tunnel_dst;
|
||||
__be64 tunnel_id;
|
||||
int err;
|
||||
|
||||
if (!vlan || !vlan->tinfo.tunnel_id)
|
||||
if (!vlan)
|
||||
return 0;
|
||||
|
||||
if (unlikely(!skb_vlan_tag_present(skb)))
|
||||
tunnel_id = READ_ONCE(vlan->tinfo.tunnel_id);
|
||||
if (!tunnel_id || unlikely(!skb_vlan_tag_present(skb)))
|
||||
return 0;
|
||||
|
||||
skb_dst_drop(skb);
|
||||
@@ -199,7 +207,9 @@ int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
skb_dst_set(skb, dst_clone(&vlan->tinfo.tunnel_dst->dst));
|
||||
tunnel_dst = rcu_dereference(vlan->tinfo.tunnel_dst);
|
||||
if (tunnel_dst && dst_hold_safe(&tunnel_dst->dst))
|
||||
skb_dst_set(skb, &tunnel_dst->dst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ struct bcm_sock {
|
||||
struct sock sk;
|
||||
int bound;
|
||||
int ifindex;
|
||||
struct notifier_block notifier;
|
||||
struct list_head notifier;
|
||||
struct list_head rx_ops;
|
||||
struct list_head tx_ops;
|
||||
unsigned long dropped_usr_msgs;
|
||||
@@ -133,6 +133,10 @@ struct bcm_sock {
|
||||
char procname [32]; /* inode number in decimal with \0 */
|
||||
};
|
||||
|
||||
static LIST_HEAD(bcm_notifier_list);
|
||||
static DEFINE_SPINLOCK(bcm_notifier_lock);
|
||||
static struct bcm_sock *bcm_busy_notifier;
|
||||
|
||||
static inline struct bcm_sock *bcm_sk(const struct sock *sk)
|
||||
{
|
||||
return (struct bcm_sock *)sk;
|
||||
@@ -393,6 +397,7 @@ static void bcm_tx_timeout_tsklet(unsigned long data)
|
||||
if (!op->count && (op->flags & TX_COUNTEVT)) {
|
||||
|
||||
/* create notification to user */
|
||||
memset(&msg_head, 0, sizeof(msg_head));
|
||||
msg_head.opcode = TX_EXPIRED;
|
||||
msg_head.flags = op->flags;
|
||||
msg_head.count = op->count;
|
||||
@@ -440,6 +445,7 @@ static void bcm_rx_changed(struct bcm_op *op, struct canfd_frame *data)
|
||||
/* this element is not throttled anymore */
|
||||
data->flags &= (BCM_CAN_FLAGS_MASK|RX_RECV);
|
||||
|
||||
memset(&head, 0, sizeof(head));
|
||||
head.opcode = RX_CHANGED;
|
||||
head.flags = op->flags;
|
||||
head.count = op->count;
|
||||
@@ -554,6 +560,7 @@ static void bcm_rx_timeout_tsklet(unsigned long data)
|
||||
struct bcm_msg_head msg_head;
|
||||
|
||||
/* create notification to user */
|
||||
memset(&msg_head, 0, sizeof(msg_head));
|
||||
msg_head.opcode = RX_TIMEOUT;
|
||||
msg_head.flags = op->flags;
|
||||
msg_head.count = op->count;
|
||||
@@ -1429,20 +1436,15 @@ static int bcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
|
||||
/*
|
||||
* notification handler for netdevice status changes
|
||||
*/
|
||||
static int bcm_notifier(struct notifier_block *nb, unsigned long msg,
|
||||
void *ptr)
|
||||
static void bcm_notify(struct bcm_sock *bo, unsigned long msg,
|
||||
struct net_device *dev)
|
||||
{
|
||||
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||
struct bcm_sock *bo = container_of(nb, struct bcm_sock, notifier);
|
||||
struct sock *sk = &bo->sk;
|
||||
struct bcm_op *op;
|
||||
int notify_enodev = 0;
|
||||
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
return NOTIFY_DONE;
|
||||
|
||||
if (dev->type != ARPHRD_CAN)
|
||||
return NOTIFY_DONE;
|
||||
return;
|
||||
|
||||
switch (msg) {
|
||||
|
||||
@@ -1477,7 +1479,28 @@ static int bcm_notifier(struct notifier_block *nb, unsigned long msg,
|
||||
sk->sk_error_report(sk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int bcm_notifier(struct notifier_block *nb, unsigned long msg,
|
||||
void *ptr)
|
||||
{
|
||||
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||
|
||||
if (dev->type != ARPHRD_CAN)
|
||||
return NOTIFY_DONE;
|
||||
if (msg != NETDEV_UNREGISTER && msg != NETDEV_DOWN)
|
||||
return NOTIFY_DONE;
|
||||
if (unlikely(bcm_busy_notifier)) /* Check for reentrant bug. */
|
||||
return NOTIFY_DONE;
|
||||
|
||||
spin_lock(&bcm_notifier_lock);
|
||||
list_for_each_entry(bcm_busy_notifier, &bcm_notifier_list, notifier) {
|
||||
spin_unlock(&bcm_notifier_lock);
|
||||
bcm_notify(bcm_busy_notifier, msg, dev);
|
||||
spin_lock(&bcm_notifier_lock);
|
||||
}
|
||||
bcm_busy_notifier = NULL;
|
||||
spin_unlock(&bcm_notifier_lock);
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
@@ -1497,9 +1520,9 @@ static int bcm_init(struct sock *sk)
|
||||
INIT_LIST_HEAD(&bo->rx_ops);
|
||||
|
||||
/* set notifier */
|
||||
bo->notifier.notifier_call = bcm_notifier;
|
||||
|
||||
register_netdevice_notifier(&bo->notifier);
|
||||
spin_lock(&bcm_notifier_lock);
|
||||
list_add_tail(&bo->notifier, &bcm_notifier_list);
|
||||
spin_unlock(&bcm_notifier_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1522,7 +1545,14 @@ static int bcm_release(struct socket *sock)
|
||||
|
||||
/* remove bcm_ops, timer, rx_unregister(), etc. */
|
||||
|
||||
unregister_netdevice_notifier(&bo->notifier);
|
||||
spin_lock(&bcm_notifier_lock);
|
||||
while (bcm_busy_notifier == bo) {
|
||||
spin_unlock(&bcm_notifier_lock);
|
||||
schedule_timeout_uninterruptible(1);
|
||||
spin_lock(&bcm_notifier_lock);
|
||||
}
|
||||
list_del(&bo->notifier);
|
||||
spin_unlock(&bcm_notifier_lock);
|
||||
|
||||
lock_sock(sk);
|
||||
|
||||
@@ -1737,6 +1767,10 @@ static struct pernet_operations canbcm_pernet_ops __read_mostly = {
|
||||
.exit = canbcm_pernet_exit,
|
||||
};
|
||||
|
||||
static struct notifier_block canbcm_notifier = {
|
||||
.notifier_call = bcm_notifier
|
||||
};
|
||||
|
||||
static int __init bcm_module_init(void)
|
||||
{
|
||||
int err;
|
||||
@@ -1750,12 +1784,14 @@ static int __init bcm_module_init(void)
|
||||
}
|
||||
|
||||
register_pernet_subsys(&canbcm_pernet_ops);
|
||||
register_netdevice_notifier(&canbcm_notifier);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit bcm_module_exit(void)
|
||||
{
|
||||
can_proto_unregister(&bcm_can_proto);
|
||||
unregister_netdevice_notifier(&canbcm_notifier);
|
||||
unregister_pernet_subsys(&canbcm_pernet_ops);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ struct raw_sock {
|
||||
struct sock sk;
|
||||
int bound;
|
||||
int ifindex;
|
||||
struct notifier_block notifier;
|
||||
struct list_head notifier;
|
||||
int loopback;
|
||||
int recv_own_msgs;
|
||||
int fd_frames;
|
||||
@@ -96,6 +96,10 @@ struct raw_sock {
|
||||
struct uniqframe __percpu *uniq;
|
||||
};
|
||||
|
||||
static LIST_HEAD(raw_notifier_list);
|
||||
static DEFINE_SPINLOCK(raw_notifier_lock);
|
||||
static struct raw_sock *raw_busy_notifier;
|
||||
|
||||
/*
|
||||
* Return pointer to store the extra msg flags for raw_recvmsg().
|
||||
* We use the space of one unsigned int beyond the 'struct sockaddr_can'
|
||||
@@ -266,21 +270,16 @@ static int raw_enable_allfilters(struct net *net, struct net_device *dev,
|
||||
return err;
|
||||
}
|
||||
|
||||
static int raw_notifier(struct notifier_block *nb,
|
||||
unsigned long msg, void *ptr)
|
||||
static void raw_notify(struct raw_sock *ro, unsigned long msg,
|
||||
struct net_device *dev)
|
||||
{
|
||||
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||
struct raw_sock *ro = container_of(nb, struct raw_sock, notifier);
|
||||
struct sock *sk = &ro->sk;
|
||||
|
||||
if (!net_eq(dev_net(dev), sock_net(sk)))
|
||||
return NOTIFY_DONE;
|
||||
|
||||
if (dev->type != ARPHRD_CAN)
|
||||
return NOTIFY_DONE;
|
||||
return;
|
||||
|
||||
if (ro->ifindex != dev->ifindex)
|
||||
return NOTIFY_DONE;
|
||||
return;
|
||||
|
||||
switch (msg) {
|
||||
|
||||
@@ -309,7 +308,28 @@ static int raw_notifier(struct notifier_block *nb,
|
||||
sk->sk_error_report(sk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int raw_notifier(struct notifier_block *nb, unsigned long msg,
|
||||
void *ptr)
|
||||
{
|
||||
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||
|
||||
if (dev->type != ARPHRD_CAN)
|
||||
return NOTIFY_DONE;
|
||||
if (msg != NETDEV_UNREGISTER && msg != NETDEV_DOWN)
|
||||
return NOTIFY_DONE;
|
||||
if (unlikely(raw_busy_notifier)) /* Check for reentrant bug. */
|
||||
return NOTIFY_DONE;
|
||||
|
||||
spin_lock(&raw_notifier_lock);
|
||||
list_for_each_entry(raw_busy_notifier, &raw_notifier_list, notifier) {
|
||||
spin_unlock(&raw_notifier_lock);
|
||||
raw_notify(raw_busy_notifier, msg, dev);
|
||||
spin_lock(&raw_notifier_lock);
|
||||
}
|
||||
raw_busy_notifier = NULL;
|
||||
spin_unlock(&raw_notifier_lock);
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
@@ -338,9 +358,9 @@ static int raw_init(struct sock *sk)
|
||||
return -ENOMEM;
|
||||
|
||||
/* set notifier */
|
||||
ro->notifier.notifier_call = raw_notifier;
|
||||
|
||||
register_netdevice_notifier(&ro->notifier);
|
||||
spin_lock(&raw_notifier_lock);
|
||||
list_add_tail(&ro->notifier, &raw_notifier_list);
|
||||
spin_unlock(&raw_notifier_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -355,7 +375,14 @@ static int raw_release(struct socket *sock)
|
||||
|
||||
ro = raw_sk(sk);
|
||||
|
||||
unregister_netdevice_notifier(&ro->notifier);
|
||||
spin_lock(&raw_notifier_lock);
|
||||
while (raw_busy_notifier == ro) {
|
||||
spin_unlock(&raw_notifier_lock);
|
||||
schedule_timeout_uninterruptible(1);
|
||||
spin_lock(&raw_notifier_lock);
|
||||
}
|
||||
list_del(&ro->notifier);
|
||||
spin_unlock(&raw_notifier_lock);
|
||||
|
||||
lock_sock(sk);
|
||||
|
||||
@@ -870,6 +897,10 @@ static const struct can_proto raw_can_proto = {
|
||||
.prot = &raw_proto,
|
||||
};
|
||||
|
||||
static struct notifier_block canraw_notifier = {
|
||||
.notifier_call = raw_notifier
|
||||
};
|
||||
|
||||
static __init int raw_module_init(void)
|
||||
{
|
||||
int err;
|
||||
@@ -879,6 +910,8 @@ static __init int raw_module_init(void)
|
||||
err = can_proto_register(&raw_can_proto);
|
||||
if (err < 0)
|
||||
printk(KERN_ERR "can: registration of raw protocol failed\n");
|
||||
else
|
||||
register_netdevice_notifier(&canraw_notifier);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -886,6 +919,7 @@ static __init int raw_module_init(void)
|
||||
static __exit void raw_module_exit(void)
|
||||
{
|
||||
can_proto_unregister(&raw_can_proto);
|
||||
unregister_netdevice_notifier(&canraw_notifier);
|
||||
}
|
||||
|
||||
module_init(raw_module_init);
|
||||
|
||||
@@ -158,7 +158,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
|
||||
if (kcmlen > stackbuf_size)
|
||||
kcmsg_base = kcmsg = sock_kmalloc(sk, kcmlen, GFP_KERNEL);
|
||||
if (kcmsg == NULL)
|
||||
return -ENOBUFS;
|
||||
return -ENOMEM;
|
||||
|
||||
/* Now copy them over neatly. */
|
||||
memset(kcmsg, 0, kcmlen);
|
||||
|
||||
@@ -1594,7 +1594,7 @@ static int ethtool_get_any_eeprom(struct net_device *dev, void __user *useraddr,
|
||||
if (eeprom.offset + eeprom.len > total_len)
|
||||
return -EINVAL;
|
||||
|
||||
data = kmalloc(PAGE_SIZE, GFP_USER);
|
||||
data = kzalloc(PAGE_SIZE, GFP_USER);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1659,7 +1659,7 @@ static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr)
|
||||
if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
|
||||
return -EINVAL;
|
||||
|
||||
data = kmalloc(PAGE_SIZE, GFP_USER);
|
||||
data = kzalloc(PAGE_SIZE, GFP_USER);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1840,7 +1840,7 @@ static int ethtool_self_test(struct net_device *dev, char __user *useraddr)
|
||||
return -EFAULT;
|
||||
|
||||
test.len = test_len;
|
||||
data = kmalloc_array(test_len, sizeof(u64), GFP_USER);
|
||||
data = kcalloc(test_len, sizeof(u64), GFP_USER);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2372,7 +2372,7 @@ static int ethtool_get_tunable(struct net_device *dev, void __user *useraddr)
|
||||
ret = ethtool_tunable_valid(&tuna);
|
||||
if (ret)
|
||||
return ret;
|
||||
data = kmalloc(tuna.len, GFP_USER);
|
||||
data = kzalloc(tuna.len, GFP_USER);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
ret = ops->get_tunable(dev, &tuna, data);
|
||||
@@ -2552,7 +2552,7 @@ static int get_phy_tunable(struct net_device *dev, void __user *useraddr)
|
||||
ret = ethtool_phy_tunable_valid(&tuna);
|
||||
if (ret)
|
||||
return ret;
|
||||
data = kmalloc(tuna.len, GFP_USER);
|
||||
data = kzalloc(tuna.len, GFP_USER);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
mutex_lock(&phydev->lock);
|
||||
|
||||
@@ -1105,7 +1105,7 @@ static void notify_rule_change(int event, struct fib_rule *rule,
|
||||
{
|
||||
struct net *net;
|
||||
struct sk_buff *skb;
|
||||
int err = -ENOBUFS;
|
||||
int err = -ENOMEM;
|
||||
|
||||
net = ops->fro_net;
|
||||
skb = nlmsg_new(fib_rule_nlmsg_size(ops, rule), GFP_KERNEL);
|
||||
|
||||
@@ -598,6 +598,18 @@ void __put_net(struct net *net)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__put_net);
|
||||
|
||||
/**
|
||||
* get_net_ns - increment the refcount of the network namespace
|
||||
* @ns: common namespace (net)
|
||||
*
|
||||
* Returns the net's common namespace.
|
||||
*/
|
||||
struct ns_common *get_net_ns(struct ns_common *ns)
|
||||
{
|
||||
return &get_net(container_of(ns, struct net, ns))->ns;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(get_net_ns);
|
||||
|
||||
struct net *get_net_ns_by_fd(int fd)
|
||||
{
|
||||
struct file *file;
|
||||
|
||||
@@ -4102,6 +4102,10 @@ static int rtnl_bridge_notify(struct net_device *dev)
|
||||
if (err < 0)
|
||||
goto errout;
|
||||
|
||||
/* Notification info is only filled for bridge ports, not the bridge
|
||||
* device itself. Therefore, a zero notification length is valid and
|
||||
* should not result in an error.
|
||||
*/
|
||||
if (!skb->len)
|
||||
goto errout;
|
||||
|
||||
|
||||
@@ -1315,19 +1315,20 @@ ieee802154_llsec_parse_dev_addr(struct nlattr *nla,
|
||||
nl802154_dev_addr_policy, NULL))
|
||||
return -EINVAL;
|
||||
|
||||
if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] ||
|
||||
!attrs[NL802154_DEV_ADDR_ATTR_MODE] ||
|
||||
!(attrs[NL802154_DEV_ADDR_ATTR_SHORT] ||
|
||||
attrs[NL802154_DEV_ADDR_ATTR_EXTENDED]))
|
||||
if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] || !attrs[NL802154_DEV_ADDR_ATTR_MODE])
|
||||
return -EINVAL;
|
||||
|
||||
addr->pan_id = nla_get_le16(attrs[NL802154_DEV_ADDR_ATTR_PAN_ID]);
|
||||
addr->mode = nla_get_u32(attrs[NL802154_DEV_ADDR_ATTR_MODE]);
|
||||
switch (addr->mode) {
|
||||
case NL802154_DEV_ADDR_SHORT:
|
||||
if (!attrs[NL802154_DEV_ADDR_ATTR_SHORT])
|
||||
return -EINVAL;
|
||||
addr->short_addr = nla_get_le16(attrs[NL802154_DEV_ADDR_ATTR_SHORT]);
|
||||
break;
|
||||
case NL802154_DEV_ADDR_EXTENDED:
|
||||
if (!attrs[NL802154_DEV_ADDR_ATTR_EXTENDED])
|
||||
return -EINVAL;
|
||||
addr->extended_addr = nla_get_le64(attrs[NL802154_DEV_ADDR_ATTR_EXTENDED]);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -486,6 +486,7 @@ void cipso_v4_doi_free(struct cipso_v4_doi *doi_def)
|
||||
kfree(doi_def->map.std->lvl.local);
|
||||
kfree(doi_def->map.std->cat.cipso);
|
||||
kfree(doi_def->map.std->cat.local);
|
||||
kfree(doi_def->map.std);
|
||||
break;
|
||||
}
|
||||
kfree(doi_def);
|
||||
|
||||
@@ -744,6 +744,13 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
|
||||
icmp_param.data_len = room;
|
||||
icmp_param.head_len = sizeof(struct icmphdr);
|
||||
|
||||
/* if we don't have a source address at this point, fall back to the
|
||||
* dummy address instead of sending out a packet with a source address
|
||||
* of 0.0.0.0
|
||||
*/
|
||||
if (!fl4.saddr)
|
||||
fl4.saddr = htonl(INADDR_DUMMY);
|
||||
|
||||
icmp_push_reply(&icmp_param, &fl4, &ipc, &rt);
|
||||
ende:
|
||||
ip_rt_put(rt);
|
||||
|
||||
@@ -1816,6 +1816,7 @@ void ip_mc_destroy_dev(struct in_device *in_dev)
|
||||
while ((i = rtnl_dereference(in_dev->mc_list)) != NULL) {
|
||||
in_dev->mc_list = i->next_rcu;
|
||||
in_dev->mc_count--;
|
||||
ip_mc_clear_src(i);
|
||||
ip_ma_put(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -866,7 +866,7 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
|
||||
|
||||
|
||||
/*
|
||||
* Copy BOOTP-supplied string if not already set.
|
||||
* Copy BOOTP-supplied string
|
||||
*/
|
||||
static int __init ic_bootp_string(char *dest, char *src, int len, int max)
|
||||
{
|
||||
@@ -915,12 +915,15 @@ static void __init ic_do_bootp_ext(u8 *ext)
|
||||
}
|
||||
break;
|
||||
case 12: /* Host name */
|
||||
ic_bootp_string(utsname()->nodename, ext+1, *ext,
|
||||
__NEW_UTS_LEN);
|
||||
ic_host_name_set = 1;
|
||||
if (!ic_host_name_set) {
|
||||
ic_bootp_string(utsname()->nodename, ext+1, *ext,
|
||||
__NEW_UTS_LEN);
|
||||
ic_host_name_set = 1;
|
||||
}
|
||||
break;
|
||||
case 15: /* Domain name (DNS) */
|
||||
ic_bootp_string(ic_domain, ext+1, *ext, sizeof(ic_domain));
|
||||
if (!ic_domain[0])
|
||||
ic_bootp_string(ic_domain, ext+1, *ext, sizeof(ic_domain));
|
||||
break;
|
||||
case 17: /* Root path */
|
||||
if (!root_server_path[0])
|
||||
|
||||
@@ -968,6 +968,7 @@ bool ping_rcv(struct sk_buff *skb)
|
||||
struct sock *sk;
|
||||
struct net *net = dev_net(skb->dev);
|
||||
struct icmphdr *icmph = icmp_hdr(skb);
|
||||
bool rc = false;
|
||||
|
||||
/* We assume the packet has already been checked by icmp_rcv */
|
||||
|
||||
@@ -982,14 +983,15 @@ bool ping_rcv(struct sk_buff *skb)
|
||||
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
|
||||
|
||||
pr_debug("rcv on socket %p\n", sk);
|
||||
if (skb2)
|
||||
ping_queue_rcv_skb(sk, skb2);
|
||||
if (skb2 && !ping_queue_rcv_skb(sk, skb2))
|
||||
rc = true;
|
||||
sock_put(sk);
|
||||
return true;
|
||||
}
|
||||
pr_debug("no socket, dropping\n");
|
||||
|
||||
return false;
|
||||
if (!rc)
|
||||
pr_debug("no socket, dropping\n");
|
||||
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ping_rcv);
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/socket.h>
|
||||
#include <linux/sockios.h>
|
||||
@@ -470,8 +471,10 @@ static void ipv4_confirm_neigh(const struct dst_entry *dst, const void *daddr)
|
||||
__ipv4_confirm_neigh(dev, *(__force u32 *)pkey);
|
||||
}
|
||||
|
||||
#define IP_IDENTS_SZ 2048u
|
||||
|
||||
/* Hash tables of size 2048..262144 depending on RAM size.
|
||||
* Each bucket uses 8 bytes.
|
||||
*/
|
||||
static u32 ip_idents_mask __read_mostly;
|
||||
static atomic_t *ip_idents __read_mostly;
|
||||
static u32 *ip_tstamps __read_mostly;
|
||||
|
||||
@@ -481,12 +484,16 @@ static u32 *ip_tstamps __read_mostly;
|
||||
*/
|
||||
u32 ip_idents_reserve(u32 hash, int segs)
|
||||
{
|
||||
u32 *p_tstamp = ip_tstamps + hash % IP_IDENTS_SZ;
|
||||
atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ;
|
||||
u32 old = READ_ONCE(*p_tstamp);
|
||||
u32 now = (u32)jiffies;
|
||||
u32 bucket, old, now = (u32)jiffies;
|
||||
atomic_t *p_id;
|
||||
u32 *p_tstamp;
|
||||
u32 delta = 0;
|
||||
|
||||
bucket = hash & ip_idents_mask;
|
||||
p_tstamp = ip_tstamps + bucket;
|
||||
p_id = ip_idents + bucket;
|
||||
old = READ_ONCE(*p_tstamp);
|
||||
|
||||
if (old != now && cmpxchg(p_tstamp, old, now) == old)
|
||||
delta = prandom_u32_max(now - old);
|
||||
|
||||
@@ -3197,18 +3204,25 @@ struct ip_rt_acct __percpu *ip_rt_acct __read_mostly;
|
||||
|
||||
int __init ip_rt_init(void)
|
||||
{
|
||||
void *idents_hash;
|
||||
int cpu;
|
||||
|
||||
ip_idents = kmalloc_array(IP_IDENTS_SZ, sizeof(*ip_idents),
|
||||
GFP_KERNEL);
|
||||
if (!ip_idents)
|
||||
panic("IP: failed to allocate ip_idents\n");
|
||||
/* For modern hosts, this will use 2 MB of memory */
|
||||
idents_hash = alloc_large_system_hash("IP idents",
|
||||
sizeof(*ip_idents) + sizeof(*ip_tstamps),
|
||||
0,
|
||||
16, /* one bucket per 64 KB */
|
||||
HASH_ZERO,
|
||||
NULL,
|
||||
&ip_idents_mask,
|
||||
2048,
|
||||
256*1024);
|
||||
|
||||
prandom_bytes(ip_idents, IP_IDENTS_SZ * sizeof(*ip_idents));
|
||||
ip_idents = idents_hash;
|
||||
|
||||
ip_tstamps = kcalloc(IP_IDENTS_SZ, sizeof(*ip_tstamps), GFP_KERNEL);
|
||||
if (!ip_tstamps)
|
||||
panic("IP: failed to allocate ip_tstamps\n");
|
||||
prandom_bytes(ip_idents, (ip_idents_mask + 1) * sizeof(*ip_idents));
|
||||
|
||||
ip_tstamps = idents_hash + (ip_idents_mask + 1) * sizeof(*ip_idents);
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
struct uncached_list *ul = &per_cpu(rt_uncached_list, cpu);
|
||||
|
||||
@@ -2432,6 +2432,9 @@ void udp_destroy_sock(struct sock *sk)
|
||||
{
|
||||
struct udp_sock *up = udp_sk(sk);
|
||||
bool slow = lock_sock_fast(sk);
|
||||
|
||||
/* protects from races with udp_abort() */
|
||||
sock_set_flag(sk, SOCK_DEAD);
|
||||
udp_flush_pending_frames(sk);
|
||||
unlock_sock_fast(sk, slow);
|
||||
if (static_branch_unlikely(&udp_encap_needed_key) && up->encap_type) {
|
||||
@@ -2673,10 +2676,17 @@ int udp_abort(struct sock *sk, int err)
|
||||
{
|
||||
lock_sock(sk);
|
||||
|
||||
/* udp{v6}_destroy_sock() sets it under the sk lock, avoid racing
|
||||
* with close()
|
||||
*/
|
||||
if (sock_flag(sk, SOCK_DEAD))
|
||||
goto out;
|
||||
|
||||
sk->sk_err = err;
|
||||
sk->sk_error_report(sk);
|
||||
__udp_disconnect(sk, 0);
|
||||
|
||||
out:
|
||||
release_sock(sk);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1476,6 +1476,9 @@ void udpv6_destroy_sock(struct sock *sk)
|
||||
{
|
||||
struct udp_sock *up = udp_sk(sk);
|
||||
lock_sock(sk);
|
||||
|
||||
/* protects from races with udp_abort() */
|
||||
sock_set_flag(sk, SOCK_DEAD);
|
||||
udp_v6_flush_pending_frames(sk);
|
||||
release_sock(sk);
|
||||
|
||||
|
||||
@@ -1398,7 +1398,7 @@ ieee80211_get_sband(struct ieee80211_sub_if_data *sdata)
|
||||
rcu_read_lock();
|
||||
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
|
||||
|
||||
if (WARN_ON_ONCE(!chanctx_conf)) {
|
||||
if (!chanctx_conf) {
|
||||
rcu_read_unlock();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2124,17 +2124,15 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
|
||||
sc = le16_to_cpu(hdr->seq_ctrl);
|
||||
frag = sc & IEEE80211_SCTL_FRAG;
|
||||
|
||||
if (is_multicast_ether_addr(hdr->addr1)) {
|
||||
I802_DEBUG_INC(rx->local->dot11MulticastReceivedFrameCount);
|
||||
goto out_no_led;
|
||||
}
|
||||
|
||||
if (rx->sta)
|
||||
cache = &rx->sta->frags;
|
||||
|
||||
if (likely(!ieee80211_has_morefrags(fc) && frag == 0))
|
||||
goto out;
|
||||
|
||||
if (is_multicast_ether_addr(hdr->addr1))
|
||||
return RX_DROP_MONITOR;
|
||||
|
||||
I802_DEBUG_INC(rx->local->rx_handlers_fragments);
|
||||
|
||||
if (skb_linearize(rx->skb))
|
||||
@@ -2260,7 +2258,6 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
|
||||
|
||||
out:
|
||||
ieee80211_led_rx(rx->local);
|
||||
out_no_led:
|
||||
if (rx->sta)
|
||||
rx->sta->rx_stats.packets++;
|
||||
return RX_CONTINUE;
|
||||
|
||||
@@ -34,6 +34,9 @@ synproxy_parse_options(const struct sk_buff *skb, unsigned int doff,
|
||||
int length = (th->doff * 4) - sizeof(*th);
|
||||
u8 buf[40], *ptr;
|
||||
|
||||
if (unlikely(length < 0))
|
||||
return false;
|
||||
|
||||
ptr = skb_header_pointer(skb, doff + sizeof(*th), length, buf);
|
||||
if (ptr == NULL)
|
||||
return false;
|
||||
@@ -50,6 +53,8 @@ synproxy_parse_options(const struct sk_buff *skb, unsigned int doff,
|
||||
length--;
|
||||
continue;
|
||||
default:
|
||||
if (length < 2)
|
||||
return true;
|
||||
opsize = *ptr++;
|
||||
if (opsize < 2)
|
||||
return true;
|
||||
|
||||
@@ -2656,7 +2656,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
|
||||
}
|
||||
if (likely(saddr == NULL)) {
|
||||
dev = packet_cached_dev_get(po);
|
||||
proto = po->num;
|
||||
proto = READ_ONCE(po->num);
|
||||
} else {
|
||||
err = -EINVAL;
|
||||
if (msg->msg_namelen < sizeof(struct sockaddr_ll))
|
||||
@@ -2869,7 +2869,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
|
||||
|
||||
if (likely(saddr == NULL)) {
|
||||
dev = packet_cached_dev_get(po);
|
||||
proto = po->num;
|
||||
proto = READ_ONCE(po->num);
|
||||
} else {
|
||||
err = -EINVAL;
|
||||
if (msg->msg_namelen < sizeof(struct sockaddr_ll))
|
||||
@@ -3141,7 +3141,7 @@ static int packet_do_bind(struct sock *sk, const char *name, int ifindex,
|
||||
/* prevents packet_notifier() from calling
|
||||
* register_prot_hook()
|
||||
*/
|
||||
po->num = 0;
|
||||
WRITE_ONCE(po->num, 0);
|
||||
__unregister_prot_hook(sk, true);
|
||||
rcu_read_lock();
|
||||
dev_curr = po->prot_hook.dev;
|
||||
@@ -3151,17 +3151,17 @@ static int packet_do_bind(struct sock *sk, const char *name, int ifindex,
|
||||
}
|
||||
|
||||
BUG_ON(po->running);
|
||||
po->num = proto;
|
||||
WRITE_ONCE(po->num, proto);
|
||||
po->prot_hook.type = proto;
|
||||
|
||||
if (unlikely(unlisted)) {
|
||||
dev_put(dev);
|
||||
po->prot_hook.dev = NULL;
|
||||
po->ifindex = -1;
|
||||
WRITE_ONCE(po->ifindex, -1);
|
||||
packet_cached_dev_reset(po);
|
||||
} else {
|
||||
po->prot_hook.dev = dev;
|
||||
po->ifindex = dev ? dev->ifindex : 0;
|
||||
WRITE_ONCE(po->ifindex, dev ? dev->ifindex : 0);
|
||||
packet_cached_dev_assign(po, dev);
|
||||
}
|
||||
}
|
||||
@@ -3476,7 +3476,7 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr,
|
||||
uaddr->sa_family = AF_PACKET;
|
||||
memset(uaddr->sa_data, 0, sizeof(uaddr->sa_data));
|
||||
rcu_read_lock();
|
||||
dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex);
|
||||
dev = dev_get_by_index_rcu(sock_net(sk), READ_ONCE(pkt_sk(sk)->ifindex));
|
||||
if (dev)
|
||||
strlcpy(uaddr->sa_data, dev->name, sizeof(uaddr->sa_data));
|
||||
rcu_read_unlock();
|
||||
@@ -3491,16 +3491,18 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
|
||||
struct sock *sk = sock->sk;
|
||||
struct packet_sock *po = pkt_sk(sk);
|
||||
DECLARE_SOCKADDR(struct sockaddr_ll *, sll, uaddr);
|
||||
int ifindex;
|
||||
|
||||
if (peer)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ifindex = READ_ONCE(po->ifindex);
|
||||
sll->sll_family = AF_PACKET;
|
||||
sll->sll_ifindex = po->ifindex;
|
||||
sll->sll_protocol = po->num;
|
||||
sll->sll_ifindex = ifindex;
|
||||
sll->sll_protocol = READ_ONCE(po->num);
|
||||
sll->sll_pkttype = 0;
|
||||
rcu_read_lock();
|
||||
dev = dev_get_by_index_rcu(sock_net(sk), po->ifindex);
|
||||
dev = dev_get_by_index_rcu(sock_net(sk), ifindex);
|
||||
if (dev) {
|
||||
sll->sll_hatype = dev->type;
|
||||
sll->sll_halen = dev->addr_len;
|
||||
@@ -4079,7 +4081,7 @@ static int packet_notifier(struct notifier_block *this,
|
||||
}
|
||||
if (msg == NETDEV_UNREGISTER) {
|
||||
packet_cached_dev_reset(po);
|
||||
po->ifindex = -1;
|
||||
WRITE_ONCE(po->ifindex, -1);
|
||||
if (po->prot_hook.dev)
|
||||
dev_put(po->prot_hook.dev);
|
||||
po->prot_hook.dev = NULL;
|
||||
@@ -4391,7 +4393,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
|
||||
was_running = po->running;
|
||||
num = po->num;
|
||||
if (was_running) {
|
||||
po->num = 0;
|
||||
WRITE_ONCE(po->num, 0);
|
||||
__unregister_prot_hook(sk, false);
|
||||
}
|
||||
spin_unlock(&po->bind_lock);
|
||||
@@ -4426,7 +4428,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
|
||||
|
||||
spin_lock(&po->bind_lock);
|
||||
if (was_running) {
|
||||
po->num = num;
|
||||
WRITE_ONCE(po->num, num);
|
||||
register_prot_hook(sk);
|
||||
}
|
||||
spin_unlock(&po->bind_lock);
|
||||
@@ -4597,8 +4599,8 @@ static int packet_seq_show(struct seq_file *seq, void *v)
|
||||
s,
|
||||
refcount_read(&s->sk_refcnt),
|
||||
s->sk_type,
|
||||
ntohs(po->num),
|
||||
po->ifindex,
|
||||
ntohs(READ_ONCE(po->num)),
|
||||
READ_ONCE(po->ifindex),
|
||||
po->running,
|
||||
atomic_read(&s->sk_rmem_alloc),
|
||||
from_kuid_munged(seq_user_ns(seq), sock_i_uid(s)),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user