1. 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
  2. 28 9月, 2006 1 次提交
  3. 22 6月, 2006 1 次提交
    • D
      [PATCH] improved TT scheduling for EHCI · ba47f66b
      Dan Streetman 提交于
      This updates the EHCI driver by adding an improved scheduler for the
      transaction translators, found in USB 2.0 hubs and used for low and
      full speed devices.
      
       - adds periodic_tt_usecs() and some helper functions, which does
         the same thing that "periodic_usecs" does, except on the other
         side of the TT, i.e.  it calculates the low/fullspeed bandwidth
         usage instead of highspeed.
      
       - adds a tt_available() function which is the new implementation
         of what tt_no_collision() does ... while tt_no_collision() ensures
         that each TT handles only 1 periodic transfer at a time (a very
         pessimistic approach) this version instead tracks bandwidth and
         allows each TT to handle as many transfers as will fit on each TT's
         downstream bus (closer to best-case).
      
      The new scheduler is selected by a config option, marked as EXPERIMENTAL
      so it can be tested (and more broadly reviewed) for a while until it
      seems safe to remove the original scheduler.
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ba47f66b
  4. 21 3月, 2006 3 次提交
  5. 01 2月, 2006 2 次提交
  6. 30 11月, 2005 1 次提交
    • B
      [PATCH] USB: Fix USB suspend/resume crasher (#2) · 8de98402
      Benjamin Herrenschmidt 提交于
      This patch closes the IRQ race and makes various other OHCI & EHCI code
      path safer vs. suspend/resume.
      I've been able to (finally !) successfully suspend and resume various
      Mac models, with or without USB mouse plugged, or plugging while asleep,
      or unplugging while asleep etc... all without a crash.
      
      Alan, please verify the UHCI bit I did, I only verified that it builds.
      It's very simple so I wouldn't expect any issue there. If you aren't
      confident, then just drop the hunks that change uhci-hcd.c
      
      I also made the patch a little bit more "safer" by making sure the store
      to the interrupt register that disables interrupts is not posted before
      I set the flag and drop the spinlock.
      
      Without this patch, you cannot reliably sleep/wakeup any recent Mac, and
      I suspect PCs have some more sneaky issues too (they don't frankly crash
      with machine checks because x86 tend to silently swallow PCI errors but
      that won't last afaik, at least PCI Express will blow up in those
      situations, but the USB code may still misbehave).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8de98402
  7. 28 10月, 2005 1 次提交
  8. 09 9月, 2005 1 次提交
  9. 08 9月, 2005 1 次提交
  10. 05 8月, 2005 1 次提交
    • D
      [PATCH] USB: ehci: microframe handling fix · 7dedacf4
      David Brownell 提交于
      This patch has a one line oops fix, plus related cleanups.
      
       - The bugfix uses microframe scheduling data given to the hardware to
         test "is this a periodic QH", rather than testing for nonzero period.
         (Prevents an oops by providing the correct answer.)
      
       - The cleanup going along with the patch should make it clearer what's
         going on whenever those bitfields are accessed.
      
      The bug came about when, around January, two new kinds of EHCI interrupt
      scheduling operation were added, involving both the high speed (24 KBytes
      per millisec) and low/full speed (1-64 bytes per millisec) microframe
      scheduling.  A driver for the Edirol UA-1000 Audio Capture Unit ran into
      the oops; it used one of the newly supported high speed modes.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7dedacf4
  11. 13 7月, 2005 1 次提交
  12. 28 6月, 2005 1 次提交
    • D
      [PATCH] USB: ehci-hcd - fix page pointer allocation in itd_patch() · 77078570
      David Brownell 提交于
      The itd_patch() function is responsible for allocating entries in the
      buffer page pointer list of the iTD.  Particularly, a new page pointer
      is needed every time when buffer data crosses a page boundary.
      
      However, there is a bug in the allocation logic: the function does not
      allocate a new entry when the current transaction is the first
      transaction in the iTD (as indicated by first!=0).
      
      The consequence is that, when the data of the first transaction begins
      somewhere at the end of a page so that it actually does cross the page
      boundary, no new page pointer is allocated.  This means that the data
      at the end of the first transaction (beyond the page boundary) will be
      accessed by the HC using the second page pointer, which is zero.
      Furthermore, the first page pointer will be later overwritten by the
      page pointers of the other transactions, which will garble it because
      the value is or-ed into the iTD field.
      
      All this particular check (for !first) does is cause incorrect
      behaviour, so it should be entirely removed (and with it the variable
      first that is not used for anything else).
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      77078570
  13. 19 4月, 2005 1 次提交
  14. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4