Linux 5.4.126
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.4.126 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 arch/mips/lib/mips-atomic.c | 12 +- arch/powerpc/boot/dts/fsl/p1010si-post.dtsi | 8 + arch/powerpc/boot/dts/fsl/p2041si-post.dtsi | 16 +++ arch/x86/boot/setup.ld | 2 arch/x86/kvm/trace.h | 6 - drivers/gpu/drm/drm_auth.c | 3 drivers/gpu/drm/drm_ioctl.c | 9 +- drivers/i2c/busses/i2c-mpc.c | 95 +++++++++++++++++++++- drivers/infiniband/hw/mlx4/main.c | 5 - drivers/infiniband/hw/mlx5/cq.c | 9 -- drivers/infiniband/ulp/ipoib/ipoib_netlink.c | 1 drivers/isdn/hardware/mISDN/netjet.c | 1 drivers/md/dm-verity-verify-sig.c | 2 drivers/net/appletalk/cops.c | 4 drivers/net/bonding/bond_main.c | 2 drivers/net/dsa/microchip/ksz9477.c | 1 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 4 drivers/net/ethernet/cadence/macb_main.c | 3 drivers/net/ethernet/mellanox/mlx4/fw.c | 3 drivers/net/ethernet/mellanox/mlx4/fw.h | 1 drivers/net/ethernet/mellanox/mlx4/main.c | 6 + drivers/net/ethernet/qlogic/qla3xxx.c | 2 drivers/net/phy/mdio_bus.c | 3 drivers/nvme/host/Kconfig | 3 drivers/nvme/host/fabrics.c | 5 + drivers/regulator/core.c | 6 + drivers/regulator/max77620-regulator.c | 7 + drivers/s390/cio/vfio_ccw_drv.c | 12 ++ drivers/scsi/bnx2fc/bnx2fc_io.c | 1 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 8 - drivers/scsi/hosts.c | 47 ++++++---- drivers/scsi/qla2xxx/qla_target.c | 2 drivers/scsi/vmw_pvscsi.c | 8 + drivers/spi/spi-bcm2835.c | 10 +- drivers/spi/spi-bitbang.c | 18 +++- drivers/spi/spi-fsl-spi.c | 4 drivers/spi/spi-omap-uwire.c | 9 +- drivers/spi/spi-omap2-mcspi.c | 39 +++++---- drivers/spi/spi-pxa2xx.c | 9 +- drivers/spi/spi-sprd.c | 1 drivers/spi/spi.c | 20 +++- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 drivers/usb/cdns3/gadget.c | 4 drivers/usb/dwc3/ep0.c | 3 drivers/usb/gadget/config.c | 8 + drivers/usb/gadget/function/f_ecm.c | 2 drivers/usb/gadget/function/f_eem.c | 6 - drivers/usb/gadget/function/f_fs.c | 3 drivers/usb/gadget/function/f_hid.c | 3 drivers/usb/gadget/function/f_loopback.c | 2 drivers/usb/gadget/function/f_ncm.c | 10 +- drivers/usb/gadget/function/f_printer.c | 3 drivers/usb/gadget/function/f_rndis.c | 2 drivers/usb/gadget/function/f_serial.c | 2 drivers/usb/gadget/function/f_sourcesink.c | 3 drivers/usb/gadget/function/f_subset.c | 2 drivers/usb/gadget/function/f_tcm.c | 3 drivers/usb/musb/musb_core.c | 3 drivers/usb/serial/cp210x.c | 20 ++++ drivers/usb/serial/ftdi_sio.c | 1 drivers/usb/serial/ftdi_sio_ids.h | 1 drivers/usb/serial/omninet.c | 2 drivers/usb/serial/quatech2.c | 6 - drivers/usb/typec/mux.c | 2 drivers/usb/typec/tcpm/wcove.c | 2 drivers/usb/typec/ucsi/ucsi.c | 1 fs/btrfs/disk-io.c | 26 ++++-- fs/btrfs/file.c | 4 fs/nfs/client.c | 2 fs/nfs/nfs4_fs.h | 1 fs/nfs/nfs4client.c | 2 fs/nfs/nfs4proc.c | 29 ++++++ fs/proc/base.c | 11 ++ include/asm-generic/vmlinux.lds.h | 1 include/linux/kvm_host.h | 10 ++ include/linux/mlx4/device.h | 1 include/linux/usb/pd.h | 2 kernel/cgroup/cgroup-v1.c | 4 kernel/cgroup/cgroup.c | 13 +-- kernel/events/core.c | 2 kernel/sched/fair.c | 2 kernel/trace/ftrace.c | 8 + kernel/trace/trace.c | 2 kernel/workqueue.c | 12 ++ net/netlink/af_netlink.c | 6 - net/nfc/rawsock.c | 2 net/rds/connection.c | 23 +++-- net/rds/tcp.c | 4 net/rds/tcp.h | 3 net/rds/tcp_listen.c | 6 + sound/soc/codecs/max98088.c | 13 ++- sound/soc/codecs/sti-sas.c | 1 sound/soc/intel/boards/bytcr_rt5640.c | 25 +++++ tools/perf/util/session.c | 1 95 files changed, 554 insertions(+), 167 deletions(-)
Alaa Hleihel (1):
IB/mlx5: Fix initializing CQ fragments buffer
Alexander Kuznetsov (1):
cgroup1: don't allow '\n' in renaming
Alexandre GRIVEAUX (1):
USB: serial: omninet: add device id for Zyxel Omni 56K Plus
Andy Shevchenko (1):
usb: typec: wcove: Use LE to CPU conversion when accessing msg->header
Anna Schumaker (1):
NFS: Fix use-after-free in nfs4_init_client()
Arvind Sankar (1):
x86/boot: Add .text.* to setup.ld
Bjorn Andersson (1):
usb: typec: mux: Fix copy-paste mistake in typec_mux_match
Chris Packham (4):
powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P2041 i2c controllers powerpc/fsl: set fsl,i2c-erratum-a004447 flag for P1010 i2c controllers
i2c: mpc: Make use of i2c_recover_bus()
i2c: mpc: implement erratum A-004447 workaround
Chunyan Zhang (1):
spi: sprd: Add missing MODULE_DEVICE_TABLE
Dai Ngo (1):
NFSv4: nfs4_proc_set_acl needs to restore NFS_CAP_UIDGID_NOMAP on error.
Dan Carpenter (2):
net: mdiobus: get rid of a BUG_ON()
NFS: Fix a potential NULL dereference in nfs_get_client()
Desmond Cheong Zhi Xi (2):
drm: Fix use-after-free read in drm_getunique()
drm: Lock pointer access in drm_master_release()
Dinghao Liu (1):
usb: cdns3: Fix runtime PM imbalance on error
Dmitry Baryshkov (1):
regulator: core: resolve supply for boot-on/always-on regulators
Dmitry Bogdanov (1):
scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal
Dmitry Osipenko (1):
regulator: max77620: Use device_set_of_node_from_dev()
Eric Farman (1):
vfio-ccw: Serialize FSM IDLE state with I/O completion
George McCollister (2):
net: dsa: microchip: enable phy errata workaround on 9567
USB: serial: ftdi_sio: add NovaTech OrionMX product ID
Greg Kroah-Hartman (1):
Linux 5.4.126
Hannes Reinecke (1):
nvme-fabrics: decode host pathing error for connect
Hans de Goede (2):
ASoC: Intel: bytcr_rt5640: Add quirk for the Glavey TM800A550L tablet
ASoC: Intel: bytcr_rt5640: Add quirk for the Lenovo Miix 3-830 tablet
Javed Hasan (1):
scsi: bnx2fc: Return failure if io_req is already in ABTS processing
Jeimon (1):
net/nfc/rawsock.c: fix a permission check bug
Jiapeng Chong (1):
bnx2x: Fix missing error code in bnx2x_iov_init_one()
Johan Hovold (1):
USB: serial: quatech2: fix control-request directions
Johannes Berg (2):
bonding: init notify_work earlier to avoid uninitialized use
netlink: disable IRQs for netlink_lock_table()
John Keeping (1):
dm verity: fix require_signatures module_param permissions
Kamal Heib (1):
RDMA/ipoib: Fix warning caused by destroying non-initial netns
Kees Cook (1):
proc: Track /proc/$pid/attr/ opener mm_struct
Kyle Tso (1):
usb: pd: Set PD_T_SINK_WAIT_CAP to 310ms
Leo Yan (1):
perf session: Correct buffer copying when peeking events
Liangyan (1):
tracing: Correct the length check which causes memory corruption
Linus Torvalds (1):
proc: only require mm_struct for writing
Linyu Yuan (1):
usb: gadget: eem: fix wrong eem header operation
Lukas Wunner (2):
spi: Cleanup on failure of initial setup
spi: bcm2835: Fix out-of-bounds access with more than 4 slaves
Maciej Żenczykowski (4):
USB: f_ncm: ncm_bitrate (speed) is unsigned
usb: f_ncm: only first packet of aggregate needs to start timer
usb: fix various gadgets null ptr deref on 10gbps cabling.
usb: fix various gadget panics on 10gbps cabling
Marco Elver (1):
perf: Fix data race between pin_count increment/decrement
Marco Felsch (1):
ASoC: max98088: fix ni clock divider calculation
Marian-Cristian Rotariu (1):
usb: dwc3: ep0: fix NULL pointer exception
Matt Wang (1):
scsi: vmw_pvscsi: Set correct residual data length
Mayank Rana (1):
usb: typec: ucsi: Clear PPM capability data in ucsi_init() error path
Ming Lei (4):
scsi: core: Fix error handling of scsi_host_alloc()
scsi: core: Fix failure handling of scsi_add_host_with_dma()
scsi: core: Put .shost_dev in failure path if host state changes to RUNNING
scsi: core: Only put parent device if host state differs from SHOST_CREATED
Nathan Chancellor (1):
vmlinux.lds.h: Avoid orphan section with !SMP
Nikolay Borisov (1):
btrfs: promote debugging asserts to full-fledged checks in validate_super
Paolo Bonzini (2):
kvm: avoid speculation-based attacks from out-of-range memslot accesses
kvm: fix previous commit for 32-bit builds
Rao Shoaib (1):
RDS tcp loopback connection can hang
Ritesh Harjani (1):
btrfs: return value from btrfs_mark_extent_written() in case of error
Sagi Grimberg (1):
nvme-tcp: remove incorrect Kconfig dep in BLK_DEV_NVME
Saravana Kannan (2):
spi: Fix spi device unregister flow
spi: Don't have controller clean up spi device before driver unbind
Saubhik Mukherjee (1):
net: appletalk: cops: Fix data race in cops_probe1
Sean Christopherson (1):
KVM: x86: Ensure liveliness of nested VM-Enter fail tracepoint message
Sergey Senozhatsky (1):
wq: handle VM suspension in stall detection
Shakeel Butt (1):
cgroup: disable controllers at parse time
Shay Drory (1):
RDMA/mlx4: Do not map the core_clock page to user space unless enabled
Stefan Agner (1):
USB: serial: cp210x: fix alternate function for CP2102N QFN20
Steven Rostedt (VMware) (1):
ftrace: Do not blindly read the ip address in ftrace_bug()
Thomas Petazzoni (1):
usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling
Tiezhu Yang (1):
MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER
Trond Myklebust (2):
NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode()
NFSv4: Fix second deadlock in nfs4_evict_inode()
Vincent Guittot (1):
sched/fair: Make sure to update tg contrib for blocked load
Wenli Looi (1):
staging: rtl8723bs: Fix uninitialized variables
Wesley Cheng (1):
usb: gadget: f_fs: Ensure io_completion_wq is idle during unbind
Yang Yingliang (1):
scsi: hisi_sas: Drop free_irq() of devm_request_irq() allocated irq
Zheyu Ma (2):
isdn: mISDN: netjet: Fix crash in nj_probe:
net/qla3xxx: fix schedule while atomic in ql_sem_spinlock
Zong Li (1):
net: macb: ensure the device is available before accessing GEMGXL control registers
Zou Wei (1):
ASoC: sti-sas: add missing MODULE_DEVICE_TABLE
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 125 +SUBLEVEL = 126 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/mips/lib/mips-atomic.c +6 -6
@@ -37,7 +37,7 @@*/ notrace void arch_local_irq_disable(void) { -preempt_disable (); +preempt_disable_notrace (); __asm__ __volatile__( " .set push \n"
@@ -53,7 +53,7 @@ notrace void arch_local_irq_disable(void) : /* no inputs */ : "memory"); -preempt_enable (); +preempt_enable_notrace (); }EXPORT_SYMBOL (arch_local_irq_disable);
@@ -61,7 +61,7 @@ notrace unsigned long arch_local_irq_save(void) {unsigned long flags; -preempt_disable (); +preempt_disable_notrace (); __asm__ __volatile__( " .set push \n"
@@ -78,7 +78,7 @@ notrace unsigned long arch_local_irq_save(void) : /* no inputs */ : "memory"); -preempt_enable (); +preempt_enable_notrace ();return flags; }
@@ -88,7 +88,7 @@ notrace void arch_local_irq_restore(unsigned long flags) {unsigned long __tmp1; -preempt_disable (); +preempt_disable_notrace (); __asm__ __volatile__( " .set push \n"
@@ -106,7 +106,7 @@ notrace void arch_local_irq_restore(unsigned long flags) : "0" (flags) : "memory"); -preempt_enable (); +preempt_enable_notrace (); }EXPORT_SYMBOL (arch_local_irq_restore);
arch/powerpc/boot/dts/fsl/p1010si-post.dtsi +8 -0
@@ -122,7 +122,15 @@ }; /include/ "pq3-i2c-0.dtsi" + i2c@3000 { + fsl,i2c-erratum-a004447; + }; + /include/ "pq3-i2c-1.dtsi" + i2c@3100 { + fsl,i2c-erratum-a004447; + }; + /include/ "pq3-duart-0.dtsi" /include/ "pq3-espi-0.dtsi" spi0: spi@7000 {
arch/powerpc/boot/dts/fsl/p2041si-post.dtsi +16 -0
@@ -371,7 +371,23 @@ }; /include/ "qoriq-i2c-0.dtsi" + i2c@118000 { + fsl,i2c-erratum-a004447; + }; + + i2c@118100 { + fsl,i2c-erratum-a004447; + }; + /include/ "qoriq-i2c-1.dtsi" + i2c@119000 { + fsl,i2c-erratum-a004447; + }; + + i2c@119100 { + fsl,i2c-erratum-a004447; + }; + /include/ "qoriq-duart-0.dtsi" /include/ "qoriq-duart-1.dtsi" /include/ "qoriq-gpio-0.dtsi"
arch/x86/boot/setup.ld +1 -1
@@ -20,7 +20,7 @@ SECTIONS .initdata : { *(.initdata) } __end_init = .; - .text : { *(.text) } + .text : { *(.text .text.*) } .text32 : { *(.text32) } . = ALIGN(16);
arch/x86/kvm/trace.h +3 -3
@@ -1483,16 +1483,16 @@ TRACE_EVENT(kvm_nested_vmenter_failed,TP_ARGS (msg, err),TP_STRUCT__entry ( - __field(const char *, msg) + __string(msg, msg)__field (u32, err) ),TP_fast_assign ( - __entry->msg = msg; + __assign_str(msg, msg); __entry->err = err; ), -TP_printk ("%s%s" , __entry->msg, !__entry->err ?"" : +TP_printk ("%s%s" ,__get_str (msg), !__entry->err ?"" :__print_symbolic (__entry->err,VMX_VMENTER_INSTRUCTION_ERRORS )) );
drivers/gpu/drm/drm_auth.c +2 -1
@@ -268,9 +268,10 @@ int drm_master_open(struct drm_file *file_priv)void drm_master_release (struct drm_file *file_priv) {struct drm_device *dev = file_priv->minor->dev; -struct drm_master *master = file_priv->master; +struct drm_master *master;mutex_lock (&dev->master_mutex); + master = file_priv->master;if (file_priv->magic)idr_remove (&file_priv->master->magic_map, file_priv->magic);
drivers/gpu/drm/drm_ioctl.c +5 -4
@@ -118,17 +118,18 @@ int drm_getunique(struct drm_device *dev, void *data, struct drm_file *file_priv) {struct drm_unique *u = data; -struct drm_master *master = file_priv->master; +struct drm_master *master; -mutex_lock (&master->dev->master_mutex); +mutex_lock (&dev->master_mutex); + master = file_priv->master;if (u->unique_len >= master->unique_len) {if (copy_to_user (u->unique, master->unique, master->unique_len)) { -mutex_unlock (&master->dev->master_mutex); +mutex_unlock (&dev->master_mutex);return -EFAULT ; } } u->unique_len = master->unique_len; -mutex_unlock (&master->dev->master_mutex); +mutex_unlock (&dev->master_mutex);return 0 ; }
drivers/i2c/busses/i2c-mpc.c +93 -2
155 lines not on this page · raw message
drivers/infiniband/hw/mlx4/main.c +1 -4
@@ -577,12 +577,9 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, props->cq_caps.max_cq_moderation_count =MLX4_MAX_CQ_COUNT ; props->cq_caps.max_cq_moderation_period =MLX4_MAX_CQ_PERIOD ; -if (!mlx4_is_slave (dev->dev)) - err =mlx4_get_internal_clock_params (dev->dev, &clock_params); -if (uhw->outlen >= resp.response_length +sizeof (resp.hca_core_clock_offset)) { resp.response_length +=sizeof (resp.hca_core_clock_offset); -if (!err && !mlx4_is_slave (dev->dev)) { +if (!mlx4_get_internal_clock_params (dev->dev, &clock_params)) { resp.comp_mask |=MLX4_IB_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET ; resp.hca_core_clock_offset = clock_params.offset %PAGE_SIZE ; }
drivers/infiniband/hw/mlx5/cq.c +4 -5
@@ -829,15 +829,14 @@ static void destroy_cq_user(struct mlx5_ib_cq *cq, struct ib_udata *udata)ib_umem_release (cq->buf.umem); } -static void init_cq_frag_buf (struct mlx5_ib_cq *cq, -struct mlx5_ib_cq_buf *buf) +static void init_cq_frag_buf (struct mlx5_ib_cq_buf *buf) {int i;void *cqe;struct mlx5_cqe64 *cqe64;for (i =0 ; i < buf->nent; i++) { - cqe =get_cqe (cq, i); + cqe =mlx5_frag_buf_get_wqe (&buf->fbc, i); cqe64 = buf->cqe_size ==64 ? cqe : cqe +64 ; cqe64->op_own =MLX5_CQE_INVALID <<4 ; }
@@ -863,7 +862,7 @@ static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,if (err) goto err_db; -init_cq_frag_buf (cq, &cq->buf); +init_cq_frag_buf (&cq->buf); *inlen =MLX5_ST_SZ_BYTES (create_cq_in) + MLX5_FLD_SZ_BYTES(create_cq_in, pas[0]) *
@@ -1163,7 +1162,7 @@ static int resize_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,if (err) goto ex; -init_cq_frag_buf (cq, cq->resize_buf); +init_cq_frag_buf (cq->resize_buf);return 0 ;
drivers/infiniband/ulp/ipoib/ipoib_netlink.c +1 -0
@@ -163,6 +163,7 @@ static size_t ipoib_get_size(const struct net_device *dev)static struct rtnl_link_ops ipoib_link_ops__read_mostly = { .kind ="ipoib" , + .netns_refund = true, .maxtype =IFLA_IPOIB_MAX , .policy = ipoib_policy, .priv_size =sizeof (struct ipoib_dev_priv ),
drivers/isdn/hardware/mISDN/netjet.c +0 -1
@@ -1100,7 +1100,6 @@ nj_probe(struct pci_dev *pdev, const struct pci_device_id *ent) card->typ =NETJET_S_TJ300 ; card->base =pci_resource_start (pdev,0 ); - card->irq = pdev->irq;pci_set_drvdata (pdev, card); err =setup_instance (card);if (err)
drivers/md/dm-verity-verify-sig.c +1 -1
@@ -15,7 +15,7 @@#define DM_VERITY_VERIFY_ERR (s) DM_VERITY_ROOT_HASH_VERIFICATION " " sstatic bool require_signatures; -module_param (require_signatures, bool, false); +module_param (require_signatures, bool,0444 );MODULE_PARM_DESC (require_signatures,"Verify the roothash of dm-verity hash tree" );
drivers/net/appletalk/cops.c +2 -2
@@ -325,6 +325,8 @@ static int __init cops_probe1(struct net_device *dev, int ioaddr)break ; } + dev->base_addr = ioaddr; +/* Reserve any actual interrupt. */ if (dev->irq) { retval =request_irq (dev->irq, cops_interrupt,0 , dev->name, dev);
@@ -332,8 +334,6 @@ static int __init cops_probe1(struct net_device *dev, int ioaddr) goto err_out; } - dev->base_addr = ioaddr; - lp =netdev_priv (dev);spin_lock_init (&lp->lock);
drivers/net/bonding/bond_main.c +1 -1
@@ -1335,6 +1335,7 @@ static struct slave *bond_alloc_slave(struct bonding *bond, slave->bond = bond; slave->dev = slave_dev; +INIT_DELAYED_WORK (&slave->notify_work, bond_netdev_notify_work);if (bond_kobj_init (slave))return NULL ;
@@ -1347,7 +1348,6 @@ static struct slave *bond_alloc_slave(struct bonding *bond,return NULL ; } } -INIT_DELAYED_WORK (&slave->notify_work, bond_netdev_notify_work);return slave; }
drivers/net/dsa/microchip/ksz9477.c +1 -0
@@ -1520,6 +1520,7 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_statics = 16, .cpu_ports = 0x7F, /* can be configured as cpu port */ .port_cnt = 7, /* total physical port count */ + .phy_errata_9477 = true, }, };
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +3 -1
@@ -1245,8 +1245,10 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, goto failed;/* SR-IOV capability was enabled but there are no VFs*/ -if (iov->total ==0 ) +if (iov->total ==0 ) { + err = -EINVAL ; goto failed; + } iov->nr_virtfn =min_t (u16, iov->total, num_vfs_param);
drivers/net/ethernet/cadence/macb_main.c +3 -0
@@ -2536,6 +2536,9 @@ static struct net_device_stats *gem_get_stats(struct macb *bp)struct gem_stats *hwstat = &bp->hw_stats.gem;struct net_device_stats *nstat = &bp->dev->stats; +if (!netif_running (bp->dev)) +return nstat; +gem_update_stats (bp); nstat->rx_errors = (hwstat->rx_frame_check_sequence_errors +
drivers/net/ethernet/mellanox/mlx4/fw.c +3 -0
@@ -823,6 +823,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)#define QUERY_DEV_CAP_MAD_DEMUX_OFFSET 0xb0#define QUERY_DEV_CAP_DMFS_HIGH_RATE_QPN_BASE_OFFSET 0xa8#define QUERY_DEV_CAP_DMFS_HIGH_RATE_QPN_RANGE_OFFSET 0xac +#define QUERY_DEV_CAP_MAP_CLOCK_TO_USER 0xc1#define QUERY_DEV_CAP_QP_RATE_LIMIT_NUM_OFFSET 0xcc#define QUERY_DEV_CAP_QP_RATE_LIMIT_MAX_OFFSET 0xd0#define QUERY_DEV_CAP_QP_RATE_LIMIT_MIN_OFFSET 0xd2
@@ -841,6 +842,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)if (mlx4_is_mfunc (dev))disable_unsupported_roce_caps (outbox); +MLX4_GET (field, outbox,QUERY_DEV_CAP_MAP_CLOCK_TO_USER ); + dev_cap->map_clock_to_user = field &0x80 ;MLX4_GET (field, outbox,QUERY_DEV_CAP_RSVD_QP_OFFSET ); dev_cap->reserved_qps =1 << (field &0xf );MLX4_GET (field, outbox,QUERY_DEV_CAP_MAX_QP_OFFSET );
drivers/net/ethernet/mellanox/mlx4/fw.h +1 -0
@@ -131,6 +131,7 @@ struct mlx4_dev_cap {u32 health_buffer_addrs;struct mlx4_port_cap port_cap[MLX4_MAX_PORTS +1 ];bool wol_port[MLX4_MAX_PORTS +1 ]; +bool map_clock_to_user; };struct mlx4_func_cap {
drivers/net/ethernet/mellanox/mlx4/main.c +6 -0
@@ -498,6 +498,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) } } + dev->caps.map_clock_to_user = dev_cap->map_clock_to_user; dev->caps.uar_page_size =PAGE_SIZE ; dev->caps.num_uars = dev_cap->uar_size /PAGE_SIZE ; dev->caps.local_ca_ack_delay = dev_cap->local_ca_ack_delay;
@@ -1948,6 +1949,11 @@ int mlx4_get_internal_clock_params(struct mlx4_dev *dev,if (mlx4_is_slave (dev))return -EOPNOTSUPP ; +if (!dev->caps.map_clock_to_user) { +mlx4_dbg (dev,"Map clock to user is not supported.\n" ); +return -EOPNOTSUPP ; + } +if (!params)return -EINVAL ;
drivers/net/ethernet/qlogic/qla3xxx.c +1 -1
@@ -115,7 +115,7 @@ static int ql_sem_spinlock(struct ql3_adapter *qdev, value =readl (&port_regs->CommonRegs.semaphoreReg);if ((value & (sem_mask >>16 )) == sem_bits)return 0 ; -ssleep (1 ); +mdelay (1000 ); }while (--seconds);return -1 ; }
drivers/net/phy/mdio_bus.c +2 -1
@@ -453,7 +453,8 @@ void mdiobus_unregister(struct mii_bus *bus)struct mdio_device *mdiodev;int i; -BUG_ON (bus->state !=MDIOBUS_REGISTERED ); +if (WARN_ON_ONCE (bus->state !=MDIOBUS_REGISTERED )) +return ; bus->state =MDIOBUS_UNREGISTERED ;for (i =0 ; i <PHY_MAX_ADDR ; i++) {
drivers/nvme/host/Kconfig +2 -1
@@ -62,7 +62,8 @@ config NVME_FC config NVME_TCP tristate "NVM Express over Fabrics TCP host driver" depends on INET - depends on BLK_DEV_NVME + depends on BLOCK + select NVME_CORE select NVME_FABRICS select CRYPTO select CRYPTO_CRC32C
drivers/nvme/host/fabrics.c +5 -0
@@ -336,6 +336,11 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl, cmd->connect.recfmt);break ; +case NVME_SC_HOST_PATH_ERROR : +dev_err (ctrl->device, +"Connect command failed: host path error\n" ); +break ; +default : dev_err(ctrl->device, "Connect command failed, error wo/DNR bit: %d\n",
drivers/regulator/core.c +6 -0
@@ -1381,6 +1381,12 @@ static int set_machine_constraints(struct regulator_dev *rdev)* and we have control then make sure it is enabled. */ if (rdev->constraints->always_on || rdev->constraints->boot_on) { +/* If we want to enable this regulator, make sure that we know +* the supplying regulator. +*/ +if (rdev->supply_name && !rdev->supply) +return -EPROBE_DEFER ; +if (rdev->supply) { ret =regulator_enable (rdev->supply);if (ret <0 ) {
drivers/regulator/max77620-regulator.c +7 -0
@@ -814,6 +814,13 @@ static int max77620_regulator_probe(struct platform_device *pdev) config.dev = dev; config.driver_data = pmic; +/* +* Set of_node_reuse flag to prevent driver core from attempting to +* claim any pinmux resources already claimed by the parent device. +* Otherwise PMIC driver will fail to re-probe. +*/ +device_set_of_node_from_dev (&pdev->dev, pdev->dev.parent); +for (id =0 ; id <MAX77620_NUM_REGS ; id++) {struct regulator_dev *rdev;struct regulator_desc *rdesc;
drivers/s390/cio/vfio_ccw_drv.c +10 -2
@@ -83,6 +83,7 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work)struct vfio_ccw_private *private;struct irb *irb;bool is_final; +bool cp_is_finished = false; private = container_of(work, struct vfio_ccw_private, io_work); irb = &private->irb;
@@ -91,14 +92,21 @@ static void vfio_ccw_sch_io_todo(struct work_struct *work) (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT));if (scsw_is_solicited (&irb->scsw)) {cp_update_scsw (&private->cp, &irb->scsw); -if (is_final && private->state ==VFIO_CCW_STATE_CP_PENDING ) +if (is_final && private->state ==VFIO_CCW_STATE_CP_PENDING ) {cp_free (&private->cp); + cp_is_finished = true; + } }mutex_lock (&private->io_mutex);memcpy (private->io_region->irb_area, irb,sizeof (*irb));mutex_unlock (&private->io_mutex); -if (private->mdev && is_final) +/* +* Reset to IDLE only if processing of a channel program +* has finished. Do not overwrite a possible processing +* state if the final interrupt was for HSCH or CSCH. +*/ +if (private->mdev && cp_is_finished) private->state =VFIO_CCW_STATE_IDLE ;if (private->io_trigger)
drivers/scsi/bnx2fc/bnx2fc_io.c +1 -0
@@ -1219,6 +1219,7 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)was a result from the ABTS request rather than the CLEANUP request */ set_bit (BNX2FC_FLAG_IO_CLEANUP , &io_req->req_flags); + rc =FAILED ; goto done; }
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +4 -4
@@ -3274,14 +3274,14 @@ hisi_sas_v3_destroy_irqs(struct pci_dev *pdev, struct hisi_hba *hisi_hba) {int i; -free_irq (pci_irq_vector (pdev,1 ), hisi_hba); -free_irq (pci_irq_vector (pdev,2 ), hisi_hba); -free_irq (pci_irq_vector (pdev,11 ), hisi_hba); +devm_free_irq (&pdev->dev,pci_irq_vector (pdev,1 ), hisi_hba); +devm_free_irq (&pdev->dev,pci_irq_vector (pdev,2 ), hisi_hba); +devm_free_irq (&pdev->dev,pci_irq_vector (pdev,11 ), hisi_hba);for (i =0 ; i < hisi_hba->cq_nvecs; i++) {struct hisi_sas_cq *cq = &hisi_hba->cq[i];int nr = hisi_sas_intr_conv ?16 :16 + i; -free_irq (pci_irq_vector (pdev, nr), cq); +devm_free_irq (&pdev->dev,pci_irq_vector (pdev, nr), cq); }pci_free_irq_vectors (pdev); }
drivers/scsi/hosts.c +26 -21
110 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_target.c +2 -0
@@ -1559,10 +1559,12 @@ void qlt_stop_phase2(struct qla_tgt *tgt)return ; } +mutex_lock (&tgt->ha->optrom_mutex);mutex_lock (&vha->vha_tgt.tgt_mutex); tgt->tgt_stop =0 ; tgt->tgt_stopped =1 ;mutex_unlock (&vha->vha_tgt.tgt_mutex); +mutex_unlock (&tgt->ha->optrom_mutex);ql_dbg (ql_dbg_tgt_mgt, vha,0xf00c ,"Stop of tgt %p finished\n" , tgt);
drivers/scsi/vmw_pvscsi.c +7 -1
@@ -574,7 +574,13 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,case BTSTAT_SUCCESS :case BTSTAT_LINKED_COMMAND_COMPLETED :case BTSTAT_LINKED_COMMAND_COMPLETED_WITH_FLAG : -/* If everything went fine, let's move on.. */ +/* +* Commands like INQUIRY may transfer less data than +* requested by the initiator via bufflen. Set residual +* count to make upper layer aware of the actual amount +* of data returned. +*/ +scsi_set_resid (cmd,scsi_bufflen (cmd) - e->dataLen); cmd->result = (DID_OK <<16 );break ;
drivers/spi/spi-bcm2835.c +8 -2
@@ -68,7 +68,7 @@#define BCM2835_SPI_FIFO_SIZE 64#define BCM2835_SPI_FIFO_SIZE_3_4 48#define BCM2835_SPI_DMA_MIN_LENGTH 96 -#define BCM2835_SPI_NUM_CS 3/* raise as necessary */ +#define BCM2835_SPI_NUM_CS 24/* raise as necessary */ #define BCM2835_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \ | SPI_NO_CS | SPI_3WIRE)
@@ -1181,6 +1181,12 @@ static int bcm2835_spi_setup(struct spi_device *spi)struct gpio_chip *chip;u32 cs; +if (spi->chip_select >=BCM2835_SPI_NUM_CS ) { +dev_err (&spi->dev,"only %d chip-selects supported\n" , +BCM2835_SPI_NUM_CS -1 ); +return -EINVAL ; + } +/* * Precalculate SPI slave's CS register value for ->prepare_message(): * The driver always uses software-controlled GPIO chip select, hence
@@ -1274,7 +1280,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev) ctlr->use_gpio_descriptors = true; ctlr->mode_bits =BCM2835_SPI_MODE_BITS ; ctlr->bits_per_word_mask =SPI_BPW_MASK (8 ); - ctlr->num_chipselect =BCM2835_SPI_NUM_CS ; + ctlr->num_chipselect =3 ; ctlr->setup = bcm2835_spi_setup; ctlr->transfer_one = bcm2835_spi_transfer_one; ctlr->handle_err = bcm2835_spi_handle_err;
drivers/spi/spi-bitbang.c +14 -4
@@ -181,6 +181,8 @@ int spi_bitbang_setup(struct spi_device *spi) {struct spi_bitbang_cs *cs = spi->controller_state;struct spi_bitbang *bitbang; +bool initial_setup = false; +int retval; bitbang =spi_master_get_devdata (spi->master);
@@ -189,22 +191,30 @@ int spi_bitbang_setup(struct spi_device *spi)if (!cs)return -ENOMEM ; spi->controller_state = cs; + initial_setup = true; }/* per-word shift register access, in hardware or bitbanging */ cs->txrx_word = bitbang->txrx_word[spi->mode & (SPI_CPOL |SPI_CPHA )]; -if (!cs->txrx_word) -return -EINVAL ; +if (!cs->txrx_word) { + retval = -EINVAL ; + goto err_free; + }if (bitbang->setup_transfer) { -int retval = bitbang->setup_transfer (spi,NULL ); + retval = bitbang->setup_transfer (spi,NULL );if (retval <0 ) -return retval; + goto err_free; }dev_dbg (&spi->dev,"%s, %u nsec/bit\n" , __func__,2 * cs->nsecs);return 0 ; + +err_free: +if (initial_setup) +kfree (cs); +return retval; }EXPORT_SYMBOL_GPL (spi_bitbang_setup);
drivers/spi/spi-fsl-spi.c +4 -0
@@ -442,6 +442,7 @@ static int fsl_spi_setup(struct spi_device *spi) {struct mpc8xxx_spi *mpc8xxx_spi;struct fsl_spi_reg *reg_base; +bool initial_setup = false;int retval;u32 hw_mode;struct spi_mpc8xxx_cs *cs =spi_get_ctldata (spi);
@@ -454,6 +455,7 @@ static int fsl_spi_setup(struct spi_device *spi)if (!cs)return -ENOMEM ;spi_set_ctldata (spi, cs); + initial_setup = true; } mpc8xxx_spi =spi_master_get_devdata (spi->master);
@@ -477,6 +479,8 @@ static int fsl_spi_setup(struct spi_device *spi) retval =fsl_spi_setup_transfer (spi,NULL );if (retval <0 ) { cs->hw_mode = hw_mode;/* Restore settings */ +if (initial_setup) +kfree (cs);return retval; }
drivers/spi/spi-omap-uwire.c +8 -1
@@ -424,15 +424,22 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t)static int uwire_setup (struct spi_device *spi) {struct uwire_state *ust = spi->controller_state; +bool initial_setup = false; +int status;if (ust ==NULL ) { ust =kzalloc (sizeof (*ust),GFP_KERNEL );if (ust ==NULL )return -ENOMEM ; spi->controller_state = ust; + initial_setup = true; } -return uwire_setup_transfer (spi,NULL ); + status =uwire_setup_transfer (spi,NULL ); +if (status && initial_setup) +kfree (ust); + +return status; }static void uwire_cleanup (struct spi_device *spi)
drivers/spi/spi-omap2-mcspi.c +23 -16
@@ -1043,8 +1043,25 @@ static void omap2_mcspi_release_dma(struct spi_master *master) } } +static void omap2_mcspi_cleanup (struct spi_device *spi) +{ +struct omap2_mcspi_cs *cs; + +if (spi->controller_state) { +/* Unlink controller state from context save list */ + cs = spi->controller_state; +list_del (&cs->node); + +kfree (cs); + } + +if (gpio_is_valid (spi->cs_gpio)) +gpio_free (spi->cs_gpio); +} +static int omap2_mcspi_setup (struct spi_device *spi) { +bool initial_setup = false;int ret;struct omap2_mcspi *mcspi =spi_master_get_devdata (spi->master);struct omap2_mcspi_regs *ctx = &mcspi->ctx;
@@ -1062,6 +1079,7 @@ static int omap2_mcspi_setup(struct spi_device *spi) spi->controller_state = cs;/* Link this to context save list */ list_add_tail (&cs->node, &ctx->cs); + initial_setup = true;if (gpio_is_valid (spi->cs_gpio)) { ret =gpio_request (spi->cs_gpio,dev_name (&spi->dev));
@@ -1077,33 +1095,22 @@ static int omap2_mcspi_setup(struct spi_device *spi) ret =pm_runtime_get_sync (mcspi->dev);if (ret <0 ) {pm_runtime_put_noidle (mcspi->dev); +if (initial_setup) +omap2_mcspi_cleanup (spi);return ret; } ret =omap2_mcspi_setup_transfer (spi,NULL ); +if (ret && initial_setup) +omap2_mcspi_cleanup (spi); +pm_runtime_mark_last_busy (mcspi->dev);pm_runtime_put_autosuspend (mcspi->dev);return ret; } -static void omap2_mcspi_cleanup (struct spi_device *spi) -{ -struct omap2_mcspi_cs *cs; - -if (spi->controller_state) { -/* Unlink controller state from context save list */ - cs = spi->controller_state; -list_del (&cs->node); - -kfree (cs); - } - -if (gpio_is_valid (spi->cs_gpio)) -gpio_free (spi->cs_gpio); -} -static irqreturn_t omap2_mcspi_irq_handler (int irq,void *data) {struct omap2_mcspi *mcspi = data;
drivers/spi/spi-pxa2xx.c +8 -1
@@ -1241,6 +1241,8 @@ static int setup_cs(struct spi_device *spi, struct chip_data *chip, chip->gpio_cs_inverted = spi->mode &SPI_CS_HIGH ; err =gpiod_direction_output (gpiod, !chip->gpio_cs_inverted); +if (err) +gpiod_put (chip->gpiod_cs); }return err;
@@ -1254,6 +1256,7 @@ static int setup(struct spi_device *spi)struct driver_data *drv_data =spi_controller_get_devdata (spi->controller);uint tx_thres, tx_hi_thres, rx_thres; +int err;switch (drv_data->ssp_type) {case QUARK_X1000_SSP :
@@ -1400,7 +1403,11 @@ static int setup(struct spi_device *spi)if (drv_data->ssp_type ==CE4100_SSP )return 0 ; -return setup_cs (spi, chip, chip_info); + err =setup_cs (spi, chip, chip_info); +if (err) +kfree (chip); + +return err; }static void cleanup (struct spi_device *spi)
drivers/spi/spi-sprd.c +1 -0
@@ -1066,6 +1066,7 @@ static const struct of_device_id sprd_spi_of_match[] = { { .compatible = "sprd,sc9860-spi", }, {/* sentinel */ } }; +MODULE_DEVICE_TABLE (of, sprd_spi_of_match);static struct platform_driver sprd_spi_driver = { .driver = {
drivers/spi/spi.c +13 -7
@@ -47,10 +47,6 @@ static void spidev_release(struct device *dev) {struct spi_device *spi =to_spi_device (dev); -/* spi controllers may cleanup for released devices */ -if (spi->controller->cleanup) - spi->controller->cleanup (spi); -spi_controller_put (spi->controller);kfree (spi->driver_override);kfree (spi);
@@ -549,6 +545,12 @@ static int spi_dev_check(struct device *dev, void *data)return 0 ; } +static void spi_cleanup (struct spi_device *spi) +{ +if (spi->controller->cleanup) + spi->controller->cleanup (spi); +} +/** * spi_add_device - Add spi_device allocated with spi_alloc_device * @spi: spi_device to register
@@ -613,11 +615,13 @@ int spi_add_device(struct spi_device *spi)/* Device may be bound to an active driver when this returns */ status =device_add (&spi->dev); -if (status <0 ) +if (status <0 ) {dev_err (dev,"can't add %s, status %d\n" ,dev_name (&spi->dev), status); -else +spi_cleanup (spi); + }else {dev_dbg (dev,"registered child %s\n" ,dev_name (&spi->dev)); + } done:mutex_unlock (&spi_add_lock);
@@ -710,7 +714,9 @@ void spi_unregister_device(struct spi_device *spi) }if (ACPI_COMPANION (&spi->dev))acpi_device_clear_enumerated (ACPI_COMPANION (&spi->dev)); -device_unregister (&spi->dev); +device_del (&spi->dev); +spi_cleanup (spi); +put_device (&spi->dev); }EXPORT_SYMBOL_GPL (spi_unregister_device);
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +1 -1
@@ -2406,7 +2406,7 @@ void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame,DBG_871X (FUNC_ADPT_FMT "\n" ,FUNC_ADPT_ARG (padapter)); { -struct station_info sinfo; +struct station_info sinfo = {};u8 ie_offset;if (GetFrameSubType (pmgmt_frame) ==WIFI_ASSOCREQ ) ie_offset = _ASOCREQ_IE_OFFSET_;
drivers/usb/cdns3/gadget.c +3 -1
@@ -2706,8 +2706,10 @@ static int __cdns3_gadget_init(struct cdns3 *cdns)pm_runtime_get_sync (cdns->dev); ret =cdns3_gadget_start (cdns); -if (ret) +if (ret) { +pm_runtime_put_sync (cdns->dev);return ret; + }/* * Because interrupt line can be shared with other components in
drivers/usb/dwc3/ep0.c +3 -0
@@ -292,6 +292,9 @@ static struct dwc3_ep *dwc3_wIndex_to_dep(struct dwc3 *dwc, __le16 wIndex_le) epnum |=1 ; dep = dwc->eps[epnum]; +if (dep ==NULL ) +return NULL ; +if (dep->flags &DWC3_EP_ENABLED )return dep;
drivers/usb/gadget/config.c +8 -0
@@ -164,6 +164,14 @@ int usb_assign_descriptors(struct usb_function *f, {struct usb_gadget *g = f->config->cdev->gadget; +/* super-speed-plus descriptor falls back to super-speed one, +* if such a descriptor was provided, thus avoiding a NULL +* pointer dereference if a 5gbps capable gadget is used with +* a 10gbps capable config (device port + cable + host port) +*/ +if (!ssp) + ssp = ss; +if (fs) { f->fs_descriptors =usb_copy_descriptors (fs);if (!f->fs_descriptors)
drivers/usb/gadget/function/f_ecm.c +1 -1
@@ -791,7 +791,7 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f) fs_ecm_notify_desc.bEndpointAddress; status =usb_assign_descriptors (f, ecm_fs_function, ecm_hs_function, - ecm_ss_function,NULL ); + ecm_ss_function, ecm_ss_function);if (status) goto fail;
drivers/usb/gadget/function/f_eem.c +3 -3
@@ -304,7 +304,7 @@ static int eem_bind(struct usb_configuration *c, struct usb_function *f) eem_ss_out_desc.bEndpointAddress = eem_fs_out_desc.bEndpointAddress; status =usb_assign_descriptors (f, eem_fs_function, eem_hs_function, - eem_ss_function,NULL ); + eem_ss_function, eem_ss_function);if (status) goto fail;
@@ -497,7 +497,7 @@ static int eem_unwrap(struct gether *port, skb2 =skb_clone (skb,GFP_ATOMIC );if (unlikely (!skb2)) {DBG (cdev,"unable to unframe EEM packet\n" ); -continue ; + goto next; }skb_trim (skb2, len -ETH_FCS_LEN );
@@ -507,7 +507,7 @@ static int eem_unwrap(struct gether *port, GFP_ATOMIC);if (unlikely (!skb3)) {dev_kfree_skb_any (skb2); -continue ; + goto next; }dev_kfree_skb_any (skb2);skb_queue_tail (list, skb3);
drivers/usb/gadget/function/f_fs.c +3 -0
@@ -3585,6 +3585,9 @@ static void ffs_func_unbind(struct usb_configuration *c, ffs->func =NULL ; } +/* Drain any pending AIO completions */ +drain_workqueue (ffs->io_completion_wq); +if (!--opts->refcnt)functionfs_unbind (ffs);
drivers/usb/gadget/function/f_hid.c +2 -1
@@ -808,7 +808,8 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) hidg_fs_out_ep_desc.bEndpointAddress; status =usb_assign_descriptors (f, hidg_fs_descriptors, - hidg_hs_descriptors, hidg_ss_descriptors,NULL ); + hidg_hs_descriptors, hidg_ss_descriptors, + hidg_ss_descriptors);if (status) goto fail;
drivers/usb/gadget/function/f_loopback.c +1 -1
@@ -207,7 +207,7 @@ static int loopback_bind(struct usb_configuration *c, struct usb_function *f) ss_loop_sink_desc.bEndpointAddress = fs_loop_sink_desc.bEndpointAddress; ret =usb_assign_descriptors (f, fs_loopback_descs, hs_loopback_descs, - ss_loopback_descs,NULL ); + ss_loopback_descs, ss_loopback_descs);if (ret)return ret;
drivers/usb/gadget/function/f_ncm.c +5 -5
@@ -583,7 +583,7 @@ static void ncm_do_notify(struct f_ncm *ncm) data[0 ] =cpu_to_le32 (ncm_bitrate (cdev->gadget)); data[1 ] = data[0 ]; -DBG (cdev,"notify speed %d\n" ,ncm_bitrate (cdev->gadget)); +DBG (cdev,"notify speed %u\n" ,ncm_bitrate (cdev->gadget)); ncm->notify_state =NCM_NOTIFY_CONNECT ;break ; }
@@ -1101,11 +1101,11 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port, ncm->ndp_dgram_count =1 ;/* Note: we skip opts->next_ndp_index */ - } -/* Delay the timer. */ -hrtimer_start (&ncm->task_timer,TX_TIMEOUT_NSECS , -HRTIMER_MODE_REL_SOFT ); +/* Start the timer. */ +hrtimer_start (&ncm->task_timer,TX_TIMEOUT_NSECS , +HRTIMER_MODE_REL_SOFT ); + }/* Add the datagram position entries */ ntb_ndp =skb_put_zero (ncm->skb_tx_ndp, dgram_idx_len);
drivers/usb/gadget/function/f_printer.c +2 -1
@@ -1063,7 +1063,8 @@ static int printer_func_bind(struct usb_configuration *c, ss_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress; ret =usb_assign_descriptors (f, fs_printer_function, - hs_printer_function, ss_printer_function,NULL ); + hs_printer_function, ss_printer_function, + ss_printer_function);if (ret)return ret;
drivers/usb/gadget/function/f_rndis.c +1 -1
@@ -789,7 +789,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) ss_notify_desc.bEndpointAddress = fs_notify_desc.bEndpointAddress; status =usb_assign_descriptors (f, eth_fs_function, eth_hs_function, - eth_ss_function,NULL ); + eth_ss_function, eth_ss_function);if (status) goto fail;
drivers/usb/gadget/function/f_serial.c +1 -1
@@ -233,7 +233,7 @@ static int gser_bind(struct usb_configuration *c, struct usb_function *f) gser_ss_out_desc.bEndpointAddress = gser_fs_out_desc.bEndpointAddress; status =usb_assign_descriptors (f, gser_fs_function, gser_hs_function, - gser_ss_function,NULL ); + gser_ss_function, gser_ss_function);if (status) goto fail; dev_dbg(&cdev->gadget->dev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n",
drivers/usb/gadget/function/f_sourcesink.c +2 -1
@@ -431,7 +431,8 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f) ss_iso_sink_desc.bEndpointAddress = fs_iso_sink_desc.bEndpointAddress; ret =usb_assign_descriptors (f, fs_source_sink_descs, - hs_source_sink_descs, ss_source_sink_descs,NULL ); + hs_source_sink_descs, ss_source_sink_descs, + ss_source_sink_descs);if (ret)return ret;
drivers/usb/gadget/function/f_subset.c +1 -1
@@ -358,7 +358,7 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) fs_subset_out_desc.bEndpointAddress; status =usb_assign_descriptors (f, fs_eth_function, hs_eth_function, - ss_eth_function,NULL ); + ss_eth_function, ss_eth_function);if (status) goto fail;
drivers/usb/gadget/function/f_tcm.c +2 -1
@@ -2056,7 +2056,8 @@ static int tcm_bind(struct usb_configuration *c, struct usb_function *f) uasp_fs_cmd_desc.bEndpointAddress = uasp_ss_cmd_desc.bEndpointAddress; ret =usb_assign_descriptors (f, uasp_fs_function_desc, - uasp_hs_function_desc, uasp_ss_function_desc,NULL ); + uasp_hs_function_desc, uasp_ss_function_desc, + uasp_ss_function_desc);if (ret) goto ep_fail;
drivers/usb/musb/musb_core.c +1 -2
@@ -1871,9 +1871,8 @@ static void musb_pm_runtime_check_session(struct musb *musb)schedule_delayed_work (&musb->irq_work,msecs_to_jiffies (1000 )); musb->quirk_retries--; -break ; } - fallthrough; +break ;case MUSB_QUIRK_B_INVALID_VBUS_91 :if (musb->quirk_retries && !musb->flush_irq_work) { musb_dbg(musb,
drivers/usb/serial/cp210x.c +19 -1
@@ -507,6 +507,12 @@ struct cp210x_single_port_config {#define CP210X_2NCONFIG_GPIO_RSTLATCH_IDX 587#define CP210X_2NCONFIG_GPIO_CONTROL_IDX 600 +/* CP2102N QFN20 port configuration values */ +#define CP2102N_QFN20_GPIO2_TXLED_MODE BIT(2) +#define CP2102N_QFN20_GPIO3_RXLED_MODE BIT(3) +#define CP2102N_QFN20_GPIO1_RS485_MODE BIT(4) +#define CP2102N_QFN20_GPIO0_CLK_MODE BIT(6) +/* CP210X_VENDOR_SPECIFIC, CP210X_WRITE_LATCH call writes these 0x2 bytes. */ struct cp210x_gpio_write {u8 mask;
@@ -1691,7 +1697,19 @@ static int cp2102n_gpioconf_init(struct usb_serial *serial) priv->gpio_pushpull = (gpio_pushpull >>3 ) &0x0f ;/* 0 indicates GPIO mode, 1 is alternate function */ - priv->gpio_altfunc = (gpio_ctrl >>2 ) &0x0f ; +if (priv->partnum ==CP210X_PARTNUM_CP2102N_QFN20 ) { +/* QFN20 is special... */ +if (gpio_ctrl &CP2102N_QFN20_GPIO0_CLK_MODE )/* GPIO 0 */ + priv->gpio_altfunc |=BIT (0 ); +if (gpio_ctrl &CP2102N_QFN20_GPIO1_RS485_MODE )/* GPIO 1 */ + priv->gpio_altfunc |=BIT (1 ); +if (gpio_ctrl &CP2102N_QFN20_GPIO2_TXLED_MODE )/* GPIO 2 */ + priv->gpio_altfunc |=BIT (2 ); +if (gpio_ctrl &CP2102N_QFN20_GPIO3_RXLED_MODE )/* GPIO 3 */ + priv->gpio_altfunc |=BIT (3 ); + }else { + priv->gpio_altfunc = (gpio_ctrl >>2 ) &0x0f ; + }if (priv->partnum ==CP210X_PARTNUM_CP2102N_QFN28 ) {/*
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -611,6 +611,7 @@ static const struct usb_device_id id_table_combined[] = { .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLX_PLUS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_NT_ORION_IO_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONMX_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) }, { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) }, { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) },
drivers/usb/serial/ftdi_sio_ids.h +1 -0
@@ -581,6 +581,7 @@#define FTDI_NT_ORIONLXM_PID 0x7c90/* OrionLXm Substation Automation Platform */ #define FTDI_NT_ORIONLX_PLUS_PID 0x7c91/* OrionLX+ Substation Automation Platform */ #define FTDI_NT_ORION_IO_PID 0x7c92/* Orion I/O */ +#define FTDI_NT_ORIONMX_PID 0x7c93/* OrionMX */ /* * Synapse Wireless product ids (FTDI_VID)
drivers/usb/serial/omninet.c +2 -0
@@ -26,6 +26,7 @@#define ZYXEL_VENDOR_ID 0x0586#define ZYXEL_OMNINET_ID 0x1000 +#define ZYXEL_OMNI_56K_PLUS_ID 0x1500/* This one seems to be a re-branded ZyXEL device */ #define BT_IGNITIONPRO_ID 0x2000
@@ -40,6 +41,7 @@ static int omninet_port_remove(struct usb_serial_port *port);static const struct usb_device_id id_table[] = { {USB_DEVICE (ZYXEL_VENDOR_ID ,ZYXEL_OMNINET_ID ) }, + {USB_DEVICE (ZYXEL_VENDOR_ID ,ZYXEL_OMNI_56K_PLUS_ID ) }, {USB_DEVICE (ZYXEL_VENDOR_ID ,BT_IGNITIONPRO_ID ) }, { }/* Terminating entry */ };
drivers/usb/serial/quatech2.c +3 -3
@@ -416,7 +416,7 @@ static void qt2_close(struct usb_serial_port *port)/* flush the port transmit buffer */ i =usb_control_msg (serial->dev, -usb_rcvctrlpipe (serial->dev,0 ), +usb_sndctrlpipe (serial->dev,0 ),QT2_FLUSH_DEVICE ,0x40 ,1 , port_priv->device_port,NULL ,0 ,QT2_USB_TIMEOUT );
@@ -426,7 +426,7 @@ static void qt2_close(struct usb_serial_port *port)/* flush the port receive buffer */ i =usb_control_msg (serial->dev, -usb_rcvctrlpipe (serial->dev,0 ), +usb_sndctrlpipe (serial->dev,0 ),QT2_FLUSH_DEVICE ,0x40 ,0 , port_priv->device_port,NULL ,0 ,QT2_USB_TIMEOUT );
@@ -670,7 +670,7 @@ static int qt2_attach(struct usb_serial *serial)int status;/* power on unit */ - status =usb_control_msg (serial->dev,usb_rcvctrlpipe (serial->dev,0 ), + status =usb_control_msg (serial->dev,usb_sndctrlpipe (serial->dev,0 ),0xc2 ,0x40 ,0x8000 ,0 ,NULL ,0 ,QT2_USB_TIMEOUT );if (status <0 ) {
drivers/usb/typec/mux.c +1 -1
@@ -243,7 +243,7 @@ static void *typec_mux_match(struct device_connection *con, int ep, void *data) dev =class_find_device (&typec_mux_class,NULL , con->fwnode, mux_fwnode_match); -return dev ?to_typec_switch (dev) :ERR_PTR (-EPROBE_DEFER ); +return dev ?to_typec_mux (dev) :ERR_PTR (-EPROBE_DEFER ); }/**
drivers/usb/typec/tcpm/wcove.c +1 -1
@@ -377,7 +377,7 @@ static int wcove_pd_transmit(struct tcpc_dev *tcpc,const u8 *data = (void *)msg;int i; -for (i =0 ; i <pd_header_cnt (msg->header) *4 +2 ; i++) { +for (i =0 ; i <pd_header_cnt_le (msg->header) *4 +2 ; i++) { ret =regmap_write (wcove->regmap,USBC_TX_DATA + i, data[i]);if (ret)
drivers/usb/typec/ucsi/ucsi.c +1 -0
@@ -977,6 +977,7 @@ static void ucsi_init(struct work_struct *work) } err_reset: +memset (&ucsi->cap,0 ,sizeof (ucsi->cap));ucsi_reset_ppm (ucsi); err:mutex_unlock (&ucsi->ppm_lock);
fs/btrfs/disk-io.c +18 -8
@@ -2463,6 +2463,24 @@ static int validate_super(struct btrfs_fs_info *fs_info, ret = -EINVAL ; } +if (memcmp (fs_info->fs_devices->fsid, fs_info->super_copy->fsid, +BTRFS_FSID_SIZE )) { +btrfs_err (fs_info, +"superblock fsid doesn't match fsid of fs_devices: %pU != %pU" , + fs_info->super_copy->fsid, fs_info->fs_devices->fsid); + ret = -EINVAL ; + } + +if (btrfs_fs_incompat (fs_info,METADATA_UUID ) && +memcmp (fs_info->fs_devices->metadata_uuid, + fs_info->super_copy->metadata_uuid,BTRFS_FSID_SIZE )) { +btrfs_err (fs_info, +"superblock metadata_uuid doesn't match metadata uuid of fs_devices: %pU != %pU" , + fs_info->super_copy->metadata_uuid, + fs_info->fs_devices->metadata_uuid); + ret = -EINVAL ; + } +if (memcmp (fs_info->fs_devices->metadata_uuid, sb->dev_item.fsid,BTRFS_FSID_SIZE ) !=0 ) { btrfs_err(fs_info,
@@ -2837,14 +2855,6 @@ int open_ctree(struct super_block *sb, disk_super = fs_info->super_copy; -ASSERT (!memcmp (fs_info->fs_devices->fsid, fs_info->super_copy->fsid, -BTRFS_FSID_SIZE )); - -if (btrfs_fs_incompat (fs_info,METADATA_UUID )) { -ASSERT (!memcmp (fs_info->fs_devices->metadata_uuid, - fs_info->super_copy->metadata_uuid, -BTRFS_FSID_SIZE )); - } features =btrfs_super_flags (disk_super);if (features &BTRFS_SUPER_FLAG_CHANGING_FSID_V2 ) {
fs/btrfs/file.c +2 -2
@@ -1163,7 +1163,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,int del_nr =0 ;int del_slot =0 ;int recow; -int ret; +int ret =0 ;u64 ino =btrfs_ino (inode); path =btrfs_alloc_path ();
@@ -1384,7 +1384,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, } out:btrfs_free_path (path); -return 0 ; +return ret; }/*
fs/nfs/client.c +1 -1
@@ -399,7 +399,7 @@ struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_init)if (cl_init->hostname ==NULL ) {WARN_ON (1 ); -return NULL ; +return ERR_PTR (-EINVAL ); }/* see if the client already exists */
fs/nfs/nfs4_fs.h +1 -0
@@ -203,6 +203,7 @@ struct nfs4_exception {struct inode *inode;nfs4_stateid *stateid;long timeout; + unsigned char task_is_privileged : 1; unsigned char delay : 1, recovering : 1, retry : 1;
fs/nfs/nfs4client.c +1 -1
@@ -435,8 +435,8 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,*/ nfs_mark_client_ready (clp, -EPERM ); } -nfs_put_client (clp);clear_bit (NFS_CS_TSM_POSSIBLE , &clp->cl_flags); +nfs_put_client (clp);return old; error:
fs/nfs/nfs4proc.c +26 -3
@@ -581,6 +581,8 @@ int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_ goto out_retry; }if (exception->recovering) { +if (exception->task_is_privileged) +return -EDEADLOCK ; ret =nfs4_wait_clnt_recover (clp);if (test_bit (NFS_MIG_FAILED , &server->mig_status))return -EIO ;
@@ -606,6 +608,8 @@ nfs4_async_handle_exception(struct rpc_task *task, struct nfs_server *server, goto out_retry; }if (exception->recovering) { +if (exception->task_is_privileged) +return -EDEADLOCK ;rpc_sleep_on (&clp->cl_rpcwaitq, task,NULL );if (test_bit (NFS4CLNT_MANAGER_RUNNING , &clp->cl_state) ==0 )rpc_wake_up_queued_task (&clp->cl_rpcwaitq, task);
@@ -5795,6 +5799,14 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflendo { err =__nfs4_proc_set_acl (inode, buf, buflen);trace_nfs4_set_acl (inode, err); +if (err == -NFS4ERR_BADOWNER || err == -NFS4ERR_BADNAME ) { +/* +* no need to retry since the kernel +* isn't involved in encoding the ACEs. +*/ + err = -EINVAL ; +break ; + } err =nfs4_handle_exception (NFS_SERVER (inode), err, &exception); }while (exception.retry);
@@ -6231,6 +6243,7 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)struct nfs4_exception exception = { .inode = data->inode, .stateid = &data->stateid, + .task_is_privileged = data->args.seq_args.sa_privileged, };if (!nfs4_sequence_done (task, &data->res.seq_res))
@@ -6349,7 +6362,6 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, data =kzalloc (sizeof (*data),GFP_NOFS );if (data ==NULL )return -ENOMEM ; -nfs4_init_sequence (&data->args.seq_args, &data->res.seq_res,1 ,0 ); nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_CLEANUP,
@@ -6377,6 +6389,12 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, } } +if (!data->inode) +nfs4_init_sequence (&data->args.seq_args, &data->res.seq_res,1 , +1 ); +else +nfs4_init_sequence (&data->args.seq_args, &data->res.seq_res,1 , +0 ); task_setup_data.callback_data = data; msg.rpc_argp = &data->args; msg.rpc_resp = &data->res;
@@ -9332,15 +9350,20 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, bool sync) &task_setup_data.rpc_client, &msg);dprintk ("--> %s\n" , __func__); + lrp->inode =nfs_igrab_and_active (lrp->args.inode);if (!sync) { - lrp->inode =nfs_igrab_and_active (lrp->args.inode);if (!lrp->inode) {nfs4_layoutreturn_release (lrp);return -EAGAIN ; } task_setup_data.flags |=RPC_TASK_ASYNC ; } -nfs4_init_sequence (&lrp->args.seq_args, &lrp->res.seq_res,1 ,0 ); +if (!lrp->inode) +nfs4_init_sequence (&lrp->args.seq_args, &lrp->res.seq_res,1 , +1 ); +else +nfs4_init_sequence (&lrp->args.seq_args, &lrp->res.seq_res,1 , +0 ); task =rpc_run_task (&task_setup_data);if (IS_ERR (task))return PTR_ERR (task);
fs/proc/base.c +10 -1
@@ -2527,6 +2527,13 @@ static int proc_pident_readdir(struct file *file, struct dir_context *ctx, }#ifdef CONFIG_SECURITY +static int proc_pid_attr_open (struct inode *inode,struct file *file) +{ + file->private_data =NULL ; +__mem_open (inode, file,PTRACE_MODE_READ_FSCREDS ); +return 0 ; +} +static ssize_t proc_pid_attr_read (struct file * file,char __user * buf,size_t count,loff_t *ppos) {
@@ -2557,7 +2564,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,int rv;/* A task may only write when it was the opener. */ -if (file->f_cred !=current_real_cred ()) +if (file->private_data != current->mm)return -EPERM ;rcu_read_lock ();
@@ -2607,9 +2614,11 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, }static const struct file_operations proc_pid_attr_operations = { + .open = proc_pid_attr_open, .read = proc_pid_attr_read, .write = proc_pid_attr_write, .llseek = generic_file_llseek, + .release = mem_release, };#define LSM_DIR_OPS (LSM ) \
include/asm-generic/vmlinux.lds.h +1 -0
@@ -882,6 +882,7 @@#ifdef CONFIG_AMD_MEM_ENCRYPT #define PERCPU_DECRYPTED_SECTION \ . = ALIGN(PAGE_SIZE); \ + *(.data..decrypted) \ *(.data..percpu..decrypted) \ . = ALIGN(PAGE_SIZE);#else
include/linux/kvm_host.h +9 -1
@@ -1045,7 +1045,15 @@ __gfn_to_memslot(struct kvm_memslots *slots, gfn_t gfn)static inline unsigned long __gfn_to_hva_memslot (struct kvm_memory_slot *slot,gfn_t gfn) { -return slot->userspace_addr + (gfn - slot->base_gfn) *PAGE_SIZE ; +/* +* The index was checked originally in search_memslots. To avoid +* that a malicious guest builds a Spectre gadget out of e.g. page +* table walks, do not let the processor speculate loads outside +* the guest's registered memslots. +*/ +unsigned long offset = gfn - slot->base_gfn; + offset =array_index_nospec (offset, slot->npages); +return slot->userspace_addr + offset *PAGE_SIZE ; }static inline int memslot_id (struct kvm *kvm,gfn_t gfn)
include/linux/mlx4/device.h +1 -0
@@ -632,6 +632,7 @@ struct mlx4_caps {bool wol_port[MLX4_MAX_PORTS +1 ];struct mlx4_rate_limit_caps rl_caps;u32 health_buffer_addrs; +bool map_clock_to_user; };struct mlx4_buf_list {
include/linux/usb/pd.h +1 -1
@@ -425,7 +425,7 @@ static inline unsigned int rdo_max_power(u32 rdo)#define PD_T_SENDER_RESPONSE 60/* 24 - 30 ms, relaxed */ #define PD_T_SOURCE_ACTIVITY 45#define PD_T_SINK_ACTIVITY 135 -#define PD_T_SINK_WAIT_CAP 240 +#define PD_T_SINK_WAIT_CAP 310/* 310 - 620 ms */ #define PD_T_PS_TRANSITION 500#define PD_T_SRC_TRANSITION 35#define PD_T_DRP_SNK 40
kernel/cgroup/cgroup-v1.c +4 -0
@@ -821,6 +821,10 @@ static int cgroup1_rename(struct kernfs_node *kn, struct kernfs_node *new_parentstruct cgroup *cgrp = kn->priv;int ret; +/* do not accept '\n' to prevent making /proc/<pid>/cgroup unparsable */ +if (strchr (new_name_str,'\n' )) +return -EINVAL ; +if (kernfs_type (kn) !=KERNFS_DIR )return -ENOTDIR ;if (kn->parent != new_parent)
kernel/cgroup/cgroup.c +5 -8
@@ -5721,8 +5721,6 @@ int __init cgroup_init_early(void)return 0 ; } -static u16 cgroup_disable_mask__initdata ; -/** * cgroup_init - cgroup initialization *
@@ -5781,12 +5779,8 @@ int __init cgroup_init(void)* disabled flag and cftype registration needs kmalloc, * both of which aren't available during early_init. */ -if (cgroup_disable_mask & (1 << ssid)) { -static_branch_disable (cgroup_subsys_enabled_key[ssid]); -printk (KERN_INFO "Disabling %s control group subsystem\n" , - ss->name); +if (!cgroup_ssid_enabled (ssid))continue ; - }if (cgroup1_ssid_disabled (ssid)) printk(KERN_INFO "Disabling %s control group subsystem in v1 mounts\n",
@@ -6173,7 +6167,10 @@ static int __init cgroup_disable(char *str)if (strcmp (token, ss->name) &&strcmp (token, ss->legacy_name))continue ; - cgroup_disable_mask |=1 << i; + +static_branch_disable (cgroup_subsys_enabled_key[i]); +pr_info ("Disabling %s control group subsystem\n" , + ss->name); } }return 1 ;
kernel/events/core.c +2 -0
@@ -4249,7 +4249,9 @@ find_get_context(struct pmu *pmu, struct task_struct *task, cpuctx =per_cpu_ptr (pmu->pmu_cpu_context, cpu); ctx = &cpuctx->ctx;get_ctx (ctx); +raw_spin_lock_irqsave (&ctx->lock, flags); ++ctx->pin_count; +raw_spin_unlock_irqrestore (&ctx->lock, flags);return ctx; }
kernel/sched/fair.c +1 -1
@@ -7660,7 +7660,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)/* Propagate pending load changes to the parent, if any: */ se = cfs_rq->tg->se[cpu];if (se && !skip_blocked_update (se)) -update_load_avg (cfs_rq_of (se), se,0 ); +update_load_avg (cfs_rq_of (se), se,UPDATE_TG );/* * There can be a lot of idle CPU cgroups. Don't let fully
kernel/trace/ftrace.c +7 -1
@@ -1953,12 +1953,18 @@ static int ftrace_hash_ipmodify_update(struct ftrace_ops *ops,static void print_ip_ins (const char *fmt,const unsigned char *p) { +char ins[MCOUNT_INSN_SIZE ];int i; +if (probe_kernel_read (ins, p,MCOUNT_INSN_SIZE )) { +printk (KERN_CONT "%s[FAULT] %px\n" , fmt, p); +return ; + } +printk (KERN_CONT "%s" , fmt);for (i =0 ; i <MCOUNT_INSN_SIZE ; i++) -printk (KERN_CONT "%s%02x" , i ?":" :"" , p[i]); +printk (KERN_CONT "%s%02x" , i ?":" :"" , ins[i]); }enum ftrace_bug_type ftrace_bug_type;
kernel/trace/trace.c +1 -1
@@ -2487,7 +2487,7 @@ trace_event_buffer_lock_reserve(struct ring_buffer **current_rb, (entry = this_cpu_read(trace_buffered_event))) {/* Try to use the per cpu buffer first */ val =this_cpu_inc_return (trace_buffered_event_cnt); -if ((len < (PAGE_SIZE -sizeof (*entry))) && val ==1 ) { +if ((len < (PAGE_SIZE -sizeof (*entry) -sizeof (entry->array[0 ]))) && val ==1 ) {trace_event_setup (entry, type, flags, pc); entry->array[0 ] = len;return entry;
kernel/workqueue.c +10 -2
@@ -50,6 +50,7 @@#include <linux/uaccess.h> #include <linux/sched/isolation.h> #include <linux/nmi.h> +#include <linux/kvm_para.h> #include "workqueue_internal.h"
@@ -5734,6 +5735,7 @@ static void wq_watchdog_timer_fn(struct timer_list *unused) {unsigned long thresh =READ_ONCE (wq_watchdog_thresh) *HZ ;bool lockup_detected = false; +unsigned long now = jiffies;struct worker_pool *pool;int pi;
@@ -5748,6 +5750,12 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)if (list_empty (&pool->worklist))continue ; +/* +* If a virtual machine is stopped by the host it can look to +* the watchdog like a stall. +*/ +kvm_check_and_clear_guest_paused (); +/* get the latest of pool and touched timestamps */ pool_ts =READ_ONCE (pool->watchdog_ts); touched =READ_ONCE (wq_watchdog_touched);
@@ -5766,12 +5774,12 @@ static void wq_watchdog_timer_fn(struct timer_list *unused) }/* did we stall? */ -if (time_after (jiffies, ts + thresh)) { +if (time_after (now, ts + thresh)) { lockup_detected = true;pr_emerg ("BUG: workqueue lockup - pool" );pr_cont_pool_info (pool);pr_cont (" stuck for %us!\n" , -jiffies_to_msecs (jiffies - pool_ts) /1000 ); +jiffies_to_msecs (now - pool_ts) /1000 ); } }
net/netlink/af_netlink.c +4 -2
@@ -452,11 +452,13 @@ void netlink_table_ungrab(void)static inline void netlink_lock_table (void ) { +unsigned long flags; +/* read_lock() synchronizes us to netlink_table_grab */ -read_lock (&nl_table_lock); +read_lock_irqsave (&nl_table_lock, flags);atomic_inc (&nl_table_users); -read_unlock (&nl_table_lock); +read_unlock_irqrestore (&nl_table_lock, flags); } static inline void
net/nfc/rawsock.c +1 -1
@@ -333,7 +333,7 @@ static int rawsock_create(struct net *net, struct socket *sock,return -ESOCKTNOSUPPORT ;if (sock->type ==SOCK_RAW ) { -if (!capable (CAP_NET_RAW )) +if (!ns_capable (net->user_ns,CAP_NET_RAW ))return -EPERM ; sock->ops = &rawsock_raw_ops; }else {
net/rds/connection.c +17 -6
@@ -240,12 +240,23 @@ static struct rds_connection *__rds_conn_create(struct net *net,if (loop_trans) {rds_trans_put (loop_trans); conn->c_loopback =1 ; -if (is_outgoing && trans->t_prefer_loopback) { -/* "outgoing" connection - and the transport -* says it wants the connection handled by the -* loopback transport. This is what TCP does. -*/ - trans = &rds_loop_transport; +if (trans->t_prefer_loopback) { +if (likely (is_outgoing)) { +/* "outgoing" connection to local address. +* Protocol says it wants the connection +* handled by the loopback transport. +* This is what TCP does. +*/ + trans = &rds_loop_transport; + }else { +/* No transport currently in use +* should end up here, but if it +* does, reset/destroy the connection. +*/ +kmem_cache_free (rds_conn_slab, conn); + conn =ERR_PTR (-EOPNOTSUPP ); + goto out; + } } }
net/rds/tcp.c +2 -2
@@ -323,8 +323,8 @@ static void rds6_tcp_tc_info(struct socket *sock, unsigned int len, }#endif -static int rds_tcp_laddr_check (struct net *net,const struct in6_addr *addr, -__u32 scope_id) +int rds_tcp_laddr_check (struct net *net,const struct in6_addr *addr, +__u32 scope_id) {struct net_device *dev =NULL ;#if IS_ENABLED (CONFIG_IPV6 )
net/rds/tcp.h +2 -1
@@ -60,7 +60,8 @@ u32 rds_tcp_snd_una(struct rds_tcp_connection *tc);u64 rds_tcp_map_seq (struct rds_tcp_connection *tc,u32 seq);extern struct rds_transport rds_tcp_transport;void rds_tcp_accept_work (struct sock *sk); - +int rds_tcp_laddr_check (struct net *net,const struct in6_addr *addr, +__u32 scope_id);/* tcp_connect.c */ int rds_tcp_conn_path_connect (struct rds_conn_path *cp);void rds_tcp_conn_path_shutdown (struct rds_conn_path *conn);
net/rds/tcp_listen.c +6 -0
@@ -198,6 +198,12 @@ int rds_tcp_accept_one(struct socket *sock) }#endif +if (!rds_tcp_laddr_check (sock_net (sock->sk), peer_addr, dev_if)) { +/* local address connection is only allowed via loopback */ + ret = -EOPNOTSUPP ; + goto out; + } + conn =rds_conn_create (sock_net (sock->sk), my_addr, peer_addr, &rds_tcp_transport,0 ,GFP_KERNEL , dev_if);
sound/soc/codecs/max98088.c +11 -2
@@ -41,6 +41,7 @@ struct max98088_priv {enum max98088_type devtype;struct max98088_pdata *pdata;struct clk *mclk; +unsigned char mclk_prescaler;unsigned int sysclk;struct max98088_cdata dai[2 ];int eq_textcnt;
@@ -998,13 +999,16 @@ static int max98088_dai1_hw_params(struct snd_pcm_substream *substream,/* Configure NI when operating as master */ if (snd_soc_component_read32 (component,M98088_REG_14_DAI1_FORMAT ) &M98088_DAI_MAS ) { +unsigned long pclk; +if (max98088->sysclk ==0 ) {dev_err (component->dev,"Invalid system clock frequency\n" );return -EINVAL ; } ni =65536ULL * (rate <50000 ?96ULL :48ULL ) * (unsigned long long int )rate; -do_div (ni, (unsigned long long int )max98088->sysclk); + pclk =DIV_ROUND_CLOSEST (max98088->sysclk, max98088->mclk_prescaler); + ni =DIV_ROUND_CLOSEST_ULL (ni, pclk);snd_soc_component_write (component,M98088_REG_12_DAI1_CLKCFG_HI , (ni >>8 ) &0x7F ); snd_soc_component_write(component, M98088_REG_13_DAI1_CLKCFG_LO,
@@ -1065,13 +1069,16 @@ static int max98088_dai2_hw_params(struct snd_pcm_substream *substream,/* Configure NI when operating as master */ if (snd_soc_component_read32 (component,M98088_REG_1C_DAI2_FORMAT ) &M98088_DAI_MAS ) { +unsigned long pclk; +if (max98088->sysclk ==0 ) {dev_err (component->dev,"Invalid system clock frequency\n" );return -EINVAL ; } ni =65536ULL * (rate <50000 ?96ULL :48ULL ) * (unsigned long long int )rate; -do_div (ni, (unsigned long long int )max98088->sysclk); + pclk =DIV_ROUND_CLOSEST (max98088->sysclk, max98088->mclk_prescaler); + ni =DIV_ROUND_CLOSEST_ULL (ni, pclk);snd_soc_component_write (component,M98088_REG_1A_DAI2_CLKCFG_HI , (ni >>8 ) &0x7F ); snd_soc_component_write(component, M98088_REG_1B_DAI2_CLKCFG_LO,
@@ -1113,8 +1120,10 @@ static int max98088_dai_set_sysclk(struct snd_soc_dai *dai,*/ if ((freq >=10000000 ) && (freq <20000000 )) {snd_soc_component_write (component,M98088_REG_10_SYS_CLK ,0x10 ); + max98088->mclk_prescaler =1 ; }else if ((freq >=20000000 ) && (freq <30000000 )) {snd_soc_component_write (component,M98088_REG_10_SYS_CLK ,0x20 ); + max98088->mclk_prescaler =2 ; }else {dev_err (component->dev,"Invalid master clock frequency\n" );return -EINVAL ;
sound/soc/codecs/sti-sas.c +1 -0
@@ -411,6 +411,7 @@ static const struct of_device_id sti_sas_dev_match[] = { }, {}, }; +MODULE_DEVICE_TABLE (of, sti_sas_dev_match);static int sti_sas_driver_probe (struct platform_device *pdev) {
sound/soc/intel/boards/bytcr_rt5640.c +25 -0
@@ -568,6 +568,17 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {BYT_RT5640_SSP0_AIF1 | BYT_RT5640_MCLK_EN), }, + { /* Glavey TM800A550L */ + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"AMI Corporation" ), +DMI_MATCH (DMI_BOARD_NAME ,"Aptio CRB" ), +/* Above strings are too generic, also match on BIOS version */ + DMI_MATCH(DMI_BIOS_VERSION, "ZY-8-BI-PX4S70VTR400-X423B-005-D"), + }, + .driver_data = (void *)(BYTCR_INPUT_DEFAULTS | +BYT_RT5640_SSP0_AIF1 | + BYT_RT5640_MCLK_EN), + }, { .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
@@ -635,6 +646,20 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {BYT_RT5640_MONO_SPEAKER | BYT_RT5640_MCLK_EN), }, + { /* Lenovo Miix 3-830 */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 3-830"), + }, + .driver_data = (void *)(BYT_RT5640_IN1_MAP | +BYT_RT5640_JD_SRC_JD2_IN4N | +BYT_RT5640_OVCD_TH_2000UA | +BYT_RT5640_OVCD_SF_0P75 | +BYT_RT5640_MONO_SPEAKER | +BYT_RT5640_DIFF_MIC | +BYT_RT5640_SSP0_AIF1 | + BYT_RT5640_MCLK_EN), + }, { /* Linx Linx7 tablet */ .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LINX"),
tools/perf/util/session.c +1 -0
@@ -1631,6 +1631,7 @@ int perf_session__peek_event(struct perf_session *session, off_t file_offset,if (event->header.size < hdr_sz || event->header.size > buf_sz)return -1 ; + buf += hdr_sz; rest = event->header.size - hdr_sz;if (readn (fd, buf, rest) != (ssize_t )rest)