Linux-kernel mailing list archive 1999-23,: Re: [RFC] new bus architecture (+ byte-endianess)

# Re: [RFC] new bus architecture (+ byte-endianess)

Martin Mares (mj@ucw.cz)
Tue, 8 Jun 1999 00:37:49 +0200

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: debian: "howdy"
- Previous message: Martin Mares: "Re: [RFC] new bus architecture (+ byte-endianess)"

Hello,

> This won't probably work with IOMMU. E.g. on sparc64 once we kill GFP_DMA
> limiting to first 4GB physical. That's why buses using IOMMU will need some
> kind of acquire_dma/acquire_dma_sg/release_dma/release_dma_sg, so that IOMMU
> page tables can be dynamically filled up. And if you want to go between two
> different cards, then you'll have to use some special function which will
> fill two IO page tables if necessary (e.g. SBUS and PCI one). I don't know
> if SBUS<->SBUS DMA actually works, there are some bits for it but have never
> tried, but PCI<->other PCI should definitely work.

What about doing it this way: (imagine we need to access memory on bus1
from bus2)

(1) Convert bus1 address to physical address via bus1-specific function.
(2) Call bus2->acquire_dma on bus2 (a bus2-specific function).
This sets up the IOMMU.
(3) Do the transfer.
(4) Call bus2->release_dma.

BTW what should happen if the IOMMU address space is full? I guess
we cannot block in acquire_dma() since it can be run from a BH.
> But you need to take care of the bus endianity in case a system has more
> buses with different endians. E.g. say you have SBUS and PCI, SBUS is big
> endian and PCI little endian.
> So you either stick them into bus_ops (I'd recommend that),

Accessing readl() et al. via bus_ops is awfully slow.

> plus have some
> possibly inlineable functions for each different bus e.g. for cases where a
> driver is single bus only and will always be (many are).
> So you'd have
> read_32(bus_t bus, ptr) which would do bus->bus_ops->read_32(ptr) and then
> pci_read_32(ptr) which would be the pci version of the same. All these would
> work in its bus native order.

The inline functions are much better, but what if a single driver is able
to handle the same chip connected via different bus interfaces (for example
an ethernet chip available in both ISA and PCI cards)?

Have a nice fortnight

    --
    Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
    Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
    "If a train station is where the train stops, what is a work station?"

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

- Next message: debian: "howdy"
- Previous message: Martin Mares: "Re: [RFC] new bus architecture (+ byte-endianess)"