4.9.80-stable review
Greg Kroah-Hartman
maintainercover 4.9.80-stable review
This is the start of the stable review cycle for the 4.9.80 release. There are 86 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 4 14:07:37 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.80-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.9.80-rc1
Stefan Agner <[email protected]>
spi: imx: do not access registers while clocks disabled
Fabio Estevam <[email protected]>
serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS
Shuah Khan <[email protected]>
usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit
Benjamin Herrenschmidt <[email protected]>
usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()
Oliver Neukum <[email protected]>
usb: uas: unconditionally bring back host after reset
Hemant Kumar <[email protected]>
usb: f_fs: Prevent gadget unbind if it is already unbound
Johan Hovold <[email protected]>
USB: serial: simple: add Motorola Tetra driver
Shuah Khan <[email protected]>
usbip: list: don't list devices attached to vhci_hcd
Shuah Khan <[email protected]>
usbip: prevent bind loops on devices attached to vhci_hcd
Jia-Ju Bai <[email protected]>
USB: serial: io_edgeport: fix possible sleep-in-atomic
Oliver Neukum <[email protected]>
CDC-ACM: apply quirk for card reader
Hans de Goede <[email protected]>
USB: cdc-acm: Do not log urb submission errors on disconnect
Greg Kroah-Hartman <[email protected]>
USB: serial: pl2303: new device id for Chilitag
OKAMOTO Yoshiaki <[email protected]>
usb: option: Add support for FS040U modem
Gaurav Kohli <[email protected]>
tty: fix data race between tty_init_dev and flush of buf
Dmitry Eremin <[email protected]>
staging: lustre: separate a connection destroy from free struct kib_conn
Stefan Schake <[email protected]>
drm/vc4: Move IRQ enable to PM path
Larry Finger <[email protected]>
staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID
Colin Ian King <[email protected]>
usb: gadget: don't dereference g until after it has been null checked
Icenowy Zheng <[email protected]>
media: usbtv: add a new usbid
Florian Fainelli <[email protected]>
ARM: dts: NSP: Fix PPI interrupt types
Emmanuel Grumbach <[email protected]>
iwlwifi: mvm: fix the TX queue hang timeout for MONITOR vif type
Gustavo A. R. Silva <[email protected]>
scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg
Guilherme G. Piccoli <[email protected]>
scsi: aacraid: Prevent crash in case of free interrupt during scsi EH path
Carlos Maiolino <[email protected]>
xfs: Properly retry failed dquot items in case of error during buffer writeback
Darrick J. Wong <[email protected]>
xfs: ubsan fixes
Christophe JAILLET <[email protected]>
drm/omap: Fix error handling path in 'omap_dmm_probe()'
Andrey Gusakov <[email protected]>
drm/bridge: tc358767: fix 1-lane behavior
Andrey Gusakov <[email protected]>
drm/bridge: tc358767: fix AUXDATAn registers access
Andrey Gusakov <[email protected]>
drm/bridge: tc358767: fix timing calculations
Andrey Gusakov <[email protected]>
drm/bridge: tc358767: fix DP0_MISC register set
Andrey Gusakov <[email protected]>
drm/bridge: tc358767: filter out too high modes
Andrey Gusakov <[email protected]>
drm/bridge: tc358767: do no fail on hi-res displays
Yisheng Xie <[email protected]>
kmemleak: add scheduling point to kmemleak_scan()
Trond Myklebust <[email protected]>
SUNRPC: Allow connect to return EHOSTUNREACH
Tetsuo Handa <[email protected]>
quota: Check for register_shrinker() failure.
Geert Uytterhoeven <[email protected]>
net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit
Christian König <[email protected]>
drm/amdgpu: don't try to move pinned BOs
Michal Hocko <[email protected]>
xfs: fortify xfs_alloc_buftarg error handling
Christophe JAILLET <[email protected]>
bnxt_en: Fix an error handling path in 'bnxt_get_module_eeprom()'
Robert Lippert <[email protected]>
hwmon: (pmbus) Use 64bit math for DIRECT format values
Vasily Averin <[email protected]>
lockd: fix "list_add double add" caused by legacy signal interface
Andrew Elble <[email protected]>
nfsd: check for use of the closed special stateid
Vasily Averin <[email protected]>
grace: replace BUG_ON by WARN_ONCE in exit_net hook
Trond Myklebust <[email protected]>
nfsd: Ensure we check stateid validity in the seqid operation checks
Trond Myklebust <[email protected]>
nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0)
Thomas Meyer <[email protected]>
auxdisplay: img-ascii-lcd: Only build on archs that have IOMEM
Eduardo Otubo <[email protected]>
xen-netfront: remove warning when unloading module
Darrick J. Wong <[email protected]>
xfs: always free inline data before resetting inode fork during ifree
Wanpeng Li <[email protected]>
KVM: VMX: Fix rflags cache during vCPU reset
Wanpeng Li <[email protected]>
KVM: X86: Fix softlockup when get the current kvmclock
Jeff Layton <[email protected]>
reiserfs: remove unneeded i_version bump
Josef Bacik <[email protected]>
btrfs: fix deadlock when writing out space cache
Chun-Yeow Yeoh <[email protected]>
mac80211: fix the update of path metric for RANN frame
zhangliping <[email protected]>
openvswitch: fix the incorrect flow action alloc size
Felix Kuehling <[email protected]>
drm/amdkfd: Fix SDMA oversubsription handling
shaoyunl <[email protected]>
drm/amdkfd: Fix SDMA ring buffer size calculation
Felix Kuehling <[email protected]>
drm/amdgpu: Fix SDMA load/unload sequence on HWS disabled mode
Michael Lyle <[email protected]>
bcache: check return value of register_shrinker
James Hogan <[email protected]>
cpufreq: Add Loongson machine dependencies
Nikita Leshenko <[email protected]>
KVM: x86: ioapic: Preserve read-only values in the redirection table
Hans de Goede <[email protected]>
ACPI / bus: Leave modalias empty for devices which are not present
Nikita Leshenko <[email protected]>
KVM: x86: ioapic: Clear Remote IRR when entry is switched to edge-triggered
Nikita Leshenko <[email protected]>
KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race
Wanpeng Li <[email protected]>
KVM: X86: Fix operand/address-size during instruction decoding
Liran Alon <[email protected]>
KVM: x86: Don't re-execute instruction when not passing CR2 value
Liran Alon <[email protected]>
KVM: x86: emulator: Return to user-mode on L1 CPL=0 emulation failure
Abhishek Goel <[email protected]>
cpupower : Fix cpupower working when cpu0 is offline
Abhishek Goel <[email protected]>
cpupowerutils: bench - Fix cpu online check
Stefan Schake <[email protected]>
drm/vc4: Account for interrupts in flight
Lyude Paul <[email protected]>
igb: Free IRQs when device is hotplugged
Jesse Chan <[email protected]>
mtd: nand: denali_pci: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
Jesse Chan <[email protected]>
gpio: ath79: add missing MODULE_DESCRIPTION/LICENSE
Jesse Chan <[email protected]>
gpio: iop: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
Jesse Chan <[email protected]>
power: reset: zx-reboot: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
Aaron Armstrong Skomra <[email protected]>
HID: wacom: EKR: ensure devres groups at higher indexes are released
Stephan Mueller <[email protected]>
crypto: af_alg - whitelist mask and type
Ard Biesheuvel <[email protected]>
crypto: sha3-generic - fixes for alignment and big endian operation
Stephan Mueller <[email protected]>
crypto: aesni - handle zero length dst buffer
Hauke Mehrtens <[email protected]>
crypto: ecdh - fix typo in KPP dependency of CRYPTO_ECDH
Linus Walleij <[email protected]>
gpio: Fix kernel stack leak to userspace
Patrice Chotard <[email protected]>
gpio: stmpe: i2c transfer are forbiden in atomic context
Joel Stanley <[email protected]>
tools/gpio: Fix build error with musl libc
Max Gurtovoy <[email protected]>
RDMA/mlx5: set UMR wqe fence according to HCA cap
Max Gurtovoy <[email protected]>
net/mlx5: Define interface bits for fencing UMR wqe
Linus Torvalds <[email protected]>
loop: fix concurrent lo_open/lo_release
-------------
Diffstat:
Makefile | 4 +- arch/arm/boot/dts/bcm-nsp.dtsi | 4 +- arch/x86/crypto/aesni-intel_glue.c | 2 +- arch/x86/include/asm/kvm_host.h | 3 +- arch/x86/kvm/emulate.c | 7 +++ arch/x86/kvm/ioapic.c | 20 +++++- arch/x86/kvm/vmx.c | 4 +- arch/x86/kvm/x86.c | 13 ++-- crypto/Kconfig | 2 +- crypto/af_alg.c | 10 +-- crypto/sha3_generic.c | 5 +- drivers/acpi/device_sysfs.c | 4 ++ drivers/auxdisplay/Kconfig | 1 + drivers/block/loop.c | 10 ++- drivers/cpufreq/Kconfig | 2 + drivers/gpio/gpio-ath79.c | 3 + drivers/gpio/gpio-iop.c | 4 ++ drivers/gpio/gpio-stmpe.c | 20 +++--- drivers/gpio/gpiolib.c | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 47 ++++++++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 4 +- .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 18 ++++++ drivers/gpu/drm/bridge/tc358767.c | 73 ++++++++++++---------- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 3 +- drivers/gpu/drm/vc4/vc4_irq.c | 3 + drivers/gpu/drm/vc4/vc4_v3d.c | 3 + drivers/hid/wacom_sys.c | 24 +++---- drivers/hwmon/pmbus/pmbus_core.c | 21 ++++--- drivers/infiniband/hw/mlx5/main.c | 14 +++++ drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 +- drivers/infiniband/hw/mlx5/qp.c | 59 +++++++---------- drivers/md/bcache/btree.c | 5 +- drivers/media/usb/usbtv/usbtv-core.c | 1 + drivers/mtd/nand/denali_pci.c | 4 ++ drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- drivers/net/ethernet/xilinx/Kconfig | 1 + drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 2 + drivers/net/xen-netfront.c | 18 ++++++ drivers/power/reset/zx-reboot.c | 4 ++ drivers/scsi/aacraid/commsup.c | 2 +- drivers/scsi/ufs/ufshcd.c | 7 ++- drivers/spi/spi-imx.c | 15 ++++- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 7 +-- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 2 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 6 +- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 14 ++--- drivers/tty/serial/imx.c | 14 +++-- drivers/tty/tty_io.c | 8 ++- drivers/tty/tty_ldisc.c | 4 +- drivers/usb/class/cdc-acm.c | 5 +- drivers/usb/gadget/composite.c | 7 ++- drivers/usb/gadget/function/f_fs.c | 3 +- drivers/usb/gadget/udc/core.c | 2 +- drivers/usb/serial/Kconfig | 1 + drivers/usb/serial/io_edgeport.c | 1 - drivers/usb/serial/option.c | 5 ++ drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 1 + drivers/usb/serial/usb-serial-simple.c | 7 +++ drivers/usb/storage/uas.c | 7 +-- drivers/usb/usbip/vhci_hcd.c | 2 +- fs/btrfs/free-space-cache.c | 3 +- fs/nfs_common/grace.c | 10 ++- fs/nfsd/nfs4state.c | 34 +++++----- fs/quota/dquot.c | 3 +- fs/reiserfs/super.c | 1 - fs/xfs/xfs_aops.c | 6 +- fs/xfs/xfs_buf.c | 15 +++-- fs/xfs/xfs_dquot.c | 14 ++++- fs/xfs/xfs_dquot_item.c | 40 +++++++++++- fs/xfs/xfs_inode.c | 21 +++++++ include/linux/mlx5/mlx5_ifc.h | 10 ++- include/linux/tty.h | 2 + mm/kmemleak.c | 2 + net/mac80211/mesh_hwmp.c | 15 +++-- net/openvswitch/flow_netlink.c | 16 ++--- net/sunrpc/xprtsock.c | 1 + tools/gpio/gpio-event-mon.c | 1 + tools/power/cpupower/bench/system.c | 2 +- .../cpupower/utils/idle_monitor/cpuidle_sysfs.c | 9 ++- tools/usb/usbip/src/usbip_bind.c | 9 +++ tools/usb/usbip/src/usbip_list.c | 9 +++ 84 files changed, 543 insertions(+), 239 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/86 loop: fix concurrent lo_open/lo_release
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <[email protected]>
commit ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5 upstream.
范龙飞 reports that KASAN can report a use-after-free in __lock_acquire. The reason is due to insufficient serialization in lo_release(), which will continue to use the loop device even after it has decremented the lo_refcnt to zero.
In the meantime, another process can come in, open the loop device again as it is being shut down. Confusion ensues.
--- drivers/block/loop.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/block/loop.c +8 -2
@@ -1558,9 +1558,8 @@ out:return err; } -static void lo_release (struct gendisk *disk,fmode_t mode) +static void __lo_release (struct loop_device *lo) { -struct loop_device *lo = disk->private_data;int err;if (atomic_dec_return (&lo->lo_refcnt))
@@ -1586,6 +1585,13 @@ static void lo_release(struct gendisk *dmutex_unlock (&lo->lo_ctl_mutex); } +static void lo_release (struct gendisk *disk,fmode_t mode) +{ +mutex_lock (&loop_index_mutex); +__lo_release (disk->private_data); +mutex_unlock (&loop_index_mutex); +} +static const struct block_device_operations lo_fops = { .owner =THIS_MODULE , .open = lo_open,
Greg Kroah-Hartman
maintainerPATCH 2/86 net/mlx5: Define interface bits for fencing UMR wqe
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Gurtovoy <[email protected]>
commit 1410a90ae449061b7e1ae19d275148f36948801b upstream.
HW can implement UMR wqe re-transmission in various ways. Thus, add HCA cap to distinguish the needed fence for UMR to make sure that the wqe wouldn't fail on mkey checks.
--- include/linux/mlx5/mlx5_ifc.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
include/linux/mlx5/mlx5_ifc.h +9 -1
@@ -737,6 +737,12 @@ enum { MLX5_CAP_PORT_TYPE_ETH = 0x1, }; +enum { +MLX5_CAP_UMR_FENCE_STRONG =0x0 , +MLX5_CAP_UMR_FENCE_SMALL =0x1 , +MLX5_CAP_UMR_FENCE_NONE =0x2 , +}; +struct mlx5_ifc_cmd_hca_cap_bits {u8 reserved_at_0[0x80 ];
@@ -838,7 +844,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {u8 striding_rq[0x1 ];u8 reserved_at_201[0x2 ];u8 ipoib_basic_offloads[0x1 ]; -u8 reserved_at_205[0xa ]; +u8 reserved_at_205[0x5 ]; +u8 umr_fence[0x2 ]; +u8 reserved_at_20c[0x3 ];u8 drain_sigerr[0x1 ];u8 cmdif_checksum[0x2 ];u8 sigerr_cqe[0x1 ];
Greg Kroah-Hartman
maintainerPATCH 3/86 RDMA/mlx5: set UMR wqe fence according to HCA cap
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Gurtovoy <[email protected]>
commit 6e8484c5cf07c7ee632587e98c1a12d319dacb7c upstream.
Cache the needed umr_fence and set the wqe ctrl segmennt accordingly.
--- drivers/infiniband/hw/mlx5/main.c | 14 ++++++++ drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 + drivers/infiniband/hw/mlx5/qp.c | 59 +++++++++++++---------------------- 3 files changed, 39 insertions(+), 37 deletions(-)
drivers/infiniband/hw/mlx5/main.c +14 -0
@@ -2575,6 +2575,18 @@ error_0:return ret; } +static u8 mlx5_get_umr_fence (u8 umr_fence_cap) +{ +switch (umr_fence_cap) { +case MLX5_CAP_UMR_FENCE_NONE : +return MLX5_FENCE_MODE_NONE ; +case MLX5_CAP_UMR_FENCE_SMALL : +return MLX5_FENCE_MODE_INITIATOR_SMALL ; +default : +return MLX5_FENCE_MODE_STRONG_ORDERING ; + } +} +static int create_dev_resources (struct mlx5_ib_resources *devr) {struct ib_srq_init_attr attr;
@@ -3101,6 +3113,8 @@ static void *mlx5_ib_add(struct mlx5_cormlx5_ib_internal_fill_odp_caps (dev); + dev->umr_fence =mlx5_get_umr_fence (MLX5_CAP_GEN (mdev, umr_fence)); +if (MLX5_CAP_GEN (mdev, imaicl)) { dev->ib_dev.alloc_mw = mlx5_ib_alloc_mw; dev->ib_dev.dealloc_mw = mlx5_ib_dealloc_mw;
drivers/infiniband/hw/mlx5/mlx5_ib.h +2 -1
@@ -345,7 +345,7 @@ struct mlx5_ib_qp {struct mlx5_ib_wq rq;u8 sq_signal_bits; -u8 fm_cache; +u8 next_fence;struct mlx5_ib_wq sq;/* serialize qp state modifications
@@ -643,6 +643,7 @@ struct mlx5_ib_dev {struct list_head qp_list;/* Array with num_ports elements */ struct mlx5_ib_port *port; +u8 umr_fence; };static inline struct mlx5_ib_cq *to_mibcq (struct mlx5_core_cq *mcq)
drivers/infiniband/hw/mlx5/qp.c +23 -36
131 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 4/86 tools/gpio: Fix build error with musl libc
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joel Stanley <[email protected]>
commit 1696784eb7b52b13b62d160c028ef2c2c981d4f2 upstream.
The GPIO tools build fails when using a buildroot toolchain that uses musl as it's C library:
arm-broomstick-linux-musleabi-gcc -Wp,-MD,./.gpio-event-mon.o.d \
-Wp,-MT,gpio-event-mon.o -O2 -Wall -g -D_GNU_SOURCE \
-Iinclude -D"BUILD_STR(s)=#s" -c -o gpio-event-mon.o gpio-event-mon.c
gpio-event-mon.c:30:6: error: unknown type name ‘u_int32_t’; did you mean ‘uint32_t’?
u_int32_t handleflags,
^~~~~~~~~
uint32_tThe glibc headers installed on my laptop include sys/types.h in unistd.h, but it appears that musl does not.
--- tools/gpio/gpio-event-mon.c | 1 + 1 file changed, 1 insertion(+)
tools/gpio/gpio-event-mon.c +1 -0
@@ -23,6 +23,7 @@#include <getopt.h> #include <inttypes.h> #include <sys/ioctl.h> +#include <sys/types.h> #include <linux/gpio.h> int monitor_device(const char *device_name,
Greg Kroah-Hartman
maintainerPATCH 5/86 gpio: stmpe: i2c transfer are forbiden in atomic context
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrice Chotard <[email protected]>
commit b888fb6f2a278442933e3bfab70262e9a5365fb3 upstream.
Move the workaround from stmpe_gpio_irq_unmask() which is executed in atomic context to stmpe_gpio_irq_sync_unlock() which is not.
It fixes the following issue:
[ 1.500000] BUG: scheduling while atomic: swapper/1/0x00000002 [ 1.500000] CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc2-00020-gbd4301f-dirty #28 [ 1.520000] Hardware name: STM32 (Device Tree Support) [ 1.520000] [<0000bfc9>] (unwind_backtrace) from [<0000b347>] (show_stack+0xb/0xc) [ 1.530000] [<0000b347>] (show_stack) from [<0001fc49>] (__schedule_bug+0x39/0x58) [ 1.530000] [<0001fc49>] (__schedule_bug) from [<00168211>] (__schedule+0x23/0x2b2) [ 1.550000] [<00168211>] (__schedule) from [<001684f7>] (schedule+0x57/0x64) [ 1.550000] [<001684f7>] (schedule) from [<0016a513>] (schedule_timeout+0x137/0x164) [ 1.550000] [<0016a513>] (schedule_timeout) from [<00168b91>] (wait_for_common+0x8d/0xfc) [ 1.570000] [<00168b91>] (wait_for_common) from [<00139753>] (stm32f4_i2c_xfer+0xe9/0xfe) [ 1.580000] [<00139753>] (stm32f4_i2c_xfer) from [<00138545>] (__i2c_transfer+0x111/0x148) [ 1.590000] [<00138545>] (__i2c_transfer) from [<001385cf>] (i2c_transfer+0x53/0x70) [ 1.590000] [<001385cf>] (i2c_transfer) from [<001388a5>] (i2c_smbus_xfer+0x12f/0x36e) [ 1.600000] [<001388a5>] (i2c_smbus_xfer) from [<00138b49>] (i2c_smbus_read_byte_data+0x1f/0x2a) [ 1.610000] [<00138b49>] (i2c_smbus_read_byte_data) from [<00124fdd>] (__stmpe_reg_read+0xd/0x24) [ 1.620000] [<00124fdd>] (__stmpe_reg_read) from [<001252b3>] (stmpe_reg_read+0x19/0x24) [ 1.630000] [<001252b3>] (stmpe_reg_read) from [<0002c4d1>] (unmask_irq+0x17/0x22) [ 1.640000] [<0002c4d1>] (unmask_irq) from [<0002c57f>] (irq_startup+0x6f/0x78) [ 1.650000] [<0002c57f>] (irq_startup) from [<0002b7a1>] (__setup_irq+0x319/0x47c) [ 1.650000] [<0002b7a1>] (__setup_irq) from [<0002bad3>] (request_threaded_irq+0x6b/0xe8) [ 1.660000] [<0002bad3>] (request_threaded_irq) from [<0002d0b9>] (devm_request_threaded_irq+0x3b/0x6a) [ 1.670000] [<0002d0b9>] (devm_request_threaded_irq) from [<001446e7>] (mmc_gpiod_request_cd_irq+0x49/0x8a) [ 1.680000] [<001446e7>] (mmc_gpiod_request_cd_irq) from [<0013d45d>] (mmc_start_host+0x49/0x60) [ 1.690000] [<0013d45d>] (mmc_start_host) from [<0013e40b>] (mmc_add_host+0x3b/0x54) [ 1.700000] [<0013e40b>] (mmc_add_host) from [<00148119>] (mmci_probe+0x4d1/0x60c) [ 1.710000] [<00148119>] (mmci_probe) from [<000f903b>] (amba_probe+0x7b/0xbe) [ 1.720000] [<000f903b>] (amba_probe) from [<001170e5>] (driver_probe_device+0x169/0x1f8) [ 1.730000] [<001170e5>] (driver_probe_device) from [<001171b7>] (__driver_attach+0x43/0x5c) [ 1.740000] [<001171b7>] (__driver_attach) from [<0011618d>] (bus_for_each_dev+0x3d/0x46) [ 1.740000] [<0011618d>] (bus_for_each_dev) from [<001165cd>] (bus_add_driver+0xcd/0x124) [ 1.740000] [<001165cd>] (bus_add_driver) from [<00117713>] (driver_register+0x4d/0x7a) [ 1.760000] [<00117713>] (driver_register) from [<001fc765>] (do_one_initcall+0xbd/0xe8) [ 1.770000] [<001fc765>] (do_one_initcall) from [<001fc88b>] (kernel_init_freeable+0xfb/0x134) [ 1.780000] [<001fc88b>] (kernel_init_freeable) from [<00167ee3>] (kernel_init+0x7/0x9c) [ 1.790000] [<00167ee3>] (kernel_init) from [<00009b65>] (ret_from_fork+0x11/0x2c)
--- drivers/gpio/gpio-stmpe.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpio/gpio-stmpe.c +10 -10
@@ -190,6 +190,16 @@ static void stmpe_gpio_irq_sync_unlock(s };int i, j; +/* +* STMPE1600: to be able to get IRQ from pins, +* a read must be done on GPMR register, or a write in +* GPSR or GPCR registers +*/ +if (stmpe->partnum ==STMPE1600 ) { +stmpe_reg_read (stmpe, stmpe->regs[STMPE_IDX_GPMR_LSB ]); +stmpe_reg_read (stmpe, stmpe->regs[STMPE_IDX_GPMR_CSB ]); + } +for (i =0 ; i <CACHE_NR_REGS ; i++) {/* STMPE801 and STMPE1600 don't have RE and FE registers */ if ((stmpe->partnum == STMPE801 ||
@@ -227,21 +237,11 @@ static void stmpe_gpio_irq_unmask(struct {struct gpio_chip *gc =irq_data_get_irq_chip_data (d);struct stmpe_gpio *stmpe_gpio =gpiochip_get_data (gc); -struct stmpe *stmpe = stmpe_gpio->stmpe;int offset = d->hwirq;int regoffset = offset /8 ;int mask =BIT (offset %8 ); stmpe_gpio->regs[REG_IE ][regoffset] |= mask; - -/* -* STMPE1600 workaround: to be able to get IRQ from pins, -* a read must be done on GPMR register, or a write in -* GPSR or GPCR registers -*/ -if (stmpe->partnum ==STMPE1600 ) -stmpe_reg_read (stmpe, - stmpe->regs[STMPE_IDX_GPMR_LSB + regoffset]); } static void stmpe_dbg_show_one(struct seq_file *s,
Greg Kroah-Hartman
maintainerPATCH 6/86 gpio: Fix kernel stack leak to userspace
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit 24bd3efc9d1efb5f756a7c6f807a36ddb6adc671 upstream.
The GPIO event descriptor was leaking kernel stack to userspace because we don't zero the variable before use. Ooops. Fix this.
--- drivers/gpio/gpiolib.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpio/gpiolib.c +3 -0
@@ -705,6 +705,9 @@ static irqreturn_t lineevent_irq_thread(struct gpioevent_data ge;int ret, level; +/* Do not leak kernel stack to userspace */ +memset (&ge,0 ,sizeof (ge)); + ge.timestamp =ktime_get_real_ns (); level =gpiod_get_value_cansleep (le->desc);
Greg Kroah-Hartman
maintainerPATCH 7/86 crypto: ecdh - fix typo in KPP dependency of CRYPTO_ECDH
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hauke Mehrtens <[email protected]>
commit b5b9007730ce1d90deaf25d7f678511550744bdc upstream.
This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH.
--- crypto/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/Kconfig +1 -1
@@ -120,7 +120,7 @@ config CRYPTO_DH config CRYPTO_ECDH tristate "ECDH algorithm" - select CRYTPO_KPP + select CRYPTO_KPP help Generic implementation of the ECDH algorithm
Greg Kroah-Hartman
maintainerPATCH 8/86 crypto: aesni - handle zero length dst buffer
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Mueller <[email protected]>
commit 9c674e1e2f9e24fa4392167efe343749008338e0 upstream.
GCM can be invoked with a zero destination buffer. This is possible if the AAD and the ciphertext have zero lengths and only the tag exists in the source buffer (i.e. a source buffer cannot be zero). In this case, the GCM cipher only performs the authentication and no decryption operation.
When the destination buffer has zero length, it is possible that no page is mapped to the SG pointing to the destination. In this case, sg_page(req->dst) is an invalid access. Therefore, page accesses should only be allowed if the req->dst->length is non-zero which is the indicator that a page must exist.
This fixes a crash that can be triggered by user space via AF_ALG.
--- arch/x86/crypto/aesni-intel_glue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/crypto/aesni-intel_glue.c +1 -1
@@ -906,7 +906,7 @@ static int helper_rfc4106_encrypt(structif (sg_is_last (req->src) && req->src->offset + req->src->length <=PAGE_SIZE && -sg_is_last (req->dst) && ++sg_is_last (req->dst) && req->dst->length && req->dst->offset + req->dst->length <=PAGE_SIZE ) { one_entry_in_sg =1 ;scatterwalk_start (&src_sg_walk, req->src);
Greg Kroah-Hartman
maintainerPATCH 9/86 crypto: sha3-generic - fixes for alignment and big endian operation
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit c013cee99d5a18aec8c71fee8f5f41369cd12595 upstream.
Ensure that the input is byte swabbed before injecting it into the SHA3 transform. Use the get_unaligned() accessor for this so that we don't perform unaligned access inadvertently on architectures that do not support that.
--- crypto/sha3_generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
crypto/sha3_generic.c +3 -2
@@ -18,6 +18,7 @@#include <linux/types.h> #include <crypto/sha3.h> #include <asm/byteorder.h> +#include <asm/unaligned.h> #define KECCAK_ROUNDS 24
@@ -149,7 +150,7 @@ static int sha3_update(struct shash_descunsigned int i;for (i =0 ; i < sctx->rsizw; i++) - sctx->st[i] ^= ((u64 *) src)[i]; + sctx->st[i] ^=get_unaligned_le64 (src +8 * i);keccakf (sctx->st); done += sctx->rsiz;
@@ -174,7 +175,7 @@ static int sha3_final(struct shash_desc sctx->buf[sctx->rsiz -1 ] |=0x80 ;for (i =0 ; i < sctx->rsizw; i++) - sctx->st[i] ^= ((u64 *) sctx->buf)[i]; + sctx->st[i] ^=get_unaligned_le64 (sctx->buf +8 * i);keccakf (sctx->st);
Greg Kroah-Hartman
maintainerPATCH 10/86 crypto: af_alg - whitelist mask and type
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Mueller <[email protected]>
commit bb30b8848c85e18ca7e371d0a869e94b3e383bdf upstream.
The user space interface allows specifying the type and mask field used to allocate the cipher. Only a subset of the possible flags are intended for user space. Therefore, white-list the allowed flags.
In case the user space caller uses at least one non-allowed flag, EINVAL is returned.
--- crypto/af_alg.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
crypto/af_alg.c +6 -4
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(af_alg_release_parent)static int alg_bind (struct socket *sock,struct sockaddr *uaddr,int addr_len) { -const u32 forbidden =CRYPTO_ALG_INTERNAL ; +const u32 allowed =CRYPTO_ALG_KERN_DRIVER_ONLY ;struct sock *sk = sock->sk;struct alg_sock *ask =alg_sk (sk);struct sockaddr_alg *sa = (void *)uaddr;
@@ -157,6 +157,10 @@ static int alg_bind(struct socket *sock,void *private;int err; +/* If caller uses non-allowed flag, return error. */ +if ((sa->salg_feat & ~allowed) || (sa->salg_mask & ~allowed)) +return -EINVAL ; +if (sock->state ==SS_CONNECTED )return -EINVAL ;
@@ -175,9 +179,7 @@ static int alg_bind(struct socket *sock,if (IS_ERR (type))return PTR_ERR (type); - private = type->bind (sa->salg_name, - sa->salg_feat & ~forbidden, - sa->salg_mask & ~forbidden); + private = type->bind (sa->salg_name, sa->salg_feat, sa->salg_mask);if (IS_ERR (private)) {module_put (type->owner);return PTR_ERR (private);
Greg Kroah-Hartman
maintainerPATCH 11/86 HID: wacom: EKR: ensure devres groups at higher indexes are released
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Armstrong Skomra <[email protected]>
commit 791ae273731fa85d3332e45064dab177ae663e80 upstream.
Background: ExpressKey Remotes communicate their events via usb dongle. Each dongle can hold up to 5 pairings at one time and one EKR (identified by its serial number) can unfortunately be paired with its dongle more than once. The pairing takes place in a round-robin fashion.
Input devices are only created once per EKR, when a new serial number is seen in the list of pairings. However, if a device is created for a "higher" paring index and subsequently a second pairing occurs at a lower pairing index, unpairing the remote with that serial number from any pairing index will currently cause a driver crash. This occurs infrequently, as two remotes are necessary to trigger this bug and most users have only one remote.
As an illustration, to trigger the bug you need to have two remotes, and pair them in this order:
1. slot 0 -> remote 1 (input device created for remote 1)
2. slot 1 -> remote 1 (duplicate pairing - no device created)
3. slot 2 -> remote 1 (duplicate pairing - no device created)
4. slot 3 -> remote 1 (duplicate pairing - no device created)
5. slot 4 -> remote 2 (input device created for remote 2)
6. slot 0 -> remote 2 (1 destroyed and recreated at slot 1)
7. slot 1 -> remote 2 (1 destroyed and recreated at slot 2)
8. slot 2 -> remote 2 (1 destroyed and recreated at slot 3)
9. slot 3 -> remote 2 (1 destroyed and not recreated)
10. slot 4 -> remote 2 (2 was already in this slot so no changes)
11. slot 0 -> remote 1 (The current code sees remote 2 was paired over in one of the dongle slots it occupied and attempts to remove all information about remote 2 [1]. It calls wacom_remote_destroy_one for remote 2, but the destroy function assumes the lowest index is where the remote's input device was created. The code "cleans up" the other remote 2 pairings including the one which the input device was based on, assuming they were were just duplicate pairings. However, the cleanup doesn't call the devres release function for the input device that was created in slot 4).
This issue is fixed by this commit.
[1] Remote 2 should subsequently be re-created on the next packet from the EKR at the lowest numbered slot that it occupies (here slot 1).
--- drivers/hid/wacom_sys.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/hid/wacom_sys.c +12 -12
@@ -2192,23 +2192,23 @@ static void wacom_remote_destroy_one(strint i;unsigned long flags; -spin_lock_irqsave (&remote->remote_lock, flags); - remote->remotes[index].registered = false; -spin_unlock_irqrestore (&remote->remote_lock, flags); +for (i =0 ; i <WACOM_MAX_REMOTES ; i++) { +if (remote->remotes[i].serial == serial) { -if (remote->remotes[index].battery.battery) -devres_release_group (&wacom->hdev->dev, - &remote->remotes[index].battery.bat_desc); +spin_lock_irqsave (&remote->remote_lock, flags); + remote->remotes[i].registered = false; +spin_unlock_irqrestore (&remote->remote_lock, flags); -if (remote->remotes[index].group.name) -devres_release_group (&wacom->hdev->dev, - &remote->remotes[index]); +if (remote->remotes[i].battery.battery) +devres_release_group (&wacom->hdev->dev, + &remote->remotes[i].battery.bat_desc); + +if (remote->remotes[i].group.name) +devres_release_group (&wacom->hdev->dev, + &remote->remotes[i]); -for (i =0 ; i <WACOM_MAX_REMOTES ; i++) { -if (remote->remotes[i].serial == serial) { remote->remotes[i].serial =0 ; remote->remotes[i].group.name =NULL ; - remote->remotes[i].registered = false; remote->remotes[i].battery.battery =NULL ; wacom->led.groups[i].select =WACOM_STATUS_UNKNOWN ; }
Greg Kroah-Hartman
maintainerPATCH 12/86 power: reset: zx-reboot: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Chan <[email protected]>
commit 348c7cf5fcbcb68838255759d4cb45d039af36d2 upstream.
This change resolves a new compile-time warning
when built as a loadable module:
WARNING: modpost: missing MODULE_LICENSE() in drivers/power/reset/zx-reboot.o see include/linux/module.h for more information
This adds the license as "GPL v2", which matches the header of the file.
MODULE_DESCRIPTION and MODULE_AUTHOR are also added.
--- drivers/power/reset/zx-reboot.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/power/reset/zx-reboot.c +4 -0
@@ -81,3 +81,7 @@ static struct platform_driver zx_reboot_ }, };module_platform_driver (zx_reboot_driver); + +MODULE_DESCRIPTION ("ZTE SoCs reset driver" ); +MODULE_AUTHOR ("Jun Nie <[email protected]>" ); +MODULE_LICENSE ("GPL v2" );
Greg Kroah-Hartman
maintainerPATCH 13/86 gpio: iop: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Chan <[email protected]>
commit 97b03136e1b637d7a9d2274c099e44ecf23f1103 upstream.
This change resolves a new compile-time warning
when built as a loadable module:
WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o see include/linux/module.h for more information
This adds the license as "GPL", which matches the header of the file.
MODULE_DESCRIPTION and MODULE_AUTHOR are also added.
--- drivers/gpio/gpio-iop.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpio/gpio-iop.c +4 -0
@@ -58,3 +58,7 @@ static int __init iop3xx_gpio_init(void)return platform_driver_register (&iop3xx_gpio_driver); }arch_initcall (iop3xx_gpio_init); + +MODULE_DESCRIPTION ("GPIO handling for Intel IOP3xx processors" ); +MODULE_AUTHOR ("Lennert Buytenhek <[email protected]>" ); +MODULE_LICENSE ("GPL" );
Greg Kroah-Hartman
maintainerPATCH 14/86 gpio: ath79: add missing MODULE_DESCRIPTION/LICENSE
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Chan <[email protected]>
commit 539340f37e6d6ed4cd93e8e18c9b2e4eafd4b842 upstream.
This change resolves a new compile-time warning
when built as a loadable module:
WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o see include/linux/module.h for more information
This adds the license as "GPL v2", which matches the header of the file.
MODULE_DESCRIPTION is also added.
--- drivers/gpio/gpio-ath79.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpio/gpio-ath79.c +3 -0
@@ -323,3 +323,6 @@ static struct platform_driver ath79_gpio };module_platform_driver (ath79_gpio_driver); + +MODULE_DESCRIPTION ("Atheros AR71XX/AR724X/AR913X GPIO API support" ); +MODULE_LICENSE ("GPL v2" );
Greg Kroah-Hartman
maintainerPATCH 15/86 mtd: nand: denali_pci: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Chan <[email protected]>
commit d822401d1c6898a4a4ee03977b78b8cec402e88a upstream.
This change resolves a new compile-time warning
when built as a loadable module:
WARNING: modpost: missing MODULE_LICENSE() in drivers/mtd/nand/denali_pci.o see include/linux/module.h for more information
This adds the license as "GPL v2", which matches the header of the file.
MODULE_DESCRIPTION and MODULE_AUTHOR are also added.
--- drivers/mtd/nand/denali_pci.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mtd/nand/denali_pci.c +4 -0
@@ -119,3 +119,7 @@ static struct pci_driver denali_pci_driv };module_pci_driver (denali_pci_driver); + +MODULE_DESCRIPTION ("PCI driver for Denali NAND controller" ); +MODULE_AUTHOR ("Intel Corporation and its suppliers" ); +MODULE_LICENSE ("GPL v2" );
Greg Kroah-Hartman
maintainerPATCH 16/86 igb: Free IRQs when device is hotplugged
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lyude Paul <[email protected]>
commit 888f22931478a05bc81ceb7295c626e1292bf0ed upstream.
Recently I got a Caldigit TS3 Thunderbolt 3 dock, and noticed that upon hotplugging my kernel would immediately crash due to igb:
[ 680.825801] kernel BUG at drivers/pci/msi.c:352! [ 680.828388] invalid opcode: 0000 [#1] SMP [ 680.829194] Modules linked in: igb(O) thunderbolt i2c_algo_bit joydev vfat fat btusb btrtl btbcm btintel bluetooth ecdh_generic hp_wmi sparse_keymap rfkill wmi_bmof iTCO_wdt intel_rapl x86_pkg_temp_thermal coretemp crc32_pclmul snd_pcm rtsx_pci_ms mei_me snd_timer memstick snd pcspkr mei soundcore i2c_i801 tpm_tis psmouse shpchp wmi tpm_tis_core tpm video hp_wireless acpi_pad rtsx_pci_sdmmc mmc_core crc32c_intel serio_raw rtsx_pci mfd_core xhci_pci xhci_hcd i2c_hid i2c_core [last unloaded: igb] [ 680.831085] CPU: 1 PID: 78 Comm: kworker/u16:1 Tainted: G O 4.15.0-rc3Lyude-Test+ #6 [ 680.831596] Hardware name: HP HP ZBook Studio G4/826B, BIOS P71 Ver. 01.03 06/09/2017 [ 680.832168] Workqueue: kacpi_hotplug acpi_hotplug_work_fn [ 680.832687] RIP: 0010:free_msi_irqs+0x180/0x1b0 [ 680.833271] RSP: 0018:ffffc9000030fbf0 EFLAGS: 00010286 [ 680.833761] RAX: ffff8803405f9c00 RBX: ffff88033e3d2e40 RCX: 000000000000002c [ 680.834278] RDX: 0000000000000000 RSI: 00000000000000ac RDI: ffff880340be2178 [ 680.834832] RBP: 0000000000000000 R08: ffff880340be1ff0 R09: ffff8803405f9c00 [ 680.835342] R10: 0000000000000000 R11: 0000000000000040 R12: ffff88033d63a298 [ 680.835822] R13: ffff88033d63a000 R14: 0000000000000060 R15: ffff880341959000 [ 680.836332] FS: 0000000000000000(0000) GS:ffff88034f440000(0000) knlGS:0000000000000000 [ 680.836817] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 680.837360] CR2: 000055e64044afdf CR3: 0000000001c09002 CR4: 00000000003606e0 [ 680.837954] Call Trace: [ 680.838853] pci_disable_msix+0xce/0xf0 [ 680.839616] igb_reset_interrupt_capability+0x5d/0x60 [igb] [ 680.840278] igb_remove+0x9d/0x110 [igb] [ 680.840764] pci_device_remove+0x36/0xb0 [ 680.841279] device_release_driver_internal+0x157/0x220 [ 680.841739] pci_stop_bus_device+0x7d/0xa0 [ 680.842255] pci_stop_bus_device+0x2b/0xa0 [ 680.842722] pci_stop_bus_device+0x3d/0xa0 [ 680.843189] pci_stop_and_remove_bus_device+0xe/0x20 [ 680.843627] trim_stale_devices+0xf3/0x140 [ 680.844086] trim_stale_devices+0x94/0x140 [ 680.844532] trim_stale_devices+0xa6/0x140 [ 680.845031] ? get_slot_status+0x90/0xc0 [ 680.845536] acpiphp_check_bridge.part.5+0xfe/0x140 [ 680.846021] acpiphp_hotplug_notify+0x175/0x200 [ 680.846581] ? free_bridge+0x100/0x100 [ 680.847113] acpi_device_hotplug+0x8a/0x490 [ 680.847535] acpi_hotplug_work_fn+0x1a/0x30 [ 680.848076] process_one_work+0x182/0x3a0 [ 680.848543] worker_thread+0x2e/0x380 [ 680.848963] ? process_one_work+0x3a0/0x3a0 [ 680.849373] kthread+0x111/0x130 [ 680.849776] ? kthread_create_worker_on_cpu+0x50/0x50 [ 680.850188] ret_from_fork+0x1f/0x30 [ 680.850601] Code: 43 14 85 c0 0f 84 d5 fe ff ff 31 ed eb 0f 83 c5 01 39 6b 14 0f 86 c5 fe ff ff 8b 7b 10 01 ef e8 b7 e4 d2 ff 48 83 78 70 00 74 e3 <0f> 0b 49 8d b5 a0 00 00 00 e8 62 6f d3 ff e9 c7 fe ff ff 48 8b [ 680.851497] RIP: free_msi_irqs+0x180/0x1b0 RSP: ffffc9000030fbf0
As it turns out, normally the freeing of IRQs that would fix this is called inside of the scope of __igb_close(). However, since the device is already gone by the point we try to unregister the netdevice from the driver due to a hotplug we end up seeing that the netif isn't present and thus, forget to free any of the device IRQs.
So: make sure that if we're in the process of dismantling the netdev, we always allow __igb_close() to be called so that IRQs may be freed normally. Additionally, only allow igb_close() to be called from __igb_close() if it hasn't already been called for the given adapter.
--- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
@@ -3273,7 +3273,7 @@ static int __igb_close(struct net_deviceint igb_close (struct net_device *netdev) { -if (netif_device_present (netdev)) +if (netif_device_present (netdev) || netdev->dismantle)return __igb_close (netdev, false);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 17/86 drm/vc4: Account for interrupts in flight
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Schake <[email protected]>
[ Upstream commit 253696ccd613fbdaa5aba1de44c461a058e0a114 ]
Synchronously disable the IRQ to make the following cancel_work_sync invocation effective.
An interrupt in flight could enqueue further overflow mem work. As we free the binner BO immediately following vc4_irq_uninstall this caused a NULL pointer dereference in the work callback vc4_overflow_mem_work.
--- drivers/gpu/drm/vc4/vc4_irq.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/vc4/vc4_irq.c +6 -0
@@ -208,6 +208,9 @@ vc4_irq_postinstall(struct drm_device *d {struct vc4_dev *vc4 =to_vc4_dev (dev); +/* Undo the effects of a previous vc4_irq_uninstall. */ +enable_irq (dev->irq); +/* Enable both the render done and out of memory interrupts. */ V3D_WRITE (V3D_INTENA ,V3D_DRIVER_IRQS );
@@ -225,6 +228,9 @@ vc4_irq_uninstall(struct drm_device *dev/* Clear any pending interrupts we might have left. */ V3D_WRITE (V3D_INTCTL ,V3D_DRIVER_IRQS ); +/* Finish any interrupt handler still in flight. */ +disable_irq (dev->irq); +cancel_work_sync (&vc4->overflow_mem_work); }
Greg Kroah-Hartman
maintainerPATCH 18/86 cpupowerutils: bench - Fix cpu online check
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abhishek Goel <[email protected]>
[ Upstream commit 53d1cd6b125fb9d69303516a1179ebc3b72f797a ]
cpupower_is_cpu_online was incorrectly checking for 0. This patch fixes this by checking for 1 when the cpu is online.
--- tools/power/cpupower/bench/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/cpupower/bench/system.c +1 -1
@@ -61,7 +61,7 @@ int set_cpufreq_governor(char *governor,dprintf ("set %s as cpufreq governor\n" , governor); -if (cpupower_is_cpu_online (cpu) !=0 ) { +if (cpupower_is_cpu_online (cpu) !=1 ) {perror ("cpufreq_cpu_exists" );fprintf (stderr,"error: cpu %u does not exist\n" , cpu);return -1 ;
Greg Kroah-Hartman
maintainerPATCH 19/86 cpupower : Fix cpupower working when cpu0 is offline
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abhishek Goel <[email protected]>
[ Upstream commit dbdc468f35ee827cab2753caa1c660bdb832243a ]
cpuidle_monitor used to assume that cpu0 is always online which is not a valid assumption on POWER machines. This patch fixes this by getting the cpu on which the current thread is running, instead of always using cpu0 for monitoring which may not be online.
--- tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c +6 -3
@@ -130,15 +130,18 @@ static struct cpuidle_monitor *cpuidle_r {int num;char *tmp; +int this_cpu; + + this_cpu =sched_getcpu ();/* Assume idle state count is the same for all CPUs */ - cpuidle_sysfs_monitor.hw_states_num =cpuidle_state_count (0 ); + cpuidle_sysfs_monitor.hw_states_num =cpuidle_state_count (this_cpu);if (cpuidle_sysfs_monitor.hw_states_num <=0 )return NULL ;for (num =0 ; num < cpuidle_sysfs_monitor.hw_states_num; num++) { - tmp =cpuidle_state_name (0 , num); + tmp =cpuidle_state_name (this_cpu, num);if (tmp ==NULL )continue ;
@@ -146,7 +149,7 @@ static struct cpuidle_monitor *cpuidle_rstrncpy (cpuidle_cstates[num].name, tmp,CSTATE_NAME_LEN -1 );free (tmp); - tmp =cpuidle_state_desc (0 , num); + tmp =cpuidle_state_desc (this_cpu, num);if (tmp ==NULL )continue ;strncpy (cpuidle_cstates[num].desc, tmp,CSTATE_DESC_LEN -1 );
Greg Kroah-Hartman
maintainerPATCH 20/86 KVM: x86: emulator: Return to user-mode on L1 CPL=0 emulation failure
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liran Alon <[email protected]>
[ Upstream commit 1f4dcb3b213235e642088709a1c54964d23365e9 ]
On this case, handle_emulation_failure() fills kvm_run with internal-error information which it expects to be delivered to user-mode for further processing.
However, the code reports a wrong return-value which makes KVM to never return to user-mode on this scenario.
userspace")
--- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/x86.c +1 -1
@@ -5308,7 +5308,7 @@ static int handle_emulation_failure(stru vcpu->run->exit_reason =KVM_EXIT_INTERNAL_ERROR ; vcpu->run->internal.suberror =KVM_INTERNAL_ERROR_EMULATION ; vcpu->run->internal.ndata =0 ; - r =EMULATE_FAIL ; + r =EMULATE_USER_EXIT ; }kvm_queue_exception (vcpu,UD_VECTOR );
Greg Kroah-Hartman
maintainerPATCH 21/86 KVM: x86: Dont re-execute instruction when not passing CR2 value
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liran Alon <[email protected]>
[ Upstream commit 9b8ae63798cb97e785a667ff27e43fa6220cb734 ]
In case of instruction-decode failure or emulation failure, x86_emulate_instruction() will call reexecute_instruction() which will attempt to use the cr2 value passed to x86_emulate_instruction(). However, when x86_emulate_instruction() is called from emulate_instruction(), cr2 is not passed (passed as 0) and therefore it doesn't make sense to execute reexecute_instruction() logic at all.
--- arch/x86/include/asm/kvm_host.h | 3 ++- arch/x86/kvm/vmx.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/include/asm/kvm_host.h +2 -1
@@ -1113,7 +1113,8 @@ int x86_emulate_instruction(struct kvm_vstatic inline int emulate_instruction (struct kvm_vcpu *vcpu,int emulation_type) { -return x86_emulate_instruction (vcpu,0 , emulation_type,NULL ,0 ); +return x86_emulate_instruction (vcpu,0 , + emulation_type |EMULTYPE_NO_REEXECUTE ,NULL ,0 ); }void kvm_enable_efer_bits (u64 );
arch/x86/kvm/vmx.c +1 -1
@@ -6257,7 +6257,7 @@ static int handle_invalid_guest_state(stif (test_bit (KVM_REQ_EVENT , &vcpu->requests))return 1 ; - err =emulate_instruction (vcpu,EMULTYPE_NO_REEXECUTE ); + err =emulate_instruction (vcpu,0 );if (err ==EMULATE_USER_EXIT ) { ++vcpu->stat.mmio_exits;
Greg Kroah-Hartman
maintainerPATCH 22/86 KVM: X86: Fix operand/address-size during instruction decoding
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wanpeng Li <[email protected]>
[ Upstream commit 3853be2603191829b442b64dac6ae8ba0c027bf9 ]
Pedro reported:
During tests that we conducted on KVM, we noticed that executing a "PUSH %ES" instruction under KVM produces different results on both memory and the SP register depending on whether EPT support is enabled. With EPT the SP is reduced by 4 bytes (and the written value is 0-padded) but without EPT support it is only reduced by 2 bytes. The difference can be observed when the CS.DB field is 1 (32-bit) but not when it's 0 (16-bit).
The internal segment descriptor cache exist even in real/vm8096 mode. The CS.D also should be respected instead of just default operand/address-size/66H prefix/67H prefix during instruction decoding. This patch fixes it by also adjusting operand/address-size according to CS.D.
--- arch/x86/kvm/emulate.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/kvm/emulate.c +7 -0
@@ -4990,6 +4990,8 @@ int x86_decode_insn(struct x86_emulate_cbool op_prefix = false;bool has_seg_override = false;struct opcode opcode; +u16 dummy; +struct desc_struct desc; ctxt->memop.type =OP_NONE ; ctxt->memopp =NULL ;
@@ -5008,6 +5010,11 @@ int x86_decode_insn(struct x86_emulate_cswitch (mode) {case X86EMUL_MODE_REAL :case X86EMUL_MODE_VM86 : + def_op_bytes = def_ad_bytes =2 ; + ctxt->ops->get_segment (ctxt, &dummy, &desc,NULL ,VCPU_SREG_CS ); +if (desc.d) + def_op_bytes = def_ad_bytes =4 ; +break ;case X86EMUL_MODE_PROT16 : def_op_bytes = def_ad_bytes =2 ;break ;
Greg Kroah-Hartman
maintainerPATCH 23/86 KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Leshenko <[email protected]>
[ Upstream commit 0fc5a36dd6b345eb0d251a65c236e53bead3eef7 ]
KVM uses ioapic_handled_vectors to track vectors that need to notify the IOAPIC on EOI. The problem is that IOAPIC can be reconfigured while an interrupt with old configuration is pending or running and ioapic_handled_vectors only remembers the newest configuration; thus EOI from the old interrupt is not delievered to the IOAPIC.
A previous commit db2bdcbbbd32
("KVM: x86: fix edge EOI and IOAPIC reconfig race") addressed this issue by adding pending edge-triggered interrupts to ioapic_handled_vectors, fixing this race for edge-triggered interrupts. The commit explicitly ignored level-triggered interrupts, but this race applies to them as well:
1) IOAPIC sends a level triggered interrupt vector to VCPU0
2) VCPU0's handler deasserts the irq line and reconfigures the IOAPIC to route the vector to VCPU1. The reconfiguration rewrites only the upper 32 bits of the IOREDTBLn register. (Causes KVM to update ioapic_handled_vectors for VCPU0 and it no longer includes the vector.)
3) VCPU0 sends EOI for the vector, but it's not delievered to the IOAPIC because the ioapic_handled_vectors doesn't include the vector.
4) New interrupts are not delievered to VCPU1 because remote_irr bit is set forever.
Therefore, the correct behavior is to add all pending and running interrupts to ioapic_handled_vectors.
This commit introduces a slight performance hit similar to commit db2bdcbbbd32 ("KVM: x86: fix edge EOI and IOAPIC reconfig race") for the rare case that the vector is reused by a non-IOAPIC source on VCPU0. We prefer to keep solution simple and not handle this case just as the original commit does.
--- arch/x86/kvm/ioapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/ioapic.c +1 -2
@@ -257,8 +257,7 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, ulong *ioapic_handled_vectors) index == RTC_GSI) {if (kvm_apic_match_dest (vcpu,NULL ,0 , e->fields.dest_id, e->fields.dest_mode) || - (e->fields.trig_mode ==IOAPIC_EDGE_TRIG && -kvm_apic_pending_eoi (vcpu, e->fields.vector))) +kvm_apic_pending_eoi (vcpu, e->fields.vector))__set_bit (e->fields.vector, ioapic_handled_vectors); }
Signature · 1 line
2.16.1
Greg Kroah-Hartman
maintainerPATCH 24/86 KVM: x86: ioapic: Clear Remote IRR when entry is switched to edge-triggered
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Leshenko <[email protected]>
[ Upstream commit a8bfec2930525808c01f038825d1df3904638631 ]
Some OSes (Linux, Xen) use this behavior to clear the Remote IRR bit for IOAPICs without an EOI register. They simulate the EOI message manually by changing the trigger mode to edge and then back to level, with the entry being masked during this.
QEMU implements this feature in commit ed1263c363c9 ("ioapic: clear remote irr bit for edge-triggered interrupts")
As a side effect, this commit removes an incorrect behavior where Remote IRR was cleared when the redirection table entry was rewritten. This is not consistent with the manual and also opens an opportunity for a strange behavior when a redirection table entry is modified from an interrupt handler that handles the same entry: The modification will clear the Remote IRR bit even though the interrupt handler is still running.
--- arch/x86/kvm/ioapic.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
arch/x86/kvm/ioapic.c +10 -1
@@ -306,8 +306,17 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val) }else { e->bits &= ~0xffffffffULL ; e->bits |= (u32 ) val; - e->fields.remote_irr =0 ; } + +/* +* Some OSes (Linux, Xen) assume that Remote IRR bit will +* be cleared by IOAPIC hardware when the entry is configured +* as edge-triggered. This behavior is used to simulate an +* explicit EOI on IOAPICs that don't have the EOI register. +*/ +if (e->fields.trig_mode ==IOAPIC_EDGE_TRIG ) + e->fields.remote_irr =0 ; + mask_after = e->fields.mask;if (mask_before != mask_after)kvm_fire_mask_notifiers (ioapic->kvm,KVM_IRQCHIP_IOAPIC , index, mask_after);
Signature · 1 line
2.16.1
Greg Kroah-Hartman
maintainerPATCH 25/86 ACPI / bus: Leave modalias empty for devices which are not present
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 10809bb976648ac58194a629e3d7af99e7400297 ]
Most Bay and Cherry Trail devices use a generic DSDT with all possible peripheral devices present in the DSDT, with their _STA returning 0x00 or 0x0f based on AML variables which describe what is actually present on the board.
Since ACPI device objects with a 0x00 status (not present) still get an entry under /sys/bus/acpi/devices, and those entry had an acpi:PNPID modalias, userspace would end up loading modules for non present hardware.
This commit fixes this by leaving the modalias empty for non present devices. This results in 10 modules less being loaded with a generic distro kernel config on my Cherry Trail test-device (a GPD pocket).
--- drivers/acpi/device_sysfs.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/acpi/device_sysfs.c +4 -0
@@ -146,6 +146,10 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,int count;struct acpi_hardware_id *id; +/* Avoid unnecessarily loading modules for non present devices. */ +if (!acpi_device_is_present (acpi_dev)) +return 0 ; +/* * Since we skip ACPI_DT_NAMESPACE_HID from the modalias below, 0 should * be returned if ACPI_DT_NAMESPACE_HID is the only ACPI/PNP ID in the
Signature · 1 line
2.16.1
Greg Kroah-Hartman
maintainerPATCH 26/86 KVM: x86: ioapic: Preserve read-only values in the redirection table
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikita Leshenko <[email protected]>
[ Upstream commit b200dded0a6974a3b69599832b2203483920ab25 ]
According to 82093AA (IOAPIC) manual, Remote IRR and Delivery Status are read-only. QEMU implements the bits as RO in commit 479c2a1cb7fb ("ioapic: keep RO bits for IOAPIC entry").
--- arch/x86/kvm/ioapic.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kvm/ioapic.c +6 -0
@@ -278,6 +278,7 @@ static void ioapic_write_indirect(struct {unsigned index;bool mask_before, mask_after; +int old_remote_irr, old_delivery_status;union kvm_ioapic_redirect_entry *e;switch (ioapic->ioregsel) {
@@ -300,6 +301,9 @@ static void ioapic_write_indirect(structreturn ; e = &ioapic->redirtbl[index]; mask_before = e->fields.mask; +/* Preserve read-only fields */ + old_remote_irr = e->fields.remote_irr; + old_delivery_status = e->fields.delivery_status;if (ioapic->ioregsel &1 ) { e->bits &=0xffffffff ; e->bits |= (u64 ) val <<32 ;
@@ -307,6 +311,8 @@ static void ioapic_write_indirect(struct e->bits &= ~0xffffffffULL ; e->bits |= (u32 ) val; } + e->fields.remote_irr = old_remote_irr; + e->fields.delivery_status = old_delivery_status;/* * Some OSes (Linux, Xen) assume that Remote IRR bit will
Greg Kroah-Hartman
maintainerPATCH 27/86 cpufreq: Add Loongson machine dependencies
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <[email protected]>
[ Upstream commit 0d307935fefa6389eb726c6362351c162c949101 ]
The MIPS loongson cpufreq drivers don't build unless configured for the correct machine type, due to dependency on machine specific architecture headers and symbols in machine specific platform code.
More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU, neither of which is defined in asm/mach-loongson32/regs-clk.h unless CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references loongson2_clockmod_table[], which is only defined in arch/mips/loongson64/lemote-2f/clock.c, i.e. when CONFIG_LEMOTE_MACH2F=y.
Add these dependencies to Kconfig to avoid randconfig / allyesconfig build failures (e.g. when based on BMIPS which also has a cpufreq driver).
--- drivers/cpufreq/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig +2 -0
@@ -273,6 +273,7 @@ endif if MIPS config LOONGSON2_CPUFREQ tristate "Loongson2 CPUFreq Driver" + depends on LEMOTE_MACH2F help This option adds a CPUFreq driver for loongson processors which support software configurable cpu frequency.
@@ -285,6 +286,7 @@ config LOONGSON2_CPUFREQ config LOONGSON1_CPUFREQ tristate "Loongson1 CPUFreq Driver" + depends on LOONGSON1_LS1B help This option adds a CPUFreq driver for loongson1 processors which support software configurable cpu frequency.
Greg Kroah-Hartman
maintainerPATCH 28/86 bcache: check return value of register_shrinker
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Lyle <[email protected]>
[ Upstream commit 6c4ca1e36cdc1a0a7a84797804b87920ccbebf51 ]
register_shrinker is now __must_check, so check it to kill a warning. Caller of bch_btree_cache_alloc in super.c appropriately checks return value so this is fully plumbed through.
This V2 fixes checkpatch warnings and improves the commit description, as I was too hasty getting the previous version out.
--- drivers/md/bcache/btree.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/md/bcache/btree.c +4 -1
@@ -803,7 +803,10 @@ int bch_btree_cache_alloc(struct cache_s c->shrink.scan_objects = bch_mca_scan; c->shrink.seeks =4 ; c->shrink.batch = c->btree_pages *2 ; -register_shrinker (&c->shrink); + +if (register_shrinker (&c->shrink)) +pr_warn ("bcache: %s: could not register shrinker" , + __func__);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 29/86 drm/amdgpu: Fix SDMA load/unload sequence on HWS disabled mode
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Kuehling <[email protected]>
[ Upstream commit cf21654b40968609779751b34e7923180968fe5b ]
Fix the SDMA load and unload sequence as suggested by HW document.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 47 +++++++++++++++------- 1 file changed, 34 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +34 -13
@@ -367,29 +367,50 @@ static int kgd_hqd_sdma_load(struct kgd_ {struct amdgpu_device *adev =get_amdgpu_device (kgd);struct cik_sdma_rlc_registers *m; +unsigned long end_jiffies;uint32_t sdma_base_addr; +uint32_t data; m =get_sdma_mqd (mqd); sdma_base_addr =get_sdma_base_addr (m); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_VIRTUAL_ADDR, - m->sdma_rlc_virtual_addr); +WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_CNTL, + m->sdma_rlc_rb_cntl & (~SDMA0_RLC0_RB_CNTL__RB_ENABLE_MASK )); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_BASE, - m->sdma_rlc_rb_base); + end_jiffies =msecs_to_jiffies (2000 ) + jiffies; +while (true) { + data =RREG32 (sdma_base_addr + mmSDMA0_RLC0_CONTEXT_STATUS); +if (data &SDMA0_RLC0_CONTEXT_STATUS__IDLE_MASK ) +break ; +if (time_after (jiffies, end_jiffies)) +return -ETIME ; +usleep_range (500 ,1000 ); + } +if (m->sdma_engine_id) { + data =RREG32 (mmSDMA1_GFX_CONTEXT_CNTL); + data =REG_SET_FIELD (data,SDMA1_GFX_CONTEXT_CNTL , +RESUME_CTX ,0 ); +WREG32 (mmSDMA1_GFX_CONTEXT_CNTL, data); + }else { + data =RREG32 (mmSDMA0_GFX_CONTEXT_CNTL); + data =REG_SET_FIELD (data,SDMA0_GFX_CONTEXT_CNTL , +RESUME_CTX ,0 ); +WREG32 (mmSDMA0_GFX_CONTEXT_CNTL, data); + } +WREG32 (sdma_base_addr + mmSDMA0_RLC0_DOORBELL, + m->sdma_rlc_doorbell); +WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_RPTR,0 ); +WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_WPTR,0 ); +WREG32 (sdma_base_addr + mmSDMA0_RLC0_VIRTUAL_ADDR, + m->sdma_rlc_virtual_addr); +WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_BASE, m->sdma_rlc_rb_base);WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_BASE_HI, m->sdma_rlc_rb_base_hi); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_RPTR_ADDR_LO, m->sdma_rlc_rb_rptr_addr_lo); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_RPTR_ADDR_HI, m->sdma_rlc_rb_rptr_addr_hi); - -WREG32 (sdma_base_addr + mmSDMA0_RLC0_DOORBELL, - m->sdma_rlc_doorbell); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_CNTL, m->sdma_rlc_rb_cntl);
@@ -493,9 +514,9 @@ static int kgd_hqd_sdma_destroy(struct k }WREG32 (sdma_base_addr + mmSDMA0_RLC0_DOORBELL,0 ); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_RPTR,0 ); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_WPTR,0 ); -WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_BASE,0 ); +WREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_CNTL, +RREG32 (sdma_base_addr + mmSDMA0_RLC0_RB_CNTL) | +SDMA0_RLC0_RB_CNTL__RB_ENABLE_MASK );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 30/86 drm/amdkfd: Fix SDMA ring buffer size calculation
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: shaoyunl <[email protected]>
[ Upstream commit d12fb13f23199faa7e536acec1db49068e5a067d ]
ffs function return the position of the first bit set on 1 based. (bit zero returns 1).
--- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +2 -2
@@ -215,8 +215,8 @@ static int update_mqd_sdma(struct mqd_maBUG_ON (!mm || !mqd || !q); m =get_sdma_mqd (mqd); - m->sdma_rlc_rb_cntl =ffs (q->queue_size /sizeof (unsigned int )) << -SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT | + m->sdma_rlc_rb_cntl = (ffs (q->queue_size /sizeof (unsigned int )) -1 ) + <<SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT | q->vmid <<SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT |1 <<SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT |6 <<SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT ;
Greg Kroah-Hartman
maintainerPATCH 31/86 drm/amdkfd: Fix SDMA oversubsription handling
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Kuehling <[email protected]>
[ Upstream commit 8c946b8988acec785bcf67088b6bd0747f36d2d3 ]
SDMA only supports a fixed number of queues. HWS cannot handle oversubscription.
--- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 18 +++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +18 -0
@@ -205,6 +205,24 @@ int pqm_create_queue(struct process_queuswitch (type) {case KFD_QUEUE_TYPE_SDMA : +if (dev->dqm->queue_count >= +CIK_SDMA_QUEUES_PER_ENGINE *CIK_SDMA_ENGINE_NUM ) { +pr_err ("Over-subscription is not allowed for SDMA.\n" ); + retval = -EPERM ; + goto err_create_queue; + } + + retval =create_cp_queue (pqm, dev, &q, properties, f, *qid); +if (retval !=0 ) + goto err_create_queue; + pqn->q = q; + pqn->kq =NULL ; + retval = dev->dqm->ops.create_queue (dev->dqm, q, &pdd->qpd, + &q->properties.vmid); +pr_debug ("DQM returned %d for create_queue\n" , retval); +print_queue (q); +break ; +case KFD_QUEUE_TYPE_COMPUTE :/* check if there is over subscription */ if ((sched_policy == KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION) &&
Greg Kroah-Hartman
maintainerPATCH 32/86 openvswitch: fix the incorrect flow action alloc size
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: zhangliping <[email protected]>
[ Upstream commit 67c8d22a73128ff910e2287567132530abcf5b71 ]
If we want to add a datapath flow, which has more than 500 vxlan outputs' action, we will get the following error reports:
openvswitch: netlink: Flow action size 32832 bytes exceeds max
openvswitch: netlink: Flow action size 32832 bytes exceeds max
openvswitch: netlink: Actions may not be safe on all matching packets ... ...
It seems that we can simply enlarge the MAX_ACTIONS_BUFSIZE to fix it, but this is not the root cause. For example, for a vxlan output action, we need about 60 bytes for the nlattr, but after it is converted to the flow action, it only occupies 24 bytes. This means that we can still support more than 1000 vxlan output actions for a single datapath flow under the the current 32k max limitation.
So even if the nla_len(attr) is larger than MAX_ACTIONS_BUFSIZE, we shouldn't report EINVAL and keep it move on, as the judgement can be done by the reserve_sfa_size.
--- net/openvswitch/flow_netlink.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
net/openvswitch/flow_netlink.c +8 -8
@@ -1789,14 +1789,11 @@ int ovs_nla_put_mask(const struct sw_flo#define MAX_ACTIONS_BUFSIZE (32 * 1024) -static struct sw_flow_actions *nla_alloc_flow_actions (int size,bool log) +static struct sw_flow_actions *nla_alloc_flow_actions (int size) {struct sw_flow_actions *sfa; -if (size >MAX_ACTIONS_BUFSIZE ) { -OVS_NLERR (log,"Flow action size %u bytes exceeds max" , size); -return ERR_PTR (-EINVAL ); - } +WARN_ON_ONCE (size >MAX_ACTIONS_BUFSIZE ); sfa =kmalloc (sizeof (*sfa) + size,GFP_KERNEL );if (!sfa)
@@ -1869,12 +1866,15 @@ static struct nlattr *reserve_sfa_size(s new_acts_size =ksize (*sfa) *2 ;if (new_acts_size >MAX_ACTIONS_BUFSIZE ) { -if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) +if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) { +OVS_NLERR (log,"Flow action size exceeds max %u" , +MAX_ACTIONS_BUFSIZE );return ERR_PTR (-EMSGSIZE ); + } new_acts_size =MAX_ACTIONS_BUFSIZE ; } - acts =nla_alloc_flow_actions (new_acts_size, log); + acts =nla_alloc_flow_actions (new_acts_size);if (IS_ERR (acts))return (void *)acts;
@@ -2500,7 +2500,7 @@ int ovs_nla_copy_actions(struct net *net {int err; - *sfa =nla_alloc_flow_actions (nla_len (attr), log); + *sfa =nla_alloc_flow_actions (min (nla_len (attr),MAX_ACTIONS_BUFSIZE ));if (IS_ERR (*sfa))return PTR_ERR (*sfa);
Greg Kroah-Hartman
maintainerPATCH 33/86 mac80211: fix the update of path metric for RANN frame
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chun-Yeow Yeoh <[email protected]>
[ Upstream commit fbbdad5edf0bb59786a51b94a9d006bc8c2da9a2 ]
The previous path metric update from RANN frame has not considered the own link metric toward the transmitting mesh STA. Fix this.
--- net/mac80211/mesh_hwmp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
net/mac80211/mesh_hwmp.c +9 -6
@@ -788,7 +788,7 @@ static void hwmp_rann_frame_process(strustruct mesh_path *mpath;u8 ttl, flags, hopcount;const u8 *orig_addr; -u32 orig_sn, metric, metric_txsta, interval; +u32 orig_sn, new_metric, orig_metric, last_hop_metric, interval;bool root_is_gate; ttl = rann->rann_ttl;
@@ -799,7 +799,7 @@ static void hwmp_rann_frame_process(stru interval =le32_to_cpu (rann->rann_interval); hopcount = rann->rann_hopcount; hopcount++; - metric =le32_to_cpu (rann->rann_metric); + orig_metric =le32_to_cpu (rann->rann_metric);/* Ignore our own RANNs */ if (ether_addr_equal (orig_addr, sdata->vif.addr))
@@ -816,7 +816,10 @@ static void hwmp_rann_frame_process(strureturn ; } - metric_txsta =airtime_link_metric_get (local, sta); + last_hop_metric =airtime_link_metric_get (local, sta); + new_metric = orig_metric + last_hop_metric; +if (new_metric < orig_metric) + new_metric =MAX_METRIC ; mpath =mesh_path_lookup (sdata, orig_addr);if (!mpath) {
@@ -829,7 +832,7 @@ static void hwmp_rann_frame_process(stru }if (!(SN_LT (mpath->sn, orig_sn)) && - !(mpath->sn == orig_sn && metric < mpath->rann_metric)) { + !(mpath->sn == orig_sn && new_metric < mpath->rann_metric)) {rcu_read_unlock ();return ; }
@@ -847,7 +850,7 @@ static void hwmp_rann_frame_process(stru } mpath->sn = orig_sn; - mpath->rann_metric = metric + metric_txsta; + mpath->rann_metric = new_metric; mpath->is_root = true;/* Recording RANNs sender address to send individually * addressed PREQs destined for root mesh STA */
@@ -867,7 +870,7 @@ static void hwmp_rann_frame_process(strumesh_path_sel_frame_tx (MPATH_RANN , flags, orig_addr, orig_sn,0 ,NULL ,0 , broadcast_addr, hopcount, ttl, interval, - metric + metric_txsta,0 , sdata); + new_metric,0 , sdata); }rcu_read_unlock ();
Greg Kroah-Hartman
maintainerPATCH 34/86 btrfs: fix deadlock when writing out space cache
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit b77000ed558daa3bef0899d29bf171b8c9b5e6a8 ]
If we fail to prepare our pages for whatever reason (out of memory in our case) we need to make sure to drop the block_group->data_rwsem, otherwise hilarity ensues.
--- fs/btrfs/free-space-cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/free-space-cache.c +2 -1
@@ -1253,7 +1253,7 @@ static int __btrfs_write_out_cache(struc/* Lock all pages first so we can lock the extent safely. */ ret =io_ctl_prepare_pages (io_ctl, inode,0 );if (ret) - goto out; + goto out_unlock;lock_extent_bits (&BTRFS_I (inode)->io_tree,0 ,i_size_read (inode) -1 , &cached_state);
@@ -1346,6 +1346,7 @@ out_nospc_locked: out_nospc:cleanup_write_cache_enospc (inode, io_ctl, &cached_state, &bitmap_list); +out_unlock:if (block_group && (block_group->flags &BTRFS_BLOCK_GROUP_DATA ))up_write (&block_group->data_rwsem);
Greg Kroah-Hartman
maintainerPATCH 35/86 reiserfs: remove unneeded i_version bump
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
[ Upstream commit 9f97df50c52c2887432debb6238f4e43567386a5 ]
The i_version field in reiserfs is not initialized and is only ever updated here. Nothing ever views it, so just remove it.
--- fs/reiserfs/super.c | 1 - 1 file changed, 1 deletion(-)
fs/reiserfs/super.c +0 -1
@@ -2521,7 +2521,6 @@ out:return err;if (inode->i_size < off + len - towrite)i_size_write (inode, off + len - towrite); - inode->i_version++; inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty (inode);return len - towrite;
Greg Kroah-Hartman
maintainerPATCH 36/86 KVM: X86: Fix softlockup when get the current kvmclock
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wanpeng Li <[email protected]>
[ Upstream commit e70b57a6ce4e8b92a56a615ae79bdb2bd66035e7 ]
watchdog: BUG: soft lockup - CPU#6 stuck for 22s! [qemu-system-x86:10185] CPU: 6 PID: 10185 Comm: qemu-system-x86 Tainted: G OE 4.14.0-rc4+ #4 RIP: 0010:kvm_get_time_scale+0x4e/0xa0 [kvm] Call Trace: get_time_ref_counter+0x5a/0x80 [kvm] kvm_hv_process_stimers+0x120/0x5f0 [kvm] kvm_arch_vcpu_ioctl_run+0x4b4/0x1690 [kvm] kvm_vcpu_ioctl+0x33a/0x620 [kvm] do_vfs_ioctl+0xa1/0x5d0 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x1e/0xa9
This can be reproduced when running kvm-unit-tests/hyperv_stimer.flat and cpu-hotplug stress simultaneously. __this_cpu_read(cpu_tsc_khz) returns 0 (set in kvmclock_cpu_down_prep()) when the pCPU is unhotplug which results in kvm_get_time_scale() gets into an infinite loop.
This patch fixes it by treating the unhotplug pCPU as not using master clock.
--- arch/x86/kvm/x86.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
arch/x86/kvm/x86.c +7 -4
@@ -1751,10 +1751,13 @@ static u64 __get_kvmclock_ns(struct kvm/* both __this_cpu_read() and rdtsc() should be on the same cpu */ get_cpu (); -kvm_get_time_scale (NSEC_PER_SEC ,__this_cpu_read (cpu_tsc_khz) *1000LL , - &hv_clock.tsc_shift, - &hv_clock.tsc_to_system_mul); - ret =__pvclock_read_cycles (&hv_clock,rdtsc ()); +if (__this_cpu_read (cpu_tsc_khz)) { +kvm_get_time_scale (NSEC_PER_SEC ,__this_cpu_read (cpu_tsc_khz) *1000LL , + &hv_clock.tsc_shift, + &hv_clock.tsc_to_system_mul); + ret =__pvclock_read_cycles (&hv_clock,rdtsc ()); + }else + ret =ktime_get_boot_ns () + ka->kvmclock_offset;put_cpu ();
Greg Kroah-Hartman
maintainerPATCH 37/86 KVM: VMX: Fix rflags cache during vCPU reset
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wanpeng Li <[email protected]>
[ Upstream commit c37c28730bb031cc8a44a130c2555c0f3efbe2d0 ]
Reported by syzkaller:
*** Guest State ***
CR0: actual=0x0000000080010031, shadow=0x0000000060000010, gh_mask=fffffffffffffff7
CR4: actual=0x0000000000002061, shadow=0x0000000000000000, gh_mask=ffffffffffffe8f1 CR3 = 0x000000002081e000
RSP = 0x000000000000fffa RIP = 0x0000000000000000
RFLAGS=0x00023000 DR7 = 0x00000000000000
^^^^^^^^^^
------------[ cut here ]------------
WARNING: CPU: 6 PID: 24431 at /home/kernel/linux/arch/x86/kvm//x86.c:7302 kvm_arch_vcpu_ioctl_run+0x651/0x2ea0 [kvm]
CPU: 6 PID: 24431 Comm: reprotest Tainted: G W OE 4.14.0+ #26
RIP: 0010:kvm_arch_vcpu_ioctl_run+0x651/0x2ea0 [kvm]
RSP: 0018:ffff880291d179e0 EFLAGS: 00010202
Call Trace:
kvm_vcpu_ioctl+0x479/0x880 [kvm]
do_vfs_ioctl+0x142/0x9a0
SyS_ioctl+0x74/0x80
entry_SYSCALL_64_fastpath+0x23/0x9aThe failed vmentry is triggered by the following beautified testcase:
#include <unistd.h>
#include <sys/syscall.h>
#include <string.h>
#include <stdint.h>
#include <linux/kvm.h>
#include <fcntl.h>
#include <sys/ioctl.h>
long r[5];
int main()
{
struct kvm_debugregs dr = { 0 };
r[2] = open("/dev/kvm", O_RDONLY);
r[3] = ioctl(r[2], KVM_CREATE_VM, 0);
r[4] = ioctl(r[3], KVM_CREATE_VCPU, 7);
struct kvm_guest_debug debug = {
.control = 0xf0403,
.arch = {
.debugreg[6] = 0x2,
.debugreg[7] = 0x2
}
};
ioctl(r[4], KVM_SET_GUEST_DEBUG, &debug);
ioctl(r[4], KVM_RUN, 0);
}which testcase tries to setup the processor specific debug registers and configure vCPU for handling guest debug events through KVM_SET_GUEST_DEBUG. The KVM_SET_GUEST_DEBUG ioctl will get and set rflags in order to set TF bit if single step is needed. All regs' caches are reset to avail and GUEST_RFLAGS vmcs field is reset to 0x2 during vCPU reset. However, the cache of rflags is not reset during vCPU reset. The function vmx_get_rflags() returns an unreset rflags cache value since the cache is marked avail, it is 0 after boot. Vmentry fails if the rflags reserved bit 1 is 0.
This patch fixes it by resetting both the GUEST_RFLAGS vmcs field and its cache to 0x2 during vCPU reset.
--- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/vmx.c +1 -1
@@ -5194,7 +5194,7 @@ static void vmx_vcpu_reset(struct kvm_vcvmcs_write64 (GUEST_IA32_DEBUGCTL ,0 ); } -vmcs_writel (GUEST_RFLAGS ,0x02 ); +kvm_set_rflags (vcpu,X86_EFLAGS_FIXED );kvm_rip_write (vcpu,0xfff0 );vmcs_writel (GUEST_GDTR_BASE ,0 );
Greg Kroah-Hartman
maintainerPATCH 38/86 xfs: always free inline data before resetting inode fork during ifree
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Darrick J. Wong" <[email protected]>
[ Upstream commit 98c4f78dcdd8cec112d1cbc5e9a792ee6e5ab7a6 ]
In xfs_ifree, we reset the data/attr forks to extents format without bothering to free any inline data buffer that might still be around after all the blocks have been truncated off the file. Prior to commit 43518812d2 ("xfs: remove support for inlining data/extents into the inode fork") nobody noticed because the leftover inline data after truncation was small enough to fit inside the inline buffer inside the fork itself.
However, now that we've removed the inline buffer, we /always/ have to free the inline data buffer or else we leak them like crazy. This test was found by turning on kmemleak for generic/001 or generic/388.
--- fs/xfs/xfs_inode.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
fs/xfs/xfs_inode.c +21 -0
@@ -2430,6 +2430,24 @@ retry: }/* +* Free any local-format buffers sitting around before we reset to +* extents format. +*/ +static inline void +xfs_ifree_local_data ( +struct xfs_inode *ip, +int whichfork) +{ +struct xfs_ifork *ifp; + +if (XFS_IFORK_FORMAT (ip, whichfork) !=XFS_DINODE_FMT_LOCAL ) +return ; + + ifp =XFS_IFORK_PTR (ip, whichfork); +xfs_idata_realloc (ip, -ifp->if_bytes, whichfork); +} + +/* * This is called to return an inode to the inode free list. * The inode should already be truncated to 0 length and have * no pages associated with it. This routine also assumes that
@@ -2466,6 +2484,9 @@ xfs_ifree(if (error)return error; +xfs_ifree_local_data (ip,XFS_DATA_FORK ); +xfs_ifree_local_data (ip,XFS_ATTR_FORK ); +VFS_I (ip)->i_mode =0 ;/* mark incore inode as free */ ip->i_d.di_flags =0 ; ip->i_d.di_dmevmask =0 ;
Greg Kroah-Hartman
maintainerPATCH 39/86 xen-netfront: remove warning when unloading module
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eduardo Otubo <[email protected]>
[ Upstream commit 5b5971df3bc2775107ddad164018a8a8db633b81 ]
v2:
* Replace busy wait with wait_event()/wake_up_all()
* Cannot garantee that at the time xennet_remove is called, the xen_netback state will not be XenbusStateClosed, so added a condition for that
* There's a small chance for the xen_netback state is XenbusStateUnknown by the time the xen_netfront switches to Closed, so added a condition for that.
When unloading module xen_netfront from guest, dmesg would output warning messages like below:
[ 105.236836] xen:grant_table: WARNING: g.e. 0x903 still in use! [ 105.236839] deferring g.e. 0x903 (pfn 0x35805)
This problem relies on netfront and netback being out of sync. By the time netfront revokes the g.e.'s netback didn't have enough time to free all of them, hence displaying the warnings on dmesg.
The trick here is to make netfront to wait until netback frees all the g.e.'s and only then continue to cleanup for the module removal, and this is done by manipulating both device states.
--- drivers/net/xen-netfront.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/net/xen-netfront.c +18 -0
@@ -86,6 +86,8 @@ struct netfront_cb {/* IRQ name is queue name with "-tx" or "-rx" appended */ #define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3) +static DECLARE_WAIT_QUEUE_HEAD (module_unload_q); +struct netfront_stats {u64 packets;u64 bytes;
@@ -2051,10 +2053,12 @@ static void netback_changed(struct xenbubreak ;case XenbusStateClosed: +wake_up_all (&module_unload_q);if (dev->state == XenbusStateClosed)break ;/* Missed the backend's CLOSING state -- fallthrough */ case XenbusStateClosing: +wake_up_all (&module_unload_q);xenbus_frontend_closed (dev);break ; }
@@ -2160,6 +2164,20 @@ static int xennet_remove(struct xenbus_ddev_dbg (&dev->dev,"%s\n" , dev->nodename); +if (xenbus_read_driver_state (dev->otherend) != XenbusStateClosed) { +xenbus_switch_state (dev, XenbusStateClosing); +wait_event (module_unload_q, +xenbus_read_driver_state (dev->otherend) == + XenbusStateClosing); + +xenbus_switch_state (dev, XenbusStateClosed); +wait_event (module_unload_q, +xenbus_read_driver_state (dev->otherend) == + XenbusStateClosed || +xenbus_read_driver_state (dev->otherend) == + XenbusStateUnknown); + } +xennet_disconnect_backend (info);unregister_netdev (info->netdev);
Greg Kroah-Hartman
maintainerPATCH 40/86 auxdisplay: img-ascii-lcd: Only build on archs that have IOMEM
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Meyer <[email protected]>
[ Upstream commit 141cbfba1d0502006463aa80f57c64086226af1a ]
This avoids the MODPOST error:
ERROR: "devm_ioremap_resource" [drivers/auxdisplay/img-ascii-lcd.ko] undefined!
--- drivers/auxdisplay/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/auxdisplay/Kconfig +1 -0
@@ -121,6 +121,7 @@ config CFAG12864B_RATE config IMG_ASCII_LCD tristate "Imagination Technologies ASCII LCD Display" + depends on HAS_IOMEM default y if MIPS_MALTA || MIPS_SEAD3 select SYSCON help
Greg Kroah-Hartman
maintainerPATCH 41/86 nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0)
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit fb500a7cfee7f2f447d2bbf30cb59629feab6ac1 ]
--- fs/nfsd/nfs4state.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/nfsd/nfs4state.c +8 -0
@@ -63,6 +63,9 @@ static const stateid_t zero_stateid = {static const stateid_t currentstateid = { .si_generation =1 , }; +static const stateid_t close_stateid = { + .si_generation =0xffffffffU , +};static u64 current_sessionid =1 ;
@@ -5407,6 +5410,11 @@ nfsd4_close(struct svc_rqst *rqstp, strunfsd4_close_open_stateid (stp);mutex_unlock (&stp->st_mutex); +/* See RFC5661 sectionm 18.2.4 */ +if (stp->st_stid.sc_client->cl_minorversion) +memcpy (&close->cl_stateid, &close_stateid, +sizeof (close->cl_stateid)); +/* put reference from nfs4_preprocess_seqid_op */ nfs4_put_stid (&stp->st_stid); out:
Greg Kroah-Hartman
maintainerPATCH 42/86 nfsd: Ensure we check stateid validity in the seqid operation checks
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 9271d7e509c1bfc0b9a418caec29ec8d1ac38270 ]
After taking the stateid st_mutex, we want to know that the stateid still represents valid state before performing any non-idempotent actions.
--- fs/nfsd/nfs4state.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
fs/nfsd/nfs4state.c +3 -9
@@ -5178,15 +5178,9 @@ static __be32 nfs4_seqid_op_checks(struc status =nfsd4_check_seqid (cstate, sop, seqid);if (status)return status; -if (stp->st_stid.sc_type ==NFS4_CLOSED_STID - || stp->st_stid.sc_type ==NFS4_REVOKED_DELEG_STID ) -/* -* "Closed" stateid's exist *only* to return -* nfserr_replay_me from the previous step, and -* revoked delegations are kept only for free_stateid. -*/ -return nfserr_bad_stateid; -mutex_lock (&stp->st_mutex); + status =nfsd4_lock_ol_stateid (stp); +if (status != nfs_ok) +return status; status =check_stateid_generation (stateid, &stp->st_stid.sc_stateid,nfsd4_has_session (cstate));if (status == nfs_ok) status =nfs4_check_fh (current_fh, &stp->st_stid);
Greg Kroah-Hartman
maintainerPATCH 43/86 grace: replace BUG_ON by WARN_ONCE in exit_net hook
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasily Averin <[email protected]>
[ Upstream commit b872285751c1af010e12d02bce7069e2061a58ca ]
--- fs/nfs_common/grace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/nfs_common/grace.c +3 -1
@@ -104,7 +104,9 @@ grace_exit_net(struct net *net) {struct list_head *grace_list =net_generic (net, grace_net_id); -BUG_ON (!list_empty (grace_list)); +WARN_ONCE (!list_empty (grace_list), +"net %x %s: grace_list is not empty\n" , + net->ns.inum, __func__); }static struct pernet_operations grace_net_ops = {
Greg Kroah-Hartman
maintainerPATCH 44/86 nfsd: check for use of the closed special stateid
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Elble <[email protected]>
[ Upstream commit ae254dac721d44c0bfebe2795df87459e2e88219 ]
Prevent the use of the closed (invalid) special stateid by clients.
--- fs/nfsd/nfs4state.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/nfsd/nfs4state.c +5 -2
@@ -72,6 +72,7 @@ static u64 current_sessionid = 1;#define ZERO_STATEID (stateid) (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))#define ONE_STATEID (stateid) (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))#define CURRENT_STATEID (stateid) (!memcmp((stateid), ¤tstateid, sizeof(stateid_t))) +#define CLOSE_STATEID (stateid) (!memcmp((stateid), &close_stateid, sizeof(stateid_t)))/* forward declarations */ static bool check_for_locks (struct nfs4_file *fp,struct nfs4_lockowner *lowner);
@@ -4869,7 +4870,8 @@ static __be32 nfsd4_validate_stateid(strstruct nfs4_stid *s;__be32 status = nfserr_bad_stateid; -if (ZERO_STATEID (stateid) ||ONE_STATEID (stateid)) +if (ZERO_STATEID (stateid) ||ONE_STATEID (stateid) || +CLOSE_STATEID (stateid))return status;/* Client debugging aid. */ if (!same_clid (&stateid->si_opaque.so_clid, &cl->cl_clientid)) {
@@ -4927,7 +4929,8 @@ nfsd4_lookup_stateid(struct nfsd4_compouelse if (typemask &NFS4_DELEG_STID ) typemask |=NFS4_REVOKED_DELEG_STID ; -if (ZERO_STATEID (stateid) ||ONE_STATEID (stateid)) +if (ZERO_STATEID (stateid) ||ONE_STATEID (stateid) || +CLOSE_STATEID (stateid))return nfserr_bad_stateid; status =lookup_clientid (&stateid->si_opaque.so_clid, cstate, nn);if (status == nfserr_stale_clientid) {
Greg Kroah-Hartman
maintainerPATCH 45/86 lockd: fix "list_add double add" caused by legacy signal interface
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasily Averin <[email protected]>
[ Upstream commit 81833de1a46edce9ca20cfe079872ac1c20ef359 ]
restart_grace() uses hardcoded init_net.
It can cause to "list_add double add" in following scenario:
1) nfsd and lockd was started in several net namespaces
2) nfsd in init_net was stopped (lockd was not stopped because it have users from another net namespaces)
3) lockd got signal, called restart_grace() -> set_grace_period() and enabled lock_manager in hardcoded init_net.
4) nfsd in init_net is started again,
its lockd_up() calls set_grace_period() and tries to add lock_manager into init_net 2nd time.
Jeff Layton suggest:
"Make it safe to call locks_start_grace multiple times on the same lock_manager. If it's already on the global grace_list, then don't try to add it again. (But we don't intentionally add twice, so for now we WARN about that case.)
With this change, we also need to ensure that the nfsd4 lock manager initializes the list before we call locks_start_grace. While we're at it, move the rest of the nfsd_net initialization into nfs4_state_create_net. I see no reason to have it spread over two functions like it is today."
Suggested patch was updated to generate warning in described situation.
--- fs/nfs_common/grace.c | 6 +++++- fs/nfsd/nfs4state.c | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-)
fs/nfs_common/grace.c +5 -1
@@ -30,7 +30,11 @@ locks_start_grace(struct net *net, strucstruct list_head *grace_list =net_generic (net, grace_net_id);spin_lock (&grace_lock); -list_add (&lm->list, grace_list); +if (list_empty (&lm->list)) +list_add (&lm->list, grace_list); +else +WARN (1 ,"double list_add attempt detected in net %x %s\n" , + net->ns.inum, (net == &init_net) ?"(init_net)" :"" );spin_unlock (&grace_lock); }EXPORT_SYMBOL_GPL (locks_start_grace);
fs/nfsd/nfs4state.c +4 -3
@@ -7012,6 +7012,10 @@ static int nfs4_state_create_net(structINIT_LIST_HEAD (&nn->sessionid_hashtbl[i]); nn->conf_name_tree =RB_ROOT ; nn->unconf_name_tree =RB_ROOT ; + nn->boot_time =get_seconds (); + nn->grace_ended = false; + nn->nfsd4_manager.block_opens = true; +INIT_LIST_HEAD (&nn->nfsd4_manager.list);INIT_LIST_HEAD (&nn->client_lru);INIT_LIST_HEAD (&nn->close_lru);INIT_LIST_HEAD (&nn->del_recall_lru);
@@ -7069,9 +7073,6 @@ nfs4_state_start_net(struct net *net) ret =nfs4_state_create_net (net);if (ret)return ret; - nn->boot_time =get_seconds (); - nn->grace_ended = false; - nn->nfsd4_manager.block_opens = true;locks_start_grace (net, &nn->nfsd4_manager);nfsd4_client_tracking_init (net); printk(KERN_INFO "NFSD: starting %ld-second grace period (net %p)\n",
Greg Kroah-Hartman
maintainerPATCH 46/86 hwmon: (pmbus) Use 64bit math for DIRECT format values
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Lippert <[email protected]>
[ Upstream commit bd467e4eababe4c04272c1e646f066db02734c79 ]
Power values in the 100s of watt range can easily blow past 32bit math limits when processing everything in microwatts.
Use 64bit math instead to avoid these issues on common 32bit ARM BMC platforms.
--- drivers/hwmon/pmbus/pmbus_core.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/hwmon/pmbus/pmbus_core.c +12 -9
@@ -20,6 +20,7 @@*/ #include <linux/kernel.h> +#include <linux/math64.h> #include <linux/module.h> #include <linux/init.h> #include <linux/err.h>
@@ -476,8 +477,8 @@ static long pmbus_reg2data_linear(structstatic long pmbus_reg2data_direct (struct pmbus_data *data,struct pmbus_sensor *sensor) { -long val = (s16 ) sensor->data; -long m, b,R ; +s64 b, val = (s16 )sensor->data; +s32 m,R ; m = data->info->m[sensor->class]; b = data->info->b[sensor->class];
@@ -505,11 +506,12 @@ static long pmbus_reg2data_direct(structR --; }while (R <0 ) { - val =DIV_ROUND_CLOSEST (val,10 ); + val =div_s64 (val +5LL ,10L );/* round closest */ R ++; } -return (val - b) / m; + val =div_s64 (val - b, m); +return clamp_val (val,LONG_MIN ,LONG_MAX ); }/*
@@ -629,7 +631,8 @@ static u16 pmbus_data2reg_linear(structstatic u16 pmbus_data2reg_direct (struct pmbus_data *data,struct pmbus_sensor *sensor,long val) { -long m, b,R ; +s64 b, val64 = val; +s32 m,R ; m = data->info->m[sensor->class]; b = data->info->b[sensor->class];
@@ -646,18 +649,18 @@ static u16 pmbus_data2reg_direct(structR -=3 ;/* Adjust R and b for data in milli-units */ b *=1000 ; } - val = val * m + b; + val64 = val64 * m + b;while (R >0 ) { - val *=10 ; + val64 *=10 ;R --; }while (R <0 ) { - val =DIV_ROUND_CLOSEST (val,10 ); + val64 =div_s64 (val64 +5LL ,10L );/* round closest */ R ++; } -return val; +return (u16 )clamp_val (val64,S16_MIN ,S16_MAX ); } static u16 pmbus_data2reg_vid(struct pmbus_data *data,
Greg Kroah-Hartman
maintainerPATCH 47/86 bnxt_en: Fix an error handling path in bnxt_get_module_eeprom()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit dea521a2b9f96e905fa2bb2f95e23ec00c2ec436 ]
Error code returned by 'bnxt_read_sfp_module_eeprom_info()' is handled a few lines above when reading the A0 portion of the EEPROM. The same should be done when reading the A2 portion of the EEPROM.
In order to correctly propagate an error, update 'rc' in this 2nd call as well, otherwise 0 (success) is returned.
--- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 -2
@@ -1843,8 +1843,8 @@ static int bnxt_get_module_eeprom(struct/* Read A2 portion of the EEPROM */ if (length) { start -=ETH_MODULE_SFF_8436_LEN ; -bnxt_read_sfp_module_eeprom_info (bp,I2C_DEV_ADDR_A2 ,1 , start, - length, data); + rc =bnxt_read_sfp_module_eeprom_info (bp,I2C_DEV_ADDR_A2 ,1 , + start, length, data); }return rc; }
Greg Kroah-Hartman
maintainerPATCH 48/86 xfs: fortify xfs_alloc_buftarg error handling
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Hocko <[email protected]>
[ Upstream commit d210a9874b8f6166579408131cb74495caff1958 ]
percpu_counter_init failure path doesn't clean up &btp->bt_lru list. Call list_lru_destroy in that error path. Similarly register_shrinker error path is not handled.
While it is unlikely to trigger these error path, it is not impossible especially the later might fail with large NUMAs. Let's handle the failure to make the code more robust.
--- fs/xfs/xfs_buf.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
fs/xfs/xfs_buf.c +10 -5
@@ -1785,22 +1785,27 @@ xfs_alloc_buftarg( btp->bt_bdi =blk_get_backing_dev_info (bdev);if (xfs_setsize_buftarg_early (btp, bdev)) - goto error; + goto error_free;if (list_lru_init (&btp->bt_lru)) - goto error; + goto error_free;if (percpu_counter_init (&btp->bt_io_count,0 ,GFP_KERNEL )) - goto error; + goto error_lru; btp->bt_shrinker.count_objects = xfs_buftarg_shrink_count; btp->bt_shrinker.scan_objects = xfs_buftarg_shrink_scan; btp->bt_shrinker.seeks =DEFAULT_SEEKS ; btp->bt_shrinker.flags =SHRINKER_NUMA_AWARE ; -register_shrinker (&btp->bt_shrinker); +if (register_shrinker (&btp->bt_shrinker)) + goto error_pcpu;return btp; -error: +error_pcpu: +percpu_counter_destroy (&btp->bt_io_count); +error_lru: +list_lru_destroy (&btp->bt_lru); +error_free:kmem_free (btp);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 49/86 drm/amdgpu: dont try to move pinned BOs
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Christian K�nig" <[email protected]>
[ Upstream commit 6edc6910ba4cd6eab309263539c8f09b8ad772bf ]
Never try to move pinned BOs during CS.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +4 -0
@@ -416,6 +416,10 @@ static bool amdgpu_cs_try_evict(struct aif (candidate == lobj)break ; +/* We can't move pinned BOs here */ +if (bo->pin_count) +continue ; + other =amdgpu_mem_type_to_domain (bo->tbo.mem.mem_type);/* Check if this BO is in one of the domains we need space for */
Greg Kroah-Hartman
maintainerPATCH 50/86 net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 15bfe05c8d6386f1a90e9340d15336e85e32aad6 ]
On 64-bit (e.g. powerpc64/allmodconfig):
drivers/net/ethernet/xilinx/ll_temac_main.c: In function 'temac_start_xmit_done':
drivers/net/ethernet/xilinx/ll_temac_main.c:633:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
dev_kfree_skb_irq((struct sk_buff *)cur_p->app4);
^
cdmac_bd.app4 is u32, so it is too small to hold a kernel pointer.
Note that several other fields in struct cdmac_bd are also too small to hold physical addresses on 64-bit platforms.
--- drivers/net/ethernet/xilinx/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/xilinx/Kconfig +1 -0
@@ -34,6 +34,7 @@ config XILINX_AXI_EMAC config XILINX_LL_TEMAC tristate "Xilinx LL TEMAC (LocalLink Tri-mode Ethernet MAC) driver" depends on (PPC || MICROBLAZE) + depends on !64BIT || BROKEN select PHYLIB ---help--- This driver supports the Xilinx 10/100/1000 LocalLink TEMAC
Greg Kroah-Hartman
maintainerPATCH 51/86 quota: Check for register_shrinker() failure.
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 88bc0ede8d35edc969350852894dc864a2dc1859 ]
register_shrinker() might return -ENOMEM error since Linux 3.12. Call panic() as with other failure checks in this function if register_shrinker() failed.
--- fs/quota/dquot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/quota/dquot.c +2 -1
@@ -2985,7 +2985,8 @@ static int __init dquot_init(void)pr_info ("VFS: Dquot-cache hash table entries: %ld (order %ld," " %ld bytes)\n" , nr_hash, order, (PAGE_SIZE << order)); -register_shrinker (&dqcache_shrinker); +if (register_shrinker (&dqcache_shrinker)) +panic ("Cannot register dquot shrinker" );return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 52/86 SUNRPC: Allow connect to return EHOSTUNREACH
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 4ba161a793d5f43757c35feff258d9f20a082940 ]
--- net/sunrpc/xprtsock.c | 1 + 1 file changed, 1 insertion(+)
net/sunrpc/xprtsock.c +1 -0
@@ -2381,6 +2381,7 @@ static void xs_tcp_setup_socket(struct wcase -ECONNREFUSED :case -ECONNRESET :case -ENETUNREACH : +case -EHOSTUNREACH :case -EADDRINUSE :case -ENOBUFS :/* retry with existing socket, after a delay */
Greg Kroah-Hartman
maintainerPATCH 53/86 kmemleak: add scheduling point to kmemleak_scan()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yisheng Xie <[email protected]>
[ Upstream commit bde5f6bc68db51128f875a756e9082a6c6ff7b4c ]
kmemleak_scan() will scan struct page for each node and it can be really large and resulting in a soft lockup. We have seen a soft lockup when do scan while compile kernel:
watchdog: BUG: soft lockup - CPU#53 stuck for 22s! [bash:10287] [...] Call Trace: kmemleak_scan+0x21a/0x4c0 kmemleak_write+0x312/0x350 full_proxy_write+0x5a/0xa0 __vfs_write+0x33/0x150 vfs_write+0xad/0x1a0 SyS_write+0x52/0xc0 do_syscall_64+0x61/0x1a0 entry_SYSCALL64_slow_path+0x25/0x25
Fix this by adding cond_resched every MAX_SCAN_SIZE.
--- mm/kmemleak.c | 2 ++ 1 file changed, 2 insertions(+)
mm/kmemleak.c +2 -0
@@ -1442,6 +1442,8 @@ static void kmemleak_scan(void)if (page_count (page) ==0 )continue ;scan_block (page, page +1 ,NULL ); +if (!(pfn % (MAX_SCAN_SIZE /sizeof (*page)))) +cond_resched (); } }put_online_mems ();
Greg Kroah-Hartman
maintainerPATCH 54/86 drm/bridge: tc358767: do no fail on hi-res displays
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Gusakov <[email protected]>
[ Upstream commit cffd2b16c01c3431a7a7dd62e722af33490fc436 ]
Do not fail data rates higher than 2.7 and more than 2 lanes. Try to fall back to 2.7Gbps and 2 lanes.
--- drivers/gpu/drm/bridge/tc358767.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +9 -5
@@ -603,8 +603,15 @@ static int tc_get_display_props(struct t ret =drm_dp_link_probe (&tc->aux, &tc->link.base);if (ret <0 ) goto err_dpcd_read; -if ((tc->link.base.rate !=162000 ) && (tc->link.base.rate !=270000 )) - goto err_dpcd_inval; +if (tc->link.base.rate !=162000 && tc->link.base.rate !=270000 ) { +dev_dbg (tc->dev,"Falling to 2.7 Gbps rate\n" ); + tc->link.base.rate =270000 ; + } + +if (tc->link.base.num_lanes >2 ) { +dev_dbg (tc->dev,"Falling to 2 lanes\n" ); + tc->link.base.num_lanes =2 ; + } ret =drm_dp_dpcd_readb (&tc->aux,DP_MAX_DOWNSPREAD , tmp);if (ret <0 )
@@ -637,9 +644,6 @@ static int tc_get_display_props(struct t err_dpcd_read:dev_err (tc->dev,"failed to read DPCD: %d\n" , ret);return ret; -err_dpcd_inval: -dev_err (tc->dev,"invalid DPCD\n" ); -return -EINVAL ; }static int tc_set_video_mode (struct tc_data *tc,struct drm_display_mode *mode)
Greg Kroah-Hartman
maintainerPATCH 55/86 drm/bridge: tc358767: filter out too high modes
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Gusakov <[email protected]>
[ Upstream commit 99fc8e963a4c0203dba26a77cf737db6081bca14 ]
Pixel clock limitation for DPI is 154 MHz. Do not accept modes with higher pixel clock rate.
--- drivers/gpu/drm/bridge/tc358767.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358767.c +4 -1
@@ -1109,7 +1109,10 @@ static bool tc_bridge_mode_fixup(structstatic int tc_connector_mode_valid (struct drm_connector *connector,struct drm_display_mode *mode) { -/* Accept any mode */ +/* DPI interface clock limitation: upto 154 MHz */ +if (mode->clock >154000 ) +return MODE_CLOCK_HIGH ; +return MODE_OK ; }
Greg Kroah-Hartman
maintainerPATCH 56/86 drm/bridge: tc358767: fix DP0_MISC register set
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Gusakov <[email protected]>
[ Upstream commit f3b8adbe1911f66fd3cab1aaa74f0f66b7ceda25 ]
Remove shift from TU_SIZE_RECOMMENDED define as it used to calculate max_tu_symbols.
--- drivers/gpu/drm/bridge/tc358767.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +3 -2
@@ -97,7 +97,7 @@#define DP0_ACTIVEVAL 0x0650#define DP0_SYNCVAL 0x0654#define DP0_MISC 0x0658 -#define TU_SIZE_RECOMMENDED (0x3f << 16)/* LSCLK cycles per TU */ +#define TU_SIZE_RECOMMENDED (63)/* LSCLK cycles per TU */ #define BPC_6 (0 << 5)#define BPC_8 (1 << 5)
@@ -716,7 +716,8 @@ static int tc_set_video_mode(struct tc_d* Must be less than tu_size. */ max_tu_symbol =TU_SIZE_RECOMMENDED -1 ; -tc_write (DP0_MISC , (max_tu_symbol <<23 ) |TU_SIZE_RECOMMENDED |BPC_8 ); +tc_write (DP0_MISC , (max_tu_symbol <<23 ) | (TU_SIZE_RECOMMENDED <<16 ) | +BPC_8 );return 0 ; err:
Greg Kroah-Hartman
maintainerPATCH 57/86 drm/bridge: tc358767: fix timing calculations
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Gusakov <[email protected]>
[ Upstream commit 66d1c3b94d5d59e4325e61a78d520f92c043d645 ]
Fields in HTIM01 and HTIM02 regs should be even. Recomended thresh_dly value is max_tu_symbol. Remove set of VPCTRL0.VSDELAY as it is related to DSI input interface. Currently driver supports only DPI.
--- drivers/gpu/drm/bridge/tc358767.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +20 -14
@@ -659,6 +659,14 @@ static int tc_set_video_mode(struct tc_dint lower_margin = mode->vsync_start - mode->vdisplay;int vsync_len = mode->vsync_end - mode->vsync_start; +/* +* Recommended maximum number of symbols transferred in a transfer unit: +* DIV_ROUND_UP((input active video bandwidth in bytes) * tu_size, +* (output active video bandwidth in bytes)) +* Must be less than tu_size. +*/ + max_tu_symbol =TU_SIZE_RECOMMENDED -1 ; +dev_dbg (tc->dev,"set mode %dx%d\n" , mode->hdisplay, mode->vdisplay); dev_dbg(tc->dev, "H margin %d,%d sync %d\n",
@@ -668,13 +676,18 @@ static int tc_set_video_mode(struct tc_ddev_dbg (tc->dev,"total: %dx%d\n" , mode->htotal, mode->vtotal); -/* LCD Ctl Frame Size */ -tc_write (VPCTRL0 , (0x40 <<20 )/* VSDELAY */ | +/* +* LCD Ctl Frame Size +* datasheet is not clear of vsdelay in case of DPI +* assume we do not need any delay when DPI is a source of +* sync signals +*/ +tc_write (VPCTRL0 , (0 <<20 )/* VSDELAY */ |OPXLFMT_RGB888 |FRMSYNC_DISABLED |MSF_DISABLED ); -tc_write (HTIM01 , (left_margin <<16 ) |/* H back porch */ - (hsync_len <<0 ));/* Hsync */ -tc_write (HTIM02 , (right_margin <<16 ) |/* H front porch */ - (mode->hdisplay <<0 ));/* width */ +tc_write (HTIM01 , (ALIGN (left_margin,2 ) <<16 ) |/* H back porch */ + (ALIGN (hsync_len,2 ) <<0 ));/* Hsync */ +tc_write (HTIM02 , (ALIGN (right_margin,2 ) <<16 ) |/* H front porch */ + (ALIGN (mode->hdisplay,2 ) <<0 ));/* width */ tc_write (VTIM01 , (upper_margin <<16 ) |/* V back porch */ (vsync_len <<0 ));/* Vsync */ tc_write(VTIM02, (lower_margin << 16) | /* V front porch */
@@ -693,7 +706,7 @@ static int tc_set_video_mode(struct tc_d/* DP Main Stream Attributes */ vid_sync_dly = hsync_len + left_margin + mode->hdisplay;tc_write (DP0_VIDSYNCDELAY , - (0x003e <<16 ) |/* thresh_dly */ + (max_tu_symbol <<16 ) |/* thresh_dly */ (vid_sync_dly <<0 ));tc_write (DP0_TOTALVAL , (mode->vtotal <<16 ) | (mode->htotal));
@@ -709,13 +722,6 @@ static int tc_set_video_mode(struct tc_dtc_write (DPIPXLFMT ,VS_POL_ACTIVE_LOW |HS_POL_ACTIVE_LOW |DE_POL_ACTIVE_HIGH |SUB_CFG_TYPE_CONFIG1 |DPI_BPP_RGB888 ); -/* -* Recommended maximum number of symbols transferred in a transfer unit: -* DIV_ROUND_UP((input active video bandwidth in bytes) * tu_size, -* (output active video bandwidth in bytes)) -* Must be less than tu_size. -*/ - max_tu_symbol =TU_SIZE_RECOMMENDED -1 ;tc_write (DP0_MISC , (max_tu_symbol <<23 ) | (TU_SIZE_RECOMMENDED <<16 ) |BPC_8 );
Greg Kroah-Hartman
maintainerPATCH 58/86 drm/bridge: tc358767: fix AUXDATAn registers access
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Gusakov <[email protected]>
[ Upstream commit 9217c1abbc145a77d65c476cf2004a3df02104c7 ]
First four bytes should go to DP0_AUXWDATA0. Due to bug if len > 4 first four bytes was writen to DP0_AUXWDATA1 and all data get shifted by 4 bytes. Fix it.
--- drivers/gpu/drm/bridge/tc358767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358767.c +1 -1
@@ -318,7 +318,7 @@ static ssize_t tc_aux_transfer(struct dr tmp = (tmp <<8 ) | buf[i]; i++;if (((i %4 ) ==0 ) || (i == size)) { -tc_write (DP0_AUXWDATA (i >>2 ), tmp); +tc_write (DP0_AUXWDATA ((i -1 ) >>2 ), tmp); tmp =0 ; } }
Greg Kroah-Hartman
maintainerPATCH 59/86 drm/bridge: tc358767: fix 1-lane behavior
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Gusakov <[email protected]>
[ Upstream commit 4dbd6c03fbf88299c573d676838896c6e06aade2 ]
Use drm_dp_channel_eq_ok helper
--- drivers/gpu/drm/bridge/tc358767.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +3 -10
@@ -819,8 +819,6 @@ static int tc_main_link_setup(struct tc_unsigned int rate;u32 dp_phy_ctrl;int timeout; -bool aligned; -bool ready;u32 value;int ret;u8 tmp[8 ];
@@ -965,16 +963,15 @@ static int tc_main_link_setup(struct tc_ ret =drm_dp_dpcd_read_link_status (aux, tmp +2 );if (ret <0 ) goto err_dpcd_read; - ready = (tmp[2 ] == ((DP_CHANNEL_EQ_BITS <<4 ) |/* Lane1 */ -DP_CHANNEL_EQ_BITS ));/* Lane0 */ - aligned = tmp[4 ] &DP_INTERLANE_ALIGN_DONE ; - }while ((--timeout) && !(ready && aligned)); + }while ((--timeout) && + !(drm_dp_channel_eq_ok (tmp +2 , tc->link.base.num_lanes)));if (timeout ==0 ) {/* Read DPCD 0x200-0x201 */ ret =drm_dp_dpcd_read (aux,DP_SINK_COUNT , tmp,2 );if (ret <0 ) goto err_dpcd_read; +dev_err (dev,"channel(s) EQ not ok\n" );dev_info (dev,"0x0200 SINK_COUNT: 0x%02x\n" , tmp[0 ]);dev_info (dev,"0x0201 DEVICE_SERVICE_IRQ_VECTOR: 0x%02x\n" , tmp[1 ]);
@@ -985,10 +982,6 @@ static int tc_main_link_setup(struct tc_dev_info (dev,"0x0206 ADJUST_REQUEST_LANE0_1: 0x%02x\n" , tmp[6 ]); -if (!ready) -dev_err (dev,"Lane0/1 not ready\n" ); -if (!aligned) -dev_err (dev,"Lane0/1 not aligned\n" );return -EAGAIN ; }
Greg Kroah-Hartman
maintainerPATCH 60/86 drm/omap: Fix error handling path in omap_dmm_probe()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 8677b1ac2db021ab30bb1fa34f1e56ebe0051ec3 ]
If we don't find a matching device node, we must free the memory allocated in 'omap_dmm' a few lines above.
--- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +2 -1
@@ -638,7 +638,8 @@ static int omap_dmm_probe(struct platfor match =of_match_node (dmm_of_match, dev->dev.of_node);if (!match) {dev_err (&dev->dev,"failed to find matching device node\n" ); -return -ENODEV ; + ret = -ENODEV ; + goto fail; } omap_dmm->plat_data = match->data;
Greg Kroah-Hartman
maintainerPATCH 61/86 xfs: ubsan fixes
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Darrick J. Wong" <[email protected]>
[ Upstream commit 22a6c83777ac7c17d6c63891beeeac24cf5da450 ]
Fix some complaints from the UBSAN about signed integer addition overflows.
--- fs/xfs/xfs_aops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/xfs/xfs_aops.c +3 -3
@@ -391,7 +391,7 @@ xfs_map_blocks( (ip->i_df.if_flags & XFS_IFEXTENTS));ASSERT (offset <= mp->m_super->s_maxbytes); -if (offset + count > mp->m_super->s_maxbytes) +if ((xfs_ufsize_t )offset + count > mp->m_super->s_maxbytes) count = mp->m_super->s_maxbytes - offset; end_fsb =XFS_B_TO_FSB (mp, (xfs_ufsize_t )offset + count); offset_fsb =XFS_B_TO_FSBT (mp, offset);
@@ -1295,7 +1295,7 @@ xfs_map_trim_size(if (mapping_size > size) mapping_size = size;if (offset <i_size_read (inode) && - offset + mapping_size >=i_size_read (inode)) { + (xfs_ufsize_t )offset + mapping_size >=i_size_read (inode)) {/* limit mapping to block that spans EOF */ mapping_size =roundup_64 (i_size_read (inode) - offset,i_blocksize (inode));
@@ -1347,7 +1347,7 @@ __xfs_get_blocks( lockmode =xfs_ilock_data_map_shared (ip);ASSERT (offset <= mp->m_super->s_maxbytes); -if (offset + size > mp->m_super->s_maxbytes) +if ((xfs_ufsize_t )offset + size > mp->m_super->s_maxbytes) size = mp->m_super->s_maxbytes - offset; end_fsb =XFS_B_TO_FSB (mp, (xfs_ufsize_t )offset + size); offset_fsb =XFS_B_TO_FSBT (mp, offset);
Greg Kroah-Hartman
maintainerPATCH 62/86 xfs: Properly retry failed dquot items in case of error during buffer writeback
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Maiolino <[email protected]>
[ Upstream commit 373b0589dc8d58bc09c9a28d03611ae4fb216057 ]
Once the inode item writeback errors is already fixed, it's time to fix the same problem in dquot code.
Although there were no reports of users hitting this bug in dquot code (at least none I've seen), the bug is there and I was already planning to fix it when the correct approach to fix the inodes part was decided.
This patch aims to fix the same problem in dquot code, regarding failed buffers being unable to be resubmitted once they are flush locked.
Tested with the recently test-case sent to fstests list by Hou Tao.
--- fs/xfs/xfs_dquot.c | 14 +++++++++++--- fs/xfs/xfs_dquot_item.c | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 5 deletions(-)
fs/xfs/xfs_dquot.c +11 -3
@@ -1004,14 +1004,22 @@ xfs_qm_dqflush_done(* holding the lock before removing the dquot from the AIL. */ if ((lip->li_flags &XFS_LI_IN_AIL ) && - lip->li_lsn == qip->qli_flush_lsn) { + ((lip->li_lsn == qip->qli_flush_lsn) || + (lip->li_flags &XFS_LI_FAILED ))) {/* xfs_trans_ail_delete() drops the AIL lock. */ spin_lock (&ailp->xa_lock); -if (lip->li_lsn == qip->qli_flush_lsn) +if (lip->li_lsn == qip->qli_flush_lsn) {xfs_trans_ail_delete (ailp, lip,SHUTDOWN_CORRUPT_INCORE ); -else + }else { +/* +* Clear the failed state since we are about to drop the +* flush lock +*/ +if (lip->li_flags &XFS_LI_FAILED ) +xfs_clear_li_failed (lip);spin_unlock (&ailp->xa_lock); + } }/*
fs/xfs/xfs_dquot_item.c +38 -2
@@ -137,6 +137,26 @@ xfs_qm_dqunpin_wait(wait_event (dqp->q_pinwait, (atomic_read (&dqp->q_pincount) ==0 )); } +/* +* Callback used to mark a buffer with XFS_LI_FAILED when items in the buffer +* have been failed during writeback +* +* this informs the AIL that the dquot is already flush locked on the next push, +* and acquires a hold on the buffer to ensure that it isn't reclaimed before +* dirty data makes it to disk. +*/ +STATIC void +xfs_dquot_item_error ( +struct xfs_log_item *lip, +struct xfs_buf *bp) +{ +struct xfs_dquot *dqp; + + dqp =DQUOT_ITEM (lip)->qli_dquot; +ASSERT (!completion_done (&dqp->q_flush)); +xfs_set_li_failed (lip, bp); +} + STATIC uint xfs_qm_dquot_logitem_push( struct xfs_log_item *lip,
@@ -144,13 +164,28 @@ xfs_qm_dquot_logitem_push( __acquires(&lip->li_ailp->xa_lock) {struct xfs_dquot *dqp =DQUOT_ITEM (lip)->qli_dquot; -struct xfs_buf *bp =NULL ; +struct xfs_buf *bp = lip->li_buf;uint rval =XFS_ITEM_SUCCESS ;int error;if (atomic_read (&dqp->q_pincount) >0 )return XFS_ITEM_PINNED ; +/* +* The buffer containing this item failed to be written back +* previously. Resubmit the buffer for IO +*/ +if (lip->li_flags &XFS_LI_FAILED ) { +if (!xfs_buf_trylock (bp)) +return XFS_ITEM_LOCKED ; + +if (!xfs_buf_resubmit_failed_buffers (bp, lip, buffer_list)) + rval =XFS_ITEM_FLUSHING ; + +xfs_buf_unlock (bp); +return rval; + } +if (!xfs_dqlock_nowait (dqp))return XFS_ITEM_LOCKED ;
@@ -242,7 +277,8 @@ static const struct xfs_item_ops xfs_dqu .iop_unlock = xfs_qm_dquot_logitem_unlock, .iop_committed = xfs_qm_dquot_logitem_committed, .iop_push = xfs_qm_dquot_logitem_push, - .iop_committing = xfs_qm_dquot_logitem_committing + .iop_committing = xfs_qm_dquot_logitem_committing, + .iop_error = xfs_dquot_item_error };/*
Greg Kroah-Hartman
maintainerPATCH 63/86 scsi: aacraid: Prevent crash in case of free interrupt during scsi EH path
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Guilherme G. Piccoli" <[email protected]>
[ Upstream commit e4717292ddebcfe231651b5aff9fa19ca158d178 ]
As part of the scsi EH path, aacraid performs a reinitialization of the adapter, which encompass freeing resources and IRQs, NULLifying lots of pointers, and then initialize it all over again. We've identified a problem during the free IRQ portion of this path if CONFIG_DEBUG_SHIRQ is enabled on kernel config file.
Happens that, in case this flag was set, right after free_irq() effectively clears the interrupt, it checks if it was requested as IRQF_SHARED. In positive case, it performs another call to the IRQ handler on driver. Problem is: since aacraid currently free some resources *before* freeing the IRQ, once free_irq() path calls the handler again (due to CONFIG_DEBUG_SHIRQ), aacraid crashes due to NULL pointer dereference with the following trace:
aac_src_intr_message+0xf8/0x740 [aacraid] __free_irq+0x33c/0x4a0 free_irq+0x78/0xb0 aac_free_irq+0x13c/0x150 [aacraid] aac_reset_adapter+0x2e8/0x970 [aacraid] aac_eh_reset+0x3a8/0x5d0 [aacraid] scsi_try_host_reset+0x74/0x180 scsi_eh_ready_devs+0xc70/0x1510 scsi_error_handler+0x624/0xa20
This patch prevents the crash by changing the order of the deinitialization in this path of aacraid: first we clear the IRQ, then we free other resources. No functional change intended.
--- drivers/scsi/aacraid/commsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aacraid/commsup.c +1 -1
@@ -1416,13 +1416,13 @@ static int _aac_reset_adapter(struct aac* will ensure that i/o is queisced and the card is flushed in that * case. */ +aac_free_irq (aac);aac_fib_map_free (aac);pci_free_consistent (aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); aac->comm_addr =NULL ; aac->comm_phys =0 ;kfree (aac->queues); aac->queues =NULL ; -aac_free_irq (aac);kfree (aac->fsa_dev); aac->fsa_dev =NULL ; quirks =aac_get_driver_ident (index)->quirks;
Greg Kroah-Hartman
maintainerPATCH 64/86 scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit 727535903bea924c4f73abb202c4b3e85fff0ca4 ]
_vreg_ is being dereferenced before it is null checked, hence there is a potential null pointer dereference.
Fix this by moving the pointer dereference after _vreg_ has been null checked.
This issue was detected with the help of Coccinelle.
--- drivers/scsi/ufs/ufshcd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/ufs/ufshcd.c +5 -2
@@ -5327,12 +5327,15 @@ static int ufshcd_config_vreg(struct dev struct ufs_vreg *vreg, bool on) { int ret = 0; -struct regulator *reg = vreg->reg; -const char *name = vreg->name; +struct regulator *reg; +const char *name;int min_uV, uA_load;BUG_ON (!vreg); + reg = vreg->reg; + name = vreg->name; +if (regulator_count_voltages (reg) >0 ) { min_uV = on ? vreg->min_uV :0 ; ret =regulator_set_voltage (reg, min_uV, vreg->max_uV);
Greg Kroah-Hartman
maintainerPATCH 65/86 iwlwifi: mvm: fix the TX queue hang timeout for MONITOR vif type
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emmanuel Grumbach <[email protected]>
[ Upstream commit d1b275ffec459c5ae12b5c7086c84175696e5a9f ]
The MONITOR type is missing in the interface type switch. Add it.
--- drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +2 -0
@@ -1040,6 +1040,8 @@ unsigned int iwl_mvm_get_wd_timeout(strureturn le32_to_cpu (txq_timer->p2p_go);case NL80211_IFTYPE_P2P_DEVICE :return le32_to_cpu (txq_timer->p2p_device); +case NL80211_IFTYPE_MONITOR : +return default_timeout;default :WARN_ON (1 );return mvm->cfg->base_params->wd_timeout;
Greg Kroah-Hartman
maintainerPATCH 66/86 ARM: dts: NSP: Fix PPI interrupt types
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fainelli <[email protected]>
[ Upstream commit 5f1aa51c7a1eef1c5a60b8334e32c89904964245 ]
Booting a kernel results in the kernel warning us about the following PPI interrupts configuration:
[ 0.105127] smp: Bringing up secondary CPUs ... [ 0.110545] GIC: PPI11 is secure or misconfigured [ 0.110551] GIC: PPI13 is secure or misconfigured
Fix this by using the appropriate edge configuration for PPI11 and PPI13, this is similar to what was fixed for Northstar (BCM5301X) in commit 0e34079cd1f6 ("ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags").
--- arch/arm/boot/dts/bcm-nsp.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/bcm-nsp.dtsi +2 -2
@@ -85,7 +85,7 @@ timer@20200 { compatible = "arm,cortex-a9-global-timer"; reg = <0x20200 0x100>; - interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>; + interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>; clocks = <&periph_clk>; };
@@ -93,7 +93,7 @@ compatible = "arm,cortex-a9-twd-timer"; reg = <0x20600 0x20>; interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | - IRQ_TYPE_LEVEL_HIGH)>; + IRQ_TYPE_EDGE_RISING)>; clocks = <&periph_clk>; };
Greg Kroah-Hartman
maintainerPATCH 67/86 media: usbtv: add a new usbid
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Icenowy Zheng <[email protected]>
[ Upstream commit 04226916d2360f56d57ad00bc48d2d1854d1e0b0 ]
A new usbid of UTV007 is found in a newly bought device.
The usbid is 1f71:3301.
The ID on the chip is:
UTV007
A89029.1
1520L18K1
Both video and audio is tested with the modified usbtv driver.
--- drivers/media/usb/usbtv/usbtv-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/usb/usbtv/usbtv-core.c +1 -0
@@ -141,6 +141,7 @@ static void usbtv_disconnect(struct usb_static struct usb_device_id usbtv_id_table[] = { {USB_DEVICE (0x1b71 ,0x3002 ) }, + {USB_DEVICE (0x1f71 ,0x3301 ) }, {} };MODULE_DEVICE_TABLE (usb, usbtv_id_table);
Greg Kroah-Hartman
maintainerPATCH 68/86 usb: gadget: dont dereference g until after it has been null checked
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
[ Upstream commit b2fc059fa549fe6881d4c1f8d698b0f50bcd16ec ]
Avoid dereferencing pointer g until after g has been sanity null checked; move the assignment of cdev much later when it is required into a more local scope.
Detected by CoverityScan, CID#1222135 ("Dereference before null check")
--- drivers/usb/gadget/composite.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/usb/gadget/composite.c +5 -2
@@ -150,7 +150,6 @@ int config_ep_by_speed(struct usb_gadgetstruct usb_function *f, struct usb_ep *_ep) { - struct usb_composite_dev *cdev = get_gadget_data(g); struct usb_endpoint_descriptor *chosen_desc = NULL;struct usb_descriptor_header **speed_desc =NULL ;
@@ -229,8 +228,12 @@ ep_found: _ep->maxburst = comp_desc->bMaxBurst +1 ;break ;default : -if (comp_desc->bMaxBurst !=0 ) +if (comp_desc->bMaxBurst !=0 ) { +struct usb_composite_dev *cdev; + + cdev =get_gadget_data (g);ERROR (cdev,"ep0 bMaxBurst must be 0\n" ); + } _ep->maxburst =1 ;break ; }
Greg Kroah-Hartman
maintainerPATCH 69/86 staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
[ Upstream commit b77992d2df9e47144354d1b25328b180afa33442 ]
When not associated with an AP, wifi device drivers should respond to the SIOCGIWESSID ioctl with a zero-length string for the SSID, which is the behavior expected by dhcpcd.
Currently, this driver returns an error code (-1) from the ioctl call, which causes dhcpcd to assume that the device is not a wireless interface and therefore it fails to work correctly with it thereafter.
This problem was reported and tested at
https://github.com/lwfinger/rtl8188eu/issues/234.
--- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +4 -10
@@ -1397,19 +1397,13 @@ static int rtw_wx_get_essid(struct net_dif ((check_fwstate (pmlmepriv, _FW_LINKED)) || (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ))) { len = pcur_bss->Ssid.SsidLength; - - wrqu->essid.length = len; -memcpy (extra, pcur_bss->Ssid.Ssid, len); - - wrqu->essid.flags =1 ; }else { - ret =-1 ; - goto exit; + len =0 ; + *extra =0 ; } - -exit: - + wrqu->essid.length = len; + wrqu->essid.flags =1 ;return ret; }
Greg Kroah-Hartman
maintainerPATCH 70/86 drm/vc4: Move IRQ enable to PM path
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Schake <[email protected]>
[ Upstream commit ce9caf2f79a5aa170a4b6456a03db639eed9c988 ]
We were calling enable_irq on bind, where it was already enabled previously by the IRQ helper. Additionally, dev->irq is not set correctly until after postinstall and so was always zero here, triggering a warning in 4.15. Fix both by moving the enable to the power management resume path, where we know there was a previous disable invocation during suspend.
--- drivers/gpu/drm/vc4/vc4_irq.c | 3 --- drivers/gpu/drm/vc4/vc4_v3d.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/vc4/vc4_irq.c +0 -3
@@ -208,9 +208,6 @@ vc4_irq_postinstall(struct drm_device *d {struct vc4_dev *vc4 =to_vc4_dev (dev); -/* Undo the effects of a previous vc4_irq_uninstall. */ -enable_irq (dev->irq); -/* Enable both the render done and out of memory interrupts. */ V3D_WRITE (V3D_INTENA ,V3D_DRIVER_IRQS );
drivers/gpu/drm/vc4/vc4_v3d.c +3 -0
@@ -173,6 +173,9 @@ static int vc4_v3d_runtime_resume(structstruct vc4_dev *vc4 = v3d->vc4;vc4_v3d_init_hw (vc4->dev); + +/* We disabled the IRQ as part of vc4_irq_uninstall in suspend. */ +enable_irq (vc4->dev->irq);vc4_irq_postinstall (vc4->dev);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 71/86 staging: lustre: separate a connection destroy from free struct kib_conn
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Eremin <[email protected]>
commit 9b046013e5837f8a58453d1e9f8e01d03adb7fe7 upstream.
The logic of the original commit 4d99b2581eff ("staging: lustre: avoid intensive reconnecting for ko2iblnd") was assumed conditional free of struct kib_conn if the second argument free_conn in function kiblnd_destroy_conn(struct kib_conn *conn, bool free_conn) is true. But this hunk of code was dropped from original commit. As result the logic works wrong and current code use struct kib_conn after free.
Quoted 17 lines
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
3317kiblnd_destroy_conn(conn, !peer);
^^^^ Freed always (but should be conditionally)
3318
3319spin_lock_irqsave(lock, flags);
3320 if (!peer)
3321 continue;
33223323 conn->ibc_peer = peer; ^^^^^^^^^^^^^^ Use after free 3324 if (peer->ibp_reconnected < KIB_RECONN_HIGH_RACE) 3325 list_add_tail(&conn->ibc_list, ^^^^^^^^^^^^^^ Use after free 3326 &kiblnd_data.kib_reconn_list); 3327 else 3328 list_add_tail(&conn->ibc_list, ^^^^^^^^^^^^^^ Use after free
Quoted 1 line
3329 &kiblnd_data.kib_reconn_wait);
To avoid confusion this fix moved the freeing a struct kib_conn outside of the function kiblnd_destroy_conn() and free as it was intended in original commit.
--- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 7 +++---- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 2 +- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 6 ++++-- 3 files changed, 8 insertions(+), 7 deletions(-)
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +3 -4
@@ -824,14 +824,15 @@ struct kib_conn *kiblnd_create_conn(strureturn conn; failed_2: -kiblnd_destroy_conn (conn, true); +kiblnd_destroy_conn (conn); +LIBCFS_FREE (conn,sizeof (*conn)); failed_1:LIBCFS_FREE (init_qp_attr,sizeof (*init_qp_attr)); failed_0:return NULL ; } -void kiblnd_destroy_conn (struct kib_conn *conn,bool free_conn) +void kiblnd_destroy_conn (struct kib_conn *conn) {struct rdma_cm_id *cmid = conn->ibc_cmid;struct kib_peer *peer = conn->ibc_peer;
@@ -894,8 +895,6 @@ void kiblnd_destroy_conn(struct kib_connrdma_destroy_id (cmid);atomic_dec (&net->ibn_nconns); } - -LIBCFS_FREE (conn,sizeof (*conn)); }int kiblnd_close_peer_conns_locked (struct kib_peer *peer,int why)
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +1 -1
@@ -1018,7 +1018,7 @@ int kiblnd_close_peer_conns_locked(strustruct kib_conn *kiblnd_create_conn (struct kib_peer *peer,struct rdma_cm_id *cmid,int state,int version); -void kiblnd_destroy_conn (struct kib_conn *conn,bool free_conn); +void kiblnd_destroy_conn (struct kib_conn *conn);void kiblnd_close_conn (struct kib_conn *conn,int error);void kiblnd_close_conn_locked (struct kib_conn *conn,int error);
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +4 -2
@@ -3323,11 +3323,13 @@ kiblnd_connd(void *arg)spin_unlock_irqrestore (lock, flags); dropped_lock =1 ; -kiblnd_destroy_conn (conn, !peer); +kiblnd_destroy_conn (conn);spin_lock_irqsave (lock, flags); -if (!peer) +if (!peer) { +kfree (conn);continue ; + } conn->ibc_peer = peer;if (peer->ibp_reconnected <KIB_RECONN_HIGH_RACE )
Greg Kroah-Hartman
maintainerPATCH 72/86 tty: fix data race between tty_init_dev and flush of buf
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gaurav Kohli <[email protected]>
commit b027e2298bd588d6fa36ed2eda97447fb3eac078 upstream.
There can be a race, if receive_buf call comes before tty initialization completes in n_tty_open and tty->disc_data may be NULL.
CPU0 CPU1
---- ----
000|n_tty_receive_buf_common() n_tty_open() -001|n_tty_receive_buf2() tty_ldisc_open.isra.3() -002|tty_ldisc_receive_buf(inline) tty_ldisc_setup()
Using ldisc semaphore lock in tty_init_dev till disc_data initializes completely.
--- drivers/tty/tty_io.c | 8 +++++++- drivers/tty/tty_ldisc.c | 4 ++-- include/linux/tty.h | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/tty/tty_io.c +7 -1
@@ -1543,6 +1543,9 @@ struct tty_struct *tty_init_dev(struct t"%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n" , __func__, tty->driver->name); + retval =tty_ldisc_lock (tty,5 *HZ ); +if (retval) + goto err_release_lock; tty->port->itty = tty;/*
@@ -1553,6 +1556,7 @@ struct tty_struct *tty_init_dev(struct t retval =tty_ldisc_setup (tty, tty->link);if (retval) goto err_release_tty; +tty_ldisc_unlock (tty);/* Return the tty locked so that it cannot vanish under the caller */ return tty;
@@ -1565,9 +1569,11 @@ err_module_put:/* call the tty release_tty routine to clean out this slot */ err_release_tty: -tty_unlock (tty); +tty_ldisc_unlock (tty);tty_info_ratelimited (tty,"ldisc open failed (%d), clearing slot %d\n" , retval, idx); +err_release_lock: +tty_unlock (tty);release_tty (tty, idx);return ERR_PTR (retval); }
drivers/tty/tty_ldisc.c +2 -2
@@ -336,7 +336,7 @@ static inline void __tty_ldisc_unlock(stldsem_up_write (&tty->ldisc_sem); } -static int tty_ldisc_lock (struct tty_struct *tty,unsigned long timeout) +int tty_ldisc_lock (struct tty_struct *tty,unsigned long timeout) {int ret;
@@ -347,7 +347,7 @@ static int tty_ldisc_lock(struct tty_strreturn 0 ; } -static void tty_ldisc_unlock (struct tty_struct *tty) +void tty_ldisc_unlock (struct tty_struct *tty) {clear_bit (TTY_LDISC_HALTED , &tty->flags);__tty_ldisc_unlock (tty);
include/linux/tty.h +2 -0
@@ -394,6 +394,8 @@ extern struct tty_struct *get_current_tt/* tty_io.c */ extern int __init tty_init (void );extern const char *tty_name (const struct tty_struct *tty); +extern int tty_ldisc_lock (struct tty_struct *tty,unsigned long timeout); +extern void tty_ldisc_unlock (struct tty_struct *tty);#else static inline void console_init (void ) { }
Greg Kroah-Hartman
maintainerPATCH 73/86 usb: option: Add support for FS040U modem
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: OKAMOTO Yoshiaki <[email protected]>
commit 69341bd15018da0a662847e210f9b2380c71e623 upstream.
FS040U modem is manufactured by omega, and sold by Fujisoft. This patch adds ID of the modem to use option1 driver. Interface 3 is used as qmi_wwan, so the interface is ignored.
--- drivers/usb/serial/option.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/serial/option.c +5 -0
@@ -383,6 +383,9 @@ static void option_instat_callback(struc#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603#define FOUR_G_SYSTEMS_PRODUCT_W100 0x9b01 +/* Fujisoft products */ +#define FUJISOFT_PRODUCT_FS040U 0x9b02 +/* iBall 3.5G connect wireless modem */ #define IBALL_3_5G_CONNECT 0x9605
@@ -1897,6 +1900,8 @@ static const struct usb_device_id option { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100), .driver_info = (kernel_ulong_t)&four_g_w100_blacklist }, + {USB_DEVICE(LONGCHEER_VENDOR_ID, FUJISOFT_PRODUCT_FS040U), + .driver_info = (kernel_ulong_t)&net_intf3_blacklist}, { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, 0x9801, 0xff), .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
Greg Kroah-Hartman
maintainerPATCH 74/86 USB: serial: pl2303: new device id for Chilitag
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
commit d08dd3f3dd2ae351b793fc5b76abdbf0fd317b12 upstream.
This adds a new device id for Chilitag devices to the pl2303 driver.
--- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/serial/pl2303.c +1 -0
@@ -39,6 +39,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_CHILITAG) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) },
drivers/usb/serial/pl2303.h +1 -0
@@ -17,6 +17,7 @@#define PL2303_PRODUCT_ID_DCU11 0x1234#define PL2303_PRODUCT_ID_PHAROS 0xaaa0#define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 +#define PL2303_PRODUCT_ID_CHILITAG 0xaaa8#define PL2303_PRODUCT_ID_ALDIGA 0x0611#define PL2303_PRODUCT_ID_MMX 0x0612#define PL2303_PRODUCT_ID_GPRS 0x0609
Greg Kroah-Hartman
maintainerPATCH 75/86 USB: cdc-acm: Do not log urb submission errors on disconnect
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit f0386c083c2ce85284dc0b419d7b89c8e567c09f upstream.
When disconnected sometimes the cdc-acm driver logs errors like these:
[20278.039417] cdc_acm 2-2:2.1: urb 9 failed submission with -19 [20278.042924] cdc_acm 2-2:2.1: urb 10 failed submission with -19 [20278.046449] cdc_acm 2-2:2.1: urb 11 failed submission with -19 [20278.049920] cdc_acm 2-2:2.1: urb 12 failed submission with -19 [20278.053442] cdc_acm 2-2:2.1: urb 13 failed submission with -19 [20278.056915] cdc_acm 2-2:2.1: urb 14 failed submission with -19 [20278.060418] cdc_acm 2-2:2.1: urb 15 failed submission with -19
Silence these by not logging errors when the result is -ENODEV.
--- drivers/usb/class/cdc-acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/class/cdc-acm.c +1 -1
@@ -375,7 +375,7 @@ static int acm_submit_read_urb(struct ac res =usb_submit_urb (acm->read_urbs[index], mem_flags);if (res) { -if (res != -EPERM ) { +if (res != -EPERM && res != -ENODEV ) {dev_err (&acm->data->dev,"urb %d failed submission with %d\n" , index, res);
Greg Kroah-Hartman
maintainerPATCH 76/86 CDC-ACM: apply quirk for card reader
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit df1cc78a52491f71d8170d513d0f6f114faa1bda upstream.
This devices drops random bytes from messages if you talk to it too fast.
--- drivers/usb/class/cdc-acm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/class/cdc-acm.c +3 -0
@@ -1706,6 +1706,9 @@ static const struct usb_device_id acm_id { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */ .driver_info =SINGLE_RX_URB ,/* firmware bug */ }, + { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */ + .driver_info = SINGLE_RX_URB, + }, { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ },
Greg Kroah-Hartman
maintainerPATCH 77/86 USB: serial: io_edgeport: fix possible sleep-in-atomic
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia-Ju Bai <[email protected]>
commit c7b8f77872c73f69a16528a9eb87afefcccdc18b upstream.
According to drivers/usb/serial/io_edgeport.c, the driver may sleep under a spinlock.
The function call path is:edge_bulk_in_callback (acquire the spinlock)
process_rcvd_data
process_rcvd_status
change_port_settings
send_iosp_ext_cmd
write_cmd_usb
usb_kill_urb --> may sleepTo fix it, the redundant usb_kill_urb() is removed from the error path after usb_submit_urb() fails.
This possible bug is found by my static analysis tool (DSAC) and checked by my code review.
--- drivers/usb/serial/io_edgeport.c | 1 - 1 file changed, 1 deletion(-)
drivers/usb/serial/io_edgeport.c +0 -1
@@ -2215,7 +2215,6 @@ static int write_cmd_usb(struct edgeport/* something went wrong */ dev_err (dev,"%s - usb_submit_urb(write command) failed, status = %d\n" , __func__, status); -usb_kill_urb (urb);usb_free_urb (urb);atomic_dec (&CmdUrbs);return status;
Greg Kroah-Hartman
maintainerPATCH 78/86 usbip: prevent bind loops on devices attached to vhci_hcd
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <[email protected]>
commit ef54cf0c600fb8f5737fb001a9e357edda1a1de8 upstream.
usbip host binds to devices attached to vhci_hcd on the same server when user does attach over localhost or specifies the server as the remote.
usbip attach -r localhost -b busid
or
usbip attach -r servername (or server IP)
Unbind followed by bind works, however device is left in a bad state with accesses via the attached busid result in errors and system hangs during shutdown.
Fix it to check and bail out if the device is already attached to vhci_hcd.
--- tools/usb/usbip/src/usbip_bind.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/usb/usbip/src/usbip_bind.c +9 -0
@@ -144,6 +144,7 @@ static int bind_device(char *busid)int rc;struct udev *udev;struct udev_device *dev; +const char *devpath;/* Check whether the device with this bus ID exists. */ udev =udev_new ();
@@ -152,8 +153,16 @@ static int bind_device(char *busid)err ("device with the specified bus ID does not exist" );return -1 ; } + devpath =udev_device_get_devpath (dev);udev_unref (udev); +/* If the device is already attached to vhci_hcd - bail out */ +if (strstr (devpath,USBIP_VHCI_DRV_NAME )) { +err ("bind loop detected: device: %s is attached to %s\n" , + devpath,USBIP_VHCI_DRV_NAME ); +return -1 ; + } + rc =unbind_other (busid);if (rc ==UNBIND_ST_FAILED ) {err ("could not unbind driver from device on busid %s" , busid);
Greg Kroah-Hartman
maintainerPATCH 79/86 usbip: list: dont list devices attached to vhci_hcd
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <[email protected]>
commit ef824501f50846589f02173d73ce3fe6021a9d2a upstream.
usbip host lists devices attached to vhci_hcd on the same server when user does attach over localhost or specifies the server as the remote.
usbip attach -r localhost -b busid
or
usbip attach -r servername (or server IP)
Fix it to check and not list devices that are attached to vhci_hcd.
--- tools/usb/usbip/src/usbip_list.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/usb/usbip/src/usbip_list.c +9 -0
@@ -187,6 +187,7 @@ static int list_devices(bool parsable)const char *busid;char product_name[128 ];int ret =-1 ; +const char *devpath;/* Create libudev context. */ udev =udev_new ();
@@ -209,6 +210,14 @@ static int list_devices(bool parsable) path =udev_list_entry_get_name (dev_list_entry); dev =udev_device_new_from_syspath (udev, path); +/* Ignore devices attached to vhci_hcd */ + devpath =udev_device_get_devpath (dev); +if (strstr (devpath,USBIP_VHCI_DRV_NAME )) { +dbg ("Skip the device %s already attached to %s\n" , + devpath,USBIP_VHCI_DRV_NAME ); +continue ; + } +/* Get device information. */ idVendor =udev_device_get_sysattr_value (dev,"idVendor" ); idProduct =udev_device_get_sysattr_value (dev,"idProduct" );
Greg Kroah-Hartman
maintainerPATCH 80/86 USB: serial: simple: add Motorola Tetra driver
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 46fe895e22ab3845515ec06b01eaf1282b342e29 upstream.
Add new Motorola Tetra (simple) driver for Motorola Solutions TETRA PEI devices.
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=0cad ProdID=9011 Rev=24.16 S: Manufacturer=Motorola Solutions Inc. S: Product=Motorola Solutions TETRA PEI interface C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
Note that these devices do not support the CDC SET_CONTROL_LINE_STATE request (for any interface).
--- drivers/usb/serial/Kconfig | 1 + drivers/usb/serial/usb-serial-simple.c | 7 +++++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/Kconfig +1 -0
@@ -63,6 +63,7 @@ config USB_SERIAL_SIMPLE - Google USB serial devices - HP4x calculators - a number of Motorola phones + - Motorola Tetra devices - Novatel Wireless GPS receivers - Siemens USB/MPI adapter. - ViVOtech ViVOpay USB device.
drivers/usb/serial/usb-serial-simple.c +7 -0
@@ -80,6 +80,11 @@ DEVICE(vivopay, VIVOPAY_IDS); { USB_DEVICE(0x22b8, 0x2c64) } /* Motorola V950 phone */DEVICE (moto_modem,MOTO_IDS ); +/* Motorola Tetra driver */ +#define MOTOROLA_TETRA_IDS () \ + { USB_DEVICE(0x0cad, 0x9011) }/* Motorola Solutions TETRA PEI */ +DEVICE (motorola_tetra,MOTOROLA_TETRA_IDS ); +/* Novatel Wireless GPS driver */ #define NOVATEL_IDS () \ { USB_DEVICE(0x09d7, 0x0100) }/* NovAtel FlexPack GPS */
@@ -110,6 +115,7 @@ static struct usb_serial_driver * const &google_device, &vivopay_device, &moto_modem_device, + &motorola_tetra_device, &novatel_gps_device, &hp4x_device, &suunto_device,
@@ -125,6 +131,7 @@ static const struct usb_device_id id_tabGOOGLE_IDS (),VIVOPAY_IDS (),MOTO_IDS (), +MOTOROLA_TETRA_IDS (),NOVATEL_IDS (),HP4X_IDS (), SUUNTO_IDS(),
Greg Kroah-Hartman
maintainerPATCH 81/86 usb: f_fs: Prevent gadget unbind if it is already unbound
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hemant Kumar <[email protected]>
commit ce5bf9a50daf2d9078b505aca1cea22e88ecb94a upstream.
Upon usb composition switch there is possibility of ep0 file release happening after gadget driver bind. In case of composition switch from adb to a non-adb composition gadget will never gets bound again resulting into failure of usb device enumeration. Fix this issue by checking FFS_FL_BOUND flag and avoid extra gadget driver unbind if it is already done as part of composition switch.
This fixes adb reconnection error reported on Android running v4.4 and above kernel versions. Verified on Hikey running vanilla v4.15-rc7 + few out of tree Mali patches.
Reviewed-at: https://android-review.googlesource.com/#/c/582632/
--- drivers/usb/gadget/function/f_fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/f_fs.c +2 -1
@@ -3725,7 +3725,8 @@ static void ffs_closed(struct ffs_data * ci = opts->func_inst.group.cg_item.ci_parent->ci_parent;ffs_dev_unlock (); -unregister_gadget_item (ci); +if (test_bit (FFS_FL_BOUND , &ffs->flags)) +unregister_gadget_item (ci);return ; done:ffs_dev_unlock ();
Greg Kroah-Hartman
maintainerPATCH 82/86 usb: uas: unconditionally bring back host after reset
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit cbeef22fd611c4f47c494b821b2b105b8af970bb upstream.
Quoting Hans:
If we return 1 from our post_reset handler, then our disconnect handler will be called immediately afterwards. Since pre_reset blocks all scsi requests our disconnect handler will then hang in the scsi_remove_host call.
This is esp. bad because our disconnect handler hanging for ever also stops the USB subsys from enumerating any new USB devices, causes commands like lsusb to hang, etc.
In practice this happens when unplugging some uas devices because the hub code may see the device as needing a warm-reset and calls usb_reset_device before seeing the disconnect. In this case uas_configure_endpoints fails with -ENODEV. We do not want to print an error for this, so this commit also silences the shost_printk for -ENODEV.
ENDQUOTE
However, if we do that we better drop any unconditional execution and report to the SCSI subsystem that we have undergone a reset but we are not operational now.
--- drivers/usb/storage/uas.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/usb/storage/uas.c +3 -4
@@ -1076,20 +1076,19 @@ static int uas_post_reset(struct usb_intreturn 0 ; err =uas_configure_endpoints (devinfo); -if (err) { +if (err && err !=ENODEV )shost_printk (KERN_ERR , shost,"%s: alloc streams error %d after reset" , __func__, err); -return 1 ; - } +/* we must unblock the host in every case lest we deadlock */ spin_lock_irqsave (shost->host_lock, flags);scsi_report_bus_reset (shost,0 );spin_unlock_irqrestore (shost->host_lock, flags);scsi_unblock_requests (shost); -return 0 ; +return err ?1 :0 ; }static int uas_suspend (struct usb_interface *intf,pm_message_t message)
Greg Kroah-Hartman
maintainerPATCH 83/86 usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Herrenschmidt <[email protected]>
commit 11fb37998759c48e4e4c200c974593cbeab25d3e upstream.
The current code tries to test for bits that are masked out by usb_endpoint_maxp(). Instead, use the proper accessor to access the new high bandwidth bits.
--- drivers/usb/gadget/udc/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/core.c +1 -1
@@ -913,7 +913,7 @@ int usb_gadget_ep_match_desc(struct usb_return 0 ;/* "high bandwidth" works only at high speed */ -if (!gadget_is_dualspeed (gadget) &&usb_endpoint_maxp (desc) & (3 <<11 )) +if (!gadget_is_dualspeed (gadget) &&usb_endpoint_maxp_mult (desc) >1 )return 0 ;switch (type) {
Greg Kroah-Hartman
maintainerPATCH 84/86 usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <[email protected]>
Upstream commit 1c9de5bf4286 ("usbip: vhci-hcd: Add USB3 SuperSpeed support")
vhci_hcd clears all the bits port_status bits instead of clearing just the USB_PORT_STAT_POWER bit when it handles ClearPortFeature:USB_PORT_FEAT_POWER. This causes vhci_hcd attach to fail in a bad state, leaving device unusable by the client. The device is still attached and however client can't use it.
The problem was fixed as part of larger change to add USB3 Super Speed support. This patch backports just the change to clear the USB_PORT_STAT_POWER.
--- drivers/usb/usbip/vhci_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/usbip/vhci_hcd.c +1 -1
@@ -300,7 +300,7 @@ static int vhci_hub_control(struct usb_hcase USB_PORT_FEAT_POWER :usbip_dbg_vhci_rh (" ClearPortFeature: USB_PORT_FEAT_POWER\n" ); - dum->port_status[rhport] =0 ; + dum->port_status[rhport] &= ~USB_PORT_STAT_POWER ; dum->resuming =0 ;break ;case USB_PORT_FEAT_C_RESET :
Greg Kroah-Hartman
maintainerPATCH 85/86 serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <[email protected]>
commit 38b1f0fb42f772b8c9aac53593883a18ff5eb9d7 upstream.
The wakeup mechanism via RTSDEN bit relies on the system using the RTS/CTS lines, so only allow such wakeup method when the system actually has RTS/CTS support.
--- drivers/tty/serial/imx.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/tty/serial/imx.c +8 -6
@@ -2239,12 +2239,14 @@ static void serial_imx_enable_wakeup(str val &= ~UCR3_AWAKEN ;writel (val, sport->port.membase +UCR3 ); - val =readl (sport->port.membase +UCR1 ); -if (on) - val |=UCR1_RTSDEN ; -else - val &= ~UCR1_RTSDEN ; -writel (val, sport->port.membase +UCR1 ); +if (sport->have_rtscts) { + val =readl (sport->port.membase +UCR1 ); +if (on) + val |=UCR1_RTSDEN ; +else + val &= ~UCR1_RTSDEN ; +writel (val, sport->port.membase +UCR1 ); + } }static int imx_serial_port_suspend_noirq (struct device *dev)
Greg Kroah-Hartman
maintainerPATCH 86/86 spi: imx: do not access registers while clocks disabled
In reply to Greg Kroah-Hartman4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Agner <[email protected]>
commit d593574aff0ab846136190b1729c151c736727ec upstream.
Since clocks are disabled except during message transfer clocks are also disabled when spi_imx_remove gets called. Accessing registers leads to a freeeze at least on a i.MX 6ULL. Enable clocks before disabling accessing the MXC_CSPICTRL register.
--- drivers/spi/spi-imx.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/spi/spi-imx.c +13 -2
@@ -1307,12 +1307,23 @@ static int spi_imx_remove(struct platfor {struct spi_master *master =platform_get_drvdata (pdev);struct spi_imx_data *spi_imx =spi_master_get_devdata (master); +int ret;spi_bitbang_stop (&spi_imx->bitbang); + ret =clk_enable (spi_imx->clk_per); +if (ret) +return ret; + + ret =clk_enable (spi_imx->clk_ipg); +if (ret) { +clk_disable (spi_imx->clk_per); +return ret; + } +writel (0 , spi_imx->base +MXC_CSPICTRL ); -clk_unprepare (spi_imx->clk_ipg); -clk_unprepare (spi_imx->clk_per); +clk_disable_unprepare (spi_imx->clk_ipg); +clk_disable_unprepare (spi_imx->clk_per);spi_imx_sdma_exit (spi_imx);spi_master_put (master);
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.80 release. There are 86 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 4 14:07:37 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.80-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.80 release. There are 86 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Sun Feb 4 14:07:37 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.80-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.
Results from Linaro’s test farm.
No regressions on arm64, arm and x86_64.
Regarding bpf, I ran the bpf kselftests manually on arm64 and arm32 and they both passed, but there are only four in 4.9:
- net/reuseport_bpf
- net/test_bpf.sh
- net/reuseport_bpf_cpu
- seccomp/seccomp_bpf
Summary
------------------------------------------------------------------------
kernel: 4.9.80-rc1
git repo:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.9.y
git commit: f905cfa204ed0785b72eace99942230b08b506bc git describe: v4.9.79-87-gf905cfa204ed
Test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-4.9-oe/build/v4.9.79-87-gf905cfa204ed
No regressions (compared to build v4.9.79-71-geba6f567f652)
Boards, architectures and test suites:
-------------------------------------
hi6220-hikey - arm64
* boot - pass: 20,
* kselftest - pass: 40, skip: 23,
* libhugetlbfs - pass: 90, skip: 1,
* ltp-cap_bounds-tests - pass: 2,
* ltp-containers-tests - pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - pass: 60,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - pass: 21, skip: 1,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - pass: 10,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - pass: 984, skip: 121,
* ltp-timers-tests - pass: 12,
juno-r2 - arm64
* boot - pass: 21,
* kselftest - pass: 41, skip: 22,
* libhugetlbfs - pass: 90, skip: 1,
* ltp-cap_bounds-tests - pass: 4,
* ltp-containers-tests - pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - pass: 60,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - pass: 22,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - pass: 10,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - pass: 987, skip: 121,
* ltp-timers-tests - pass: 12,
x15 - arm
* boot - pass: 20,
* kselftest - pass: 38, skip: 24,
* libhugetlbfs - pass: 87, skip: 1,
* ltp-cap_bounds-tests - pass: 2,
* ltp-containers-tests - pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - pass: 60,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - pass: 20, skip: 2,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - pass: 13, skip: 1,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - pass: 1038, skip: 66,
* ltp-timers-tests - pass: 12,
x86_64
* boot - pass: 20,
* kselftest - pass: 51, skip: 26,
* libhugetlbfs - pass: 90, skip: 1,
* ltp-cap_bounds-tests - pass: 2,
* ltp-containers-tests - pass: 64,
* ltp-fcntl-locktests-tests - pass: 2,
* ltp-filecaps-tests - pass: 2,
* ltp-fs-tests - pass: 61, skip: 1,
* ltp-fs_bind-tests - pass: 2,
* ltp-fs_perms_simple-tests - pass: 19,
* ltp-fsx-tests - pass: 2,
* ltp-hugetlb-tests - pass: 22,
* ltp-io-tests - pass: 3,
* ltp-ipc-tests - pass: 9,
* ltp-math-tests - pass: 11,
* ltp-nptl-tests - pass: 2,
* ltp-pty-tests - pass: 4,
* ltp-sched-tests - pass: 9, skip: 1,
* ltp-securebits-tests - pass: 4,
* ltp-syscalls-tests - pass: 1016, skip: 115,
* ltp-timers-tests - pass: 12,
--
Linaro QA (beta)
https://qa-reports.linaro.org
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.80 release. There are 86 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 4 14:07:37 UTC 2018. Anything received after that time might be too late.
Build results:
total: 145 pass: 145 fail: 0 Qemu test results: total: 126 pass: 126 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter