linux/drivers/usb
Yoshihiro Shimoda b2357839c5 usb: renesas_usbhs: add a workaround for a race condition of workqueue
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>
2019-07-03 11:00:50 +03:00
..
atm USB: atm: ueagle-atm.c: remove redundant license text 2019-06-03 15:21:57 +02:00
c67x00 USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
cdns3 usb:cdns3 Fix for stuck packets in on-chip OUT buffer. 2019-07-03 10:46:07 +03:00
chipidea usb: chipidea: msm: get optional clock by devm_clk_get_optional() 2019-04-19 14:24:26 +02:00
class usb: cdc-wdm: remove redundant assignment to rv 2019-06-03 15:21:56 +02:00
common USB: move usb debugfs directory creation to the usb common core 2019-06-06 08:59:19 +02:00
core Merge 5.2-rc5 into usb-next 2019-06-17 11:23:24 +02:00
dwc2 usb: dwc2: use a longer AHB idle timeout in dwc2_core_reset() 2019-07-03 10:59:22 +03:00
dwc3 usb:gadget Separated decoding functions from dwc3 driver. 2019-07-03 10:45:58 +03:00
early drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
gadget usb: gadget: udc: renesas_usb3: remove redundant assignment to ret 2019-07-03 11:00:36 +03:00
host usb: host: u132-hcd: remove unneeded variable frame 2019-06-06 08:59:19 +02:00
image USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
isp1760 usb: isp1760-hcd: Fix fall-through annotations 2019-05-01 18:13:52 +02:00
misc USB: sisusbvga: Remove unneeded variable 2019-06-10 18:03:09 +02:00
mon USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
mtu3 Revert "usb: mtu3: fix up undefined reference to usb_debug_root" 2019-06-10 19:43:57 +02:00
musb usb: musb: dsps: Use dev_get_drvdata() 2019-04-30 17:55:08 +02:00
phy usb: phy: phy-mxs-usb: add imx7ulp support 2019-07-03 10:56:19 +03:00
renesas_usbhs usb: renesas_usbhs: add a workaround for a race condition of workqueue 2019-07-03 11:00:50 +03:00
roles usb: roles: Find the muxes by also matching against the device node 2019-02-14 10:52:25 +01:00
serial USB: serial: option: add Telit 0x1260 and 0x1261 compositions 2019-05-21 11:27:24 +02:00
storage USB: usb-storage: Add new ID to ums-realtek 2019-06-05 11:52:42 +02:00
typec Merge 5.2-rc5 into usb-next 2019-06-17 11:23:24 +02:00
usbip usbip: Replace unused kvec array with single variable in vhci_send_cmd_unlink() 2019-06-05 11:54:38 +02:00
wusbcore wusb: Remove unnecessary static function ckhdid_printf 2019-03-01 20:53:41 +01:00
Kconfig usb:cdns3 Add Cadence USB3 DRD Driver 2019-07-03 10:46:05 +03:00
Makefile usb:cdns3 Add Cadence USB3 DRD Driver 2019-07-03 10:46:05 +03:00
usb-skeleton.c usb: usb-skeleton: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00