1. 14 11月, 2008 1 次提交
    • P
      ub: stub pre_reset and post_reset to fix oops · d73b7aff
      Pete Zaitcev 提交于
      Due to recent changes to usb_reset_device, the following hang occurs:
      
      events/0      D 0000000000000000     0     6      2
       ffff880037477cc0 0000000000000046 ffff880037477c50 ffffffff80237434
       ffffffff80574c80 00000001000a015c 0000000000000286 ffff8800374757d0
       ffff88002a31c860 ffff880037475a00 0000000036779140 ffff880037475a00
      Call Trace:
       [<ffffffff80237434>] try_to_del_timer_sync+0x52/0x5b
       [<ffffffff8026f86c>] dma_pool_free+0x1a7/0x1ec
       [<ffffffffa02a928a>] ub_disconnect+0x8e/0x1ad [ub]
       [<ffffffff802407c9>] autoremove_wake_function+0x0/0x2e
       [<ffffffff80378959>] usb_unbind_interface+0x5c/0xb7
       [<ffffffff8036ab70>] __device_release_driver+0x95/0xbd
       [<ffffffff8036ac70>] device_release_driver+0x21/0x2d
       [<ffffffff803789f8>] usb_driver_release_interface+0x44/0x83
       [<ffffffff80378ab9>] usb_forced_unbind_intf+0x17/0x1d
       [<ffffffff80371ba4>] usb_reset_device+0x7d/0x114
       [<ffffffffa02aaffd>] ub_reset_task+0x0/0x293 [ub]
       [<ffffffffa02ab1c1>] ub_reset_task+0x1c4/0x293 [ub]
       [<ffffffff8033dd1e>] flush_to_ldisc+0x0/0x1cd
       [<ffffffffa02aaffd>] ub_reset_task+0x0/0x293 [ub]
       [<ffffffff8023d302>] run_workqueue+0x87/0x114
       [<ffffffff8023d467>] worker_thread+0xd8/0xe7
       [<ffffffff802407c9>] autoremove_wake_function+0x0/0x2e
       [<ffffffff8023d38f>] worker_thread+0x0/0xe7
       [<ffffffff802404c1>] kthread+0x47/0x73
       [<ffffffff8022c8dd>] schedule_tail+0x27/0x60
       [<ffffffff8020c249>] child_rip+0xa/0x11
       [<ffffffff8024047a>] kthread+0x0/0x73
       [<ffffffff8020c23f>] child_rip+0x0/0x11
      
      This is because usb_reset_device now unbinds, and that calls disconnect,
      which in case of ub waits until the reset completes... which deadlocks.
      Worse, this deadlocks keventd and this takes whole box down.
      
      I'm going to fix this properly later, but let's unbreak the driver
      quickly for non-composite devices at least.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d73b7aff
  2. 21 10月, 2008 4 次提交
  3. 18 10月, 2008 1 次提交
  4. 03 5月, 2008 4 次提交
  5. 29 4月, 2008 1 次提交
  6. 09 4月, 2008 1 次提交
    • P
      ub: remove BUG() after __blk_end_request and fix the condition causing it · ef45cb62
      Pete Zaitcev 提交于
      When __blk_end_request returns nonzero, it means that the request was
      not completely processed and some BIOs are still attached. Since we
      have dequeued it by that time, it means leaking requests and hanging
      processes, which is why BUG() was in there. In ub this happens if
      a packet request ends normally, but with residue (e.g. when scsi_id
      issues INQUIRY).
      
      The fix is to make sure that arguments passed to __blk_end_request
      are correct: the full request length and not just transferred length.
      The transferred length is indicated to applications by adjusting
      rq->data_len with old, unchanged code outside of this patch.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ef45cb62
  7. 10 2月, 2008 1 次提交
  8. 02 2月, 2008 1 次提交
  9. 28 1月, 2008 1 次提交
  10. 25 10月, 2007 1 次提交
  11. 24 10月, 2007 1 次提交
  12. 23 10月, 2007 1 次提交
  13. 24 7月, 2007 1 次提交
  14. 16 7月, 2007 1 次提交
  15. 13 7月, 2007 1 次提交
  16. 28 4月, 2007 1 次提交
  17. 22 11月, 2006 1 次提交
  18. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  19. 28 9月, 2006 1 次提交
    • P
      USB: UB: Let cdrecord to see a device with media absent · d1ad4ea3
      Pete Zaitcev 提交于
      The command "cdrecord dev=/dev/uba x.iso" prints nasty garbage if a blank
      is not in the drive. This happens because drivers have to set req->errors
      separately from just returning zero uptodate with end_that_request_first,
      end_that_request_last. These functions only set error in BIO, but sg_io()
      ignores it.
      
      Since we're on it, let cdrecord access a device when ->changed is set.
      It's useful if someone wants to know device capabilities without burning
      anything.
      Signed-Off-By: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d1ad4ea3
  20. 27 6月, 2006 4 次提交
  21. 22 6月, 2006 3 次提交
  22. 09 5月, 2006 1 次提交
    • P
      [PATCH] USB: ub oops in block_uevent · 77ef6c4d
      Pete Zaitcev 提交于
      In kernel 2.6.16, if a mounted storage device is removed, an oops happens
      because ub supplies an interface device (and kobject) to the block layer,
      but neglects to pin it. And apparently, the block layer expects its users
      to pin device structures.
      
      The code in ub was broken this way for years. But the bug was exposed only
      by 2.6.16 when it started to call block_uevent on close, which traverses
      device structures (kobjects actually).
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      77ef6c4d
  23. 21 3月, 2006 4 次提交
  24. 01 2月, 2006 3 次提交
    • P
      [PATCH] USB: ub 05 Bulk reset · 2c2e4a2e
      Pete Zaitcev 提交于
      For crying out loud, they have devices which do not like port resets.
      So, do what usb-storage does and try both bulk and port resets.
      We start with a port reset (which usb-storage does at the end of transport),
      then do a Bulk reset, then a port reset again. This seems to work for me.
      
      The code is getting dirtier and dirtier here, but I swear that I'll
      do something about it (see those two new XXX). Honest.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2c2e4a2e
    • P
      [PATCH] USB: ub 04 Loss of timer and a hang · b31f821c
      Pete Zaitcev 提交于
      If SCSI commands are submitted while other commands are still processed,
      the dispatch loop turns, and we stop the work_timer. Then, if URB fails
      to complete, ub hangs until the device is unplugged.
      
      This does not happen often, becase we only allow one SCSI command per
      block device, but does happen (on multi-LUN devices, for example).
      
      The fix is to stop timer only when we actually going to change the state.
      
      The nicest code would be to have the timer stopped in URB callback, but
      this is impossible, because it can be called from inside a timer, through
      the urb_unlink. Then we get BUG in timer.c:cascade(). So, we do it a
      little dirtier.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b31f821c
    • P
      [PATCH] USB: ub 03 Oops with CFQ · 65b4fe55
      Pete Zaitcev 提交于
      The blk_cleanup_queue does not necesserily destroy the queue. When we
      destroy the corresponding ub_dev, it may leave the queue spinlock pointer
      dangling.
      
      This patch moves spinlocks from ub_dev to static memory. The locking
      scheme is not changed. These spinlocks are still separate from the ub_lock.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      65b4fe55