Skip to contentSkip to conversation

ISA stubs for ia64

PATCH In review Bjorn Helgaas 2 participants 4 messages Apr 6, 2004 – Apr 7, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ISA stubs for ia64

These stubs allow us to build all the old drivers that assume ISA is present. (Many of these support both ISA and PCI adapters, so we do actually want them.)

With this patch and the others I just posted (hw_random, simscsi, gen_rtc), we can build allmodconfig on ia64.

=== include/asm-ia64/dma.h 1.3 vs edited ==--- 1.3/include/asm-ia64/dma.h Mon Aug 12 21:47:44 2002
+++ edited/include/asm-ia64/dma.h Tue Apr 6 15:43:16 2004
@@ -18,6 +18,29 @@

 # define isa_dma_bridge_buggy 	(0)
 #endif

-#define free_dma(x)
+/* if drivers used CONFIG_ISA, we wouldn't need this stuff */ +
+#define DMA_MODE_READ 0
+#define DMA_MODE_WRITE 0
+#define DMA_MODE_CASCADE 0
+#define DMA_AUTOINIT 0
+
+#define MAX_DMA_CHANNELS 0
+
+static inline int +unsupported_isa_dma_interface(void)
+{
+ BUG();
+ return 0;
+}
+
+#define request_dma(dmanr,id) unsupported_isa_dma_interface()
+#define enable_dma(dmanr) unsupported_isa_dma_interface()
+#define disable_dma(dmanr) unsupported_isa_dma_interface()
+#define set_dma_mode(dmanr,mode) unsupported_isa_dma_interface()
+#define claim_dma_lock() unsupported_isa_dma_interface()
+#define release_dma_lock(flags) unsupported_isa_dma_interface()
+#define clear_dma_ff(chan) unsupported_isa_dma_interface()
+#define free_dma(dmanr) unsupported_isa_dma_interface()

#endif /* _ASM_IA64_DMA_H */
=== include/asm-ia64/io.h 1.19 vs edited ==--- 1.19/include/asm-ia64/io.h Tue Feb 3 22:31:10 2004
+++ edited/include/asm-ia64/io.h Tue Apr 6 15:41:40 2004
@@ -431,6 +431,20 @@
#define dma_cache_wback(_start,_size) do { } while (0)
#define dma_cache_wback_inv(_start,_size) do { } while (0)

+/* if drivers used CONFIG_ISA, we wouldn't need this stuff */ +
+static inline int
+unsupported_isa_interface(void)
+{
+ BUG();
+ return 0;
+}
+
+#define isa_virt_to_bus(address) unsupported_isa_interface()
+#define isa_readb(address) unsupported_isa_interface()
+#define isa_memcpy_fromio(to,from,count) unsupported_isa_interface()
+#define isa_check_signature(io,sig,len) unsupported_isa_interface()
+

 # endif /* __KERNEL__ */

/*

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Bjorn Helgaas

Bjorn> These stubs allow us to build all the old drivers that assume Bjorn> ISA is present. (Many of these support both ISA and PCI Bjorn> adapters, so we do actually want them.)

Bjorn> With this patch and the others I just posted (hw_random, Bjorn> simscsi, gen_rtc), we can build allmodconfig on ia64.

I don't like this patch at all. The #defines to unsupported_isa_dma_interface() turn compile-time errors into potential runtime errors. With a properly abstracted interface, the ISA-compatibility-macros should not lead to any code in ISA-free systems (and hence there would be no possibility of runtime errors).

	--david
#2 lore raw
In reply to Bjorn Helgaas
Quoted 5 lines · David Mosberger

I don't like this patch at all. The #defines to unsupported_isa_dma_interface() turn compile-time errors into potential runtime errors. With a properly abstracted interface, the ISA-compatibility-macros should not lead to any code in ISA-free systems (and hence there would be no possibility of runtime errors).

True. I actually started by modifying drivers to use CONFIG_ISA to determine whether to use ISA interfaces, but (a) that leads to a lot of changes, most of which I can't test and have the potential to break other arches, and (b) somebody suggested that ISA is sort of a special case because it hasn't been converted to the driver model.

But I certainly agree that it would be a lot cleaner.

#3 lore raw
In reply to Bjorn Helgaas
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Bjorn Helgaas
Quoted 5 lines · David Mosberger
Quoted 5 lines

I don't like this patch at all. The #defines to unsupported_isa_dma_interface() turn compile-time errors into potential runtime errors. With a properly abstracted interface, the ISA-compatibility-macros should not lead to any code in ISA-free systems (and hence there would be no possibility of runtime errors).

Bjorn> True. I actually started by modifying drivers to use CONFIG_ISA to Bjorn> determine whether to use ISA interfaces, but (a) that leads to a lot Bjorn> of changes, most of which I can't test and have the potential to break Bjorn> other arches, and (b) somebody suggested that ISA is sort of a special Bjorn> case because it hasn't been converted to the driver model.

Bjorn> But I certainly agree that it would be a lot cleaner.

If it's not possible to define ISA-compatibility macros that expand into no runtime code, I don't see an easy solution. Perhaps we could at least provide macros such that a driver _can_ be converted to such a model. It will still require fixing some/many/most drivers with ISA-support, but to get allmodonf to work, we could just disable a driver altogether if it depends on ISA and the platform doesn't support ISA. The cleanup/conversion can then be done incrementally, as the need arises.

	--david