* [PATCH] ISA stubs for ia64
@ 2004-04-06 22:30 Bjorn Helgaas
2004-04-06 23:18 ` David Mosberger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2004-04-06 22:30 UTC (permalink / raw)
To: linux-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__ */
/*
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ISA stubs for ia64
2004-04-06 22:30 [PATCH] ISA stubs for ia64 Bjorn Helgaas
@ 2004-04-06 23:18 ` David Mosberger
2004-04-07 15:09 ` Bjorn Helgaas
2004-04-07 17:42 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-04-06 23:18 UTC (permalink / raw)
To: linux-ia64
>>>>> On Tue, 6 Apr 2004 16:30:20 -0600, Bjorn Helgaas <bjorn.helgaas@hp.com> said:
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ISA stubs for ia64
2004-04-06 22:30 [PATCH] ISA stubs for ia64 Bjorn Helgaas
2004-04-06 23:18 ` David Mosberger
@ 2004-04-07 15:09 ` Bjorn Helgaas
2004-04-07 17:42 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2004-04-07 15:09 UTC (permalink / raw)
To: linux-ia64
On Tuesday 06 April 2004 5:18 pm, David Mosberger wrote:
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ISA stubs for ia64
2004-04-06 22:30 [PATCH] ISA stubs for ia64 Bjorn Helgaas
2004-04-06 23:18 ` David Mosberger
2004-04-07 15:09 ` Bjorn Helgaas
@ 2004-04-07 17:42 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-04-07 17:42 UTC (permalink / raw)
To: linux-ia64
>>>>> On Wed, 7 Apr 2004 09:09:12 -0600, Bjorn Helgaas <bjorn.helgaas@hp.com> said:
Bjorn> On Tuesday 06 April 2004 5:18 pm, David Mosberger wrote:
>> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-04-07 17:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-06 22:30 [PATCH] ISA stubs for ia64 Bjorn Helgaas
2004-04-06 23:18 ` David Mosberger
2004-04-07 15:09 ` Bjorn Helgaas
2004-04-07 17:42 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox