android_kernel_oneplus_msm8998/drivers
Yoshihiro Shimoda 2749aaa0da usb: renesas_usbhs: add a workaround for a race condition of workqueue
commit b2357839c56ab7d06bcd4e866ebc2d0e2b7997f3 upstream.

The old commit 6e4b74e469 ("usb: renesas: fix scheduling in atomic
context bug") fixed an atomic issue by using workqueue for the shdmac
dmaengine driver. However, this has a potential race condition issue
between the work pending and usbhsg_ep_free_request() in gadget mode.
When usbhsg_ep_free_request() is called while pending the queue,
since the work_struct will be freed and then the work handler is
called, kernel panic happens on process_one_work().

To fix the issue, if we could call cancel_work_sync() at somewhere
before the free request, it could be easy. However,
the usbhsg_ep_free_request() is called on atomic (e.g. f_ncm driver
calls free request via gether_disconnect()).

For now, almost all users are having "USB-DMAC" and the DMAengine
driver can be used on atomic. So, this patch adds a workaround for
a race condition to call the DMAengine APIs without the workqueue.

This means we still have TODO on shdmac environment (SH7724), but
since it doesn't have SMP, the race condition might not happen.

Fixes: ab330cf388 ("usb: renesas_usbhs: add support for USB-DMAC")
Cc: <stable@vger.kernel.org> # v4.1+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-21 09:07:11 +02:00
..
accessibility
acpi ACPI / SBS: Fix GPE storm on recent MacBookPro's 2019-04-27 09:33:58 +02:00
amba
android coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping 2019-06-22 08:18:27 +02:00
ata libata: Extend quirks for the ST1000LM024 drives with NOLPM quirk 2019-06-22 08:18:22 +02:00
atm
auxdisplay
base PM / core: Propagate dev->power.wakeup_path when no callbacks 2019-06-11 12:24:00 +02:00
bcma
block xsysace: Fix error handling in ace_setup 2019-05-16 19:45:02 +02:00
bluetooth
bus
cdrom cdrom: Fix race condition in cdrom_sysctl_register 2019-04-27 09:33:52 +02:00
char virtio_console: initialize vtermno value for ports 2019-06-11 12:24:04 +02:00
clk clk: rockchip: Turn on "aclk_dmac1" for suspend on rk3288 2019-06-22 08:18:20 +02:00
clocksource clocksource/drivers/exynos_mct: Clear timer interrupt when shutdown 2019-03-23 08:44:35 +01:00
connector
cpufreq cpufreq: pmac32: fix possible object reference leak 2019-06-11 12:24:01 +02:00
cpuidle
crypto Revert "crypto: crypto4xx - properly set IV after de- and encrypt" 2019-06-22 08:18:26 +02:00
dca
devfreq
dio
dma dmaengine: imx-sdma: remove BD_INTR for channel0 2019-07-10 09:56:44 +02:00
dma-buf
edac
eisa
extcon extcon: arizona: Disable mic detect if running when driver is removed 2019-06-11 12:24:01 +02:00
firewire
firmware efi: stub: define DISABLE_BRANCH_PROFILING for all architectures 2019-04-03 06:23:20 +02:00
fmc
fpga
gpio gpio: fix gpio-adp5588 build errors 2019-06-22 08:18:26 +02:00
gpu drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define() 2019-06-22 08:18:24 +02:00
hid HID: core: move Usage Page concatenation to Main item 2019-06-11 12:24:03 +02:00
hsi
hv
hwmon hwmon: (pmbus/core) Treat parameters as paged if on multiple pages 2019-07-10 09:56:33 +02:00
hwspinlock
hwtracing intel_th: msu: Fix single mode with IOMMU 2019-06-11 12:23:44 +02:00
i2c i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr 2019-06-22 08:18:26 +02:00
ide
idle
iio iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data 2019-06-11 12:24:02 +02:00
infiniband coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping 2019-06-22 08:18:27 +02:00
input Input: imx_keypad - make sure keyboard can always wake up system 2019-07-21 09:07:07 +02:00
iommu iommu/vt-d: Set intel_iommu_gfx_mapped correctly 2019-06-22 08:18:19 +02:00
ipack
irqchip
isdn mISDN: make sure device name is NUL terminated 2019-06-22 08:18:25 +02:00
leds leds: lp55xx: fix null deref on firmware load failure 2019-04-27 09:33:51 +02:00
lguest
lightnvm
macintosh
mailbox
mcb
md md: fix for divide error in status_resync 2019-07-21 09:07:08 +02:00
media media: uvcvideo: Fix uvc_alloc_entity() allocation alignment 2019-06-11 12:24:12 +02:00
memory memory: tegra: Fix integer overflow on tick value calculation 2019-06-11 12:23:46 +02:00
memstick
message
mfd mfd: omap-usb-tll: Fix register offsets 2019-07-10 09:56:41 +02:00
misc Drivers: misc: fix out-of-bounds access in function param_set_kgdbts_var 2019-06-22 08:18:23 +02:00
mmc mmc: sdhci-of-esdhc: add erratum eSDHC-A001 and A-008358 support 2019-06-11 12:24:00 +02:00
mtd
net mwifiex: Don't abort on small, spec-compliant vendor IEs 2019-07-21 09:07:10 +02:00
nfc
ntb
nubus
nvdimm libnvdimm/btt: Fix a kmemdup failure check 2019-05-16 19:45:05 +02:00
nvme
nvmem nvmem: core: fix read buffer in place 2019-06-22 08:18:20 +02:00
of
oprofile
parisc parisc: Use implicit space register selection for loading the coherence index of I/O pdirs 2019-06-11 12:24:13 +02:00
parport parport: Fix mem leak in parport_register_dev_model 2019-07-10 09:56:31 +02:00
pci PCI: xilinx: Check for __get_free_pages() failure 2019-06-22 08:18:21 +02:00
pcmcia
perf
phy
pinctrl pinctrl: pistachio: fix leaked of_node references 2019-06-11 12:23:57 +02:00
platform platform/chrome: cros_ec_proto: check for NULL transfer function 2019-06-22 08:18:20 +02:00
pnp
power power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG 2019-06-11 12:23:49 +02:00
powercap
pps
ps3
ptp
pwm pwm: Fix deadlock warning when removing PWM device 2019-06-22 08:18:21 +02:00
rapidio
ras
regulator regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting 2019-04-27 09:33:53 +02:00
remoteproc
reset
rpmsg
rtc rtc: 88pm860x: prevent use-after-free on device remove 2019-06-11 12:23:54 +02:00
s390 s390/qeth: fix VLAN attribute in bridge_hostnotify udev event 2019-07-10 09:56:32 +02:00
sbus
scsi scsi: hpsa: correct ioaccel2 chaining 2019-07-10 09:56:41 +02:00
sfi
sh
sn
soc soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher 2019-06-22 08:18:20 +02:00
spi spi: bitbang: Fix NULL pointer dereference in spi_unregister_master 2019-07-10 09:56:39 +02:00
spmi
ssb ssb: Fix possible NULL pointer dereference in ssb_host_pcmcia_exit 2019-06-11 12:23:53 +02:00
staging IB/hfi1: Insure freeze_work work_struct is canceled on shutdown 2019-07-10 09:56:32 +02:00
target scsi: target/iscsi: Avoid iscsit_release_commands_from_conn() deadlock 2019-03-23 08:44:35 +01:00
tc
thermal thermal/int340x_thermal: fix mode setting 2019-04-27 09:33:57 +02:00
thunderbolt
tty tty: rocket: fix incorrect forward declaration of 'rp_init()' 2019-07-10 09:56:44 +02:00
uio
usb usb: renesas_usbhs: add a workaround for a race condition of workqueue 2019-07-21 09:07:11 +02:00
uwb
vfio vfio/pci: use correct format characters 2019-05-16 19:45:01 +02:00
vhost
video video: imsttfb: fix potential NULL pointer dereferences 2019-06-22 08:18:21 +02:00
virt drivers/virt/fsl_hypervisor.c: prevent integer overflow in ioctl 2019-05-16 19:45:18 +02:00
virtio
vlynq
vme
w1 w1: fix the resume command API 2019-06-11 12:23:55 +02:00
watchdog
xen fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock 2019-06-11 12:24:13 +02:00
zorro
Kconfig
Makefile