Skip to contentSkip to conversation

staging: gpib: Fix i386 build issue

PATCH In review Dave Penkler 2 participants 4 messages Dec 11, 2024 – Dec 13, 2024 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 staging: gpib: Fix i386 build issue

These drivers cast resource_type_t to void * causing the build to fail.

With a 32 bit build and PHYS_ADDR_T_64BIT enabled the resource_size_t type is a 64bit unsigned int which cannot be cast to a 32 bit pointer.

Disable these drivers if not 64BIT and PHYS_ADDR_T_64BIT are configured.

Fixes e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver")
Fixes e1339245eba3 ("staging: gpib: Add Computer Equipment Corporation GPIB driver")
Fixes bb1bd92fa0f2 ("staging: gpib: Add ines GPIB driver")
Fixes 0cd5b05551e0 ("staging: gpib: Add TNT4882 chip based GPIB driver")

---
v1 -> v2 changed pci_resource_start to pci_resource_len for second parameter of ioremap v2 -> v3 add changes for cb7210 and tnt4882 drivers
v3 -> v4 disable build of drivers when X86_PAE is enabled
v4 -> v5 add missing signoff
v5 -> v6 Non x86 builds were also failing. See discussion under Link above.
generalise the build dependencies to exclude the drivers when the physical address type does not match the arch word length.

drivers/staging/gpib/Kconfig | 4 ++++

 1 file changed, 4 insertions(+)
drivers/staging/gpib/Kconfig +4 -0
index 95308d15a555..36a29b52ba30 100644
@@ -50,6 +50,7 @@ config GPIB_CEC_PCI
 	tristate "CEC PCI board"
 	depends on PCI
 	depends on HAS_IOPORT
+	depends on 64BIT || !PHYS_ADDR_T_64BIT
 	select GPIB_COMMON
 	select GPIB_NEC7210
 	help
@@ -64,6 +65,7 @@ config GPIB_NI_PCI_ISA
 	depends on ISA_BUS || PCI || PCMCIA
 	select GPIB_COMMON
 	select GPIB_NEC7210
+	depends on 64BIT || !PHYS_ADDR_T_64BIT
 	help
 	  Enable support for National Instruments boards based
 	  on TNT4882 chips:
@@ -85,6 +87,7 @@ config GPIB_CB7210
        tristate "Measurement Computing compatible boards"
 	depends on HAS_IOPORT
 	depends on ISA_BUS || PCI || PCMCIA
+	depends on 64BIT || !PHYS_ADDR_T_64BIT
        select GPIB_COMMON
 	select GPIB_NEC7210
        help
@@ -176,6 +179,7 @@ config GPIB_INES
 	depends on HAS_IOPORT
        select GPIB_COMMON
        select GPIB_NEC7210
+       depends on 64BIT || !PHYS_ADDR_T_64BIT
        help
          GPIB driver for Ines compatible boards
 	 Ines
Signature · 1 line
2.47.1
Tested-by on v6 1/1
#1 lore raw
Quoted 7 lines · Dave Penkler

These drivers cast resource_type_t to void * causing the build to fail.

With a 32 bit build and PHYS_ADDR_T_64BIT enabled the resource_size_t type is a 64bit unsigned int which cannot be cast to a 32 bit pointer.

Disable these drivers if not 64BIT and PHYS_ADDR_T_64BIT are configured.

Quoted 8 lines
Fixes e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver")
Fixes e1339245eba3 ("staging: gpib: Add Computer Equipment Corporation GPIB driver")
Fixes bb1bd92fa0f2 ("staging: gpib: Add ines GPIB driver")
Fixes 0cd5b05551e0 ("staging: gpib: Add TNT4882 chip based GPIB driver")

Guenter

#2 lore raw
Quoted 17 lines · Guenter Roeck
Quoted 7 lines · Dave Penkler

These drivers cast resource_type_t to void * causing the build to fail.

With a 32 bit build and PHYS_ADDR_T_64BIT enabled the resource_size_t type is a 64bit unsigned int which cannot be cast to a 32 bit pointer.

Disable these drivers if not 64BIT and PHYS_ADDR_T_64BIT are configured.

Quoted 8 lines
Fixes e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver")
Fixes e1339245eba3 ("staging: gpib: Add Computer Equipment Corporation GPIB driver")
Fixes bb1bd92fa0f2 ("staging: gpib: Add ines GPIB driver")
Fixes 0cd5b05551e0 ("staging: gpib: Add TNT4882 chip based GPIB driver")
Quoted 4 lines

Guenter

Hi Guenter,
These nice patches from Arnd fix the i386 build issue without having applied my v6 patch:

I tested only
make ARCH=i386 allmodconfig
make ARCH=i386 M=drivers/staging/gpib

-Dave

#3 lore raw
Quoted 25 lines · Dave Penkler
Quoted 17 lines · Guenter Roeck
Quoted 7 lines · Dave Penkler

These drivers cast resource_type_t to void * causing the build to fail.

With a 32 bit build and PHYS_ADDR_T_64BIT enabled the resource_size_t type is a 64bit unsigned int which cannot be cast to a 32 bit pointer.

Disable these drivers if not 64BIT and PHYS_ADDR_T_64BIT are configured.

Quoted 8 lines
Fixes e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver")
Fixes e1339245eba3 ("staging: gpib: Add Computer Equipment Corporation GPIB driver")
Fixes bb1bd92fa0f2 ("staging: gpib: Add ines GPIB driver")
Fixes 0cd5b05551e0 ("staging: gpib: Add TNT4882 chip based GPIB driver")
Quoted 4 lines

Guenter

Hi Guenter,
These nice patches from Arnd fix the i386 build issue without having applied my v6 patch:

Quoted 7 lines

I tested only
make ARCH=i386 allmodconfig
make ARCH=i386 M=drivers/staging/gpib

-Dave

I don't care how this is fixed. What I do care about it that we are close to -rc3, and my test builds still fail.

Build results:

	total: 161 pass: 155 fail: 6

Failed builds:
csky:allmodconfig
i386:allyesconfig
i386:allmodconfig
openrisc:allmodconfig
s390:allmodconfig
xtensa:allmodconfig

all because of GPIB problems. Given that this is a staging driver, I am inclined to just hard-disable GPIB completely in my test coverage. I'll do that after -rc3 is out.

Guenter