Skip to contentSkip to conversation

Decouple X86_32 dependency from the ISA Kconfig option

PATCH Superseded William Breathitt Gray 5 participants 16 messages Apr 11, 2016 – May 1, 2016

Subsystems (6)
x86 SCSI Sound Driver core +2 more subsystems
lore
Share & tools
lore
#0 lore raw

cover Decouple X86_32 dependency from the ISA Kconfig option

This patchset is based on top of commit 3a3a5fece6f2 ("fs: kernfs: Replace CURRENT_TIME by current_fs_time()") of the driver-core-testing branch of the driver-core repository.

The introduction of the ISA_BUS option in commit b3c1be1b789c ("base: isa: Remove X86_32 dependency") blocks the compilation of ISA drivers on non-x86 platforms. The ISA_BUS configuration option should not be necessary if the X86_32 dependency can be decoupled from the ISA configuration option. This patchset both removes the ISA_BUS configuration option entirely and decouples the X86_32 dependency from the ISA configuration option.

The PNPBIOS driver requires preprocessor defines (located in include/asm/segment.h) only declared if the architecture is set to X86_32. If the architecture is set to X86_64, the PNPBIOS driver will not build properly. The X86 dependecy for the PNPBIOS configuration option is changed to an explicit X86_32 dependency in order to prevent an attempt to build for an unsupported architecture.

Changes to the ISA SSCAPE and SCSI ULTRASTOR drivers are also included. The relevant patches simply fix format string identifier mismatches exposed during an attempted X86_64 compilation after the decoupling of the X86_32 dependency from the ISA configuration option. These patches fix compilation warnings rather than errors, but the solutions were so trivial that I decided to include them in this patchset. If it would be inappropriate to include them in this patchset, let me know and I will rebase to remove the relevant patches.

William Breathitt Gray (4):
pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS
sound: isa: sscape: Use correct format identifier for size_t
scsi: ultrastor: Use correct format identifier for kernel pointer
isa: Remove the ISA_BUS Kconfig option

 arch/x86/Kconfig            | 10 ++--------
 drivers/base/Makefile       |  2 +-
 drivers/pnp/pnpbios/Kconfig |  2 +-
 drivers/scsi/ultrastor.c    |  8 ++++----
 include/linux/isa.h         |  2 +-
 sound/isa/sscape.c          |  2 +-
 6 files changed, 10 insertions(+), 16 deletions(-)
Signature · 1 line
2.7.3
#1 lore raw

PATCH 1/4 pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS

The PNPBIOS driver requires preprocessor defines (located in include/asm/segment.h) only declared if the architecture is set to X86_32. If the architecture is set to X86_64, the PNPBIOS driver will not build properly. The X86 dependecy for the PNPBIOS configuration
option is changed to an explicit X86_32 dependency in order to prevent
an attempt to build for an unsupported architecture.

---
 drivers/pnp/pnpbios/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pnp/pnpbios/Kconfig +1 -1
index 50c3dd0..a786086 100644
@@ -3,7 +3,7 @@
 #
 config PNPBIOS
 	bool "Plug and Play BIOS support"
-	depends on ISA && X86
+	depends on ISA && X86_32
 	default n
 	---help---
 	  Linux uses the PNPBIOS as defined in "Plug and Play BIOS
Signature · 1 line
2.7.3
#2 lore raw

Re: [PATCH 1/4] pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS

Quoted 9 lines · William Breathitt Gray

The PNPBIOS driver requires preprocessor defines (located in include/asm/segment.h) only declared if the architecture is set to X86_32. If the architecture is set to X86_64, the PNPBIOS driver will not build properly. The X86 dependecy for the PNPBIOS configuration
option is changed to an explicit X86_32 dependency in order to prevent
an attempt to build for an unsupported architecture.

Has anyone taken care of this already?

If not, can you possibly resend this patch with a CC to [email protected] so I can pick it up via Patchwork more easily?

Quoted 17 lines
---
  drivers/pnp/pnpbios/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pnp/pnpbios/Kconfig +1 -1
index 50c3dd0..a786086 100644
@@ -3,7 +3,7 @@
  #
  config PNPBIOS
  	bool "Plug and Play BIOS support"
-	depends on ISA && X86
+	depends on ISA && X86_32
  	default n
  	---help---
  	  Linux uses the PNPBIOS as defined in "Plug and Play BIOS
#3 lore raw

Re: [PATCH 1/4] pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS

Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · William Breathitt Gray

The PNPBIOS driver requires preprocessor defines (located in include/asm/segment.h) only declared if the architecture is set to X86_32. If the architecture is set to X86_64, the PNPBIOS driver will not build properly. The X86 dependecy for the PNPBIOS configuration
option is changed to an explicit X86_32 dependency in order to prevent
an attempt to build for an unsupported architecture.

Quoted 7 lines
Quoted 2 lines

Has anyone taken care of this already?

If not, can you possibly resend this patch with a CC to [email protected] so I can pick it up via Patchwork more easily?

Greg K-H,

Will this patch appear in the driver-core repository along with the other patches in this set?

Thanks,

William Breathitt Gray

#4 lore raw

Re: [PATCH 1/4] pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS

In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · William Breathitt Gray

The PNPBIOS driver requires preprocessor defines (located in include/asm/segment.h) only declared if the architecture is set to X86_32. If the architecture is set to X86_64, the PNPBIOS driver will not build properly. The X86 dependecy for the PNPBIOS configuration
option is changed to an explicit X86_32 dependency in order to prevent
an attempt to build for an unsupported architecture.

Quoted 7 lines
Quoted 2 lines

Has anyone taken care of this already?

If not, can you possibly resend this patch with a CC to [email protected] so I can pick it up via Patchwork more easily?

I'm not sure when this patchset will appear in driver-core, so I have resent this particular patch with a CC to [email protected] so that Rafael J. Wysocki can pick it up more easily.

William Breathitt Gray

#5 lore raw

PATCH 2/4 sound: isa: sscape: Use correct format identifier for size_t

In reply to William Breathitt Gray

The 'size' member of a struct firmware is passed to snd_printk with a respective format string using the %d identifier. The 'size' member is of type size_t, but format identifier %d indicates a signed int data type. This patch replaces the %d format identifier with the correct %zu format identifier for size_t data types.

Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
---
 sound/isa/sscape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/sscape.c +1 -1
index 7b248cd..fdcfa29 100644
@@ -591,7 +591,7 @@ static int sscape_upload_microcode(struct snd_card *card, int version)
 	}
 	err = upload_dma_data(sscape, init_fw->data, init_fw->size);
 	if (err == 0)
-		snd_printk(KERN_INFO "sscape: MIDI firmware loaded %d KBs\n",
+		snd_printk(KERN_INFO "sscape: MIDI firmware loaded %zu KBs\n",
 				init_fw->size >> 10);
 
 	release_firmware(init_fw);
Signature · 1 line
2.7.3
#6 lore raw

Re: [alsa-devel] [PATCH 2/4] sound: isa: sscape: Use correct format identifier for size_t

Quoted 10 lines · William Breathitt Gray

The 'size' member of a struct firmware is passed to snd_printk with a respective format string using the %d identifier. The 'size' member is of type size_t, but format identifier %d indicates a signed int data type. This patch replaces the %d format identifier with the correct %zu format identifier for size_t data types.

Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>

This is basically irrelevant from ISA issue you're trying to solve, so I'm going to apply this one individually to my tree.

thanks,

Takashi

Quoted 25 lines
---
 sound/isa/sscape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/sscape.c +1 -1
index 7b248cd..fdcfa29 100644
@@ -591,7 +591,7 @@ static int sscape_upload_microcode(struct snd_card *card, int version)
 	}
 	err = upload_dma_data(sscape, init_fw->data, init_fw->size);
 	if (err == 0)
-		snd_printk(KERN_INFO "sscape: MIDI firmware loaded %d KBs\n",
+		snd_printk(KERN_INFO "sscape: MIDI firmware loaded %zu KBs\n",
 				init_fw->size >> 10);
 
 	release_firmware(init_fw);
Signature · 6 lines
2.7.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#7 lore raw

PATCH 3/4 scsi: ultrastor: Use correct format identifier for kernel pointer

In reply to William Breathitt Gray

The 'bios_segment' member of a struct ultrastor_config is passed to the sprintf function with a respective %05X format identifier. The 'bio_segment' member is a kernel pointer, but the %X format identifier expects an int data type. A cast to int is correctly used to satisfy the format identifier, but this assumes that the int data type is the same size as the kernel pointer, which is not the case on several architectures such as X86_64. This patch removes the int cast and replaces the %05X format identifier with %pK in order to print the 'bio_segment' member regardless of architecture.

Cc James E.J. Bottomley <[email protected]>
Cc Martin K. Petersen <[email protected]>
---
 drivers/scsi/ultrastor.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/ultrastor.c +4 -4
index 14e0c40..2e99f98 100644
@@ -670,12 +670,12 @@ static const char *ultrastor_info(struct Scsi_Host * shpnt)
       sprintf(buf, "UltraStor 24F SCSI @ Slot %u IRQ%u",
 	      config.slot, config.interrupt);
     else if (config.subversion)
-      sprintf(buf, "UltraStor 34F SCSI @ Port %03X BIOS %05X IRQ%u",
-	      config.port_address, (int)config.bios_segment,
+      sprintf(buf, "UltraStor 34F SCSI @ Port %03X BIOS %pK IRQ%u",
+	      config.port_address, config.bios_segment,
 	      config.interrupt);
     else
-      sprintf(buf, "UltraStor 14F SCSI @ Port %03X BIOS %05X IRQ%u DMA%u",
-	      config.port_address, (int)config.bios_segment,
+      sprintf(buf, "UltraStor 14F SCSI @ Port %03X BIOS %pK IRQ%u DMA%u",
+	      config.port_address, config.bios_segment,
 	      config.interrupt, config.dma_channel);
     return buf;
 }
Signature · 1 line
2.7.3
#8 lore raw

PATCH 4/4 isa: Remove the ISA_BUS Kconfig option

In reply to William Breathitt Gray

The introduction of the ISA_BUS option blocks the compilation of ISA drivers on non-x86 platforms. The ISA_BUS configuration option should not be necessary if the X86_32 dependency can be decoupled from the ISA configuration option. This patch both removes the ISA_BUS configuration option entirely and removes the X86_32 dependency from the ISA configuration option.

---
 arch/x86/Kconfig      | 10 ++--------
 drivers/base/Makefile |  2 +-
 include/linux/isa.h   |  2 +-
 3 files changed, 4 insertions(+), 10 deletions(-)
arch/x86/Kconfig +2 -8
index a597798..280e5eb 100644
@@ -2472,16 +2472,8 @@ config ISA_DMA_API
 	  Enables ISA-style DMA support for devices requiring such controllers.
 	  If unsure, say Y.
 
-config ISA_BUS
-	bool "ISA bus support"
-	help
-	  Enables ISA bus support for devices requiring such controllers.
-
-if X86_32
-
 config ISA
 	bool "ISA support"
-	depends on ISA_BUS
 	---help---
 	  Find out whether you have ISA slots on your motherboard.  ISA is the
 	  name of a bus system, i.e. the way the CPU talks to the other stuff
@@ -2489,6 +2481,8 @@ config ISA
 	  (MCA) or VESA.  ISA is an older system, now being displaced by PCI;
 	  newer boards don't support it.  If you have ISA, say Y, otherwise N.
 
+if X86_32
+
 config EISA
 	bool "EISA support"
 	depends on ISA
drivers/base/Makefile +1 -1
index 4ebfb81..6b2a84e 100644
@@ -10,7 +10,7 @@ obj-$(CONFIG_DMA_CMA) += dma-contiguous.o
 obj-y			+= power/
 obj-$(CONFIG_HAS_DMA)	+= dma-mapping.o
 obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
-obj-$(CONFIG_ISA_BUS)	+= isa.o
+obj-$(CONFIG_ISA)	+= isa.o
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
 obj-$(CONFIG_NUMA)	+= node.o
 obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
include/linux/isa.h +1 -1
index 2a02862..b0270e3 100644
@@ -22,7 +22,7 @@ struct isa_driver {
 
 #define to_isa_driver(x) container_of((x), struct isa_driver, driver)
 
-#ifdef CONFIG_ISA_BUS
+#ifdef CONFIG_ISA
 int isa_register_driver(struct isa_driver *, unsigned int);
 void isa_unregister_driver(struct isa_driver *);
 #else
Signature · 1 line
2.7.3
#9 lore raw
In reply to William Breathitt Gray
Quoted 34 lines · William Breathitt Gray

This patchset is based on top of commit 3a3a5fece6f2 ("fs: kernfs: Replace CURRENT_TIME by current_fs_time()") of the driver-core-testing branch of the driver-core repository.

The introduction of the ISA_BUS option in commit b3c1be1b789c ("base: isa: Remove X86_32 dependency") blocks the compilation of ISA drivers on non-x86 platforms. The ISA_BUS configuration option should not be necessary if the X86_32 dependency can be decoupled from the ISA configuration option. This patchset both removes the ISA_BUS configuration option entirely and decouples the X86_32 dependency from the ISA configuration option.

The PNPBIOS driver requires preprocessor defines (located in include/asm/segment.h) only declared if the architecture is set to X86_32. If the architecture is set to X86_64, the PNPBIOS driver will not build properly. The X86 dependecy for the PNPBIOS configuration option is changed to an explicit X86_32 dependency in order to prevent an attempt to build for an unsupported architecture.

Changes to the ISA SSCAPE and SCSI ULTRASTOR drivers are also included. The relevant patches simply fix format string identifier mismatches exposed during an attempted X86_64 compilation after the decoupling of the X86_32 dependency from the ISA configuration option. These patches fix compilation warnings rather than errors, but the solutions were so trivial that I decided to include them in this patchset. If it would be inappropriate to include them in this patchset, let me know and I will rebase to remove the relevant patches.

William Breathitt Gray (4):
pnp: pnpbios: Add explicit X86_32 dependency to PNPBIOS
sound: isa: sscape: Use correct format identifier for size_t
scsi: ultrastor: Use correct format identifier for kernel pointer
isa: Remove the ISA_BUS Kconfig option

Quoted 7 lines
 arch/x86/Kconfig            | 10 ++--------
 drivers/base/Makefile       |  2 +-
 drivers/pnp/pnpbios/Kconfig |  2 +-
 drivers/scsi/ultrastor.c    |  8 ++++----
 include/linux/isa.h         |  2 +-
 sound/isa/sscape.c          |  2 +-
 6 files changed, 10 insertions(+), 16 deletions(-)

What's the practical motivation of this? What exact hardware is this for?

Thanks,

Ingo

#10 lore raw
Quoted 5 lines · Ingo Molnar

What's the practical motivation of this? What exact hardware is this for?

Thanks,

Ingo

The PC/104 bus is equivalent to the ISA bus regarding software communication. Many small form factor systems have a PC/104 bus where PC/104 cards may be stacked. Nowadays, these systems are commonly running 64-bit processors such as the Intel Atom.

I would like to utilize the ISA bus driver to support these PC/104 devices (see http://lkml.org/lkml/2016/4/7/418), but the ISA configuration option has an arbitrary X86_32 dependency. Decoupling the X86_32 dependency from the ISA configuration option will allow these PC/104 drivers to build for 64-bit architectures.

The existing kernel drivers which I intend to utilize the ISA bus driver in a X86_64 architecture for PC/104 support are the ACCES 104-DIO-48E GPIO driver, the ACCES 104-IDI-48 GPIO driver, the ACCES 104-IDIO-16 GPIO driver, and the Apex Embedded Systems STX104 DAC driver. I have several more PC/104 devices for which I wish to write drivers, but I would like to resolve this ISA bus driver situation before submitting new code.

William Breathitt Gray

Acked-by
#11 lore raw
Quoted 18 lines · William Breathitt Gray
Quoted 5 lines · Ingo Molnar

What's the practical motivation of this? What exact hardware is this for?

Thanks,

Ingo

The PC/104 bus is equivalent to the ISA bus regarding software communication. Many small form factor systems have a PC/104 bus where PC/104 cards may be stacked. Nowadays, these systems are commonly running 64-bit processors such as the Intel Atom.

I would like to utilize the ISA bus driver to support these PC/104 devices (see http://lkml.org/lkml/2016/4/7/418), but the ISA configuration option has an arbitrary X86_32 dependency. Decoupling the X86_32 dependency from the ISA configuration option will allow these PC/104 drivers to build for 64-bit architectures.

Quoted 7 lines

The existing kernel drivers which I intend to utilize the ISA bus driver in a X86_64 architecture for PC/104 support are the ACCES 104-DIO-48E GPIO driver, the ACCES 104-IDI-48 GPIO driver, the ACCES 104-IDIO-16 GPIO driver, and the Apex Embedded Systems STX104 DAC driver. I have several more PC/104 devices for which I wish to write drivers, but I would like to resolve this ISA bus driver situation before submitting new code.

Ah, ok, so it's for enabling real hardware, not just a cleanup, right? You might want to put that info into the boilerplate mail or so.

I'm perfectly fine with all the patches that touch x86 code:

I suppose you'd like to have these in the driver tree, all in one place?

Thanks,

Ingo

#12 lore raw
Quoted 5 lines · Ingo Molnar

Ah, ok, so it's for enabling real hardware, not just a cleanup, right? You might want to put that info into the boilerplate mail or so.

I'm perfectly fine with all the patches that touch x86 code:

Quoted 7 lines

I suppose you'd like to have these in the driver tree, all in one place?

Thanks,

Ingo

Ah yes, in retrospect I should have made it clear that this was for supporting hardware rather than simply code cleanup. That was an oversight on my part not to have made it more explicit.

Introducing everything to the driver tree would be most convenient, thus allowing me to quickly release my subsequent patches which will be rebased on top of these.

William Breathitt Gray

maintainer
#13 lore raw
Quoted 14 lines · William Breathitt Gray
Quoted 5 lines · Ingo Molnar

Ah, ok, so it's for enabling real hardware, not just a cleanup, right? You might want to put that info into the boilerplate mail or so.

I'm perfectly fine with all the patches that touch x86 code:

Quoted 7 lines

I suppose you'd like to have these in the driver tree, all in one place?

Thanks,

Ingo

Quoted 7 lines

Ah yes, in retrospect I should have made it clear that this was for supporting hardware rather than simply code cleanup. That was an oversight on my part not to have made it more explicit.

Introducing everything to the driver tree would be most convenient, thus allowing me to quickly release my subsequent patches which will be rebased on top of these.

Ok, I can take these.

thanks,

greg k-h

#14 lore raw
Quoted 23 lines · Greg KH
Quoted 14 lines · William Breathitt Gray
Quoted 5 lines · Ingo Molnar

Ah, ok, so it's for enabling real hardware, not just a cleanup, right? You might want to put that info into the boilerplate mail or so.

I'm perfectly fine with all the patches that touch x86 code:

Quoted 7 lines

I suppose you'd like to have these in the driver tree, all in one place?

Thanks,

Ingo

Quoted 7 lines

Ah yes, in retrospect I should have made it clear that this was for supporting hardware rather than simply code cleanup. That was an oversight on my part not to have made it more explicit.

Introducing everything to the driver tree would be most convenient, thus allowing me to quickly release my subsequent patches which will be rebased on top of these.

Quoted 5 lines

Ok, I can take these.

thanks,

greg k-h

Forgive me for probing again; what is that status of this patchset? I'm anxious to see them accepted to prevent the regression introduced by the ISA_BUS configuration option from appearing in the next merge window.

Many thanks,

William Breathitt Gray

maintainer
#15 lore raw
Quoted 26 lines · William Breathitt Gray
Quoted 25 lines · Greg KH
Quoted 14 lines · William Breathitt Gray
Quoted 5 lines · Ingo Molnar

Ah, ok, so it's for enabling real hardware, not just a cleanup, right? You might want to put that info into the boilerplate mail or so.

I'm perfectly fine with all the patches that touch x86 code:

Quoted 7 lines

I suppose you'd like to have these in the driver tree, all in one place?

Thanks,

Ingo

Quoted 7 lines

Ah yes, in retrospect I should have made it clear that this was for supporting hardware rather than simply code cleanup. That was an oversight on my part not to have made it more explicit.

Introducing everything to the driver tree would be most convenient, thus allowing me to quickly release my subsequent patches which will be rebased on top of these.

Ok, I can take these.

Quoted 7 lines
Quoted 3 lines

thanks,

greg k-h

Forgive me for probing again; what is that status of this patchset? I'm anxious to see them accepted to prevent the regression introduced by the ISA_BUS configuration option from appearing in the next merge window.

Not all of these patches had anything to do with the subject of this 0/4 patch, and seem to have gone in through other trees.

So can you resend just the patches that are for this series that have not been picked up?

thanks,

greg k-h