Re: [PATCH v7 2/5] USB: use genalloc for USB HCs with local memory

From: Greg KH
Date: Wed May 29 2019 - 06:42:05 EST


On Wed, May 29, 2019 at 01:28:40PM +0300, laurentiu.tudor@xxxxxxx wrote:
> From: Laurentiu Tudor <laurentiu.tudor@xxxxxxx>
>
> 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. 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.
> For sh arch to compile GENERIC_ALLOCATOR needs to be selected in
> Kconfig.
>
> For context, see thread here: https://lkml.org/lkml/2019/4/22/357
>
> Signed-off-by: Laurentiu Tudor <laurentiu.tudor@xxxxxxx>
> Signed-off-by: Fredrik Noring <noring@xxxxxxxxxx>
> Tested-by: Fredrik Noring <noring@xxxxxxxxxx>
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>
> ---
> drivers/usb/Kconfig | 1 +
> drivers/usb/core/buffer.c | 9 +++++++++
> drivers/usb/core/hcd.c | 36 ++++++++++++++++++++++++++++++++++++
> drivers/usb/host/ohci-hcd.c | 23 ++++++++++++++++++-----
> drivers/usb/host/ohci-mem.c | 35 +++++++++++++++++++++++++++++++----
> drivers/usb/host/ohci.h | 2 ++
> include/linux/usb/hcd.h | 5 +++++
> 7 files changed, 102 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
> index e4b27413f528..389c57d8eba7 100644
> --- a/drivers/usb/Kconfig
> +++ b/drivers/usb/Kconfig
> @@ -45,6 +45,7 @@ config USB_ARCH_HAS_HCD
> config USB
> tristate "Support for Host-side USB"
> depends on USB_ARCH_HAS_HCD
> + select GENERIC_ALLOCATOR

Are there any arches that does not have GENERIC_ALLOCATOR? I don't want
to suddenly cut off a bunch of working systems from having USB support.

thanks,

greg k-h