base: isa: Remove X86_32 dependency
PATCH 1/1 base: isa: Remove X86_32 dependency
Many motherboards utilize a LPC to ISA bridge in order to decode ISA-style port-mapped I/O addresses. This is particularly true for embedded motherboards supporting the PC/104 bus (a bus specification derived from ISA).
These motherboards are now commonly running 64-bit x86 processors. The X86_32 dependency should be removed from the ISA configuration option in order to support these newer motherboards.
--- arch/x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/Kconfig +2 -2
@@ -2443,8 +2443,6 @@ config ISA_DMA_API Enables ISA-style DMA support for devices requiring such controllers. If unsure, say Y. -if X86_32 - config ISA bool "ISA support" ---help---
@@ -2454,6 +2452,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
Signature · 1 line
2.4.10
H. Peter Anvin
reviewerQuoted 10 lines · William Breathitt Gray
Many motherboards utilize a LPC to ISA bridge in order to decode ISA-style port-mapped I/O addresses. This is particularly true for embedded motherboards supporting the PC/104 bus (a bus specification derived from ISA).
These motherboards are now commonly running 64-bit x86 processors. The
X86_32dependency should be removed from the ISA configuration option in order to support these newer motherboards.Signed-off-by William Breathitt Gray <[email protected]>
CONFIG_ISA is mainly used to exclude drivers that are for ISA-specific devices.
However, PC/104 is indeed an actual ISA parallel bus, and as you say widely used in embedded systems. However, I would like to see if there are anything hidden with !CONFIG_ISA which makes sense in PC104 systems.
-hpa
Quoted 6 lines · H. Peter Anvin
CONFIG_ISAis mainly used to exclude drivers that are for ISA-specific devices.However, PC/104 is indeed an actual ISA parallel bus, and as you say widely used in embedded systems. However, I would like to see if there are anything hidden with !CONFIG_ISA which makes sense in PC104 systems.
My ultimate objective is to be able to use the ISA bus driver (drivers/base/isa.c). This driver is conditionally compiled based on CONFIG_ISA, which in turn depends on CONFIG_X86_32. Up until now, I've been using platform_driver for my non-hotpluggable PC/104 devices, but it appears that isa_driver is more appropriate; unfortunately, I have CONFIG_X86_64 set, which prevents the compilation of drivers/base/isa.c due to the CONFIG_X86_32 dependency.
I can alternatively create a patch to introduce a CONFIG_PC104 option. This would allow the compilation of the ISA bus driver on either CONFIG_ISA or CONFIG_PC104, thus allowing CONFIG_ISA to remain dependent on CONFIG_X86_32. However, if the CONFIG_X86_32 dependency was arbitrarily added to simply hide ISA functionality from newer motherboards, perhaps the dependency should be removed.
William Breathitt Gray
H. Peter Anvin
reviewerQuoted 16 lines · William Breathitt Gray
Quoted 6 lines · H. Peter Anvin
CONFIG_ISAis mainly used to exclude drivers that are for ISA-specific devices.However, PC/104 is indeed an actual ISA parallel bus, and as you say widely used in embedded systems. However, I would like to see if there are anything hidden with !CONFIG_ISA which makes sense in PC104 systems.
My ultimate objective is to be able to use the ISA bus driver (
drivers/base/isa.c). This driver is conditionally compiled based onCONFIG_ISA, which in turn depends onCONFIG_X86_32. Up until now, I've been usingplatform_driverfor my non-hotpluggable PC/104 devices, but it appears thatisa_driveris more appropriate; unfortunately, I haveCONFIG_X86_64set, which prevents the compilation ofdrivers/base/isa.cdue to theCONFIG_X86_32dependency.
Quoted 7 lines
I can alternatively create a patch to introduce a
CONFIG_PC104option. This would allow the compilation of the ISA bus driver on eitherCONFIG_ISAorCONFIG_PC104, thus allowingCONFIG_ISAto remain dependent onCONFIG_X86_32. However, if theCONFIG_X86_32dependency was arbitrarily added to simply hide ISA functionality from newer motherboards, perhaps the dependency should be removed.
Well, and as you can see from the build robot because a lot of those drivers simply don't compile on 64-bit systems. If nothing else you would have to push the 32-bit tests downward in the config dependency tree.
-hpa
Quoted 5 lines · H. Peter Anvin
Well, and as you can see from the build robot because a lot of those drivers simply don't compile on 64-bit systems. If nothing else you would have to push the 32-bit tests downward in the config dependency tree.
-hpa
Yes, you're right. There doesn't appear to be anything 32-bit specific in the ISA bus driver itself, so these build failures must be due to configs relying on the 32-bit dependency from CONFIG_ISA. It should be possible to decouple the 32-bit dependency, so I'll work through the config dependency tree and fix the build errors with explicit CONFIG_X86_32 dependencies. I'll submit a new patch with those changes when complete.
William Breathitt Gray
Quoted 11 lines · William Breathitt Gray
Quoted 3 lines · H. Peter Anvin
Well, and as you can see from the build robot because a lot of those drivers simply don't compile on 64-bit systems. If nothing else you would have to push the 32-bit tests downward in the config dependency tree.
Yes, you're right. There doesn't appear to be anything 32-bit specific in the ISA bus driver itself, so these build failures must be due to configs relying on the 32-bit dependency from
CONFIG_ISA. It should be possible to decouple the 32-bit dependency, so I'll work through the config dependency tree and fix the build errors with explicitCONFIG_X86_32dependencies. I'll submit a new patch with those changes when complete.
Make drivers/bus/isa.c depend on CONFIG_ISA_BUS and select that from CONFIG_ISA.
That gives you the bus driver alone w/o touching any of the things which depend on x32.
Thanks,
tglx
kbuild test robot
build botreproduce:
Hi William,
[auto build test ERROR on tip/x86/core]
[also build test ERROR on v4.4 next-20160121]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/William-Breathitt-Gray/base-isa-Remove-X86_32-dependency/20160121-235906 config: x86_64-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from sound/isa/sscape.c:34:0:
sound/isa/sscape.c: In function 'sscape_upload_microcode':
>> include/linux/kern_levels.h:4:18: warning: format '%d' expects argument of type 'int', but argument 5 has type 'size_t {aka const long unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/sound/core.h:322:38: note: in definition of macro 'snd_printk'
__snd_printk(0, __FILE__, __LINE__, fmt, ##args)
^
include/linux/kern_levels.h:13:19: note: in expansion of macro 'KERN_SOH'
#define KERN_INFO KERN_SOH "6" /* informational */
^
>> sound/isa/sscape.c:594:14: note: in expansion of macro 'KERN_INFO' snd_printk(KERN_INFO "sscape: MIDI firmware loaded %d KBs\n",
^
--
arch/x86/mm/extable.c:23:13: sparse: undefined identifier 'SEGMENT_IS_PNP_CODE' In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from arch/x86/mm/extable.c:1:
arch/x86/mm/extable.c: In function 'fixup_exception':
>> arch/x86/mm/extable.c:23:15: error: implicit declaration of function 'SEGMENT_IS_PNP_CODE' [-Werror=implicit-function-declaration]
if (unlikely(SEGMENT_IS_PNP_CODE(regs->cs))) {
^
include/linux/compiler.h:166:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
cc1: some warnings being treated as errors
--
drivers/pnp/pnpbios/bioscalls.c:27:3: sparse: symbol 'pnp_bios_callpoint' was not declared. Should it be static?
drivers/pnp/pnpbios/bioscalls.c:70:15: sparse: symbol 'pnp_bios_fault_esp' was not declared. Should it be static?
drivers/pnp/pnpbios/bioscalls.c:71:15: sparse: symbol 'pnp_bios_fault_eip' was not declared. Should it be static?
drivers/pnp/pnpbios/bioscalls.c:72:15: sparse: symbol 'pnp_bios_is_utter_crap' was not declared. Should it be static?
drivers/pnp/pnpbios/bioscalls.c:259:62: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:300:57: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:332:66: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:364:72: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:381:68: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:405:65: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:430:54: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:456:50: sparse: undefined identifier 'PNP_TS1'
drivers/pnp/pnpbios/bioscalls.c:477:38: sparse: undefined identifier 'PNP_CS16'
drivers/pnp/pnpbios/bioscalls.c:483:36: sparse: undefined identifier 'GDT_ENTRY_PNPBIOS_CS32'
drivers/pnp/pnpbios/bioscalls.c:485:36: sparse: undefined identifier 'GDT_ENTRY_PNPBIOS_CS16'
drivers/pnp/pnpbios/bioscalls.c:487:36: sparse: undefined identifier 'GDT_ENTRY_PNPBIOS_DS'
drivers/pnp/pnpbios/bioscalls.c: In function 'call_pnp_bios':
>> drivers/pnp/pnpbios/bioscalls.c:106:34: error: 'PNP_TS1' undeclared (first use in this function)
Q2_SET_SEL(smp_processor_id(), PNP_TS1, ts1_base, ts1_size);
^
drivers/pnp/pnpbios/bioscalls.c:58:22: note: in definition of macro 'Q2_SET_SEL'
set_desc_base(&gdt[(selname) >> 3], (u32)(address)); \
^
drivers/pnp/pnpbios/bioscalls.c:106:34: note: each undeclared identifier is reported only once for each function it appears in
Q2_SET_SEL(smp_processor_id(), PNP_TS1, ts1_base, ts1_size);
^
drivers/pnp/pnpbios/bioscalls.c:58:22: note: in definition of macro 'Q2_SET_SEL'
set_desc_base(&gdt[(selname) >> 3], (u32)(address)); \
^
>> drivers/pnp/pnpbios/bioscalls.c:58:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
set_desc_base(&gdt[(selname) >> 3], (u32)(address)); \
^
>> drivers/pnp/pnpbios/bioscalls.c:106:3: note: in expansion of macro 'Q2_SET_SEL'
Q2_SET_SEL(smp_processor_id(), PNP_TS1, ts1_base, ts1_size);
^
>> drivers/pnp/pnpbios/bioscalls.c:108:34: error: 'PNP_TS2' undeclared (first use in this function)
Q2_SET_SEL(smp_processor_id(), PNP_TS2, ts2_base, ts2_size);
^
drivers/pnp/pnpbios/bioscalls.c:58:22: note: in definition of macro 'Q2_SET_SEL'
set_desc_base(&gdt[(selname) >> 3], (u32)(address)); \
^
>> drivers/pnp/pnpbios/bioscalls.c:58:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
set_desc_base(&gdt[(selname) >> 3], (u32)(address)); \
^
drivers/pnp/pnpbios/bioscalls.c:108:3: note: in expansion of macro 'Q2_SET_SEL'
Q2_SET_SEL(smp_processor_id(), PNP_TS2, ts2_base, ts2_size);
^
>> drivers/pnp/pnpbios/bioscalls.c:133:13: error: 'PNP_CS32' undeclared (first use in this function)
"i"(PNP_CS32), "i"(0)
^
drivers/pnp/pnpbios/bioscalls.c: In function '__pnp_bios_dev_node_info':
drivers/pnp/pnpbios/bioscalls.c:259:55: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_NUM_SYS_DEV_NODES, 0, PNP_TS1, 2,
^
>> drivers/pnp/pnpbios/bioscalls.c:260:20: error: 'PNP_DS' undeclared (first use in this function)
PNP_TS1, PNP_DS, 0, 0, data,
^
drivers/pnp/pnpbios/bioscalls.c: In function '__pnp_bios_get_dev_node':
drivers/pnp/pnpbios/bioscalls.c:300:50: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_SYS_DEV_NODE, 0, PNP_TS1, 0, PNP_TS2,
^
drivers/pnp/pnpbios/bioscalls.c:300:62: error: 'PNP_TS2' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_SYS_DEV_NODE, 0, PNP_TS1, 0, PNP_TS2,
^
drivers/pnp/pnpbios/bioscalls.c:301:25: error: 'PNP_DS' undeclared (first use in this function)
boot ? 2 : 1, PNP_DS, 0, &tmp_nodenum,
^
drivers/pnp/pnpbios/bioscalls.c: In function '__pnp_bios_set_dev_node':
drivers/pnp/pnpbios/bioscalls.c:332:59: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_SET_SYS_DEV_NODE, nodenum, 0, PNP_TS1,
^
drivers/pnp/pnpbios/bioscalls.c:333:25: error: 'PNP_DS' undeclared (first use in this function)
boot ? 2 : 1, PNP_DS, 0, 0, data, 65536, NULL,
^
drivers/pnp/pnpbios/bioscalls.c: In function 'pnp_bios_dock_station_info':
drivers/pnp/pnpbios/bioscalls.c:364:65: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_DOCKING_STATION_INFORMATION, 0, PNP_TS1,
^
drivers/pnp/pnpbios/bioscalls.c:365:11: error: 'PNP_DS' undeclared (first use in this function)
PNP_DS, 0, 0, 0, 0, data,
^
drivers/pnp/pnpbios/bioscalls.c: In function '__pnp_bios_get_stat_res':
drivers/pnp/pnpbios/bioscalls.c:381:61: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_STATIC_ALLOCED_RES_INFO, 0, PNP_TS1,
^
drivers/pnp/pnpbios/bioscalls.c:382:11: error: 'PNP_DS' undeclared (first use in this function)
PNP_DS, 0, 0, 0, 0, info, 65536, NULL, 0);
^
drivers/pnp/pnpbios/bioscalls.c: In function '__pnp_bios_isapnp_config':
drivers/pnp/pnpbios/bioscalls.c:405:58: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_PNP_ISA_CONFIG_STRUC, 0, PNP_TS1, PNP_DS,
^
drivers/pnp/pnpbios/bioscalls.c:405:67: error: 'PNP_DS' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_PNP_ISA_CONFIG_STRUC, 0, PNP_TS1, PNP_DS,
^
drivers/pnp/pnpbios/bioscalls.c: In function '__pnp_bios_escd_info':
drivers/pnp/pnpbios/bioscalls.c:430:47: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_GET_ESCD_INFO, 0, PNP_TS1, 2, PNP_TS1, 4,
^
drivers/pnp/pnpbios/bioscalls.c:431:20: error: 'PNP_DS' undeclared (first use in this function)
PNP_TS1, PNP_DS, data,
^
drivers/pnp/pnpbios/bioscalls.c: In function '__pnp_bios_read_escd':
drivers/pnp/pnpbios/bioscalls.c:456:43: error: 'PNP_TS1' undeclared (first use in this function)
status = call_pnp_bios(PNP_READ_ESCD, 0, PNP_TS1, PNP_TS2, PNP_DS, 0, 0,
^
drivers/pnp/pnpbios/bioscalls.c:456:52: error: 'PNP_TS2' undeclared (first use in this function)
status = call_pnp_bios(PNP_READ_ESCD, 0, PNP_TS1, PNP_TS2, PNP_DS, 0, 0,
^
drivers/pnp/pnpbios/bioscalls.c:456:61: error: 'PNP_DS' undeclared (first use in this function)
status = call_pnp_bios(PNP_READ_ESCD, 0, PNP_TS1, PNP_TS2, PNP_DS, 0, 0,
^
drivers/pnp/pnpbios/bioscalls.c: In function 'pnpbios_calls_init':
>> drivers/pnp/pnpbios/bioscalls.c:477:31: error: 'PNP_CS16' undeclared (first use in this function)
pnp_bios_callpoint.segment = PNP_CS16;
^
>> drivers/pnp/pnpbios/bioscalls.c:483:22: error: 'GDT_ENTRY_PNPBIOS_CS32' undeclared (first use in this function)
set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_CS32],
^
>> drivers/pnp/pnpbios/bioscalls.c:485:22: error: 'GDT_ENTRY_PNPBIOS_CS16' undeclared (first use in this function)
set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_CS16],
^
>> drivers/pnp/pnpbios/bioscalls.c:487:22: error: 'GDT_ENTRY_PNPBIOS_DS' undeclared (first use in this function)
set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_DS],
^
--
drivers/scsi/ultrastor.c:1034:5: sparse: symbol 'ultrastor_biosparam' was not declared. Should it be static?
drivers/scsi/ultrastor.c: In function 'ultrastor_info':
>> drivers/scsi/ultrastor.c:674:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
config.port_address, (int)config.bios_segment,
^
drivers/scsi/ultrastor.c:678:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
config.port_address, (int)config.bios_segment,
^
drivers/scsi/ultrastor.c: In function 'ultrastor_abort':
drivers/scsi/ultrastor.c:888:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ogm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 23));
^
drivers/scsi/ultrastor.c:890:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
icm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 28));
^
drivers/scsi/ultrastor.c: In function 'ultrastor_interrupt':
drivers/scsi/ultrastor.c:1066:50: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
printk("Ux4F interrupt: bad MSCP address %x\n", (unsigned int) mscp);
^
drivers/scsi/ultrastor.c:1080:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
mscp_index, (unsigned int) mscp);
^
drivers/scsi/ultrastor.c:1109:51: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
printk("MSCP %d (%x): no command\n", mscp_index, (unsigned int) mscp);
^
drivers/scsi/ultrastor.c:1160:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
mscp_index, (unsigned int) mscp, config.aborted[mscp_index]);
^sparse warnings: (new ones prefixed by >>)
>> drivers/isdn/icn/icn.c:721:2: sparse: TODO test headroom or use skb->nb to flag ACK
drivers/isdn/icn/icn.c:1048:49: sparse: incorrect type in argument 2 (different address spaces)
drivers/isdn/icn/icn.c:1048:49: expected void const [noderef] <asn:1>*from
drivers/isdn/icn/icn.c:1048:49: got unsigned char const [usertype] *buf
drivers/isdn/icn/icn.c:1476:38: sparse: incorrect type in argument 1 (different address spaces)
drivers/isdn/icn/icn.c:1476:38: expected unsigned char const [usertype] *buf
drivers/isdn/icn/icn.c:1476:38: got unsigned char const [noderef] [usertype] <asn:1>*buf
drivers/isdn/icn/icn.c: In function 'icn_sendbuf':
drivers/isdn/icn/icn.c:721:2: warning: #warning TODO test headroom or use skb->nb to flag ACK [-Wcpp]
#warning TODO test headroom or use skb->nb to flag ACK
^vim +/SEGMENT_IS_PNP_CODE +23 arch/x86/mm/extable.c
6d48583b Harvey Harrison 2008-01-30 @1 #include <linux/module.h>
6d48583b Harvey Harrison 2008-01-30 2 #include <linux/spinlock.h>
70627654 H. Peter Anvin 2012-04-20 3 #include <linux/sort.h>
6d48583b Harvey Harrison 2008-01-30 4 #include <asm/uaccess.h>
6d48583b Harvey Harrison 2008-01-30 5
70627654 H. Peter Anvin 2012-04-20 6 static inline unsigned long
70627654 H. Peter Anvin 2012-04-20 7 ex_insn_addr(const struct exception_table_entry *x)
70627654 H. Peter Anvin 2012-04-20 8 {
70627654 H. Peter Anvin 2012-04-20 9 return (unsigned long)&x->insn + x->insn;
70627654 H. Peter Anvin 2012-04-20 10 }
70627654 H. Peter Anvin 2012-04-20 11 static inline unsigned long
70627654 H. Peter Anvin 2012-04-20 12 ex_fixup_addr(const struct exception_table_entry *x)
70627654 H. Peter Anvin 2012-04-20 13 {
70627654 H. Peter Anvin 2012-04-20 14 return (unsigned long)&x->fixup + x->fixup;
70627654 H. Peter Anvin 2012-04-20 15 }
6d48583b Harvey Harrison 2008-01-30 16
6d48583b Harvey Harrison 2008-01-30 17 int fixup_exception(struct pt_regs *regs)
6d48583b Harvey Harrison 2008-01-30 18 {
6d48583b Harvey Harrison 2008-01-30 19 const struct exception_table_entry *fixup;
70627654 H. Peter Anvin 2012-04-20 20 unsigned long new_ip;
6d48583b Harvey Harrison 2008-01-30 21
6d48583b Harvey Harrison 2008-01-30 22 #ifdef CONFIG_PNPBIOS
6d48583b Harvey Harrison 2008-01-30 @23 if (unlikely(SEGMENT_IS_PNP_CODE(regs->cs))) {
6d48583b Harvey Harrison 2008-01-30 24 extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
6d48583b Harvey Harrison 2008-01-30 25 extern u32 pnp_bios_is_utter_crap;
6d48583b Harvey Harrison 2008-01-30 26 pnp_bios_is_utter_crap = 1;:::::: The code at line 23 was first introduced by commit
:::::: 6d48583ba9ade609634e694fc35ea62b7a8adaaa x86: unify extable_{32|64}.c
:::::: TO: Harvey Harrison <[email protected]> :::::: CC: Ingo Molnar <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation