1. 29 12月, 2008 1 次提交
  2. 20 11月, 2008 1 次提交
  3. 17 11月, 2008 1 次提交
    • F
      swiotlb: use coherent_dma_mask in alloc_coherent · 1e74f300
      FUJITA Tomonori 提交于
      Impact: fix DMA buffer allocation coherency bug in certain configs
      
      This patch fixes swiotlb to use dev->coherent_dma_mask in
      swiotlb_alloc_coherent().
      
      coherent_dma_mask is a subset of dma_mask (equal to it most of
      the time), enumerating the address range that a given device
      is able to DMA to/from in a cache-coherent way.
      
      But currently, swiotlb uses dev->dma_mask in alloc_coherent()
      implicitly via address_needs_mapping(), but alloc_coherent is really
      supposed to use coherent_dma_mask.
      
      This bug could break drivers that uses smaller coherent_dma_mask than
      dma_mask (though the current code works for the majority that use the
      same mask for coherent_dma_mask and dma_mask).
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: tony.luck@intel.com
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1e74f300
  4. 10 11月, 2008 1 次提交
  5. 07 11月, 2008 1 次提交
  6. 06 11月, 2008 1 次提交
    • R
      cpumask: introduce new API, without changing anything · 2d3854a3
      Rusty Russell 提交于
      Impact: introduce new APIs
      
      We want to deprecate cpumasks on the stack, as we are headed for
      gynormous numbers of CPUs.  Eventually, we want to head towards an
      undefined 'struct cpumask' so they can never be declared on stack.
      
      1) New cpumask functions which take pointers instead of copies.
         (cpus_* -> cpumask_*)
      
      2) Several new helpers to reduce requirements for temporary cpumasks
         (cpumask_first_and, cpumask_next_and, cpumask_any_and)
      
      3) Helpers for declaring cpumasks on or offstack for large NR_CPUS
         (cpumask_var_t, alloc_cpumask_var and free_cpumask_var)
      
      4) 'struct cpumask' for explicitness and to mark new-style code.
      
      5) Make iterator functions stop at nr_cpu_ids (a runtime constant),
         not NR_CPUS for time efficiency and for smaller dynamic allocations
         in future.
      
      6) cpumask_copy() so we can allocate less than a full cpumask eventually
         (for alloc_cpumask_var), and so we can eliminate the 'struct cpumask'
         definition eventually.
      
      7) work_on_cpu() helper for doing task on a CPU, rather than saving old
         cpumask for current thread and manipulating it.
      
      8) smp_call_function_many() which is smp_call_function_mask() except
         taking a cpumask pointer.
      
      Note that this patch simply introduces the new functions and leaves
      the obsolescent ones in place.  This is to simplify the transition
      patches.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2d3854a3
  7. 30 10月, 2008 1 次提交
    • J
      Driver core: fix 'dynamic_debug' cmd line parameter · 11332830
      Jason Baron 提交于
      In testing 2.6.28-rc1, I found that passing 'dynamic_printk' on the command
      line didn't activate the debug code. The problem is that dynamic_printk_setup()
      (which activates the debugging) is being called before dynamic_printk_init() is
      called (which initializes infrastructure). Fix this by setting setting the
      state to 'DYNAMIC_ENABLED_ALL' in dynamic_printk_setup(), which will also
      cause all subsequent modules to have debugging automatically started, which is
      probably the behavior we want.
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      11332830
  8. 24 10月, 2008 2 次提交
    • F
      swiotlb: remove panic for alloc_coherent failure · a2b89b59
      FUJITA Tomonori 提交于
      swiotlb_alloc_coherent calls panic() when allocated swiotlb pages is
      not fit for a device's dma mask. However, alloc_coherent failure is
      not a disaster at all. AFAIK, none of other x86 and IA64 IOMMU
      implementations don't crash in case of alloc_coherent failure.
      
      There are some drivers that don't check alloc_coherent failure but not
      many (about ten and I've already started to fix some of
      them). alloc_coherent returns NULL in case of failure so it's likely
      that these guilty drivers crash immediately. So swiotlb doesn't need
      to call panic() just for them.
      Reported-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Tested-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a2b89b59
    • H
      [SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact · a8659597
      H. Peter Anvin 提交于
      We would hang forever when passing a zero to string_get_size().
      Furthermore, string_get_size() would produce decimals on a value small
      enough to be exact.  Finally, a few formatting issues are inconsistent
      with standard SI style guidelines.
      
      - If the value is less than the divisor, skip the entire rounding
        step.  This prints out all small values including zero as integers,
        without decimals.
      - Add a space between the value and the symbol for the unit,
        consistent with standard SI practice.
      - Lower case k in kB since we are talking about powers of 10.
      - Finally, change "int" to "unsigned int" in one place to shut up a
        gcc warning when compiling the code out-of-kernel for testing.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      a8659597
  9. 21 10月, 2008 2 次提交
  10. 20 10月, 2008 1 次提交
  11. 17 10月, 2008 11 次提交
  12. 14 10月, 2008 1 次提交
  13. 09 10月, 2008 5 次提交
    • J
      block: add fault injection mechanism for faking request timeouts · 581d4e28
      Jens Axboe 提交于
      Only works for the generic request timer handling. Allows one to
      sporadically ignore request completions, thus exercising the timeout
      handling.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      581d4e28
    • T
      init: DEBUG_BLOCK_EXT_DEVT requires explicit root= param · 55dc7db7
      Tejun Heo 提交于
      DEBUG_BLOCK_EXT_DEVT shuffles SCSI and IDE device numbers and root
      device number set using rdev become meaningless.  Root devices should
      be explicitly specified using textual names.  Warn about it if root
      can't be found and DEBUG_BLOCK_EXT_DEVT is enabled.  Also, add warning
      to the help text.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      55dc7db7
    • J
      Change default value of CONFIG_DEBUG_BLOCK_EXT_DEVT to 'n' · 759f8ca3
      Jens Axboe 提交于
      It's a debug option that you would explicitly enable to test this
      feature, we should default it to 'n' to prevent accidental surprises
      for now.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      759f8ca3
    • T
      block: implement CONFIG_DEBUG_BLOCK_EXT_DEVT · 870d6656
      Tejun Heo 提交于
      Extended devt introduces non-contiguos device numbers.  This patch
      implements a debug option which forces most devt allocations to be
      from the extended area and spreads them out.  This is enabled by
      default if DEBUG_KERNEL is set and achieves...
      
      1. Detects code paths in kernel or userland which expect predetermined
         consecutive device numbers.
      
      2. When something goes wrong, avoid corruption as adding to the minor
         of earlier partition won't lead to the wrong but valid device.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      870d6656
    • T
      klist: don't iterate over deleted entries · a1ed5b0c
      Tejun Heo 提交于
      A klist entry is kept on the list till all its current iterations are
      finished; however, a new iteration after deletion also iterates over
      deleted entries as long as their reference count stays above zero.
      This causes problems for cases where there are users which iterate
      over the list while synchronized against list manipulations and
      natuarally expect already deleted entries to not show up during
      iteration.
      
      This patch implements dead flag which gets set on deletion so that
      iteration can skip already deleted entries.  The dead flag piggy backs
      on the lowest bit of knode->n_klist and only visible to klist
      implementation proper.
      
      While at it, drop klist_iter->i_head as it's redundant and doesn't
      offer anything in semantics or performance wise as klist_iter->i_klist
      is dereferenced on every iteration anyway.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      a1ed5b0c
  14. 04 10月, 2008 1 次提交
  15. 03 10月, 2008 1 次提交
    • P
      rcu: RCU-based detection of stalled CPUs for Classic RCU · 2133b5d7
      Paul E. McKenney 提交于
      This patch adds stalled-CPU detection to Classic RCU.  This capability
      is enabled by a new config variable CONFIG_RCU_CPU_STALL_DETECTOR, which
      defaults disabled.
      
      This is a debugging feature to detect infinite loops in kernel code, not
      something that non-kernel-hackers would be expected to care about.
      
      This feature can detect looping CPUs in !PREEMPT builds and looping CPUs
      with preemption disabled in PREEMPT builds.  This is essentially a port of
      this functionality from the treercu patch, replacing the stall debug patch
      that is already in tip/core/rcu (commit 67182ae1).
      
      The changes from the patch in tip/core/rcu include making the config
      variable name match that in treercu, changing from seconds to jiffies to
      avoid spurious warnings, and printing a boot message when this feature
      is enabled.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2133b5d7
  16. 22 9月, 2008 1 次提交
  17. 19 9月, 2008 1 次提交
  18. 17 9月, 2008 1 次提交
    • D
      bitmap: add bitmap_copy_le() · ccbe329b
      David Vrabel 提交于
      bitmap_copy_le() copies a bitmap, putting the bits into little-endian
      order (i.e., each unsigned long word in the bitmap is put into
      little-endian order).
      
      The UWB stack used bitmaps to manage Medium Access Slot availability,
      and these bitmaps need to be written to the hardware in LE order.
      Signed-off-by: NDavid Vrabel <david.vrabel@csr.com>
      ccbe329b
  19. 12 9月, 2008 1 次提交
  20. 11 9月, 2008 1 次提交
    • D
      swiotlb: fix back-off path when memory allocation fails · 36223a39
      Daniel J Blueman 提交于
      This fixes a SWIOTLB oops
      
      With SWIOTLB being enabled and straight-forward page allocation
      failure [1], the swiotlb_alloc_coherent fall-back path hits an
      issue [2], resulting in my webcam failing to work.
      
      At the time of oops, RDI is clearly a pointer to a structure which
      has arrived as NULL, leading to the typo in swiotlb_map_single's
      callsite arguments.
      
      Correctly passing the device structure [3] addresses the issue and
      gets my webcam working again (the allocation failure still occuring).
      
       --- [1]
      
      skype: page allocation failure. order:3, mode:0x1
      Pid: 5895, comm: skype Not tainted 2.6.27-rc6-235c-debug #1
      
      Call Trace:
       [<ffffffff802b7cf0>] __alloc_pages_internal+0x4a0/0x5d0
       [<ffffffff802d5ddd>] alloc_pages_current+0xad/0x110
       [<ffffffff802b4ccd>] __get_free_pages+0x1d/0x60
       [<ffffffff8046cd39>] swiotlb_alloc_coherent+0x49/0x180
       [<ffffffff80212731>] dma_alloc_coherent+0x281/0x310
       [<ffffffff805621c0>] hcd_buffer_alloc+0x50/0x90
       [<ffffffff805547fd>] usb_buffer_alloc+0x2d/0x40
       [<ffffffffa0056763>] uvc_alloc_urb_buffers+0x53/0xf0 [uvcvideo]
       [<ffffffffa0056958>] uvc_init_video+0x158/0x3e0 [uvcvideo]
       [<ffffffffa0056c17>] uvc_video_enable+0x37/0x80 [uvcvideo]
       [<ffffffffa0055853>] uvc_v4l2_do_ioctl+0x723/0x1260 [uvcvideo]
       [<ffffffff8026dd61>] ? trace_hardirqs_off_caller+0x21/0xc0
       [<ffffffff8026dd61>] ? trace_hardirqs_off_caller+0x21/0xc0
       [<ffffffffa0032c9f>] video_usercopy+0x19f/0x390 [videodev]
       [<ffffffffa0055130>] ? uvc_v4l2_do_ioctl+0x0/0x1260 [uvcvideo]
       [<ffffffff8026d0ce>] ? put_lock_stats+0xe/0x30
       [<ffffffffa0054dad>] uvc_v4l2_ioctl+0x4d/0x80 [uvcvideo]
       [<ffffffffa0045083>] native_ioctl+0x83/0x90 [compat_ioctl32]
       [<ffffffffa004534e>] v4l_compat_ioctl32+0x2be/0x1da4 [compat_ioctl32]
       [<ffffffff806aad21>] ? do_page_fault+0x3d1/0xae0
       [<ffffffff80270ccd>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffff80270c59>] ? trace_hardirqs_on_caller+0x149/0x1b0
       [<ffffffff80270ccd>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffff80329afa>] compat_sys_ioctl+0x8a/0x3c0
       [<ffffffff806a700d>] ? trace_hardirqs_off_thunk+0x3a/0x3c
       [<ffffffff8022f816>] sysenter_dispatch+0x7/0x2c
       [<ffffffff806a6fce>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      
      Mem-Info:
      Node 0 DMA per-cpu:
      CPU    0: hi:    0, btch:   1 usd:   0
      CPU    1: hi:    0, btch:   1 usd:   0
      Node 0 DMA32 per-cpu:
      CPU    0: hi:  186, btch:  31 usd:   3
      CPU    1: hi:  186, btch:  31 usd:   0
      Node 0 Normal per-cpu:
      CPU    0: hi:  186, btch:  31 usd:  23
      CPU    1: hi:  186, btch:  31 usd: 179
      Active:78545 inactive:48683 dirty:31 writeback:0 unstable:2
       free:830202 slab:17516 mapped:17473 pagetables:3496 bounce:0
      Node 0 DMA free:36kB min:28kB low:32kB high:40kB active:0kB
      inactive:0kB present:15156kB pages_scanned:0 all_unreclaimable? no
      lowmem_reserve[]: 0 3207 3956 3956
      Node 0 DMA32 free:3197192kB min:6512kB low:8140kB high:9768kB
      active:0kB inactive:0kB present:3284896kB pages_scanned:0
      all_unreclaimable? no
      lowmem_reserve[]: 0 0 748 748
      Node 0 Normal free:123580kB min:1516kB low:1892kB high:2272kB
      active:314180kB inactive:194732kB present:766464kB pages_scanned:0
      all_unreclaimable? no
      lowmem_reserve[]: 0 0 0 0
      Node 0 DMA: 1*4kB 0*8kB 0*16kB 1*32kB 0*64kB 0*128kB 0*256kB 0*512kB
      0*1024kB 0*2048kB 0*4096kB = 36kB
      Node 0 DMA32: 4*4kB 3*8kB 2*16kB 3*32kB 4*64kB 5*128kB 3*256kB 5*512kB
      4*1024kB 5*2048kB 776*4096kB = 3197224kB
      Node 0 Normal: 14*4kB 14*8kB 8*16kB 6*32kB 1*64kB 3*128kB 3*256kB
      2*512kB 4*1024kB 1*2048kB 28*4096kB = 123560kB
      64847 total pagecache pages
      0 pages in swap cache
      Swap cache stats: add 0, delete 0, find 0/0
      Free swap  = 502752kB
      Total swap = 502752kB
      1048576 pages RAM
      52120 pages reserved
      71967 pages shared
      143004 pages non-shared
      
       --- [2]
      
      BUG: unable to handle kernel NULL pointer dereference at 00000000000002c8
      IP: [<ffffffff8046c84c>] map_single+0x1c/0x280
      PGD 10e54e067 PUD 10e595067 PMD 0
      Oops: 0000 [1] PREEMPT SMP DEBUG_PAGEALLOC
      CPU 0
      Modules linked in: kvm_intel kvm microcode uvcvideo compat_ioctl32
      videodev v4l1_compat shpchp pci_hotplug
      Pid: 5895, comm: skype Not tainted 2.6.27-rc6-235c-debug #1
      RIP: 0010:[<ffffffff8046c84c>]  [<ffffffff8046c84c>] map_single+0x1c/0x280
      RSP: 0018:ffff88010e78d988  EFLAGS: 00210296
      RAX: 0000780000000000 RBX: 0000000000000000 RCX: 0000000000000002
      RDX: 0000000000005000 RSI: 0000000000000000 RDI: 0000000000000000
      RBP: ffff88010e78d9e8 R08: 0000000000000000 R09: 0000000000000001
      R10: ffff88010e78d698 R11: 0000000000000001 R12: 0000000000000002
      R13: 0000000000000000 R14: 0000000000005000 R15: ffff88012f1c9968
      FS:  0000000000000000(0000) GS:ffffffff80a6cdc0(0063) knlGS:00000000f6355b90
      CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
      CR2: 00000000000002c8 CR3: 000000010e57d000 CR4: 00000000000026e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process skype (pid: 5895, threadinfo ffff88010e78c000, task ffff88012b9cc460)
      Stack:  0000000200000000 0000000000005000 0000000000000000 0000000000000000
       00000000000017b8 0000000000000000 ffff88010e78d9c8 0000000000000000
       0000000000000002 0000000000000000 0000000000005000 ffff88012f1c9968
      Call Trace:
       [<ffffffff8046cbb0>] swiotlb_map_single_attrs+0x60/0xf0
       [<ffffffff8046cc4c>] swiotlb_map_single+0xc/0x10
       [<ffffffff8046cdee>] swiotlb_alloc_coherent+0xfe/0x180
       [<ffffffff80212731>] dma_alloc_coherent+0x281/0x310
       [<ffffffff805621c0>] hcd_buffer_alloc+0x50/0x90
       [<ffffffff805547fd>] usb_buffer_alloc+0x2d/0x40
       [<ffffffffa0056763>] uvc_alloc_urb_buffers+0x53/0xf0 [uvcvideo]
       [<ffffffffa0056958>] uvc_init_video+0x158/0x3e0 [uvcvideo]
       [<ffffffffa0056c17>] uvc_video_enable+0x37/0x80 [uvcvideo]
       [<ffffffffa0055853>] uvc_v4l2_do_ioctl+0x723/0x1260 [uvcvideo]
       [<ffffffff8026dd61>] ? trace_hardirqs_off_caller+0x21/0xc0
       [<ffffffff8026dd61>] ? trace_hardirqs_off_caller+0x21/0xc0
       [<ffffffffa0032c9f>] video_usercopy+0x19f/0x390 [videodev]
       [<ffffffffa0055130>] ? uvc_v4l2_do_ioctl+0x0/0x1260 [uvcvideo]
       [<ffffffff8026d0ce>] ? put_lock_stats+0xe/0x30
       [<ffffffffa0054dad>] uvc_v4l2_ioctl+0x4d/0x80 [uvcvideo]
       [<ffffffffa0045083>] native_ioctl+0x83/0x90 [compat_ioctl32]
       [<ffffffffa004534e>] v4l_compat_ioctl32+0x2be/0x1da4 [compat_ioctl32]
       [<ffffffff806aad21>] ? do_page_fault+0x3d1/0xae0
       [<ffffffff80270ccd>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffff80270c59>] ? trace_hardirqs_on_caller+0x149/0x1b0
       [<ffffffff80270ccd>] ? trace_hardirqs_on+0xd/0x10
       [<ffffffff80329afa>] compat_sys_ioctl+0x8a/0x3c0
       [<ffffffff806a700d>] ? trace_hardirqs_off_thunk+0x3a/0x3c
       [<ffffffff8022f816>] sysenter_dispatch+0x7/0x2c
       [<ffffffff806a6fce>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      
      Code: 45 31 c0 48 89 e5 e8 a4 ff ff ff c9 c3 66 90 55 48 89 e5 41 57
      41 56 41 55 41 54 53 48 83 ec 38 48 89 75 b0 48 89 55 a8 89 4d a4 <48>
      8b 87 c8 02 00 00 48 85 c0 0f 84 1c 02 00 00 48 8b 58 08 48
      RIP  [<ffffffff8046c84c>] map_single+0x1c/0x280
       RSP <ffff88010e78d988>
      CR2: 00000000000002c8
      ---[ end trace 5d15baeeb7025a0e ]---
      
       --- [3]
      
      ffffffff8046c830 <map_single>:
      map_single():
      /store/kernel/linux/lib/swiotlb.c:291
      ffffffff8046c830:       55                      push   %rbp
      ffffffff8046c831:       48 89 e5                mov    %rsp,%rbp
      ffffffff8046c834:       41 57                   push   %r15
      ffffffff8046c836:       41 56                   push   %r14
      ffffffff8046c838:       41 55                   push   %r13
      ffffffff8046c83a:       41 54                   push   %r12
      ffffffff8046c83c:       53                      push   %rbx
      ffffffff8046c83d:       48 83 ec 38             sub    $0x38,%rsp
      ffffffff8046c841:       48 89 75 b0             mov    %rsi,-0x50(%rbp)
      ffffffff8046c845:       48 89 55 a8             mov    %rdx,-0x58(%rbp)
      ffffffff8046c849:       89 4d a4                mov    %ecx,-0x5c(%rbp)
      dma_get_seg_boundary():
      /store/kernel/linux/include/linux/dma-mapping.h:80
      ffffffff8046c84c:       48 8b 87 c8 02 00 00    mov    0x2c8(%rdi),%rax <----
      
       --- [4]
      Signed-off-by: NDaniel J Blueman <daniel.blueman@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      36223a39
  21. 10 9月, 2008 2 次提交
  22. 08 9月, 2008 2 次提交