Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: host: Introduce flag to enable use of 64-bit dma_mask for ehci-platform

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.

Cc: David Daney <david.daney@cavium.com>
Cc: Alex Smith <alex.smith@imgtec.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andreas Herrmann and committed by
Greg Kroah-Hartman
c99e76c5 a5790e9e

+4 -4
+1 -3
arch/mips/cavium-octeon/octeon-platform.c
··· 310 310 #ifdef __BIG_ENDIAN 311 311 .big_endian_mmio = 1, 312 312 #endif 313 + .dma_mask_64 = 1, 313 314 .power_on = octeon_ehci_power_on, 314 315 .power_off = octeon_ehci_power_off, 315 316 }; ··· 332 331 octeon2_usb_clocks_stop(); 333 332 } 334 333 335 - static u64 octeon_ehci_dma_mask = DMA_BIT_MASK(64); 336 - 337 334 static int __init octeon_ehci_device_init(void) 338 335 { 339 336 struct platform_device *pd; ··· 346 347 if (!pd) 347 348 return 0; 348 349 349 - pd->dev.dma_mask = &octeon_ehci_dma_mask; 350 350 pd->dev.platform_data = &octeon_ehci_pdata; 351 351 octeon_ehci_hw_start(&pd->dev); 352 352
+2 -1
drivers/usb/host/ehci-platform.c
··· 155 155 if (!pdata) 156 156 pdata = &ehci_platform_defaults; 157 157 158 - err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); 158 + err = dma_coerce_mask_and_coherent(&dev->dev, 159 + pdata->dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32)); 159 160 if (err) 160 161 return err; 161 162
+1
include/linux/usb/ehci_pdriver.h
··· 48 48 unsigned big_endian_mmio:1; 49 49 unsigned no_io_watchdog:1; 50 50 unsigned reset_on_resume:1; 51 + unsigned dma_mask_64:1; 51 52 52 53 /* Turn on all power and clocks */ 53 54 int (*power_on)(struct platform_device *pdev);