Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1405422 > unrolled thread

[PATCH 0/4] Allow ISA-style drivers on modern systems

Started byWilliam Breathitt Gray <vilhelm.gray@gmail.com>
First post2016-05-23 17:00 +0200
Last post2016-05-23 20:10 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/4] Allow ISA-style drivers on modern systems William Breathitt Gray <vilhelm.gray@gmail.com> - 2016-05-23 17:00 +0200
    [PATCH 4/4] watchdog: ebc-c384_wdt: Allow build for X86_64 William Breathitt Gray <vilhelm.gray@gmail.com> - 2016-05-23 17:00 +0200
    [PATCH 1/4] isa: Allow ISA-style drivers on modern systems William Breathitt Gray <vilhelm.gray@gmail.com> - 2016-05-23 17:00 +0200
      Re: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems Guenter Roeck <linux@roeck-us.net> - 2016-05-23 19:30 +0200
        Re: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems William Breathitt Gray <vilhelm.gray@gmail.com> - 2016-05-23 19:50 +0200
      Re: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems Linus Torvalds <torvalds@linux-foundation.org> - 2016-05-23 20:10 +0200

#1405422 — [PATCH 0/4] Allow ISA-style drivers on modern systems

FromWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Date2016-05-23 17:00 +0200
Subject[PATCH 0/4] Allow ISA-style drivers on modern systems
Message-ID<rBZuN-77D-3@gated-at.bofh.it>
Several modern devices, such as PC/104 cards, are expected to run on
modern systems via an ISA bus interface. Since ISA is a legacy interface
for most modern architectures, ISA support should remain disabled in
general. Support for ISA-style drivers should be enabled on a per driver
basis.

To allow ISA-style drivers on modern systems, this patchset introduces
the ISA_BUS_API and ISA_BUS Kconfig options. The X86 ISA bus driver will
now build conditionally on the ISA_BUS_API Kconfig option, which
defaults to the legacy ISA Kconfig option. The ISA_BUS Kconfig option
allows the ISA_BUS_API Kconfig option to be selected on architectures
which do not enable ISA (e.g. X86_64).

For now, the ISA_BUS Kconfig option is only be available on X86
architectures. Support for other architectures may be added as required.

An earlier attempt to allow the ISA bus driver to build for X86_64 took
an inappropriate approach resulting in legacy ISA drivers becoming
enabled unconditionally on untested and unsupported architectures.
Commit 51e68d055cba ("x86 isa: add back X86_32 dependency on
CONFIG_ISA"), added to restrict the ISA bus driver to only X86_32,
causes several drivers intended for X86_64 to be restricted to X86_32 as
well.

This patchset replaces the ISA Kconfig option dependency of several
drivers to ISA_BUS_API, so that they may build for X86_64 as intended.
The respective drivers are as follows:
    * ACCES 104-IDIO-16 GPIO driver
    * ACCES 104-IDI-48 GPIO driver
    * ACCES 104-DIO-48E GPIO driver
    * Apex Embedded Systems STX104 DAC driver
    * WinSystems EBC-C384 watchdog timer driver
    * WinSystems WS16C48 GPIO driver

William Breathitt Gray (4):
  isa: Allow ISA-style drivers on modern systems
  gpio: Allow PC/104 devices on X86_64
  iio: stx104: Allow build for X86_64
  watchdog: ebc-c384_wdt: Allow build for X86_64

 arch/x86/Kconfig         | 13 +++++++++++++
 drivers/base/Makefile    |  2 +-
 drivers/gpio/Kconfig     |  8 ++++----
 drivers/iio/dac/Kconfig  |  2 +-
 drivers/watchdog/Kconfig |  2 +-
 5 files changed, 20 insertions(+), 7 deletions(-)

-- 
2.7.3

[toc] | [next] | [standalone]


#1405423 — [PATCH 4/4] watchdog: ebc-c384_wdt: Allow build for X86_64

FromWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Date2016-05-23 17:00 +0200
Subject[PATCH 4/4] watchdog: ebc-c384_wdt: Allow build for X86_64
Message-ID<rBZuN-77D-11@gated-at.bofh.it>
In reply to#1405422
With the introduction of the ISA_BUS_API Kconfig option, ISA-style
drivers may be built for X86_64 architectures. This patch changes the
ISA Kconfig option dependency of the WinSystems EBC-C384 watchdog timer
driver to ISA_BUS_API, thus allowing it to build for X86_64 as it is
expected to.

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index b54f26c..3938e2d 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -746,7 +746,7 @@ config ALIM7101_WDT
 
 config EBC_C384_WDT
 	tristate "WinSystems EBC-C384 Watchdog Timer"
-	depends on X86 && ISA
+	depends on ISA_BUS_API
 	select WATCHDOG_CORE
 	help
 	  Enables watchdog timer support for the watchdog timer on the
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1405424 — [PATCH 1/4] isa: Allow ISA-style drivers on modern systems

FromWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Date2016-05-23 17:00 +0200
Subject[PATCH 1/4] isa: Allow ISA-style drivers on modern systems
Message-ID<rBZuN-77D-21@gated-at.bofh.it>
In reply to#1405422
Several modern devices, such as PC/104 cards, are expected to run on
modern systems via an ISA bus interface. Since ISA is a legacy interface
for most modern architectures, ISA support should remain disabled in
general. Support for ISA-style drivers should be enabled on a per driver
basis.

To allow ISA-style drivers on modern systems, this patch introduces the
ISA_BUS_API and ISA_BUS Kconfig options. The X86 ISA bus driver will now
build conditionally on the ISA_BUS_API Kconfig option, which defaults to
the legacy ISA Kconfig option. The ISA_BUS Kconfig option allows the
ISA_BUS_API Kconfig option to be selected on architectures which do not
enable ISA (e.g. X86_64).

For now, the ISA_BUS Kconfig option is only be available on X86
architectures. Support for other architectures may be added as required.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
 arch/x86/Kconfig      | 13 +++++++++++++
 drivers/base/Makefile |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0a7b885..a41c0b8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2439,6 +2439,19 @@ config PCI_CNB20LE_QUIRK
 
 source "drivers/pci/Kconfig"
 
+config ISA_BUS_API
+	def_bool ISA
+
+config ISA_BUS
+	bool "ISA-style bus support on modern systems" if (X86 && EXPERT)
+	default y
+	select ISA_BUS_API
+	help
+	  Enables ISA-style drivers on modern systems. This is necessary to
+	  support PC/104 devices on X86_64 platforms.
+
+	  If unsure, say Y.
+
 # x86_64 have no ISA slots, but can have ISA-style DMA.
 config ISA_DMA_API
 	bool "ISA-style DMA support" if (X86_64 && EXPERT)
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 6b2a84e..2609ba2 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -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)	+= isa.o
+obj-$(CONFIG_ISA_BUS_API)	+= isa.o
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
 obj-$(CONFIG_NUMA)	+= node.o
 obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
-- 
2.7.3

[toc] | [prev] | [next] | [standalone]


#1405533 — Re: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems

FromGuenter Roeck <linux@roeck-us.net>
Date2016-05-23 19:30 +0200
SubjectRe: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems
Message-ID<rC1PX-k3-13@gated-at.bofh.it>
In reply to#1405424
On Mon, May 23, 2016 at 10:58:41AM -0400, William Breathitt Gray wrote:
> Several modern devices, such as PC/104 cards, are expected to run on
> modern systems via an ISA bus interface. Since ISA is a legacy interface
> for most modern architectures, ISA support should remain disabled in
> general. Support for ISA-style drivers should be enabled on a per driver
> basis.
> 
> To allow ISA-style drivers on modern systems, this patch introduces the
> ISA_BUS_API and ISA_BUS Kconfig options. The X86 ISA bus driver will now
> build conditionally on the ISA_BUS_API Kconfig option, which defaults to
> the legacy ISA Kconfig option. The ISA_BUS Kconfig option allows the
> ISA_BUS_API Kconfig option to be selected on architectures which do not
> enable ISA (e.g. X86_64).
> 
> For now, the ISA_BUS Kconfig option is only be available on X86
> architectures. Support for other architectures may be added as required.
> 
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> ---
>  arch/x86/Kconfig      | 13 +++++++++++++
>  drivers/base/Makefile |  2 +-
>  2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 0a7b885..a41c0b8 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -2439,6 +2439,19 @@ config PCI_CNB20LE_QUIRK
>  
>  source "drivers/pci/Kconfig"
>  
> +config ISA_BUS_API
> +	def_bool ISA
> +
> +config ISA_BUS
> +	bool "ISA-style bus support on modern systems" if (X86 && EXPERT)
> +	default y

Sure you want it enabled by default ?

> +	select ISA_BUS_API
> +	help
> +	  Enables ISA-style drivers on modern systems. This is necessary to
> +	  support PC/104 devices on X86_64 platforms.
> +
> +	  If unsure, say Y.
> +
>  # x86_64 have no ISA slots, but can have ISA-style DMA.
>  config ISA_DMA_API
>  	bool "ISA-style DMA support" if (X86_64 && EXPERT)
> diff --git a/drivers/base/Makefile b/drivers/base/Makefile
> index 6b2a84e..2609ba2 100644
> --- a/drivers/base/Makefile
> +++ b/drivers/base/Makefile
> @@ -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)	+= isa.o
> +obj-$(CONFIG_ISA_BUS_API)	+= isa.o

Unless I am missing something, this is insufficient, and I am a bit surprised
that it actually works. include/linux/isa.h declares isa_register_driver()
and isa_unregister_driver() as dummies if CONFIG_ISA is not enabled.
Doesn't this cause a compile error ? Confused.

Thanks,
Guenter

>  obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
>  obj-$(CONFIG_NUMA)	+= node.o
>  obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
> -- 
> 2.7.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [next] | [standalone]


#1405535 — Re: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems

FromWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Date2016-05-23 19:50 +0200
SubjectRe: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems
Message-ID<rC29j-u0-1@gated-at.bofh.it>
In reply to#1405533
On Mon, May 23, 2016 at 10:21:25AM -0700, Guenter Roeck wrote:
>On Mon, May 23, 2016 at 10:58:41AM -0400, William Breathitt Gray wrote:
>> +config ISA_BUS_API
>> +	def_bool ISA
>> +
>> +config ISA_BUS
>> +	bool "ISA-style bus support on modern systems" if (X86 && EXPERT)
>> +	default y
>
>Sure you want it enabled by default ?

Since the X86 ISA bus driver is more of an abstraction interface and
doesn't perform any hardware operations, I believe it's safe enough to
enable by default, thus allowing drivers dependent on it to show up for
selection in menuconfig.

>> +	select ISA_BUS_API
>> +	help
>> +	  Enables ISA-style drivers on modern systems. This is necessary to
>> +	  support PC/104 devices on X86_64 platforms.
>> +
>> +	  If unsure, say Y.
>> +
>>  # x86_64 have no ISA slots, but can have ISA-style DMA.
>>  config ISA_DMA_API
>>  	bool "ISA-style DMA support" if (X86_64 && EXPERT)
>> diff --git a/drivers/base/Makefile b/drivers/base/Makefile
>> index 6b2a84e..2609ba2 100644
>> --- a/drivers/base/Makefile
>> +++ b/drivers/base/Makefile
>> @@ -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)	+= isa.o
>> +obj-$(CONFIG_ISA_BUS_API)	+= isa.o
>
>Unless I am missing something, this is insufficient, and I am a bit surprised
>that it actually works. include/linux/isa.h declares isa_register_driver()
>and isa_unregister_driver() as dummies if CONFIG_ISA is not enabled.
>Doesn't this cause a compile error ? Confused.

You are correct: CONFIG_ISA in include/linux/isa.h should be
CONFIG_ISA_BUS_API. I'll add the change and submit version 2 of this
patchset after retesting.

William Breathitt Gray

[toc] | [prev] | [next] | [standalone]


#1405556 — Re: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems

FromLinus Torvalds <torvalds@linux-foundation.org>
Date2016-05-23 20:10 +0200
SubjectRe: [PATCH 1/4] isa: Allow ISA-style drivers on modern systems
Message-ID<rC2sG-Qg-35@gated-at.bofh.it>
In reply to#1405424
On Mon, May 23, 2016 at 7:58 AM, William Breathitt Gray
<vilhelm.gray@gmail.com> wrote:
>
> For now, the ISA_BUS Kconfig option is only be available on X86
> architectures. Support for other architectures may be added as required.

So I'd prefer to see that

> +config ISA_BUS_API
> +       def_bool ISA

part in arch/Kconfig.

Why?

Because other architectures _already_ define that ISA symbol, and we
want the "ISA_BUS_API" to be a complete superset of ISA.

So whenever ISA is enabled, ISA_BUS_API should be enabled.

And the way you did that, that's not true. Now, if you were to enable
ISA on ARM, you'd not get ISA_BUS_API. And that sounds insane to me.
It also sounds *wrong* because it effectively changes the meaning of
this:

  --- a/drivers/base/Makefile
  +++ b/drivers/base/Makefile
  @@ -10,7 +10,7 @@ obj-$(CONFIG_DMA_CMA) += dma-contiguous.o
  -obj-$(CONFIG_ISA)      += isa.o
  +obj-$(CONFIG_ISA_BUS_API)      += isa.o

where now that "isa.c" file gets built only on x86, whereas it *used*
to get built whenever ISA was enabled.

So the reason I suggested a separate ISA_BUS_API config option (that
then a particular architecture can choose to enable, in this case the
x86 choice of selecting ISA_BUS) was _exactly_ this issue. The plain
"ISA" config variable is not limited to x86, and the new subset of it
(the ISA_BUS_API) thus also must not be limited to just x86.

               Linus

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web