linux-stable/drivers
Alan Stern 17f673a986 USB: hub: Fix handling of connect changes during sleep
commit 9f952e2629 upstream.

Commit 8099f58f1e ("USB: hub: Don't record a connect-change event
during reset-resume") wasn't very well conceived.  The problem it
tried to fix was that if a connect-change event occurred while the
system was asleep (such as a device disconnecting itself from the bus
when it is suspended and then reconnecting when it resumes)
requiring a reset-resume during the system wakeup transition, the hub
port's change_bit entry would remain set afterward.  This would cause
the hub driver to believe another connect-change event had occurred
after the reset-resume, which was wrong and would lead the driver to
send unnecessary requests to the device (which could interfere with a
firmware update).

The commit tried to fix this by not setting the change_bit during the
wakeup.  But this was the wrong thing to do; it means that when a
device is unplugged while the system is asleep, the hub driver doesn't
realize anything has happened: The change_bit flag which would tell it
to handle the disconnect event is clear.

The commit needs to be reverted and the problem fixed in a different
way.  Fortunately an alternative solution was noted in the commit's
Changelog: We can continue to set the change_bit entry in
hub_activate() but then clear it when a reset-resume occurs.  That way
the the hub driver will see the change_bit when a device is
disconnected but won't see it when the device is still present.

That's what this patch does.

Reported-and-tested-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Fixes: 8099f58f1e ("USB: hub: Don't record a connect-change event during reset-resume")
Tested-by: Paul Zimmerman <pauldzim@gmail.com>
CC: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.2004221602480.11262-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 17:24:21 +02:00
..
accessibility
acpi x86: ACPI: fix CPU hotplug deadlock 2020-04-24 08:01:20 +02:00
amba
android binder: Handle start==NULL in binder_update_page_range() 2019-12-17 20:38:57 +01:00
ata libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set 2020-04-24 08:00:45 +02:00
atm fore200e: Fix incorrect checks of NULL pointer dereference 2020-02-28 16:36:00 +01:00
auxdisplay
base arch_topology: Fix section miss match warning due to free_raw_capacity() 2020-04-24 08:01:03 +02:00
bcma bcma: fix incorrect update of BCMA_CORE_PCI_MDIO_DATA 2020-01-27 14:46:45 +01:00
block rbd: call rbd_dev_unprobe() after unwatching and flushing notifies 2020-04-24 08:01:16 +02:00
bluetooth Bluetooth: btusb: fix PM leak in error case of setup 2020-01-09 10:17:57 +01:00
bus bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads 2020-04-24 08:00:23 +02:00
cdrom cdrom: respect device capabilities during opening action 2020-01-04 13:59:52 +01:00
char ipmi: fix hung processes in __get_guid() 2020-04-24 08:00:50 +02:00
clk clk: tegra: Fix Tegra PMC clock out parents 2020-04-24 08:01:18 +02:00
clocksource clocksource/drivers/bcm2835_timer: Fix memory leak of timer 2020-02-28 16:35:57 +01:00
connector
cpufreq cpufreq: powernv: Fix use-after-free 2020-04-24 08:00:45 +02:00
cpuidle cpuidle: Do not unset the driver if it is there already 2019-12-17 20:39:33 +01:00
crypto crypto: mxs-dcp - make symbols 'sha1_null_hash' and 'sha256_null_hash' static 2020-05-02 17:24:12 +02:00
dax
dca
devfreq Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs" 2020-03-11 18:02:50 +01:00
dio
dma dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() 2020-03-11 18:03:08 +01:00
dma-buf dma-buf: Fix memory leak in sync_file_merge() 2019-12-21 10:47:50 +01:00
edac EDAC/amd64: Set grain per DIMM 2020-03-11 18:02:56 +01:00
eisa
extcon extcon: sm5502: Reset registers during initialization 2019-12-31 12:37:06 +01:00
firewire net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:17:59 +01:00
firmware efi/x86: Ignore the memory attributes table on i386 2020-04-24 08:00:28 +02:00
fmc
fpga
fsi fsi: core: Fix small accesses and unaligned offsets via sysfs 2019-12-31 12:37:35 +01:00
gpio Revert "gpio: set up initial state from .get_direction()" 2020-04-24 08:01:02 +02:00
gpu drm/msm: Use the correct dma_sync calls harder 2020-05-02 17:24:12 +02:00
hid HID: i2c-hid: add Trekstor Surfbook E11B to descriptor override 2020-03-20 10:54:23 +01:00
hsi
hv hv_balloon: Balloon up according to request page number 2020-02-14 16:32:12 -05:00
hwmon hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() 2020-03-11 18:03:08 +01:00
hwspinlock
hwtracing intel_th: pci: Add Elkhart Lake CPU support 2020-04-02 16:34:18 +02:00
i2c i2c: st: fix missing struct parameter description 2020-04-24 08:00:25 +02:00
ide ide: serverworks: potential overflow in svwks_set_pio_mode() 2020-02-28 16:36:05 +01:00
idle
iio iio: xilinx-xadc: Fix sequencer configuration for aux channels in simultaneous mode 2020-05-02 17:24:20 +02:00
infiniband RDMA/cm: Update num_paths in cma_resolve_iboe_route error flow 2020-04-13 10:34:36 +02:00
input Input: i8042 - add Acer Aspire 5738z to nomux list 2020-04-24 08:00:44 +02:00
iommu iommu/amd: Fix the configuration of GCR3 table root pointer 2020-04-24 08:01:22 +02:00
ipack
irqchip irqchip/mbigen: Free msi_desc on device teardown 2020-04-24 08:01:01 +02:00
isdn staging: gigaset: add endpoint-type sanity check 2019-12-17 20:39:06 +01:00
leds leds: pca963x: Fix open-drain initialization 2020-02-28 16:35:55 +01:00
lightnvm lightnvm: pblk: fix lock order in pblk_rb_tear_down_check 2020-01-27 14:46:32 +01:00
macintosh
mailbox
mcb
md dm flakey: check for null arg_name in parse_features() 2020-04-24 08:00:57 +02:00
media media: ti-vpe: cal: fix disable_irqs to only the intended target 2020-04-24 08:00:35 +02:00
memory
memstick
message scsi: mptfusion: Fix double fetch bug in ioctl 2020-01-23 08:20:31 +01:00
mfd mfd: dln2: Fix sanity checking for endpoints 2020-04-24 08:00:52 +02:00
misc misc: echo: Remove unnecessary parentheses and simplify check for zero 2020-04-24 08:00:51 +02:00
mmc mmc: sdhci-of-at91: fix cd-gpios for SAMA5D2 2020-04-02 16:34:18 +02:00
mtd mtd: phram: fix a double free issue in error path 2020-04-24 08:01:24 +02:00
mux
net vrf: Check skb for XFRM_TRANSFORMED flag 2020-05-02 17:24:18 +02:00
nfc NFC: fdp: Fix a signedness bug in fdp_nci_send_patch() 2020-04-02 16:34:25 +02:00
ntb NTB: ntb_hw_idt: replace IS_ERR_OR_NULL with regular NULL checks 2020-01-27 14:46:05 +01:00
nubus
nvdimm libnvdimm: Out of bounds read in __nd_ioctl() 2020-04-24 08:01:22 +02:00
nvme nvme-fc: Revert "add module to ops template to allow module references" 2020-04-24 08:00:36 +02:00
nvmem nvmem: imx-ocotp: Ensure WAIT bits are preserved when setting timing 2020-01-27 14:46:39 +01:00
of of: unittest: kmemleak in of_unittest_platform_populate() 2020-04-24 08:01:17 +02:00
oprofile
parisc
parport parport: load lowlevel driver if ports not found 2019-12-31 12:37:39 +01:00
pci PCI/ASPM: Allow re-enabling Clock PM 2020-05-02 17:24:15 +02:00
pcmcia
perf drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer 2020-04-02 16:34:14 +02:00
phy phy: qualcomm: Adjust indentation in read_poll_timeout 2020-02-14 16:32:17 -05:00
pinctrl pinctrl: core: Remove extra kref_get which blocks hogs being freed 2020-03-20 10:54:18 +01:00
platform platform/x86: pmc_atom: Add Lex 2I385SW to critclk_systems DMI table 2020-04-02 16:34:37 +02:00
pnp
power power: supply: bq27xxx_battery: Silence deferred-probe error 2020-04-24 08:01:18 +02:00
powercap
pps
ps3
ptp ptp: free ptp device pin descriptors properly 2020-01-23 08:20:35 +01:00
pwm pwm: bcm2835: Dynamically allocate base 2020-05-02 17:24:15 +02:00
rapidio drivers/rapidio/rio_cm.c: fix potential oops in riocm_ch_listen() 2020-01-27 14:46:25 +01:00
ras
regulator regulator: rk808: Lower log level on optional GPIOs being not available 2020-02-28 16:35:59 +01:00
remoteproc remoteproc: Initialize rproc_class before use 2020-02-28 16:36:06 +01:00
reset
rpmsg rpmsg: glink: smem: Ensure ordering during tx 2020-04-24 08:01:06 +02:00
rtc rtc: 88pm860x: fix possible race condition 2020-04-24 08:01:18 +02:00
s390 s390/cio: avoid duplicated 'ADD' uevents 2020-05-02 17:24:14 +02:00
sbus
scsi scsi: iscsi: Report unbind session event when the target has been removed 2020-05-02 17:24:13 +02:00
sfi
sh
sn
soc soc: imx: gpc: fix power up sequencing 2020-04-24 08:01:18 +02:00
spi spi/zynqmp: remove entry that causes a cs glitch 2020-04-02 16:34:13 +02:00
spmi
ssb
staging staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback 2020-04-02 16:34:35 +02:00
target scsi: target: fix hang when multiple threads try to destroy the same iscsi session 2020-04-24 08:00:58 +02:00
tc
tee tee: optee: Fix compilation issue with nommu 2020-02-05 14:18:24 +00:00
thermal thermal: cpu_cooling: Actually trace CPU load in thermal_power_cpu_get_power 2020-01-27 14:46:34 +01:00
thunderbolt thunderbolt: Prevent crash if non-active NVMem file is read 2020-02-28 16:36:09 +01:00
tty tty: evh_bytechan: Fix out of bounds accesses 2020-04-24 08:01:23 +02:00
uio uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol() 2020-02-28 16:35:57 +01:00
usb USB: hub: Fix handling of connect changes during sleep 2020-05-02 17:24:21 +02:00
uwb
vfio vfio/mdev: Fix aborting mdev child device removal if one fails 2020-01-27 14:46:33 +01:00
vhost vhost: Check docket sk_family instead of call getname 2020-03-11 18:02:56 +01:00
video fbdev: potential information leak in do_fb_ioctl() 2020-04-24 08:01:23 +02:00
virt
virtio virtio_balloon: prevent pfn array overflow 2020-02-28 16:36:09 +01:00
vlynq
vme vme: bridges: reduce stack usage 2020-02-28 16:36:04 +01:00
w1
watchdog watchdog: reset last_hw_keepalive time at start 2020-05-02 17:24:12 +02:00
xen xenbus: req->err should be updated before req->state 2020-04-02 16:34:15 +02:00
zorro
Kconfig
Makefile