23 Jan, 2010

2 commits


12 Jan, 2010

1 commit


31 Dec, 2009

1 commit

  • Stephen Rothwell reported the following build warning:

    lib/dma-debug.c: In function 'dma_debug_device_change':
    lib/dma-debug.c:680: warning: 'return' with no value, in function returning non-void

    Introduced by commit f797d9881b62c2ddb1d2e7bd80d87141949c84aa
    ("dma-debug: Do not add notifier when dma debugging is disabled").

    Return 0 [notify-done] when disabled. (this is standard bus notifier behavior.)

    Signed-off-by: Shaun Ruffell
    Signed-off-by: Joerg Roedel
    Cc: Linus Torvalds
    Cc:
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

21 Dec, 2009

1 commit

  • If CONFIG_HAVE_DMA_API_DEBUG is defined and "dma_debug=off" is
    specified on the kernel command line, when you detach a driver from a
    device you can cause the following NULL pointer dereference:

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] dma_debug_device_change+0x5d/0x117

    The problem is that the dma_debug_device_change notifier function is
    added to the bus notifier chain even though the dma_entry_hash array
    was never initialized. If dma debugging is disabled, this patch both
    prevents dma_debug_device_change notifiers from being added to the
    chain, and additionally ensures that the dma_debug_device_change
    notifier function is a no-op.

    Cc: stable@kernel.org
    Signed-off-by: Shaun Ruffell
    Signed-off-by: Joerg Roedel

    Shaun Ruffell
     

04 Dec, 2009

1 commit

  • That is "success", "unknown", "through", "performance", "[re|un]mapping"
    , "access", "default", "reasonable", "[con]currently", "temperature"
    , "channel", "[un]used", "application", "example","hierarchy", "therefore"
    , "[over|under]flow", "contiguous", "threshold", "enough" and others.

    Signed-off-by: André Goddard Rosa
    Signed-off-by: Jiri Kosina

    André Goddard Rosa
     

29 Oct, 2009

1 commit

  • When PAE is enabled in the kernel configuration the size of
    phys_addr_t differs from the size of a void pointer. The gcc
    prints a warning about that in dma-debug code.
    This patch fixes the warning by converting the output to
    unsigned long long instead of a pointer.

    Signed-off-by: Joerg Roedel

    Joerg Roedel
     

21 Aug, 2009

1 commit

  • While it's debatable whether or not a NULL device argument to
    the DMA API functions is valid... since it certainly isn't
    valid on devices with an IOMMU... dma-debug really shouldn't be
    dereferencing null pointers either.

    Guard against that in err_printk and the driver_filter
    functions. A Fedora rawhide user was seeing this in one of the
    dvb drivers resulting in an oops on boot.

    [ A patch has been sent for testing to the driver, but I feel
    the dma debugging support should be fixed as well. (There's
    still a pile of legacy garbage in the kernel passing null
    pointers to dma_{alloc,free}_*. :( ]

    Signed-off-by: Kyle McMartin
    Cc: mchehab@infradead.org
    Cc: Joerg Roedel
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Kyle McMartin
     

11 Jul, 2009

1 commit

  • Linus noticed how unclean and buggy the overlap() function is:

    - It uses convoluted (and bug-causing) positive checks for
    range overlap - instead of using a more natural negative
    check.

    - Even the positive checks are buggy: a positive intersection
    check has four natural cases while we checked only for three,
    missing the (addr < start && addr2 == end) case for example.

    - The variables are mis-named, making it non-obvious how the
    check was done.

    - It needlessly uses u64 instead of unsigned long. Since these
    are kernel memory pointers and we explicitly exclude highmem
    ranges anyway we cannot ever overflow 32 bits, even if we
    could. (and on 64-bit it doesnt matter anyway)

    All in one, this function needs a total revamp. I used Linus's
    suggestions minus the paranoid checks (we cannot overflow really
    because if we get totally bad DMA ranges passed far more things
    break in the systems than just DMA debugging). I also fixed a
    few other small details i noticed.

    Reported-by: Linus Torvalds
    Cc: Joerg Roedel
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

17 Jun, 2009

1 commit

  • Alan Cox reported that lockdep runs out of its stack-trace entries
    with certain configs:

    BUG: MAX_STACK_TRACE_ENTRIES too low

    This happens because there are 1024 hash buckets, each with a
    separate lock. Lockdep puts each lock into a separate lock class and
    tracks them independently.

    But in reality we never take more than one of the buckets, so they
    really belong into a single lock-class. Annotate the has bucket lock
    init accordingly.

    [ Impact: reduce the lockdep footprint of dma-debug ]

    Reported-by: Alan Cox
    Signed-off-by: Ingo Molnar
    Signed-off-by: Joerg Roedel

    Ingo Molnar
     

16 Jun, 2009

1 commit


15 Jun, 2009

2 commits


08 Jun, 2009

5 commits


07 Jun, 2009

2 commits

  • …/joro/linux-2.6-iommu into core/iommu

    Ingo Molnar
     
  • Some device drivers map the same physical address multiple times to a
    dma address. Without an IOMMU this results in the same dma address being
    put into the dma-debug hash multiple times. With a first-fit match in
    hash_bucket_find() this function may return the wrong dma_debug_entry.

    This can result in false positive warnings. This patch fixes it by
    changing the first-fit behavior of hash_bucket_find() into a best-fit
    algorithm.

    Reported-by: Torsten Kaiser
    Reported-by: FUJITA Tomonori
    Signed-off-by: Joerg Roedel
    Cc: lethal@linux-sh.org
    Cc: just.for.lkml@googlemail.com
    Cc: hancockrwd@gmail.com
    Cc: jens.axboe@oracle.com
    Cc: bharrosh@panasas.com
    Cc: FUJITA Tomonori
    Cc: Linus Torvalds
    Cc:
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Joerg Roedel
     

02 Jun, 2009

4 commits


29 May, 2009

3 commits

  • DMA-mapping.txt says that debug_dma_sync_sg family must be called with
    the _same_ one you passed into the dma_map_sg call, it should _NOT_ be
    the 'count' value _returned_ from the dma_map_sg call.

    debug_dma_sync_sg_for_cpu and debug_dma_sync_sg_for_device can't
    handle this properly; they need to use the sg_mapped_ents in struct
    dma_debug_entry as debug_dma_unmap_sg() does.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Joerg Roedel

    FUJITA Tomonori
     
  • debug_dma_map_sg() and debug_dma_unmap_sg() use length in struct
    scatterlist while debug_dma_sync_sg_for_cpu() and
    debug_dma_sync_sg_for_device() use dma_length. This causes bugs
    warnings on some IOMMU implementations since these values are not
    same; the length doesn't represent the dma length.

    We always need to use sg_dma_len() accessor to get the dma length of a
    scatterlist entry.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Joerg Roedel

    FUJITA Tomonori
     
  • Architectures might not have dma_address in struct scatterlist (PARISC
    doesn't). Directly accessing to dma_address in struct scatterlist is
    wrong; we need to use sg_dma_address() accesssor instead.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Joerg Roedel

    FUJITA Tomonori
     

28 May, 2009

1 commit


11 May, 2009

1 commit


27 Apr, 2009

1 commit

  • The feature needs some more work because the notfier which is used to
    check for pending allocations is called before the device drivers
    ->remove() function. Therefore this feature reports false positives.

    A real fix for this issue is to introduce a new notifier event which sent
    _after_ the driver has deinitialized itself. That will done for the next
    kernel version.

    [ Impact: reduce the scope of CONFIG_DMA_API_DEBUG=y checks ]

    Signed-off-by: Joerg Roedel
    Cc: iommu@lists.linux-foundation.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Joerg Roedel
     

15 Apr, 2009

1 commit

  • We use a static value for the number of dma_debug_entries. It can be
    overwritten by a kernel command line option.

    Some IOMMUs (e.g. GART) can't set an appropriate value by a kernel
    command line option because they can't know such value until they
    finish initializing up their hardware.

    This patch adds dma_debug_resize_entries() enables IOMMUs to adjust
    the number of dma_debug_entries anytime.

    Signed-off-by: FUJITA Tomonori
    Acked-by: Joerg Roedel
    Cc: fujita.tomonori@lab.ntt.co.jp
    Cc: akpm@linux-foundation.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    FUJITA Tomonori
     

31 Mar, 2009

1 commit

  • Fix printk format warnings in dma-debug:

    lib/dma-debug.c:645: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
    lib/dma-debug.c:662: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
    lib/dma-debug.c:676: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
    lib/dma-debug.c:686: warning: format '%016llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

24 Mar, 2009

1 commit

  • Impact: extend on-kernel-stack DMA debug checks to all !highmem pages

    We only checked dma_map_single() - extend it to dma_map_page()
    and dma_map_sg() as well.

    Also, fix dma_map_single() corner case bug: make sure we dont
    stack-check highmem (not mapped) pages.

    Reported-by: FUJITA Tomonori
    Signed-off-by: Joerg Roedel
    Cc: iommu@lists.linux-foundation.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Joerg Roedel
     

19 Mar, 2009

1 commit


17 Mar, 2009

4 commits


06 Mar, 2009

2 commits