Re: [PATCH] RFC: kills consistent_dma_mask

From: Jes Sorensen
Date: Mon Aug 18 2003 - 08:05:22 EST


>>>>> "Krzysztof" == Krzysztof Halasa <khc@xxxxxxxxx> writes:

Krzysztof> "David S. Miller" <davem@xxxxxxxxxx> writes:
>> ia64 does in fact need consistent_dma_mask.

Krzysztof> For what? Perhaps a file name?

Because some ia64 boxen do not have physical memory in the lower 4GB
region and the PCI-X spec requires cards to support dual-address
cycles (aka 64 bit addressing) so some boxes do not have an MMU
operating when slots are in PCI-X mode. One can argue whether this is
a good idea or not, however it *is* spec compliant.

Krzysztof> No. This is only true if you set dma_mask =
Krzysztof> consistent_dma_mask. If they aren't equal (and don't cover
Krzysztof> the entire RAM address space) the thing is broken. If they
Krzysztof> have to be equal - why we need 2 masks in the first place?

Historically pci_alloc_consistent would always rely on the consistent
dma mask being <=32 bit. That is necessary because some adapters may
provide > 32bit addressing in their dynamic descriptors but only 32
bit in their consistent descriptors. This you are likely to find in
cases where the hardware vendor has added 'extended descriptors' to
their chips by sticking extra address bits into random places in their
control structures where there were a few bits free.

So yes, we *do* need both, having different masks for the two is in no
way broken.

We introduced pci_consistent_dma_mask for a reason, remember there are
computers out there that aren't PCs.

Jes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/