Re: [PATCH 3/3] USB: host: Introduce flag to enable use of 64-bit dma_mask for ehci-platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2014-11-13 13:36 GMT-08:00 Andreas Herrmann
<andreas.herrmann@xxxxxxxxxxxxxxxxxx>:
> ehci-octeon driver used a 64-bit dma_mask. With removal of ehci-octeon
> and usage of ehci-platform ehci dma_mask is now limited to 32 bits
> (coerced in ehci_platform_probe).
>
> Provide a flag in ehci platform data to allow use of 64 bits for
> dma_mask.

Why not just allow enforcing an arbitrary DMA mask?

>
> Cc: David Daney <david.daney@xxxxxxxxxx>
> Cc: Alex Smith <alex.smith@xxxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Andreas Herrmann <andreas.herrmann@xxxxxxxxxxxxxxxxxx>
> ---
>  arch/mips/cavium-octeon/octeon-platform.c |    4 +---
>  drivers/usb/host/ehci-platform.c          |    3 ++-
>  include/linux/usb/ehci_pdriver.h          |    1 +
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
> index eea60b6..12410a2 100644
> --- a/arch/mips/cavium-octeon/octeon-platform.c
> +++ b/arch/mips/cavium-octeon/octeon-platform.c
> @@ -310,6 +310,7 @@ static struct usb_ehci_pdata octeon_ehci_pdata = {
>  #ifdef __BIG_ENDIAN
>         .big_endian_mmio        = 1,
>  #endif
> +       .dma_mask_64    = 1,
>         .power_on       = octeon_ehci_power_on,
>         .power_off      = octeon_ehci_power_off,
>  };
> @@ -331,8 +332,6 @@ static void __init octeon_ehci_hw_start(struct device *dev)
>         octeon2_usb_clocks_stop();
>  }
>
> -static u64 octeon_ehci_dma_mask = DMA_BIT_MASK(64);
> -
>  static int __init octeon_ehci_device_init(void)
>  {
>         struct platform_device *pd;
> @@ -347,7 +346,6 @@ static int __init octeon_ehci_device_init(void)
>         if (!pd)
>                 return 0;
>
> -       pd->dev.dma_mask = &octeon_ehci_dma_mask;
>         pd->dev.platform_data = &octeon_ehci_pdata;
>         octeon_ehci_hw_start(&pd->dev);
>
> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> index 2da18ea..6df808b 100644
> --- a/drivers/usb/host/ehci-platform.c
> +++ b/drivers/usb/host/ehci-platform.c
> @@ -155,7 +155,8 @@ static int ehci_platform_probe(struct platform_device *dev)
>         if (!pdata)
>                 pdata = &ehci_platform_defaults;
>
> -       err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
> +       err = dma_coerce_mask_and_coherent(&dev->dev,
> +               pdata->dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32));
>         if (err)
>                 return err;
>
> diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h
> index 7eb4dcd..f69529e 100644
> --- a/include/linux/usb/ehci_pdriver.h
> +++ b/include/linux/usb/ehci_pdriver.h
> @@ -45,6 +45,7 @@ struct usb_ehci_pdata {
>         unsigned        big_endian_desc:1;
>         unsigned        big_endian_mmio:1;
>         unsigned        no_io_watchdog:1;
> +       unsigned        dma_mask_64:1;
>
>         /* Turn on all power and clocks */
>         int (*power_on)(struct platform_device *pdev);
> --
> 1.7.9.5
>
>



-- 
Florian





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux