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 2 次提交
    • D
      USB: EHCI update VIA workaround · 26f953fd
      David Brownell 提交于
      This revamps handling of the hardware "async advance" IRQ, and its watchdog
      timer.  Basically it dis-entangles that important timeout from the others,
      simplifying the associated state and code to make it more robust.
      
      This reportedly improves behavior of EHCI on some systems with VIA chips,
      and AFAIK won't affect non-VIA hardware.  VIA systems need this code to
      recover from silcon bugs whereby the "async advance" IRQ isn't issued.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      26f953fd
    • A
      USB: Properly unregister reboot notifier in case of failure in ehci hcd · 64a21d02
      Aleksey Gorelov 提交于
      If some problem occurs during ehci startup, for instance, request_irq fails,
      echi hcd driver tries it best to cleanup, but fails to unregister reboot
      notifier, which in turn leads to crash on reboot/poweroff.
      
      The following patch resolves this problem by not using reboot notifiers
      anymore, but instead making ehci/ohci driver get its own shutdown method.  For
      PCI, it is done through pci glue, for everything else through platform driver
      glue.
      
      One downside: sa1111 does not use platform driver stuff, and does not have its
      own shutdown hook, so no 'shutdown' is called for it now.  I'm not sure if it
      is really necessary on that platform, though.
      Signed-off-by: NAleks Gorelov <dared1st@yahoo.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      64a21d02
  3. 26 9月, 2006 1 次提交
  4. 22 6月, 2006 2 次提交
  5. 28 4月, 2006 1 次提交
  6. 21 3月, 2006 1 次提交
    • D
      [PATCH] USB: EHCI and NF2 quirk · f8aeb3bb
      David Brownell 提交于
      This teaches the EHCI driver about a quirk seen in older NForce2 chips,
      adding a workaround to ignore selective suspend requests.  Bus-wide
      (so-called "global") suspend still works, as does USB wakeup of a
      root hub that's globally suspended.
      
      There's still a hole in this support though.  Strictly speaking, this
      should _fail_ selective suspend requests, rather than ignoring them,
      since doing it this way means that devices which should be able to issue
      remote wakeup are not going to be able to do that.  For now, we'll just
      live with that problem ... since usbcore expects to do selective suspend
      on the way towards a full bus suspend, and usbcore needs to be able to
      do full bus suspend.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f8aeb3bb
  7. 01 2月, 2006 2 次提交
  8. 05 1月, 2006 2 次提交
  9. 30 11月, 2005 2 次提交
    • D
      [PATCH] USB: ehci fixups · 8926bfa7
      David Brownell 提交于
      Rename the EHCI "reset" routine so it better matches what it does (setup);
      and move the one-time data structure setup earlier, before doing anything
      that implicitly relies on it having been completed already.
      
      From: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8926bfa7
    • 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
  10. 24 11月, 2005 3 次提交
    • D
      [PATCH] USB: EHCI updates split init/reinit logic for resume · 18807521
      David Brownell 提交于
      Moving the PCI-specific parts of the EHCI driver into their own file
      created a few issues ... notably on resume paths which (like swsusp)
      require re-initializing the controller.  This patch:
      
       - Splits the EHCI startup code into run-once HCD setup code and
         separate "init the hardware" reinit code.  (That reinit code is
         a superset of the "early usb handoff" code.)
      
       - Then it makes the PCI init code run both, and the resume code only
         run the reinit code.
      
       - It also removes needless pci wrappers around EHCI start/stop methods.
      
       - Removes a byteswap issue that would be seen on big-endian hardware.
      
      The HCD glue still doesn't actually provide a good way to do all this
      run-one init stuff in one place though.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      18807521
    • D
      [PATCH] USB: EHCI updates mostly whitespace cleanups · abcc9448
      David Brownell 提交于
      This cleans up the recent updates to EHCI PCI support:
      
        - Gets rid of checks for "is this a PCI device", they're no
          longer needed since this is now all PCI-only code.
      
        - Reduce log spamming:  MWI is only interesting in the atypical
          case that it can actually be used.
      
        - Whitespace cleanup, as appropriate for a new file with no
          other pending patches.
      
      So other than that minor logging change, no functional updates.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      abcc9448
    • D
      [PATCH] USB: EHCI updates · f03c17fc
      David Brownell 提交于
      This fixes some bugs in EHCI suspend/resume that joined us over the past
      few releases (as usbcore, PCI, pmcore, and other components evolved):
      
        - Removes suspend and resume recursion from the EHCI driver, getting
          rid of the USB_SUSPEND special casing.
      
        - Updates the wakeup mechanism to work again; there's a newish usbcore
          call it needs to use.
      
        - Provide simpler tests for "do we need to restart from scratch", to
          address another case where PCI Vaux was lost.  (In this case it was
          restoring a swsusp snapshot, but there could be others.)
      
      Un-exports a symbol that was temporarily exported.
      
      A notable change from previous version is that this doesn't move
      the spinlock init, so there's still a resume/reinit path bug.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f03c17fc
  11. 11 11月, 2005 1 次提交
  12. 29 10月, 2005 4 次提交