Linux 5.4.247
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.4.247 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 block/blk-iocost.c | 10 ++- drivers/block/rbd.c | 73 ++++++++++++++++----------- drivers/gpu/drm/amd/amdgpu/vi.c | 11 +++- drivers/gpu/drm/drm_atomic_uapi.c | 14 ++--- drivers/i2c/busses/i2c-sprd.c | 8 +- drivers/infiniband/hw/i40iw/i40iw.h | 5 - drivers/input/joystick/xpad.c | 1 drivers/input/mouse/elantech.c | 9 +-- drivers/misc/eeprom/Kconfig | 1 drivers/mtd/nand/spi/macronix.c | 16 +++++ drivers/net/dsa/lan9303-core.c | 4 - drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 + drivers/net/ethernet/intel/i40e/i40e_alloc.h | 17 ++---- drivers/pinctrl/meson/pinctrl-meson-axg.c | 1 drivers/spi/spi-qup.c | 37 ++++++------- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 5 + drivers/usb/core/buffer.c | 41 +++++++++++++++ drivers/usb/core/devio.c | 20 +++++-- fs/btrfs/relocation.c | 14 +++-- fs/ceph/caps.c | 6 ++ fs/ceph/snap.c | 4 + fs/cifs/connect.c | 15 ++--- fs/ext4/xattr.c | 6 +- include/linux/netdevice.h | 7 +- include/linux/usb/hcd.h | 5 + include/net/bond_alb.h | 4 - include/net/neighbour.h | 2 include/net/pkt_sched.h | 2 include/net/sock.h | 18 ++++-- lib/cpu_rmap.c | 2 net/batman-adv/distributed-arp-table.c | 2 net/bluetooth/hci_core.c | 8 +- net/bluetooth/l2cap_core.c | 13 ++++ net/can/j1939/main.c | 24 ++++---- net/can/j1939/socket.c | 5 + net/core/dev.c | 6 +- net/netfilter/ipset/ip_set_core.c | 8 ++ net/netfilter/nf_conntrack_core.c | 3 + net/sched/cls_api.c | 3 - sound/pci/hda/patch_realtek.c | 2 42 files changed, 304 insertions(+), 139 deletions(-)
Ai Chao (1):
ALSA: hda/realtek: Add a quirk for HP Slim Desktop S01
Alexander Sverdlin (1):
net: dsa: lan9303: allow vid != 0 in port_fdb_{add|del} methodsArnd Bergmann (1):
blk-iocost: avoid 64-bit division in ioc_timer_fn
Ben Hutchings (1):
lib: cpu_rmap: Fix potential use-after-free in irq_cpu_rmap_release()
Chia-I Wu (1):
drm/amdgpu: fix xclk freq on CHIP_STONEY
Dmitry Torokhov (1):
Input: psmouse - fix OOB access in Elantech protocol
Eric Dumazet (3):
rfs: annotate lockless accesses to sk->sk_rxhash
rfs: annotate lockless accesses to RFS sock flow table
net: sched: move rtm_tca_policy declaration to include file
Fedor Pchelkin (2):
can: j1939: change j1939_netdev_lock type to mutex
can: j1939: avoid possible use-after-free when j1939_can_rx_register fails
Greg Kroah-Hartman (4):
i40iw: fix build warning in i40iw_manage_apbvt()
i40e: fix build warnings in i40e_alloc.h
Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE" Linux 5.4.247
Gustavo A. R. Silva (1):
neighbour: Replace zero-length array with flexible-array member
Hangyu Hua (1):
net: sched: fix possible refcount leak in tc_chain_tmplt_add()
Ilya Dryomov (2):
rbd: move RBD_OBJ_FLAG_COPYUP_ENABLED flag setting
rbd: get snapshot context after exclusive lock is ensured to be held
Ismael Ferreras Morezuelas (1):
Input: xpad - delete a Razer DeathAdder mouse VID/PID entry
Jiri Slaby (SUSE) (2):
block/blk-iocost (gcc13): keep large values in a new enum bonding (gcc13): synchronize bond_{a,t}lb_xmit() types
Josef Bacik (1):
btrfs: check return value of btrfs_commit_transaction in relocation
Kuniyuki Iwashima (1):
netfilter: ipset: Add schedule point in call_ad().
Luiz Augusto von Dentz (1):
Bluetooth: Fix use-after-free in hci_remove_ltk/hci_remove_irk
Martin Hundebøll (1):
pinctrl: meson-axg: add missing GPIOA_18 gpio group
Oleksij Rempel (1):
can: j1939: j1939_sk_send_loop_abort(): improved error queue handling in J1939 Socket
Paulo Alcantara (2):
cifs: get rid of unused parameter in reconn_setup_dfs_targets()
cifs: handle empty list of targets in cifs_reconnect()
Qingfang DENG (1):
neighbour: fix unaligned access to pneigh_entry
Randy Dunlap (1):
eeprom: at24: also select REGMAP
RenHai (1):
ALSA: hda/realtek: Add Lenovo P3 Tower platform
Ruihan Li (2):
usb: usbfs: Enforce page requirements for mmap
usb: usbfs: Use consistent mmap functions
Somnath Kotur (1):
bnxt_en: Query default VLAN before VNIC setup on a VF
Stephan Gerhold (1):
spi: qup: Request DMA before enabling clocks
Sungwoo Kim (1):
Bluetooth: L2CAP: Add missing checks for invalid DCID
Theodore Ts'o (1):
ext4: only check dquot_initialize_needed() when debugging
Tijs Van Buggenhout (1):
netfilter: conntrack: fix NULL pointer dereference in nf_confirm_cthelper
Uwe Kleine-König (1):
i2c: sprd: Delete i2c adapter in .remove's error path
Ville Syrjälä (1):
drm/atomic: Don't pollute crtc_state->mode_blob with error pointers
Vladislav Efanov (1):
batman-adv: Broken sync while rescheduling delayed work
Xiubo Li (1):
ceph: fix use-after-free bug for inodes when flushing capsnaps
Ying Hsu (1):
Bluetooth: Fix l2cap_disconnect_req deadlock
YouChing Lin (1):
mtd: spinand: macronix: Add support for MX35LFxGE4AD
Zixuan Fu (1):
btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 246 +SUBLEVEL = 247 EXTRAVERSION = NAME = Kleptomaniac Octopus
block/blk-iocost.c +7 -3
@@ -248,7 +248,9 @@ enum {/* 1/64k is granular enough and can easily be handled w/ u32 */ HWEIGHT_WHOLE = 1 << 16, +}; +enum {/* * As vtime is used to calculate the cost of each IO, it needs to * be fairly high precision. For example, it should be able to
@@ -271,6 +273,11 @@ enum {VRATE_MIN =VTIME_PER_USEC *VRATE_MIN_PPM /MILLION ,VRATE_CLAMP_ADJ_PCT =4 , +/* switch iff the conditions are met for longer than this */ + AUTOP_CYCLE_NSEC = 10LLU * NSEC_PER_SEC, +}; + +enum {/* if IOs end up waiting for requests, issue less */ RQ_WAIT_BUSY_PCT = 5,
@@ -288,9 +295,6 @@ enum {SURPLUS_SCALE_ABS =HWEIGHT_WHOLE /50 ,/* + 2% */ SURPLUS_MIN_ADJ_DELTA = HWEIGHT_WHOLE / 33, /* 3% */ -/* switch iff the conditions are met for longer than this */ -AUTOP_CYCLE_NSEC =10LLU *NSEC_PER_SEC , -/* * Count IO size in 4k pages. The 12bit shift helps keeping * size-proportional components of cost calculation in closer
drivers/block/rbd.c +45 -28
182 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/vi.c +9 -2
@@ -329,8 +329,15 @@ static u32 vi_get_xclk(struct amdgpu_device *adev)u32 reference_clock = adev->clock.spll.reference_freq;u32 tmp; -if (adev->flags &AMD_IS_APU ) -return reference_clock; +if (adev->flags &AMD_IS_APU ) { +switch (adev->asic_type) { +case CHIP_STONEY : +/* vbios says 48Mhz, but the actual freq is 100Mhz */ +return 10000 ; +default : +return reference_clock; + } + } tmp =RREG32_SMC (ixCG_CLKPIN_CNTL_2);if (REG_GET_FIELD (tmp,CG_CLKPIN_CNTL_2 ,MUX_TCLK_TO_XCLK ))
drivers/gpu/drm/drm_atomic_uapi.c +8 -6
@@ -75,15 +75,17 @@ int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state, state->mode_blob =NULL ;if (mode) { +struct drm_property_blob *blob; +drm_mode_convert_to_umode (&umode, mode); - state->mode_blob = -drm_property_create_blob (state->crtc->dev, -sizeof (umode), - &umode); -if (IS_ERR (state->mode_blob)) -return PTR_ERR (state->mode_blob); + blob =drm_property_create_blob (crtc->dev, +sizeof (umode), &umode); +if (IS_ERR (blob)) +return PTR_ERR (blob);drm_mode_copy (&state->mode, mode); + + state->mode_blob = blob; state->enable = true;DRM_DEBUG_ATOMIC ("Set [MODE:%s] for [CRTC:%d:%s] state %p\n" , mode->name, crtc->base.id, crtc->name, state);
drivers/i2c/busses/i2c-sprd.c +5 -3
@@ -577,12 +577,14 @@ static int sprd_i2c_remove(struct platform_device *pdev)struct sprd_i2c *i2c_dev =platform_get_drvdata (pdev);int ret; - ret =pm_runtime_resume_and_get (i2c_dev->dev); + ret =pm_runtime_get_sync (i2c_dev->dev);if (ret <0 ) -return ret; +dev_err (&pdev->dev,"Failed to resume device (%pe)\n" ,ERR_PTR (ret));i2c_del_adapter (&i2c_dev->adap); -clk_disable_unprepare (i2c_dev->clk); + +if (ret >=0 ) +clk_disable_unprepare (i2c_dev->clk);pm_runtime_put_noidle (i2c_dev->dev);pm_runtime_disable (i2c_dev->dev);
drivers/infiniband/hw/i40iw/i40iw.h +2 -3
@@ -411,9 +411,8 @@ void i40iw_manage_arp_cache(struct i40iw_device *iwdev,bool ipv4, u32 action); -int i40iw_manage_apbvt (struct i40iw_device *iwdev, -u16 accel_local_port, -bool add_port); +enum i40iw_status_code i40iw_manage_apbvt (struct i40iw_device *iwdev, +u16 accel_local_port,bool add_port);struct i40iw_cqp_request *i40iw_get_cqp_request (struct i40iw_cqp *cqp,bool wait);void i40iw_free_cqp_request (struct i40iw_cqp *cqp,struct i40iw_cqp_request *cqp_request);
drivers/input/joystick/xpad.c +0 -1
@@ -262,7 +262,6 @@ static const struct xpad_device { { 0x1430, 0xf801, "RedOctane Controller", 0, XTYPE_XBOX360 }, { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 }, { 0x146b, 0x0604, "Bigben Interactive DAIJA Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, - { 0x1532, 0x0037, "Razer Sabertooth", 0, XTYPE_XBOX360 }, { 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, { 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE }, { 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },
drivers/input/mouse/elantech.c +5 -4
@@ -674,10 +674,11 @@ static void process_packet_head_v4(struct psmouse *psmouse)struct input_dev *dev = psmouse->dev;struct elantech_data *etd = psmouse->private;unsigned char *packet = psmouse->packet; -int id = ((packet[3 ] &0xe0 ) >>5 ) -1 ; +int id;int pres, traces; -if (id <0 ) + id = ((packet[3 ] &0xe0 ) >>5 ) -1 ; +if (id <0 || id >=ETP_MAX_FINGERS )return ; etd->mt[id].x = ((packet[1 ] &0x0f ) <<8 ) | packet[2 ];
@@ -707,7 +708,7 @@ static void process_packet_motion_v4(struct psmouse *psmouse)int id, sid; id = ((packet[0 ] &0xe0 ) >>5 ) -1 ; -if (id <0 ) +if (id <0 || id >=ETP_MAX_FINGERS )return ; sid = ((packet[3 ] &0xe0 ) >>5 ) -1 ;
@@ -728,7 +729,7 @@ static void process_packet_motion_v4(struct psmouse *psmouse)input_report_abs (dev,ABS_MT_POSITION_X , etd->mt[id].x);input_report_abs (dev,ABS_MT_POSITION_Y , etd->mt[id].y); -if (sid >=0 ) { +if (sid >=0 && sid <ETP_MAX_FINGERS ) { etd->mt[sid].x += delta_x2 * weight; etd->mt[sid].y -= delta_y2 * weight;input_mt_slot (dev, sid);
drivers/misc/eeprom/Kconfig +1 -0
@@ -6,6 +6,7 @@ config EEPROM_AT24 depends on I2C && SYSFS select NVMEM select NVMEM_SYSFS + select REGMAP select REGMAP_I2C help Enable this driver to get read/write support to most I2C EEPROMs
drivers/mtd/nand/spi/macronix.c +16 -0
@@ -116,6 +116,22 @@ static const struct spinand_info macronix_spinand_table[] = { &update_cache_variants), SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL)), +SPINAND_INFO ("MX35LF2GE4AD" ,0x26 , +NAND_MEMORG (1 ,2048 ,64 ,64 ,2048 ,40 ,1 ,1 ,1 ), +NAND_ECCREQ (8 ,512 ), +SPINAND_INFO_OP_VARIANTS (&read_cache_variants, + &write_cache_variants, + &update_cache_variants), +SPINAND_HAS_QE_BIT , +SPINAND_ECCINFO (&mx35lfxge4ab_ooblayout,NULL )), +SPINAND_INFO ("MX35LF4GE4AD" ,0x37 , +NAND_MEMORG (1 ,2048 ,128 ,64 ,2048 ,40 ,1 ,1 ,1 ), +NAND_ECCREQ (8 ,512 ), +SPINAND_INFO_OP_VARIANTS (&read_cache_variants, + &write_cache_variants, + &update_cache_variants), +SPINAND_HAS_QE_BIT , + SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL)), };static int macronix_spinand_detect (struct spinand_device *spinand)
drivers/net/dsa/lan9303-core.c +0 -4
@@ -1187,8 +1187,6 @@ static int lan9303_port_fdb_add(struct dsa_switch *ds, int port,struct lan9303 *chip = ds->priv;dev_dbg (chip->dev,"%s(%d, %pM, %d)\n" , __func__, port, addr, vid); -if (vid) -return -EOPNOTSUPP ;return lan9303_alr_add_port (chip, addr, port, false); }
@@ -1200,8 +1198,6 @@ static int lan9303_port_fdb_del(struct dsa_switch *ds, int port,struct lan9303 *chip = ds->priv;dev_dbg (chip->dev,"%s(%d, %pM, %d)\n" , __func__, port, addr, vid); -if (vid) -return -EOPNOTSUPP ;lan9303_alr_del_port (chip, addr, port);return 0 ;
drivers/net/ethernet/broadcom/bnxt/bnxt.c +3 -0
@@ -7781,6 +7781,9 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init) goto err_out; } +if (BNXT_VF (bp)) +bnxt_hwrm_func_qcfg (bp); + rc =bnxt_setup_vnic (bp,0 );if (rc) goto err_out;
drivers/net/ethernet/intel/i40e/i40e_alloc.h +6 -11
@@ -20,16 +20,11 @@ enum i40e_memory_type { };/* prototype for functions used for dynamic memory allocation */ -i40e_status i40e_allocate_dma_mem (struct i40e_hw *hw, -struct i40e_dma_mem *mem, -enum i40e_memory_type type, -u64 size,u32 alignment); -i40e_status i40e_free_dma_mem (struct i40e_hw *hw, -struct i40e_dma_mem *mem); -i40e_status i40e_allocate_virt_mem (struct i40e_hw *hw, -struct i40e_virt_mem *mem, -u32 size); -i40e_status i40e_free_virt_mem (struct i40e_hw *hw, -struct i40e_virt_mem *mem); +int i40e_allocate_dma_mem (struct i40e_hw *hw,struct i40e_dma_mem *mem, +enum i40e_memory_type type,u64 size,u32 alignment); +int i40e_free_dma_mem (struct i40e_hw *hw,struct i40e_dma_mem *mem); +int i40e_allocate_virt_mem (struct i40e_hw *hw,struct i40e_virt_mem *mem, +u32 size); +int i40e_free_virt_mem (struct i40e_hw *hw,struct i40e_virt_mem *mem);#endif /* _I40E_ALLOC_H_ */
drivers/pinctrl/meson/pinctrl-meson-axg.c +1 -0
@@ -400,6 +400,7 @@ static struct meson_pmx_group meson_axg_periphs_groups[] = {GPIO_GROUP (GPIOA_15 ),GPIO_GROUP (GPIOA_16 ),GPIO_GROUP (GPIOA_17 ), +GPIO_GROUP (GPIOA_18 ),GPIO_GROUP (GPIOA_19 ), GPIO_GROUP(GPIOA_20),
drivers/spi/spi-qup.c +18 -19
@@ -1030,23 +1030,8 @@ static int spi_qup_probe(struct platform_device *pdev)return -ENXIO ; } - ret =clk_prepare_enable (cclk); -if (ret) { -dev_err (dev,"cannot enable core clock\n" ); -return ret; - } - - ret =clk_prepare_enable (iclk); -if (ret) { -clk_disable_unprepare (cclk); -dev_err (dev,"cannot enable iface clock\n" ); -return ret; - } - master =spi_alloc_master (dev,sizeof (struct spi_qup ));if (!master) { -clk_disable_unprepare (cclk); -clk_disable_unprepare (iclk);dev_err (dev,"cannot allocate master\n" );return -ENOMEM ; }
@@ -1092,6 +1077,19 @@ static int spi_qup_probe(struct platform_device *pdev)spin_lock_init (&controller->lock);init_completion (&controller->done); + ret =clk_prepare_enable (cclk); +if (ret) { +dev_err (dev,"cannot enable core clock\n" ); + goto error_dma; + } + + ret =clk_prepare_enable (iclk); +if (ret) { +clk_disable_unprepare (cclk); +dev_err (dev,"cannot enable iface clock\n" ); + goto error_dma; + } + iomode =readl_relaxed (base +QUP_IO_M_MODES ); size =QUP_IO_M_OUTPUT_BLOCK_SIZE (iomode);
@@ -1121,7 +1119,7 @@ static int spi_qup_probe(struct platform_device *pdev) ret =spi_qup_set_state (controller,QUP_STATE_RESET );if (ret) {dev_err (dev,"cannot set RESET state\n" ); - goto error_dma; + goto error_clk; }writel_relaxed (0 , base +QUP_OPERATIONAL );
@@ -1145,7 +1143,7 @@ static int spi_qup_probe(struct platform_device *pdev) ret =devm_request_irq (dev, irq, spi_qup_qup_irq,IRQF_TRIGGER_HIGH , pdev->name, controller);if (ret) - goto error_dma; + goto error_clk;pm_runtime_set_autosuspend_delay (dev,MSEC_PER_SEC );pm_runtime_use_autosuspend (dev);
@@ -1160,11 +1158,12 @@ static int spi_qup_probe(struct platform_device *pdev) disable_pm:pm_runtime_disable (&pdev->dev); +error_clk: +clk_disable_unprepare (cclk); +clk_disable_unprepare (iclk); error_dma:spi_qup_release_dma (master); error: -clk_disable_unprepare (cclk); -clk_disable_unprepare (iclk);spi_master_put (master);return ret; }
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -3
@@ -50,9 +50,9 @@ static const struct rtl819x_ops rtl819xp_ops = { };static struct pci_device_id rtl8192_pci_id_tbl[] = { - {PCI_DEVICE (0x10ec ,0x8192 )}, - {PCI_DEVICE (0x07aa ,0x0044 )}, - {PCI_DEVICE (0x07aa ,0x0047 )}, + {RTL_PCI_DEVICE (0x10ec ,0x8192 , rtl819xp_ops)}, + {RTL_PCI_DEVICE (0x07aa ,0x0044 , rtl819xp_ops)}, + {RTL_PCI_DEVICE (0x07aa ,0x0047 , rtl819xp_ops)}, {} };
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +5 -0
@@ -55,6 +55,11 @@#define IS_HARDWARE_TYPE_8192SE (_priv) \ (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE) +#define RTL_PCI_DEVICE (vend, dev, cfg) \ + .vendor = (vend), .device = (dev), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \ + .driver_data = (kernel_ulong_t)&(cfg) +#define TOTAL_CAM_ENTRY 32#define CAM_CONTENT_COUNT 8
drivers/usb/core/buffer.c +41 -0
44 lines not on this page · raw message
drivers/usb/core/devio.c +14 -6
@@ -173,6 +173,7 @@ static int connected(struct usb_dev_state *ps)static void dec_usb_memory_use_count (struct usb_memory *usbm,int *count) {struct usb_dev_state *ps = usbm->ps; +struct usb_hcd *hcd =bus_to_hcd (ps->dev->bus);unsigned long flags;spin_lock_irqsave (&ps->lock, flags);
@@ -181,8 +182,8 @@ static void dec_usb_memory_use_count(struct usb_memory *usbm, int *count)list_del (&usbm->memlist);spin_unlock_irqrestore (&ps->lock, flags); -usb_free_coherent (ps->dev, usbm->size, usbm->mem, - usbm->dma_handle); +hcd_buffer_free_pages (hcd, usbm->size, + usbm->mem, usbm->dma_handle);usbfs_decrease_memory_usage ( usbm->size +sizeof (struct usb_memory ));kfree (usbm);
@@ -221,7 +222,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma)size_t size = vma->vm_end - vma->vm_start;void *mem;unsigned long flags; -dma_addr_t dma_handle; +dma_addr_t dma_handle =DMA_MAPPING_ERROR ;int ret; ret =usbfs_increase_memory_usage (size +sizeof (struct usb_memory ));
@@ -234,8 +235,8 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) goto error_decrease_mem; } - mem =usb_alloc_coherent (ps->dev, size,GFP_USER | __GFP_NOWARN, - &dma_handle); + mem =hcd_buffer_alloc_pages (hcd, + size,GFP_USER | __GFP_NOWARN, &dma_handle);if (!mem) { ret = -ENOMEM ; goto error_free_usbm;
@@ -251,7 +252,14 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) usbm->vma_use_count =1 ;INIT_LIST_HEAD (&usbm->memlist); -if (hcd->localmem_pool || !hcd_uses_dma (hcd)) { +/* +* In DMA-unavailable cases, hcd_buffer_alloc_pages allocates +* normal pages and assigns DMA_MAPPING_ERROR to dma_handle. Check +* whether we are in such cases, and then use remap_pfn_range (or +* dma_mmap_coherent) to map normal (or DMA) pages into the user +* space, respectively. +*/ +if (dma_handle ==DMA_MAPPING_ERROR ) {if (remap_pfn_range (vma, vma->vm_start,virt_to_phys (usbm->mem) >>PAGE_SHIFT , size, vma->vm_page_prot) <0 ) {
fs/btrfs/relocation.c +10 -4
@@ -2511,7 +2511,7 @@ int prepare_to_merge(struct reloc_control *rc, int err)list_splice (&reloc_roots, &rc->reloc_roots);if (!err) -btrfs_commit_transaction (trans); + err =btrfs_commit_transaction (trans);else btrfs_end_transaction (trans);return err;
@@ -4102,8 +4102,12 @@ int prepare_to_relocate(struct reloc_control *rc)*/ return PTR_ERR (trans); } -btrfs_commit_transaction (trans); -return 0 ; + + ret =btrfs_commit_transaction (trans); +if (ret) +unset_reloc_control (rc); + +return ret; } static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
@@ -4263,7 +4267,9 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) err =PTR_ERR (trans); goto out_free; } -btrfs_commit_transaction (trans); + ret =btrfs_commit_transaction (trans); +if (ret && !err) + err = ret; out_free: ret =clean_dirty_subvols (rc);if (ret <0 && !err)
fs/ceph/caps.c +6 -0
@@ -1558,6 +1558,7 @@ void ceph_flush_snaps(struct ceph_inode_info *ci,struct inode *inode = &ci->vfs_inode;struct ceph_mds_client *mdsc =ceph_inode_to_client (inode)->mdsc;struct ceph_mds_session *session =NULL ; +bool need_put = false;int mds;dout ("ceph_flush_snaps %p\n" , inode);
@@ -1609,8 +1610,13 @@ void ceph_flush_snaps(struct ceph_inode_info *ci, }/* we flushed them all; remove this inode from the queue */ spin_lock (&mdsc->snap_flush_lock); +if (!list_empty (&ci->i_snap_flush_item)) + need_put = true;list_del_init (&ci->i_snap_flush_item);spin_unlock (&mdsc->snap_flush_lock); + +if (need_put) +iput (inode); }/*
fs/ceph/snap.c +3 -1
@@ -644,8 +644,10 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, capsnap->size);spin_lock (&mdsc->snap_flush_lock); -if (list_empty (&ci->i_snap_flush_item)) +if (list_empty (&ci->i_snap_flush_item)) { +ihold (inode);list_add_tail (&ci->i_snap_flush_item, &mdsc->snap_flush_list); + }spin_unlock (&mdsc->snap_flush_lock);return 1 ;/* caller may want to ceph_flush_snaps */ }
fs/cifs/connect.c +8 -7
@@ -469,8 +469,7 @@ static void reconn_inval_dfs_target(struct TCP_Server_Info *server, }static inline int reconn_setup_dfs_targets (struct cifs_sb_info *cifs_sb, -struct dfs_cache_tgt_list *tl, -struct dfs_cache_tgt_iterator **it) +struct dfs_cache_tgt_list *tl) {if (!cifs_sb->origin_fullpath)return -EOPNOTSUPP ;
@@ -514,11 +513,13 @@ cifs_reconnect(struct TCP_Server_Info *server) sb =NULL ; }else { cifs_sb =CIFS_SB (sb); - - rc =reconn_setup_dfs_targets (cifs_sb, &tgt_list, &tgt_it); -if (rc && (rc != -EOPNOTSUPP )) { -cifs_server_dbg (VFS ,"%s: no target servers for DFS failover\n" , - __func__); + rc =reconn_setup_dfs_targets (cifs_sb, &tgt_list); +if (rc) { + cifs_sb =NULL ; +if (rc != -EOPNOTSUPP ) { +cifs_server_dbg (VFS ,"%s: no target servers for DFS failover\n" , + __func__); + } }else { server->nr_targets =dfs_cache_get_nr_tgts (&tgt_list); }
fs/ext4/xattr.c +4 -2
@@ -2016,8 +2016,9 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,else {u32 ref; +#ifdef EXT4_XATTR_DEBUG WARN_ON_ONCE (dquot_initialize_needed (inode)); - +#endif /* The old block is released after updating the inode. */ error = dquot_alloc_block(inode,
@@ -2079,8 +2080,9 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,/* We need to allocate a new block */ ext4_fsblk_t goal, block; +#ifdef EXT4_XATTR_DEBUG WARN_ON_ONCE (dquot_initialize_needed (inode)); - +#endif goal =ext4_group_first_block_no (sb,EXT4_I (inode)->i_block_group); block = ext4_new_meta_blocks(handle, inode, goal, 0,
include/linux/netdevice.h +5 -2
@@ -732,8 +732,11 @@ static inline void rps_record_sock_flow(struct rps_sock_flow_table *table,/* We only give a hint, preemption can change CPU under us */ val |=raw_smp_processor_id (); -if (table->ents[index] != val) - table->ents[index] = val; +/* The following WRITE_ONCE() is paired with the READ_ONCE() +* here, and another one in get_rps_cpu(). +*/ +if (READ_ONCE (table->ents[index]) != val) +WRITE_ONCE (table->ents[index], val); } }
include/linux/usb/hcd.h +5 -0
@@ -503,6 +503,11 @@ void *hcd_buffer_alloc(struct usb_bus *bus, size_t size,void hcd_buffer_free (struct usb_bus *bus,size_t size,void *addr,dma_addr_t dma); +void *hcd_buffer_alloc_pages (struct usb_hcd *hcd, +size_t size,gfp_t mem_flags,dma_addr_t *dma); +void hcd_buffer_free_pages (struct usb_hcd *hcd, +size_t size,void *addr,dma_addr_t dma); +/* generic bus glue, needed for host controllers that don't use PCI */ extern irqreturn_t usb_hcd_irq (int irq,void *__hcd);
include/net/bond_alb.h +2 -2
@@ -156,8 +156,8 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave);void bond_alb_deinit_slave (struct bonding *bond,struct slave *slave);void bond_alb_handle_link_change (struct bonding *bond,struct slave *slave,char link);void bond_alb_handle_active_change (struct bonding *bond,struct slave *new_slave); -int bond_alb_xmit (struct sk_buff *skb,struct net_device *bond_dev); -int bond_tlb_xmit (struct sk_buff *skb,struct net_device *bond_dev); +netdev_tx_t bond_alb_xmit (struct sk_buff *skb,struct net_device *bond_dev); +netdev_tx_t bond_tlb_xmit (struct sk_buff *skb,struct net_device *bond_dev);void bond_alb_monitor (struct work_struct *);int bond_alb_set_mac_address (struct net_device *bond_dev,void *addr);void bond_alb_clear_vlan (struct bonding *bond,unsigned short vlan_id);
include/net/neighbour.h +1 -1
@@ -174,7 +174,7 @@ struct pneigh_entry {struct net_device *dev;u8 flags;u8 protocol; -u8 key[0 ]; +u32 key[]; };/*
include/net/pkt_sched.h +2 -0
@@ -124,6 +124,8 @@ static inline void qdisc_run(struct Qdisc *q) } } +extern const struct nla_policy rtm_tca_policy[TCA_MAX +1 ]; +/* Calculate maximal size of packet seen by hard_start_xmit routine of this device. */
include/net/sock.h +13 -5
@@ -997,8 +997,12 @@ static inline void sock_rps_record_flow(const struct sock *sk)* OR an additional socket flag * [1] : sk_state and sk_prot are in the same cache line. */ -if (sk->sk_state ==TCP_ESTABLISHED ) - sock_rps_record_flow_hash(sk->sk_rxhash); +if (sk->sk_state ==TCP_ESTABLISHED ) { +/* This READ_ONCE() is paired with the WRITE_ONCE() +* from sock_rps_save_rxhash() and sock_rps_reset_rxhash(). +*/ +sock_rps_record_flow_hash (READ_ONCE (sk->sk_rxhash)); + } }#endif }
@@ -1007,15 +1011,19 @@ static inline void sock_rps_save_rxhash(struct sock *sk, const struct sk_buff *skb) {#ifdef CONFIG_RPS -if (unlikely (sk->sk_rxhash != skb->hash)) - sk->sk_rxhash = skb->hash; +/* The following WRITE_ONCE() is paired with the READ_ONCE() +* here, and another one in sock_rps_record_flow(). +*/ +if (unlikely (READ_ONCE (sk->sk_rxhash) != skb->hash)) +WRITE_ONCE (sk->sk_rxhash, skb->hash);#endif }static inline void sock_rps_reset_rxhash (struct sock *sk) {#ifdef CONFIG_RPS - sk->sk_rxhash =0 ; +/* Paired with READ_ONCE() in sock_rps_record_flow() */ +WRITE_ONCE (sk->sk_rxhash,0 );#endif }
lib/cpu_rmap.c +1 -1
@@ -268,8 +268,8 @@ static void irq_cpu_rmap_release(struct kref *ref)struct irq_glue *glue = container_of(ref, struct irq_glue, notify.kref); -cpu_rmap_put (glue->rmap); glue->rmap->obj[glue->index] =NULL ; +cpu_rmap_put (glue->rmap);kfree (glue); }
net/batman-adv/distributed-arp-table.c +1 -1
@@ -102,7 +102,6 @@ static void batadv_dat_purge(struct work_struct *work);*/ static void batadv_dat_start_timer (struct batadv_priv *bat_priv) { -INIT_DELAYED_WORK (&bat_priv->dat.work, batadv_dat_purge);queue_delayed_work (batadv_event_workqueue, &bat_priv->dat.work,msecs_to_jiffies (10000 )); }
@@ -817,6 +816,7 @@ int batadv_dat_init(struct batadv_priv *bat_priv)if (!bat_priv->dat.hash)return -ENOMEM ; +INIT_DELAYED_WORK (&bat_priv->dat.work, batadv_dat_purge);batadv_dat_start_timer (bat_priv); batadv_tvlv_handler_register(bat_priv, batadv_dat_tvlv_ogm_handler_v1,
net/bluetooth/hci_core.c +4 -4
@@ -2572,10 +2572,10 @@ int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr)int hci_remove_ltk (struct hci_dev *hdev,bdaddr_t *bdaddr,u8 bdaddr_type) { -struct smp_ltk *k; +struct smp_ltk *k, *tmp;int removed =0 ; -list_for_each_entry_rcu (k, &hdev->long_term_keys, list) { +list_for_each_entry_safe (k, tmp, &hdev->long_term_keys, list) {if (bacmp (bdaddr, &k->bdaddr) || k->bdaddr_type != bdaddr_type)continue ;
@@ -2591,9 +2591,9 @@ int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type)void hci_remove_irk (struct hci_dev *hdev,bdaddr_t *bdaddr,u8 addr_type) { -struct smp_irk *k; +struct smp_irk *k, *tmp; -list_for_each_entry_rcu (k, &hdev->identity_resolving_keys, list) { +list_for_each_entry_safe (k, tmp, &hdev->identity_resolving_keys, list) {if (bacmp (bdaddr, &k->bdaddr) || k->addr_type != addr_type)continue ;
net/bluetooth/l2cap_core.c +13 -0
@@ -4024,6 +4024,10 @@ static int l2cap_connect_create_rsp(struct l2cap_conn *conn, result =__le16_to_cpu (rsp->result); status =__le16_to_cpu (rsp->status); +if (result ==L2CAP_CR_SUCCESS && (dcid <L2CAP_CID_DYN_START || + dcid >L2CAP_CID_DYN_END )) +return -EPROTO ; +BT_DBG ("dcid 0x%4.4x scid 0x%4.4x result 0x%2.2x status 0x%2.2x" , dcid, scid, result, status);
@@ -4055,6 +4059,11 @@ static int l2cap_connect_create_rsp(struct l2cap_conn *conn,switch (result) {case L2CAP_CR_SUCCESS : +if (__l2cap_get_chan_by_dcid (conn, dcid)) { + err = -EBADSLT ; +break ; + } +l2cap_state_change (chan,BT_CONFIG ); chan->ident =0 ; chan->dcid = dcid;
@@ -4380,7 +4389,9 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, chan->ops->set_shutdown (chan); +l2cap_chan_unlock (chan);mutex_lock (&conn->chan_lock); +l2cap_chan_lock (chan);l2cap_chan_del (chan,ECONNRESET );mutex_unlock (&conn->chan_lock);
@@ -4419,7 +4430,9 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn,return 0 ; } +l2cap_chan_unlock (chan);mutex_lock (&conn->chan_lock); +l2cap_chan_lock (chan);l2cap_chan_del (chan,0 );mutex_unlock (&conn->chan_lock);
net/can/j1939/main.c +13 -11
@@ -122,7 +122,7 @@ static void j1939_can_recv(struct sk_buff *iskb, void *data)#define J1939_CAN_ID CAN_EFF_FLAG#define J1939_CAN_MASK (CAN_EFF_FLAG | CAN_RTR_FLAG) -static DEFINE_SPINLOCK (j1939_netdev_lock); +static DEFINE_MUTEX (j1939_netdev_lock);static struct j1939_priv *j1939_priv_create (struct net_device *ndev) {
@@ -216,7 +216,7 @@ static void __j1939_rx_release(struct kref *kref)j1939_can_rx_unregister (priv);j1939_ecu_unmap_all (priv);j1939_priv_set (priv->ndev,NULL ); -spin_unlock (&j1939_netdev_lock); +mutex_unlock (&j1939_netdev_lock); }/* get pointer to priv without increasing ref counter */
@@ -244,9 +244,9 @@ static struct j1939_priv *j1939_priv_get_by_ndev(struct net_device *ndev) {struct j1939_priv *priv; -spin_lock (&j1939_netdev_lock); +mutex_lock (&j1939_netdev_lock); priv =j1939_priv_get_by_ndev_locked (ndev); -spin_unlock (&j1939_netdev_lock); +mutex_unlock (&j1939_netdev_lock);return priv; }
@@ -256,14 +256,14 @@ struct j1939_priv *j1939_netdev_start(struct net_device *ndev)struct j1939_priv *priv, *priv_new;int ret; -spin_lock (&j1939_netdev_lock); +mutex_lock (&j1939_netdev_lock); priv =j1939_priv_get_by_ndev_locked (ndev);if (priv) {kref_get (&priv->rx_kref); -spin_unlock (&j1939_netdev_lock); +mutex_unlock (&j1939_netdev_lock);return priv; } -spin_unlock (&j1939_netdev_lock); +mutex_unlock (&j1939_netdev_lock); priv =j1939_priv_create (ndev);if (!priv)
@@ -273,29 +273,31 @@ struct j1939_priv *j1939_netdev_start(struct net_device *ndev)spin_lock_init (&priv->j1939_socks_lock);INIT_LIST_HEAD (&priv->j1939_socks); -spin_lock (&j1939_netdev_lock); +mutex_lock (&j1939_netdev_lock); priv_new =j1939_priv_get_by_ndev_locked (ndev);if (priv_new) {/* Someone was faster than us, use their priv and roll * back our's. */ kref_get (&priv_new->rx_kref); -spin_unlock (&j1939_netdev_lock); +mutex_unlock (&j1939_netdev_lock);dev_put (ndev);kfree (priv);return priv_new; }j1939_priv_set (ndev, priv); -spin_unlock (&j1939_netdev_lock); ret =j1939_can_rx_register (priv);if (ret <0 ) goto out_priv_put; +mutex_unlock (&j1939_netdev_lock);return priv; out_priv_put:j1939_priv_set (ndev,NULL ); +mutex_unlock (&j1939_netdev_lock); +dev_put (ndev);kfree (priv);
@@ -304,7 +306,7 @@ struct j1939_priv *j1939_netdev_start(struct net_device *ndev)void j1939_netdev_stop (struct j1939_priv *priv) { -kref_put_lock (&priv->rx_kref, __j1939_rx_release, &j1939_netdev_lock); +kref_put_mutex (&priv->rx_kref, __j1939_rx_release, &j1939_netdev_lock);j1939_priv_put (priv); }
net/can/j1939/socket.c +5 -0
@@ -1013,6 +1013,11 @@ void j1939_sk_errqueue(struct j1939_session *session,void j1939_sk_send_loop_abort (struct sock *sk,int err) { +struct j1939_sock *jsk =j1939_sk (sk); + +if (jsk->state &J1939_SOCK_ERRQUEUE ) +return ; + sk->sk_err = err; sk->sk_error_report (sk);
net/core/dev.c +4 -2
@@ -4002,8 +4002,10 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,u32 next_cpu;u32 ident; -/* First check into global flow table if there is a match */ - ident = sock_flow_table->ents[hash & sock_flow_table->mask]; +/* First check into global flow table if there is a match. +* This READ_ONCE() pairs with WRITE_ONCE() from rps_record_sock_flow(). +*/ + ident =READ_ONCE (sock_flow_table->ents[hash & sock_flow_table->mask]);if ((ident ^ hash) & ~rps_cpu_mask) goto try_rps;
net/netfilter/ipset/ip_set_core.c +8 -0
@@ -1539,6 +1539,14 @@ call_ad(struct sock *ctnl, struct sk_buff *skb, struct ip_set *set,bool eexist = flags &IPSET_FLAG_EXIST , retried = false; do { + if (retried) { + __ip_set_get(set); + nfnl_unlock(NFNL_SUBSYS_IPSET); + cond_resched(); + nfnl_lock(NFNL_SUBSYS_IPSET); + __ip_set_put(set); + } + ip_set_lock(set); ret = set->variant->uadt(set, tb, adt, &lineno, flags, retried); ip_set_unlock(set);
net/netfilter/nf_conntrack_core.c +3 -0
@@ -1943,6 +1943,9 @@ static int nf_confirm_cthelper(struct sk_buff *skb, struct nf_conn *ct,return 0 ; helper =rcu_dereference (help->helper); +if (!helper) +return 0 ; +if (!(helper->flags &NF_CT_HELPER_F_USERSPACE ))return 0 ;
net/sched/cls_api.c +1 -2
@@ -40,8 +40,6 @@#include <net/tc_act/tc_mpls.h> #include <net/flow_offload.h> -extern const struct nla_policy rtm_tca_policy[TCA_MAX +1 ]; -/* The list of all installed classifier types */ static LIST_HEAD (tcf_proto_base);
@@ -2734,6 +2732,7 @@ static int tc_chain_tmplt_add(struct tcf_chain *chain, struct net *net,return PTR_ERR (ops);if (!ops->tmplt_create || !ops->tmplt_destroy || !ops->tmplt_dump) {NL_SET_ERR_MSG (extack,"Chain templates are not supported with specified classifier" ); +module_put (ops->owner);return -EOPNOTSUPP ; }
sound/pci/hda/patch_realtek.c +2 -0
@@ -10345,6 +10345,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x8719 ,"HP" ,ALC897_FIXUP_HP_HSMIC_VERB ),SND_PCI_QUIRK (0x103c ,0x872b ,"HP" ,ALC897_FIXUP_HP_HSMIC_VERB ),SND_PCI_QUIRK (0x103c ,0x873e ,"HP" ,ALC671_FIXUP_HP_HEADSET_MIC2 ), +SND_PCI_QUIRK (0x103c ,0x8768 ,"HP Slim Desktop S01" ,ALC671_FIXUP_HP_HEADSET_MIC2 ),SND_PCI_QUIRK (0x103c ,0x877e ,"HP 288 Pro G6" ,ALC671_FIXUP_HP_HEADSET_MIC2 ),SND_PCI_QUIRK (0x103c ,0x885f ,"HP 288 Pro G8" ,ALC671_FIXUP_HP_HEADSET_MIC2 ), SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
@@ -10366,6 +10367,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {SND_PCI_QUIRK (0x14cd ,0x5003 ,"USI" ,ALC662_FIXUP_USI_HEADSET_MODE ),SND_PCI_QUIRK (0x17aa ,0x1036 ,"Lenovo P520" ,ALC662_FIXUP_LENOVO_MULTI_CODECS ),SND_PCI_QUIRK (0x17aa ,0x1057 ,"Lenovo P360" ,ALC897_FIXUP_HEADSET_MIC_PIN ), +SND_PCI_QUIRK (0x17aa ,0x1064 ,"Lenovo P3 Tower" ,ALC897_FIXUP_HEADSET_MIC_PIN ),SND_PCI_QUIRK (0x17aa ,0x32ca ,"Lenovo ThinkCentre M80" ,ALC897_FIXUP_HEADSET_MIC_PIN ),SND_PCI_QUIRK (0x17aa ,0x32cb ,"Lenovo ThinkCentre M70" ,ALC897_FIXUP_HEADSET_MIC_PIN ), SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),