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. 27 9月, 2006 1 次提交
  3. 26 9月, 2006 1 次提交
  4. 01 7月, 2006 1 次提交
  5. 22 6月, 2006 6 次提交
  6. 28 4月, 2006 1 次提交
  7. 15 4月, 2006 2 次提交
  8. 21 3月, 2006 3 次提交
    • A
      [PATCH] UHCI: improve debugging code · 8d402e1a
      Alan Stern 提交于
      This patch (as626) makes some improvements to the debugging code in
      uhci-hcd.  The main change is that now the code won't get compiled if
      CONFIG_USB_DEBUG isn't set.  But there are other changes too, like
      adding a missing .owner field and printing a debugging dump if the
      controller dies.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8d402e1a
    • A
      [PATCH] UHCI: remove main list of URBs · 0ed8fee1
      Alan Stern 提交于
      As part of reorienting uhci-hcd away from URBs and toward endpoint
      queues, this patch (as625) eliminates the driver's main list of URBs.
      The list wsa used mainly in checking for URB completions; now the driver
      goes through the list of active endpoints and checks the members of the
      queues.
      
      As a side effect, I had to remove the code that looks for FSBR timeouts.
      For now, FSBR will remain on so long as any URBs on a full-speed control
      or bulk queue request it, even if the queue isn't advancing.  A later
      patch can add more intelligent handling.  This isn't a huge drawback;
      it's pretty rare for an URB to get stuck for more than a fraction of a
      second.  (And it will help the people trying to use those insane HP USB
      devices.)
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0ed8fee1
    • A
      [PATCH] UHCI: use one QH per endpoint, not per URB · dccf4a48
      Alan Stern 提交于
      This patch (as623) changes the uhci-hcd driver to make it use one QH per
      device endpoint, instead of a QH per URB as it does now.  Numerous areas
      of the code are affected by this.  For example, the distinction between
      "queued" URBs and non-"queued" URBs no longer exists; all URBs belong to
      a queue and some just happen to be at the queue's head.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dccf4a48
  9. 05 1月, 2006 5 次提交
  10. 17 12月, 2005 1 次提交
  11. 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
  12. 11 11月, 2005 1 次提交
  13. 29 10月, 2005 7 次提交
  14. 13 9月, 2005 1 次提交
  15. 28 6月, 2005 8 次提交
    • A
      [PATCH] USB UHCI: Detect invalid ports · e07fefa6
      Alan Stern 提交于
      This patch changes the way uhci-hcd detects valid ports.  The
      specification doesn't mention any way to find out how many ports a
      controller has, so the driver has to use some heuristics, reading the port
      status and control register and deciding whether the value makes sense.
      With this patch the driver will recognize a typical failure mode (all bits
      set to one) for nonexistent ports and won't assume there are always at
      least 2 ports -- such an assumption seems silly if the heuristics have
      already shown that the ports don't exist.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e07fefa6
    • A
      [PATCH] USB HCDs: no longer need to register root hub · 247f3105
      Alan Stern 提交于
      This patch changes the host controller drivers; they no longer need to
      register their root hubs because usbcore will take care of it for them.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      247f3105
    • A
      [PATCH] UHCI: Don't store device pointer in QH or TD · 2532178a
      Alan Stern 提交于
      This patch simplifies the uhci-hcd driver by removing the device pointer
      currently stored in the QH and TD structures.  Those pointers weren't
      being used for anything other than to increment the device's reference
      count, which is unnecessary since the device is used only when an URB
      completes, and outstanding URBs take their own reference to the device.
      As a useful side effect, this change means that uhci-hcd no longer needs
      to have the root-hub device available in the start routine.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2532178a
    • A
      [PATCH] USB UHCI: Add shutdown method · 02597d2d
      Alan Stern 提交于
      After all the discussion you might not be interested in this still, but
      nevertheless here it is.  This patch adds a shutdown method to the
      uhci-hcd driver.  Its prerequisite is the patch you wrote adding shutdown
      support for PCI.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      02597d2d
    • A
      [PATCH] USB UHCI: improved reset handling · c074b416
      Alan Stern 提交于
      This patch improves the strategy uhci-hcd uses for performing controller
      resets and checking whether they are needed.
      
      	The HCRESET command doesn't affect the Suspend, Resume,
      	or Reset bits in the port status & control registers, so
      	the driver must clear them by itself.  This means the
      	code to figure out how many ports there are has to be moved
      	to an earlier spot in the driver.
      
      	The R/WC bits in the USBLEGSUP register can be set by the
      	hardware even in the absence of BIOS meddling with legacy
      	support features.  Hence it's not a good idea to check them
      	while trying to determine whether the BIOS has altered the
      	controller's state.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c074b416
    • A
      [PATCH] USB UHCI: Use root-hub IRQs while suspended · 6c1b445c
      Alan Stern 提交于
      This patch, which has as478b as a prerequisite, enables the uhci-hcd
      driver to take advantage of root-hub IRQs rather than polling during the
      time it is suspended.  (Unfortunately the hardware doesn't support
      port-change interrupts while the controller is running.)  It also turns
      off the driver's private timer while the controller is suspended, as it
      isn't needed then.  The combined elimination of polling interrupts and
      timer interrupts ought to be enough to allow some systems to save a
      noticeable amount of power while they are otherwise idle.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6c1b445c
    • A
      [PATCH] USB UHCI: Fix up loose ends · 4daaa87c
      Alan Stern 提交于
      This patch tidies up a few loose ends left by the preceding patches.
      It indicates the controller supports remote wakeup whenever the PM
      capability is present -- which shouldn't cause any harm if the
      assumption turns out to be wrong.  It refuses to suspend the
      controller if the root hub is still active, and it refuses to resume
      the root hub if the controller is suspended.  It adds checks for a
      dead controller in several spots, and it adds memory barriers as
      needed to insure that I/O operations are completed before moving on.
      
      Actually I'm not certain the last part is being done correctly.  With
      code like this:
      
      	outw(..., ...);
      	mb();
      	udelay(5);
      
      do we know for certain that the outw() will complete _before_ the
      delay begins?  If not, how should this be written?
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4daaa87c
    • A
      [PATCH] USB UHCI: Add root-hub suspend/resume support · a8bed8b6
      Alan Stern 提交于
      This patch implements (finally!) separate suspend and resume routines
      for the root hub and the controller in the UHCI driver.  It also
      changes the sequence used to reset the controller during initial
      probing, so as to preserve the existing state during a Resume-From-Disk.
      (This new sequence is what should be used in the PCI Quirks code for
      early USB handoffs, incidentally.)  Lastly it adds a notion of the
      controller being "inaccessible" while in a PCI low-power state, when
      normal I/O operations shouldn't be allowed.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a8bed8b6