Skip to contentSkip to conversation

arm: device.h: Add dma_mask to pdev_archdata structure

PATCH New Fabio Estevam 5 participants 8 messages Nov 16, 2011 – Dec 21, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

Fix the following build error when doing a 'make mx3_defconfig'

CC [M] drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata' has no member named 'dma_mask' make[3]: *** [drivers/usb/host/fsl-mph-dr-of.o] Error 1
make[2]: *** [drivers/usb/host] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

---
 arch/arm/include/asm/device.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/include/asm/device.h +1 -0
index 7aa3680..6ec60f6 100644
@@ -21,6 +21,7 @@ struct pdev_archdata {
 #ifdef CONFIG_ARCH_OMAP
 	struct omap_device *od;
 #endif
+	u64 dma_mask;
 };
 
 #endif
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

Quoted 9 lines · Fabio Estevam

Fix the following build error when doing a 'make mx3_defconfig'

CC [M] drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata' has no member named 'dma_mask' make[3]: *** [drivers/usb/host/fsl-mph-dr-of.o] Error 1
make[2]: *** [drivers/usb/host] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

Why is this required for just MX3? Why should we take the hit of adding this (needlessly) for the other sub-architectures? Why is MX3 doing this differently?

#2 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

Quoted 11 lines · Russell King - ARM Linux
Quoted 9 lines · Fabio Estevam

Fix the following build error when doing a 'make mx3_defconfig'

CC [M] drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata' has no member named 'dma_mask' make[3]: *** [drivers/usb/host/fsl-mph-dr-of.o] Error 1
make[2]: *** [drivers/usb/host] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

Quoted 3 lines

Why is this required for just MX3? Why should we take the hit of adding this (needlessly) for the other sub-architectures? Why is MX3 doing this differently?

fsl-mph-dr-of.c is a driver that works on ARM and POWERPC. The latter has dma_mask in pdev_archdata and fsl-mph-dr-of.c uses it to hold the value pointed to by pdev->dev.dma_mask. AFAIK a driver should consider pdev->dev.dma_mask readonly, shouldn't it?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#3 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

In reply to Russell King - ARM Linux
Quoted 11 lines · Russell King - ARM Linux
Quoted 9 lines · Fabio Estevam

Fix the following build error when doing a 'make mx3_defconfig'

CC [M] drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata' has no member named 'dma_mask' make[3]: *** [drivers/usb/host/fsl-mph-dr-of.o] Error 1
make[2]: *** [drivers/usb/host] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

Quoted 3 lines

Why is this required for just MX3? Why should we take the hit of adding this (needlessly) for the other sub-architectures? Why is MX3 doing this differently?

This or some way to populate a dma_mask value is needed for devicetree based probing.

That being said, fsl-mph-dr-of.c directly accessing struct pdev_archdata is not right either.

Rob

#4 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

In reply to Fabio Estevam
Quoted 20 lines · Fabio Estevam

Fix the following build error when doing a 'make mx3_defconfig'

CC [M] drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata' has no member named 'dma_mask' make[3]: *** [drivers/usb/host/fsl-mph-dr-of.o] Error 1
make[2]: *** [drivers/usb/host] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

---
  arch/arm/include/asm/device.h |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/include/asm/device.h +0 -0
index 7aa3680..6ec60f6 100644

arch/arm/include/asm/device.h struct pdev_archdata { · line 27

Quoted 7 lines
arch/arm/include/asm/device.h +1 -0
@@ -21,6 +21,7 @@ struct pdev_archdata {
  #ifdef CONFIG_ARCH_OMAP
  	struct omap_device *od;
  #endif
+	u64 dma_mask;
  };
 
  #endif

Will there be a v2 of this patch fixing the review comments?

It seems the number of people hit by the issue this patch deals with increases ...

Many thanks

Dirk

#5 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

Quoted 27 lines · Dirk Behme
Quoted 26 lines · Fabio Estevam

Fix the following build error when doing a 'make mx3_defconfig'

CC [M] drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata' has no member named 'dma_mask' make[3]: *** [drivers/usb/host/fsl-mph-dr-of.o] Error 1
make[2]: *** [drivers/usb/host] Error 2
make[1]: *** [drivers/usb] Error 2
make: *** [drivers] Error 2

---
  arch/arm/include/asm/device.h |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/include/asm/device.h +1 -0
index 7aa3680..6ec60f6 100644
@@ -21,6 +21,7 @@ struct pdev_archdata {
  #ifdef CONFIG_ARCH_OMAP
  	struct omap_device *od;
  #endif
+	u64 dma_mask;
  };
 
Quoted 6 lines

arch/arm/include/asm/device.h struct pdev_archdata { · line 27

Quoted 1 line
arch/arm/include/asm/device.h +0 -0
  #endif

Will there be a v2 of this patch fixing the review comments?

It seems the number of people hit by the issue this patch deals with increases ...

How about fixing the driver? Or how about fixing this problem properly and sorting it out in the standard platform device model, rather than asking every arch to add this to their platform device archdata?

#6 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

In reply to Dirk Behme

Dirk,

Quoted 4 lines · Dirk Behme

Will there ?be a v2 of this patch fixing the review comments?

It seems the number of people hit by the issue this patch deals with increases ...

I no longer see this issue on a recent kernel.

drivers/usb/host/fsl-mph-dr-of.c is not built for i.MX now.

If you still see this issue, let me know how to reproduce it.

Regards,

Fabio Estevam

#7 lore raw

PATCH 1/1 arm: device.h: Add dma_mask to pdev_archdata structure

Quoted 6 lines · Fabio Estevam

Dirk,

Quoted 2 lines · Dirk Behme

Will there ?be a v2 of this patch fixing the review comments?

Quoted 8 lines
Quoted 2 lines

It seems the number of people hit by the issue this patch deals with increases ...

I no longer see this issue on a recent kernel.

drivers/usb/host/fsl-mph-dr-of.c is not built for i.MX now.

If you still see this issue, let me know how to reproduce it.

Ok, I managed to reproduce it and will submit a patch to the USB mailig list.

Regards,

Fabio Estevam