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

Greg KH
2019-05-29T10:38:40Z

On Wed, May 29, 2019 at 01:28:40PM +0300, laurentiu.tudor@nxp.com wrote:
> From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
>
> 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@nxp.com>
> Signed-off-by: Fredrik Noring <noring@nocrew.org>
> Tested-by: Fredrik Noring <noring@nocrew.org>
> Reported-by: kbuild test robot <lkp@intel.com>
> ---
> 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