linux_dsm_epyc7002/drivers/usb/core
Fredrik Noring f8c63edfd7 USB: Fix incorrect DMA allocations for local memory pool drivers
Fix commit 7b81cb6bdd ("usb: add a HCD_DMA flag instead of
guestimating DMA capabilities") where local memory USB drivers
erroneously allocate DMA memory instead of pool memory, causing

	OHCI Unrecoverable Error, disabled
	HC died; cleaning up

The order between hcd_uses_dma() and hcd->localmem_pool is now
arranged as in hcd_buffer_alloc() and hcd_buffer_free(), with the
test for hcd->localmem_pool placed first.

As an alternative, one might consider adjusting hcd_uses_dma() with

 static inline bool hcd_uses_dma(struct usb_hcd *hcd)
 {
-	return IS_ENABLED(CONFIG_HAS_DMA) && (hcd->driver->flags & HCD_DMA);
+	return IS_ENABLED(CONFIG_HAS_DMA) &&
+		(hcd->driver->flags & HCD_DMA) &&
+		(hcd->localmem_pool == NULL);
 }

One can also consider unsetting HCD_DMA for local memory pool drivers.

Fixes: 7b81cb6bdd ("usb: add a HCD_DMA flag instead of guestimating DMA capabilities")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Link: https://lore.kernel.org/r/20191210172905.GA52526@sx9
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-11 09:06:41 +01:00
..
buffer.c
config.c
devices.c
devio.c compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
driver.c
endpoint.c
file.c
generic.c
hcd-pci.c
hcd.c USB: Fix incorrect DMA allocations for local memory pool drivers 2019-12-11 09:06:41 +01:00
hub.c usb, kcov: collect coverage from hub_event 2019-12-04 19:44:14 -08:00
hub.h
Kconfig
ledtrig-usbport.c
Makefile
message.c
notify.c
of.c
otg_whitelist.h
phy.c
phy.h
port.c
quirks.c
sysfs.c
urb.c usb: core: urb: fix URB structure initialization function 2019-12-10 11:41:19 +01:00
usb-acpi.c
usb.c
usb.h