1. 15 Oct, 2010 1 commit
    • Arnd Bergmann's avatar
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann authored
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      see...
      6038f373
  2. 07 Apr, 2010 1 commit
  3. 22 Jan, 2010 1 commit
  4. 11 Jan, 2010 1 commit
  5. 31 Dec, 2009 1 commit
    • Ingo Molnar's avatar
      dma-debug: Fix bug causing build warning · a8fe9ea2
      Ingo Molnar authored
      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 f797d988
      
      
      ("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: default avatarShaun Ruffell <sruffell@digium.com>
      Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@kernel.org>
      LKML-Reference: <20091231125624.GA14666@liondog.tnic>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      a8fe9ea2
  6. 21 Dec, 2009 1 commit
    • Shaun Ruffell's avatar
      dma-debug: Do not add notifier when dma debugging is disabled. · f797d988
      Shaun Ruffell authored
      
      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: [<c0580d35>] 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: default avatarShaun Ruffell <sruffell@digium.com>
      Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
      f797d988
  7. 04 Dec, 2009 1 commit
  8. 29 Oct, 2009 1 commit
  9. 21 Aug, 2009 1 commit
    • Kyle McMartin's avatar
      dma-debug: Fix check_unmap null pointer dereference · ec9c96ef
      Kyle McMartin authored
      
      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: default avatarKyle McMartin <kyle@redhat.com>
      Cc: mchehab@infradead.org
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      LKML-Reference: <20090820011708.GP25206@bombadil.infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ec9c96ef
  10. 10 Jul, 2009 1 commit
    • Ingo Molnar's avatar
      dma-debug: Fix the overlap() function to be correct and readable · f39d1b97
      Ingo Molnar authored
      
      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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f39d1b97
  11. 17 Jun, 2009 1 commit
  12. 16 Jun, 2009 1 commit
  13. 15 Jun, 2009 2 commits
  14. 08 Jun, 2009 5 commits
  15. 07 Jun, 2009 1 commit
  16. 02 Jun, 2009 3 commits
  17. 29 May, 2009 3 commits
  18. 28 May, 2009 1 commit
  19. 26 Apr, 2009 1 commit
    • Joerg Roedel's avatar
      dma-debug: remove broken dma memory leak detection for 2.6.30 · 314eeac9
      Joerg Roedel authored
      
      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: default avatarJoerg Roedel <joerg.roedel@amd.com>
      Cc: iommu@lists.linux-foundation.org
      LKML-Reference: <1240576557-22442-1-git-send-email-joerg.roedel@amd.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      314eeac9
  20. 15 Apr, 2009 1 commit
  21. 30 Mar, 2009 1 commit
    • Randy Dunlap's avatar
      dma-debug: fix printk formats (i386) · 93c36ed8
      Randy Dunlap authored
      
      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: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      93c36ed8
  22. 24 Mar, 2009 1 commit
  23. 19 Mar, 2009 1 commit
  24. 17 Mar, 2009 4 commits
  25. 05 Mar, 2009 4 commits