lkml.org 
[lkml]   [2002]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC] generic device DMA implementation
    From
    Date
    James Bottomley writes:
    > Currently our only DMA API is highly PCI specific (making any non-pci
    > bus with a DMA controller create fake PCI devices to help it
    > function).
    >
    > Now that we have the generic device model, it should be equally
    > possible to rephrase the entire API for generic devices instead of
    > pci_devs.

    Keep in mind that sometimes the actual _implementation_ is also highly
    PCI-specific -- that is, what works for PCI devices may not work for
    other devices and vice-versa.

    So perhaps instead of just replacing `pci_...' with `dma_...', it would
    be better to add new function pointers to `struct bus_type' for all this
    stuff (or something like that).

    > The PCI api has pci_alloc_consistent which allocates only consistent memory
    > and fails the allocation if none is available thus leading to driver writers
    > who might need to function with inconsistent memory to detect this and employ
    > a fallback strategy.
    > ...
    > The idea is that the memory type can be coded into dma_addr_t which the
    > subsequent memory sync operations can use to determine whether
    > wback/invalidate should be a nop or not.

    How is the driver supposed to tell whether a given dma_addr_t value
    represents consistent memory or not? It seems like an (arch-specific)
    `dma_addr_is_consistent' function is necessary, but I couldn't see one
    in your patch.

    Thanks,

    -Miles
    --
    We are all lying in the gutter, but some of us are looking at the stars.
    -Oscar Wilde
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:31    [W:2.300 / U:1.632 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site