aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2013-05-07 18:53:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-16 20:30:52 -0400
commit3b9561e9d9b88eca9d4ed6aab025dec2eeeed501 (patch)
tree6ac9d662f3b7c4ee4411d4fc5103f1226430740a
parent8ff10bdb14a52e3f25d4ce09e0582a8684c1a6db (diff)
USB: set device dma_mask without reference to global data
Many USB host drivers contain code such as: if (!pdev->dev.dma_mask) pdev->dev.dma_mask = &tegra_ehci_dma_mask; ... where tegra_ehci_dma_mask is a global. I suspect this code originated in commit 4a53f4e "USB: ehci-tegra: add probing through device tree" and was simply copied everywhere else. This works fine when the code is built-in, but can cause a crash when the code is in a module. The first module load sets up the dma_mask pointer, but if the module is removed and re-inserted, the value is now non-NULL, and hence is not updated to point at the new location, and hence points at a stale location within the previous module load address, which in turn causes a crash if the pointer is de-referenced. The simplest way of solving this seems to be to copy the code from ehci-platform.c, which uses the coherent_dma_mask as the target for the dma_mask pointer. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/chipidea/ci13xxx_imx.c15
-rw-r--r--drivers/usb/dwc3/dwc3-exynos.c6
-rw-r--r--drivers/usb/host/ehci-atmel.c6
-rw-r--r--drivers/usb/host/ehci-omap.c8
-rw-r--r--drivers/usb/host/ehci-orion.c6
-rw-r--r--drivers/usb/host/ehci-s5p.c4
-rw-r--r--drivers/usb/host/ehci-spear.c6
-rw-r--r--drivers/usb/host/ehci-tegra.c6
-rw-r--r--drivers/usb/host/ohci-at91.c6
-rw-r--r--drivers/usb/host/ohci-exynos.c4
-rw-r--r--drivers/usb/host/ohci-omap3.c8
-rw-r--r--drivers/usb/host/ohci-pxa27x.c6
-rw-r--r--drivers/usb/host/ohci-spear.c6
-rw-r--r--drivers/usb/host/uhci-platform.c6
14 files changed, 41 insertions, 52 deletions
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 8faec9dbbb84..73f9d5f15adb 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -173,17 +173,10 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
173 173
174 ci13xxx_imx_platdata.phy = data->phy; 174 ci13xxx_imx_platdata.phy = data->phy;
175 175
176 if (!pdev->dev.dma_mask) { 176 if (!pdev->dev.dma_mask)
177 pdev->dev.dma_mask = devm_kzalloc(&pdev->dev, 177 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
178 sizeof(*pdev->dev.dma_mask), GFP_KERNEL); 178 if (!pdev->dev.coherent_dma_mask)
179 if (!pdev->dev.dma_mask) { 179 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
180 ret = -ENOMEM;
181 dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
182 goto err;
183 }
184 *pdev->dev.dma_mask = DMA_BIT_MASK(32);
185 dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
186 }
187 180
188 if (usbmisc_ops && usbmisc_ops->init) { 181 if (usbmisc_ops && usbmisc_ops->init) {
189 ret = usbmisc_ops->init(&pdev->dev); 182 ret = usbmisc_ops->init(&pdev->dev);
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index a8afe6e26621..929e7dd6e58b 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -95,8 +95,6 @@ static int dwc3_exynos_remove_child(struct device *dev, void *unused)
95 return 0; 95 return 0;
96} 96}
97 97
98static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
99
100static int dwc3_exynos_probe(struct platform_device *pdev) 98static int dwc3_exynos_probe(struct platform_device *pdev)
101{ 99{
102 struct dwc3_exynos *exynos; 100 struct dwc3_exynos *exynos;
@@ -118,7 +116,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
118 * Once we move to full device tree support this will vanish off. 116 * Once we move to full device tree support this will vanish off.
119 */ 117 */
120 if (!dev->dma_mask) 118 if (!dev->dma_mask)
121 dev->dma_mask = &dwc3_exynos_dma_mask; 119 dev->dma_mask = &dev->coherent_dma_mask;
120 if (!dev->coherent_dma_mask)
121 dev->coherent_dma_mask = DMA_BIT_MASK(32);
122 122
123 platform_set_drvdata(pdev, exynos); 123 platform_set_drvdata(pdev, exynos);
124 124
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 66420097c242..02f4611faa62 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -63,8 +63,6 @@ static void atmel_stop_ehci(struct platform_device *pdev)
63 63
64/*-------------------------------------------------------------------------*/ 64/*-------------------------------------------------------------------------*/
65 65
66static u64 at91_ehci_dma_mask = DMA_BIT_MASK(32);
67
68static int ehci_atmel_drv_probe(struct platform_device *pdev) 66static int ehci_atmel_drv_probe(struct platform_device *pdev)
69{ 67{
70 struct usb_hcd *hcd; 68 struct usb_hcd *hcd;
@@ -93,7 +91,9 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
93 * Once we have dma capability bindings this can go away. 91 * Once we have dma capability bindings this can go away.
94 */ 92 */
95 if (!pdev->dev.dma_mask) 93 if (!pdev->dev.dma_mask)
96 pdev->dev.dma_mask = &at91_ehci_dma_mask; 94 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
95 if (!pdev->dev.coherent_dma_mask)
96 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
97 97
98 hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); 98 hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
99 if (!hcd) { 99 if (!hcd) {
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 3d1491b5f360..16d7150e8557 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -90,8 +90,6 @@ static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {
90 .extra_priv_size = sizeof(struct omap_hcd), 90 .extra_priv_size = sizeof(struct omap_hcd),
91}; 91};
92 92
93static u64 omap_ehci_dma_mask = DMA_BIT_MASK(32);
94
95/** 93/**
96 * ehci_hcd_omap_probe - initialize TI-based HCDs 94 * ehci_hcd_omap_probe - initialize TI-based HCDs
97 * 95 *
@@ -146,8 +144,10 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
146 * Since shared usb code relies on it, set it here for now. 144 * Since shared usb code relies on it, set it here for now.
147 * Once we have dma capability bindings this can go away. 145 * Once we have dma capability bindings this can go away.
148 */ 146 */
149 if (!pdev->dev.dma_mask) 147 if (!dev->dma_mask)
150 pdev->dev.dma_mask = &omap_ehci_dma_mask; 148 dev->dma_mask = &dev->coherent_dma_mask;
149 if (!dev->coherent_dma_mask)
150 dev->coherent_dma_mask = DMA_BIT_MASK(32);
151 151
152 hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, 152 hcd = usb_create_hcd(&ehci_omap_hc_driver, dev,
153 dev_name(dev)); 153 dev_name(dev));
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 54c579485150..efbc588b48c5 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -137,8 +137,6 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
137 } 137 }
138} 138}
139 139
140static u64 ehci_orion_dma_mask = DMA_BIT_MASK(32);
141
142static int ehci_orion_drv_probe(struct platform_device *pdev) 140static int ehci_orion_drv_probe(struct platform_device *pdev)
143{ 141{
144 struct orion_ehci_data *pd = pdev->dev.platform_data; 142 struct orion_ehci_data *pd = pdev->dev.platform_data;
@@ -183,7 +181,9 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
183 * now. Once we have dma capability bindings this can go away. 181 * now. Once we have dma capability bindings this can go away.
184 */ 182 */
185 if (!pdev->dev.dma_mask) 183 if (!pdev->dev.dma_mask)
186 pdev->dev.dma_mask = &ehci_orion_dma_mask; 184 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
185 if (!pdev->dev.coherent_dma_mask)
186 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
187 187
188 if (!request_mem_region(res->start, resource_size(res), 188 if (!request_mem_region(res->start, resource_size(res),
189 ehci_orion_hc_driver.description)) { 189 ehci_orion_hc_driver.description)) {
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 635775278c7f..a81465ed48db 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -71,8 +71,6 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev)
71 dev_err(dev, "can't request ehci vbus gpio %d", gpio); 71 dev_err(dev, "can't request ehci vbus gpio %d", gpio);
72} 72}
73 73
74static u64 ehci_s5p_dma_mask = DMA_BIT_MASK(32);
75
76static int s5p_ehci_probe(struct platform_device *pdev) 74static int s5p_ehci_probe(struct platform_device *pdev)
77{ 75{
78 struct s5p_ehci_platdata *pdata = pdev->dev.platform_data; 76 struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
@@ -90,7 +88,7 @@ static int s5p_ehci_probe(struct platform_device *pdev)
90 * Once we move to full device tree support this will vanish off. 88 * Once we move to full device tree support this will vanish off.
91 */ 89 */
92 if (!pdev->dev.dma_mask) 90 if (!pdev->dev.dma_mask)
93 pdev->dev.dma_mask = &ehci_s5p_dma_mask; 91 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
94 if (!pdev->dev.coherent_dma_mask) 92 if (!pdev->dev.coherent_dma_mask)
95 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 93 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
96 94
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
index 61ecfb3d52f5..bd3e5cbc6240 100644
--- a/drivers/usb/host/ehci-spear.c
+++ b/drivers/usb/host/ehci-spear.c
@@ -58,8 +58,6 @@ static int ehci_spear_drv_resume(struct device *dev)
58static SIMPLE_DEV_PM_OPS(ehci_spear_pm_ops, ehci_spear_drv_suspend, 58static SIMPLE_DEV_PM_OPS(ehci_spear_pm_ops, ehci_spear_drv_suspend,
59 ehci_spear_drv_resume); 59 ehci_spear_drv_resume);
60 60
61static u64 spear_ehci_dma_mask = DMA_BIT_MASK(32);
62
63static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) 61static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
64{ 62{
65 struct usb_hcd *hcd ; 63 struct usb_hcd *hcd ;
@@ -84,7 +82,9 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
84 * Once we have dma capability bindings this can go away. 82 * Once we have dma capability bindings this can go away.
85 */ 83 */
86 if (!pdev->dev.dma_mask) 84 if (!pdev->dev.dma_mask)
87 pdev->dev.dma_mask = &spear_ehci_dma_mask; 85 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
86 if (!pdev->dev.coherent_dma_mask)
87 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
88 88
89 usbh_clk = devm_clk_get(&pdev->dev, NULL); 89 usbh_clk = devm_clk_get(&pdev->dev, NULL);
90 if (IS_ERR(usbh_clk)) { 90 if (IS_ERR(usbh_clk)) {
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index e3eddc31ac83..59d111bf44a9 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -637,8 +637,6 @@ static void tegra_ehci_set_phcd(struct usb_phy *x, bool enable)
637 writel(val, base + TEGRA_USB_PORTSC1); 637 writel(val, base + TEGRA_USB_PORTSC1);
638} 638}
639 639
640static u64 tegra_ehci_dma_mask = DMA_BIT_MASK(32);
641
642static int tegra_ehci_probe(struct platform_device *pdev) 640static int tegra_ehci_probe(struct platform_device *pdev)
643{ 641{
644 struct resource *res; 642 struct resource *res;
@@ -661,7 +659,9 @@ static int tegra_ehci_probe(struct platform_device *pdev)
661 * Once we have dma capability bindings this can go away. 659 * Once we have dma capability bindings this can go away.
662 */ 660 */
663 if (!pdev->dev.dma_mask) 661 if (!pdev->dev.dma_mask)
664 pdev->dev.dma_mask = &tegra_ehci_dma_mask; 662 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
663 if (!pdev->dev.coherent_dma_mask)
664 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
665 665
666 setup_vbus_gpio(pdev, pdata); 666 setup_vbus_gpio(pdev, pdata);
667 667
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index a0cb44f0e724..2ee1496dbc1d 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -504,8 +504,6 @@ static const struct of_device_id at91_ohci_dt_ids[] = {
504 504
505MODULE_DEVICE_TABLE(of, at91_ohci_dt_ids); 505MODULE_DEVICE_TABLE(of, at91_ohci_dt_ids);
506 506
507static u64 at91_ohci_dma_mask = DMA_BIT_MASK(32);
508
509static int ohci_at91_of_init(struct platform_device *pdev) 507static int ohci_at91_of_init(struct platform_device *pdev)
510{ 508{
511 struct device_node *np = pdev->dev.of_node; 509 struct device_node *np = pdev->dev.of_node;
@@ -522,7 +520,9 @@ static int ohci_at91_of_init(struct platform_device *pdev)
522 * Once we have dma capability bindings this can go away. 520 * Once we have dma capability bindings this can go away.
523 */ 521 */
524 if (!pdev->dev.dma_mask) 522 if (!pdev->dev.dma_mask)
525 pdev->dev.dma_mask = &at91_ohci_dma_mask; 523 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
524 if (!pdev->dev.coherent_dma_mask)
525 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
526 526
527 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 527 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
528 if (!pdata) 528 if (!pdata)
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 07592c00af26..b0b542c14e31 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -98,8 +98,6 @@ static const struct hc_driver exynos_ohci_hc_driver = {
98 .start_port_reset = ohci_start_port_reset, 98 .start_port_reset = ohci_start_port_reset,
99}; 99};
100 100
101static u64 ohci_exynos_dma_mask = DMA_BIT_MASK(32);
102
103static int exynos_ohci_probe(struct platform_device *pdev) 101static int exynos_ohci_probe(struct platform_device *pdev)
104{ 102{
105 struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data; 103 struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data;
@@ -117,7 +115,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
117 * Once we move to full device tree support this will vanish off. 115 * Once we move to full device tree support this will vanish off.
118 */ 116 */
119 if (!pdev->dev.dma_mask) 117 if (!pdev->dev.dma_mask)
120 pdev->dev.dma_mask = &ohci_exynos_dma_mask; 118 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
121 if (!pdev->dev.coherent_dma_mask) 119 if (!pdev->dev.coherent_dma_mask)
122 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 120 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
123 121
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index ddfc31427bc0..8663851c8d8e 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -114,8 +114,6 @@ static const struct hc_driver ohci_omap3_hc_driver = {
114 114
115/*-------------------------------------------------------------------------*/ 115/*-------------------------------------------------------------------------*/
116 116
117static u64 omap_ohci_dma_mask = DMA_BIT_MASK(32);
118
119/* 117/*
120 * configure so an HC device and id are always provided 118 * configure so an HC device and id are always provided
121 * always called with process context; sleeping is OK 119 * always called with process context; sleeping is OK
@@ -168,8 +166,10 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev)
168 * Since shared usb code relies on it, set it here for now. 166 * Since shared usb code relies on it, set it here for now.
169 * Once we have dma capability bindings this can go away. 167 * Once we have dma capability bindings this can go away.
170 */ 168 */
171 if (!pdev->dev.dma_mask) 169 if (!dev->dma_mask)
172 pdev->dev.dma_mask = &omap_ohci_dma_mask; 170 dev->dma_mask = &dev->coherent_dma_mask;
171 if (!dev->coherent_dma_mask)
172 dev->coherent_dma_mask = DMA_BIT_MASK(32);
173 173
174 hcd = usb_create_hcd(&ohci_omap3_hc_driver, dev, 174 hcd = usb_create_hcd(&ohci_omap3_hc_driver, dev,
175 dev_name(dev)); 175 dev_name(dev));
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index efe71f3ca477..279b2ef17411 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -282,8 +282,6 @@ static const struct of_device_id pxa_ohci_dt_ids[] = {
282 282
283MODULE_DEVICE_TABLE(of, pxa_ohci_dt_ids); 283MODULE_DEVICE_TABLE(of, pxa_ohci_dt_ids);
284 284
285static u64 pxa_ohci_dma_mask = DMA_BIT_MASK(32);
286
287static int ohci_pxa_of_init(struct platform_device *pdev) 285static int ohci_pxa_of_init(struct platform_device *pdev)
288{ 286{
289 struct device_node *np = pdev->dev.of_node; 287 struct device_node *np = pdev->dev.of_node;
@@ -298,7 +296,9 @@ static int ohci_pxa_of_init(struct platform_device *pdev)
298 * Once we have dma capability bindings this can go away. 296 * Once we have dma capability bindings this can go away.
299 */ 297 */
300 if (!pdev->dev.dma_mask) 298 if (!pdev->dev.dma_mask)
301 pdev->dev.dma_mask = &pxa_ohci_dma_mask; 299 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
300 if (!pdev->dev.coherent_dma_mask)
301 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
302 302
303 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 303 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
304 if (!pdata) 304 if (!pdata)
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index 9020bf0e2eca..3e19e0170d11 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -91,8 +91,6 @@ static const struct hc_driver ohci_spear_hc_driver = {
91 .start_port_reset = ohci_start_port_reset, 91 .start_port_reset = ohci_start_port_reset,
92}; 92};
93 93
94static u64 spear_ohci_dma_mask = DMA_BIT_MASK(32);
95
96static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) 94static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
97{ 95{
98 const struct hc_driver *driver = &ohci_spear_hc_driver; 96 const struct hc_driver *driver = &ohci_spear_hc_driver;
@@ -114,7 +112,9 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
114 * Once we have dma capability bindings this can go away. 112 * Once we have dma capability bindings this can go away.
115 */ 113 */
116 if (!pdev->dev.dma_mask) 114 if (!pdev->dev.dma_mask)
117 pdev->dev.dma_mask = &spear_ohci_dma_mask; 115 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
116 if (!pdev->dev.coherent_dma_mask)
117 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
118 118
119 usbh_clk = devm_clk_get(&pdev->dev, NULL); 119 usbh_clk = devm_clk_get(&pdev->dev, NULL);
120 if (IS_ERR(usbh_clk)) { 120 if (IS_ERR(usbh_clk)) {
diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c
index 8c4dace4b14a..f1db61ada6a8 100644
--- a/drivers/usb/host/uhci-platform.c
+++ b/drivers/usb/host/uhci-platform.c
@@ -60,8 +60,6 @@ static const struct hc_driver uhci_platform_hc_driver = {
60 .hub_control = uhci_hub_control, 60 .hub_control = uhci_hub_control,
61}; 61};
62 62
63static u64 platform_uhci_dma_mask = DMA_BIT_MASK(32);
64
65static int uhci_hcd_platform_probe(struct platform_device *pdev) 63static int uhci_hcd_platform_probe(struct platform_device *pdev)
66{ 64{
67 struct usb_hcd *hcd; 65 struct usb_hcd *hcd;
@@ -78,7 +76,9 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
78 * Once we have dma capability bindings this can go away. 76 * Once we have dma capability bindings this can go away.
79 */ 77 */
80 if (!pdev->dev.dma_mask) 78 if (!pdev->dev.dma_mask)
81 pdev->dev.dma_mask = &platform_uhci_dma_mask; 79 pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
80 if (!pdev->dev.coherent_dma_mask)
81 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
82 82
83 hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev, 83 hcd = usb_create_hcd(&uhci_platform_hc_driver, &pdev->dev,
84 pdev->name); 84 pdev->name);