* Re: [Linux-ia64] Proper fix for sym53c8xx_2 driver and dma64_addr_t
2002-02-06 8:45 ` David S. Miller
@ 2002-02-05 21:23 ` Gérard Roudier
2002-02-06 17:10 ` Christoph Hellwig
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Gérard Roudier @ 2002-02-05 21:23 UTC (permalink / raw)
To: David S. Miller; +Cc: hch, davidm, mmadore, linux-ia64, linux-kernel, torvalds
On Wed, 6 Feb 2002, David S. Miller wrote:
> From: Christoph Hellwig <hch@caldera.de>
> Date: Wed, 6 Feb 2002 09:35:58 +0100
>
> On Wed, Feb 06, 2002 at 12:29:06AM -0800, David S. Miller wrote:
> > So who needs it? :-)
>
> The new sym53c8xx driver (sym2), and that one only if is actually is
> configured for DAC-mode (SYM_CONF_DMA_ADDRESSING_MODE > 0).
>
> It is not using the DMA apis correctly then, it should be using
> dma_addr_t which may or may not be 64-bits on a given platform.
>
> The sym2 driver needs to be fixed.
The code written at 't' time was using what was available at that time.
If you can let me know when Linux will be rewritten in Java, this will be
useful for me to be ready in time. :-)
--- sym_glue.c Sun Dec 30 21:33:10 2001
+++ a.c Tue Feb 5 22:17:30 2002
@@ -313,11 +313,7 @@
#ifndef SYM_LINUX_DYNAMIC_DMA_MAPPING
typedef u_long bus_addr_t;
#else
-#if SYM_CONF_DMA_ADDRESSING_MODE > 0
-typedef dma64_addr_t bus_addr_t;
-#else
typedef dma_addr_t bus_addr_t;
-#endif
#endif
You may get a couple of warnings, but since I haven't hardware to check
this, I am ready to apply patches.
Gérard.
PS:
The driver Java version is planned to be available on April the 1rst. ;)
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Linux-ia64] Proper fix for sym53c8xx_2 driver and dma64_addr_t
2002-02-06 8:45 ` David S. Miller
2002-02-05 21:23 ` Gérard Roudier
@ 2002-02-06 17:10 ` Christoph Hellwig
2002-02-06 17:15 ` Christoph Hellwig
2002-02-06 17:15 ` David Mosberger
2002-02-07 2:09 ` David S. Miller
3 siblings, 1 reply; 12+ messages in thread
From: Christoph Hellwig @ 2002-02-06 17:10 UTC (permalink / raw)
To: David S. Miller; +Cc: davidm, mmadore, linux-ia64, linux-kernel, groudier
On Wed, Feb 06, 2002 at 12:45:03AM -0800, David S. Miller wrote:
> It is not using the DMA apis correctly then, it should be using
> dma_addr_t which may or may not be 64-bits on a given platform.
When the sym2 driver is configured with SYM_CONF_DMA_ADDRESSING_MOD > 1
it uses DAC accessing and needs dma64_addr_t. It doesn't use it
when using the default addressing mode.
Christoph
--
Of course it doesn't work. We've performed a software upgrade.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Linux-ia64] Proper fix for sym53c8xx_2 driver and dma64_addr_t
2002-02-06 17:10 ` Christoph Hellwig
@ 2002-02-06 17:15 ` Christoph Hellwig
0 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2002-02-06 17:15 UTC (permalink / raw)
Cc: David S. Miller, davidm, mmadore, linux-ia64, linux-kernel, groudier
On Wed, Feb 06, 2002 at 06:10:42PM +0100, Christoph Hellwig wrote:
> On Wed, Feb 06, 2002 at 12:45:03AM -0800, David S. Miller wrote:
> > It is not using the DMA apis correctly then, it should be using
> > dma_addr_t which may or may not be 64-bits on a given platform.
>
> When the sym2 driver is configured with SYM_CONF_DMA_ADDRESSING_MOD > 1
> it uses DAC accessing and needs dma64_addr_t. It doesn't use it
> when using the default addressing mode.
Sorry, it doesn't use the _dac_ APIs. Still I'm the opinion that either
architecture should support dma64_addr_t or we need a HAVE_PCI_DAC_API
define.
Christoph
--
Of course it doesn't work. We've performed a software upgrade.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Linux-ia64] Proper fix for sym53c8xx_2 driver and dma64_addr_t
2002-02-06 8:45 ` David S. Miller
2002-02-05 21:23 ` Gérard Roudier
2002-02-06 17:10 ` Christoph Hellwig
@ 2002-02-06 17:15 ` David Mosberger
2002-02-05 21:34 ` Gérard Roudier
2002-02-07 2:09 ` David S. Miller
3 siblings, 1 reply; 12+ messages in thread
From: David Mosberger @ 2002-02-06 17:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: David S. Miller, davidm, mmadore, linux-ia64, linux-kernel, groudier
>>>>> On Wed, 6 Feb 2002 18:10:42 +0100, Christoph Hellwig <hch@caldera.de> said:
Christoph> On Wed, Feb 06, 2002 at 12:45:03AM -0800, David S. Miller
Christoph> wrote:
>> It is not using the DMA apis correctly then, it should be using
>> dma_addr_t which may or may not be 64-bits on a given platform.
Christoph> When the sym2 driver is configured with
Christoph> SYM_CONF_DMA_ADDRESSING_MOD > 1 it uses DAC accessing and
Christoph> needs dma64_addr_t. It doesn't use it when using the
Christoph> default addressing mode.
The driver never uses the pci_dac* interface, hence it should not use
dma64_addr_t. If the driver needs a 64-bit wide type, u64 will do
fine.
--david
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Linux-ia64] Proper fix for sym53c8xx_2 driver and dma64_addr_t
2002-02-06 17:15 ` David Mosberger
@ 2002-02-05 21:34 ` Gérard Roudier
0 siblings, 0 replies; 12+ messages in thread
From: Gérard Roudier @ 2002-02-05 21:34 UTC (permalink / raw)
To: David Mosberger
Cc: Christoph Hellwig, David S. Miller, mmadore, linux-ia64, linux-kernel
On Wed, 6 Feb 2002, David Mosberger wrote:
> >>>>> On Wed, 6 Feb 2002 18:10:42 +0100, Christoph Hellwig <hch@caldera.de> said:
>
> Christoph> On Wed, Feb 06, 2002 at 12:45:03AM -0800, David S. Miller
> Christoph> wrote:
> >> It is not using the DMA apis correctly then, it should be using
> >> dma_addr_t which may or may not be 64-bits on a given platform.
>
> Christoph> When the sym2 driver is configured with
> Christoph> SYM_CONF_DMA_ADDRESSING_MOD > 1 it uses DAC accessing and
> Christoph> needs dma64_addr_t. It doesn't use it when using the
> Christoph> default addressing mode.
>
> The driver never uses the pci_dac* interface, hence it should not use
> dma64_addr_t. If the driver needs a 64-bit wide type, u64 will do
> fine.
The driver was ready for PCI DAC months before the Linux way to do DAC was
stabilized to the current one. Given the discussion on the harmless way
the sym2 driver is using dma64_addr_t, it seems to me that this interface
may still move.
This let me think that the real problem is not the sym2 driver here, but
rather the Linux IO interfaces saga that lasts from years.
For now just replacing all occurrences (in fact only 1) of the offending
dma64 thing in sym_glue.c by the corresponding dma thing should do the
trick and close this thread as a result.
If you want to discuss about either PCI DAC under Linux or Linux-i64 arch
(that btw seems to be dead prior to have born) then, please, change the
subject of this thread.
Gérard.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Linux-ia64] Proper fix for sym53c8xx_2 driver and dma64_addr_t
2002-02-06 8:45 ` David S. Miller
` (2 preceding siblings ...)
2002-02-06 17:15 ` David Mosberger
@ 2002-02-07 2:09 ` David S. Miller
2002-02-06 21:38 ` Gérard Roudier
3 siblings, 1 reply; 12+ messages in thread
From: David S. Miller @ 2002-02-07 2:09 UTC (permalink / raw)
To: hch; +Cc: davidm, mmadore, linux-ia64, linux-kernel, groudier
From: Christoph Hellwig <hch@caldera.de>
Date: Wed, 6 Feb 2002 18:10:42 +0100
When the sym2 driver is configured with SYM_CONF_DMA_ADDRESSING_MOD > 1
it uses DAC accessing and needs dma64_addr_t. It doesn't use it
when using the default addressing mode.
NO it damn well does not! If the platform is NEVER GOING TO GIVE the
driver a 64-bit address (because, for example, it has IOMMU hardware),
dma_addr_t need only be 32-bits and that it how it is declared on
several platforms.
Please read the DMA API documentation.
dma64_addr_t is _ONLY_, I REPEAT _ONLY_ to be used when the driver
is making use of the following routines for it's DMA usage:
pci_dac_page_to_dma
pci_dac_dma_to_page
pci_dac_dma_to_offset
pci_dac_dma_sync_single
And NO SCSI OR NET driver should ever use these routines.
In fact, no driver in the tree right now should be using this.
The only known example that needs those interfaces are clustering
cards. And thats it!
Everything in the tree right now should use only pci_map_single and
friends, and it should set the device DMA mask bits properly to
indicate DAC capability. Do you see any pci_map_single, pci_map_sg,
etc. implementation working with dma64_addr_t arguments? If so, thats
a huge bug and it must be fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [Linux-ia64] Proper fix for sym53c8xx_2 driver and dma64_addr_t
2002-02-07 2:09 ` David S. Miller
@ 2002-02-06 21:38 ` Gérard Roudier
0 siblings, 0 replies; 12+ messages in thread
From: Gérard Roudier @ 2002-02-06 21:38 UTC (permalink / raw)
To: David S. Miller; +Cc: hch, davidm, mmadore, linux-ia64, linux-kernel
On Wed, 6 Feb 2002, David S. Miller wrote:
> From: Christoph Hellwig <hch@caldera.de>
> Date: Wed, 6 Feb 2002 18:10:42 +0100
>
> When the sym2 driver is configured with SYM_CONF_DMA_ADDRESSING_MOD > 1
> it uses DAC accessing and needs dma64_addr_t. It doesn't use it
> when using the default addressing mode.
>
> NO it damn well does not! If the platform is NEVER GOING TO GIVE the
> driver a 64-bit address (because, for example, it has IOMMU hardware),
> dma_addr_t need only be 32-bits and that it how it is declared on
> several platforms.
>
> Please read the DMA API documentation.
>
> dma64_addr_t is _ONLY_, I REPEAT _ONLY_ to be used when the driver
> is making use of the following routines for it's DMA usage:
>
> pci_dac_page_to_dma
> pci_dac_dma_to_page
> pci_dac_dma_to_offset
> pci_dac_dma_sync_single
>
> And NO SCSI OR NET driver should ever use these routines.
>
> In fact, no driver in the tree right now should be using this.
> The only known example that needs those interfaces are clustering
> cards. And thats it!
>
> Everything in the tree right now should use only pci_map_single and
> friends, and it should set the device DMA mask bits properly to
> indicate DAC capability. Do you see any pci_map_single, pci_map_sg,
> etc. implementation working with dma64_addr_t arguments? If so, thats
> a huge bug and it must be fixed.
You should calm down, in my opinion. All the burden about the PCI dma API
is your fault to you David and you David. :)
It takes a too long time for you 2 Davids to agree about this API.
Personnally, I donnot care about dma64_addr_t versus dma_addr_t being 32,
64 even 69 bits (why not, some machine with 36 bit addressing are still in
use).
Just change the topic, please. The sym2 driver has nothing to do with this
boring thread.
Gérard.
^ permalink raw reply [flat|nested] 12+ messages in thread