USB: use genalloc for USB HCs with local memory
authorLaurentiu Tudor <laurentiu.tudor@nxp.com>
Wed, 29 May 2019 10:28:40 +0000 (13:28 +0300)
committerChristoph Hellwig <hch@lst.de>
Mon, 3 Jun 2019 14:00:07 +0000 (16:00 +0200)
commitb0310c2f09bbe8aebefb97ed67949a3a7092aca6
treea0c1be9e4cf413c4bafcd77e95a84830e0f21dcd
parentda83a722959a82733c3ca60030cc364ca2318c5a
USB: use genalloc for USB HCs with local memory

For HCs that have local memory, replace the current DMA API usage with
a genalloc generic allocator to manage the mappings for these devices.
To help users, introduce a new HCD API, usb_hcd_setup_local_mem() that
will setup up the genalloc backing up the device local memory. It will
be used in subsequent patches.  This is in preparation for dropping
the existing "coherent" dma mem declaration APIs.  The current
implementation was relying on a short circuit in the DMA API that in
the end, was acting as an allocator for these type of devices.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Tested-by: Fredrik Noring <noring@nocrew.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/usb/Kconfig
drivers/usb/core/buffer.c
drivers/usb/core/hcd.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-mem.c
drivers/usb/host/ohci.h
include/linux/usb/hcd.h