08 Jun, 2016

1 commit

  • Since ed_schedule begins with marking the ED as "operational",
    the ED may be left in such state even if scheduling actually
    fails.

    This allows future submission attempts to smuggle this ED to the
    hardware behind the scheduler's back and without linking it to
    the ohci->eds_in_use list.

    The former causes bandwidth saturation and data loss on isoc
    endpoints, the latter crashes the kernel when attempt is made
    to unlink such ED from this list.

    Fix ed_schedule to update ED state only on successful return.

    Signed-off-by: Michal Pecio
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Michał Pecio
     

23 Jul, 2015

1 commit

  • This patch fixes a bug introduced by commit 977dcfdc6031 ("USB: OHCI:
    don't lose track of EDs when a controller dies"). The commit changed
    ed_state from ED_UNLINK to ED_IDLE too early, before finish_urb() had
    been called. The user-visible consequence is that the driver
    occasionally crashes or locks up when an URB is submitted while
    another URB for the same endpoint is being unlinked.

    This patch moves the ED state change later, to the right place. The
    drawback is that now we may unnecessarily execute some instructions
    multiple times when a controller dies. Since controllers dying is an
    exceptional occurrence, a little wasted time won't matter.

    Signed-off-by: Alan Stern
    Reported-by: Heiko Przybyl
    Tested-by: Heiko Przybyl
    Fixes: 977dcfdc60311e7aa571cabf6f39c36dde13339e
    CC:
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

10 May, 2015

1 commit


19 Jul, 2014

4 commits

  • Some OHCI controllers have a bug: They fail to add completed TDs to
    the done queue. Examining this queue is the only method ohci-hcd has
    for telling when a transfer is complete; failure to add a TD can
    result in an URB that never completes and cannot be unlinked.

    This patch adds a watchdog routine to ohci-hcd. The routine
    periodically scans the active ED and TD lists, looking for TDs which
    are finished but not on the done queue. When one is found, and it is
    certain that the controller hardware will never add the TD to the done
    queue, the watchdog routine manually puts the TD on the done list so
    that it can be handled normally.

    The watchdog routine also checks for a condition indicating the
    controller has died. If the done queue is non-empty but the
    HccaDoneHead pointer hasn't been updated for a few hundred
    milliseconds, we assume the controller will never update it and
    therefore is dead.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • URBs for a particular endpoint should complete sequentially. That is,
    we shouldn't call the completion handler for one URB until the handler
    for the previous URB has returned.

    When the OHCI watchdog routine is added, there will be two paths for
    completing URBs: interrupt handler and watchdog routine. Their
    activities have to be synchronized so that completions don't occur in
    multiple threads concurrently.

    For that purpose, this patch creates an ohci_work() routine which will
    be responsible for calling process_done_list() and finish_unlinks(),
    the two routines that detect when an URB is complete. Everything will
    funnel through ohci_work(), and it will be careful not to run in more
    than one thread at a time.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch changes the way ohci-hcd handles the TD done list. In
    addition to relying on the TD pointers stored by the controller
    hardware, we need to handle TDs that the hardware has forgotten about.

    This means the list has to exist even while the dl_done_list() routine
    isn't running. That function essentially gets split in two:
    update_done_list() reads the TD pointers stored by the hardware and
    adds the TDs to the done list, and process_done_list() scans through
    the list to handle URB completions. When we detect a TD that the
    hardware forgot about, we will be able to add it to the done list
    manually and then process it normally.

    Since the list is really a queue, and because there can be a lot of
    TDs, keep the existing singly linked implementation. To insure that
    URBs are given back in order of submission, whenever a TD is added to
    the done list, all the preceding TDs for the same endpoint must be
    added as well (going back to the first one that isn't already on the
    done list).

    The done list manipulations must all be protected by the private
    lock. The scope of the lock is expanded in preparation for the
    watchdog routine to be added in a later patch.

    We have to be more careful about giving back unlinked URBs. Since TDs
    may be added to the done list by the watchdog routine and not in
    response to a controller interrupt, we have to check explicitly to
    make sure all the URB's TDs that were added to the done list have been
    processed before giving back the URB.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch reverts the important parts of commit 89a0fd18a96e (USB:
    OHCI handles more ZFMicro quirks), namely, the parts related to
    handling orphan TDs for interrupt endpoints. A later patch in this
    series will introduce a more general mechanism that applies to all
    endpoint types and all controllers.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

18 Jul, 2014

2 commits

  • This patch fixes a bug in ohci-hcd. When an URB is unlinked, the
    corresponding Endpoint Descriptor is added to the ed_rm_list and taken
    off the hardware schedule. Once the ED is no longer visible to the
    hardware, finish_unlinks() handles the URBs that were unlinked or have
    completed. If any URBs remain attached to the ED, the ED is added
    back to the hardware schedule -- but only if the controller is
    running.

    This fails when a controller dies. A non-empty ED does not get added
    back to the hardware schedule and does not remain on the ed_rm_list;
    ohci-hcd loses track of it. The remaining URBs cannot be unlinked,
    which causes the USB stack to hang.

    The patch changes finish_unlinks() so that non-empty EDs remain on
    the ed_rm_list if the controller isn't running. This requires moving
    some of the existing code around, to avoid modifying the ED's hardware
    fields more than once.

    Signed-off-by: Alan Stern
    CC:
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Apparently nobody ever remembered to add Scatter-Gather support to
    ohci-hcd. This patch adds it.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

04 Dec, 2013

2 commits

  • With the introduction of dynamic debugging it has become redundant.
    Collapse it with ohci_dbg()

    Signed-off-by: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     
  • Conditional compilation for debugging is removed in favor of
    dynamic debugging. To do so

    1. the support for debugfs is always compiled
    2. the support for the ancient print_urb debugging aid is removed

    Signed-off-by: Oliver Neukum
    Signed-off-by: Greg Kroah-Hartman

    Oliver Neukum
     

26 Sep, 2013

1 commit

  • Commit 24f531371de1 (USB: EHCI: accept very late isochronous URBs)
    changed the isochronous API provided by ehci-hcd. URBs submitted too
    late, so that the time slots for all their packets have already
    expired, are no longer rejected outright. Instead the submission is
    accepted, and the URB completes normally with a -EXDEV error for each
    packet. This is what client drivers expect.

    This patch implements the same policy in ohci-hcd. The change is more
    complicated than it was in ehci-hcd, because ohci-hcd doesn't scan for
    isochronous completions in the same way as ehci-hcd does. Rather, it
    depends on the hardware adding completed TDs to a "done queue". Some
    OHCI controller don't handle this properly when a TD's time slot has
    already expired, so we have to avoid adding such TDs to the schedule
    in the first place. As a result, if the URB was submitted too late
    then none of its TDs will get put on the schedule, so none of them
    will end up on the done queue, so the driver will never realize that
    the URB should be completed.

    To solve this problem, the patch adds one to urb_priv->td_cnt for such
    URBs, making it larger than urb_priv->length (td_cnt already gets set
    to the number of TD's that had to be skipped because their slots have
    expired). Each time an URB is given back, the finish_urb() routine
    looks to see if urb_priv->td_cnt for the next URB on the same endpoint
    is marked in this way. If so, it gives back the next URB right away.

    This should be applied to all kernels containing commit 815fa7b91761
    (USB: OHCI: fix logic for scheduling isochronous URBs).

    Signed-off-by: Alan Stern
    CC:
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

30 May, 2013

1 commit

  • Note that this changes is part of separating the ohci pci host controller
    driver from ohci-hcd host code.
    This contains :
    -Moved sb800_prefetch() function from ohci-pci.c to pci-quirks.c file
    and EXPORTed, this is part of the effort to move the ohci pci related
    code to generic pci code.
    -Passed "device" argument instead of "ohci_hcd" in sb800_prefetch()
    function to avoid extra include file in pci-quirks.c.

    V2:
    -Passed "device" argment instead of "pci_dev", then we use to_pci_dev()
    to get the "pci_dev" structure.

    Signed-off-by: Manjunath Goudar
    Acked-by: Alan Stern
    Cc: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Manjunath Goudar
     

12 Jan, 2013

1 commit


27 Nov, 2012

1 commit

  • This patch (as1636) is a partial workaround for a hardware bug
    affecting OHCI controllers by NVIDIA at least, maybe others too. When
    the controller retires a Transfer Descriptor, it is supposed to add
    the TD onto the Done Queue. But sometimes this doesn't happen, with
    the result that ohci-hcd never realizes the corresponding transfer has
    finished. Symptoms can vary; a typical result is that USB audio stops
    working after a while.

    The patch works around the problem by recognizing that TDs are always
    processed in order. Therefore, if a later TD is found on the Done
    Queue than all the earlier TDs for the same endpoint must be finished
    as well.

    Unfortunately this won't solve the problem in cases where the missing
    TD is the last one in the endpoint's queue. A complete fix would
    require a signficant amount of change to the driver.

    Signed-off-by: Alan Stern
    Tested-by: Oliver Neukum
    CC:
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

23 Oct, 2012

1 commit

  • This patch (as1614) updates the isochronous scheduling in ohci-hcd to
    match the new semantics for URB_ISO_ASAP. Testing revealed a hardware
    bug in the way my OHCI controller handles expired isochronous TDs;
    consequently the patch tries hard to avoid creating them (unlike the
    ehci-hcd and uhci-hcd drivers).

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

19 Nov, 2011

1 commit

  • This patch (as1500) removes all uses of the objectionable hcd->state
    variable from the ohci-hcd family of drivers. It is replaced by a
    private ohci->rh_state field, just as in uhci-hcd and ehci-hcd.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

24 Aug, 2011

1 commit

  • Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
    instead of le16_to_cpu(desc->wMaxPacketSize).
    This patch fix it up

    Cc: Armin Fuerst
    Cc: Pavel Machek
    Cc: Johannes Erdfelt
    Cc: Vojtech Pavlik
    Cc: Oliver Neukum
    Cc: David Kubicek
    Cc: Johan Hovold
    Cc: Brad Hards
    Acked-by: Felipe Balbi
    Cc: Sebastian Andrzej Siewior
    Cc: Thomas Dahlmann
    Cc: David Brownell
    Cc: David Lopo
    Cc: Alan Stern
    Cc: Michal Nazarewicz
    Cc: Xie Xiaobo
    Cc: Li Yang
    Cc: Jiang Bo
    Cc: Yuan-hsin Chen
    Cc: Darius Augulis
    Cc: Xiaochen Shen
    Cc: Yoshihiro Shimoda
    Cc: OKI SEMICONDUCTOR,
    Cc: Robert Jarzmik
    Cc: Ben Dooks
    Cc: Thomas Abraham
    Cc: Herbert Pötzl
    Cc: Arnaud Patard
    Cc: Roman Weissgaerber
    Acked-by: Sarah Sharp
    Cc: Tony Olech
    Cc: Florian Floe Echtler
    Cc: Christian Lucht
    Cc: Juergen Stuber
    Cc: Georges Toth
    Cc: Bill Ryder
    Cc: Kuba Ober
    Cc: Inaky Perez-Gonzalez
    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     

02 Mar, 2011

1 commit

  • This patch moves the AMD PLL quirk code in OHCI/EHCI driver to pci-quirks.c,
    and exports the functions to be used by xHCI driver later.

    AMD PLL quirk disable the optional PM feature inside specific
    SB700/SB800/Hudson-2/3 platforms under the following conditions:

    1. If an isochronous device is connected to OHCI/EHCI/xHCI port and is active;
    2. Optional PM feature that powers down the internal Bus PLL when the link is
    in low power state is enabled.

    Without AMD PLL quirk, USB isochronous stream may stutter or have breaks
    occasionally, which greatly impair the performance of audio/video streams.

    Currently AMD PLL quirk is implemented in OHCI and EHCI driver, and will be
    added to xHCI driver too. They are doing similar things actually, so move
    the quirk code to pci-quirks.c, which has several advantages:

    1. Remove duplicate defines and functions in OHCI/EHCI (and xHCI) driver and
    make them cleaner;
    2. AMD chipset information will be probed only once and then stored.
    Currently they're probed during every OHCI/EHCI initialization, move
    the detect code to pci-quirks.c saves the repeat detect cost;
    3. Build up synchronization among OHCI/EHCI/xHCI driver. In current
    code, every host controller enable/disable PLL only according to
    its own status, and may enable PLL while there is still isoc transfer on
    other HCs. Move the quirk to pci-quirks.c prevents this issue.

    Signed-off-by: Andiry Xu
    Cc: David Brownell
    Cc: Alex He
    Signed-off-by: Greg Kroah-Hartman

    Andiry Xu
     

18 Feb, 2011

1 commit


05 Feb, 2011

1 commit

  • This patch moves the AMD PLL quirk code in OHCI/EHCI driver to pci-quirks.c,
    and exports the functions to be used by xHCI driver later.

    AMD PLL quirk disable the optional PM feature inside specific
    SB700/SB800/Hudson-2/3 platforms under the following conditions:

    1. If an isochronous device is connected to OHCI/EHCI/xHCI port and is active;
    2. Optional PM feature that powers down the internal Bus PLL when the link is
    in low power state is enabled.

    Without AMD PLL quirk, USB isochronous stream may stutter or have breaks
    occasionally, which greatly impair the performance of audio/video streams.

    Currently AMD PLL quirk is implemented in OHCI and EHCI driver, and will be
    added to xHCI driver too. They are doing similar things actually, so move
    the quirk code to pci-quirks.c, which has several advantages:

    1. Remove duplicate defines and functions in OHCI/EHCI (and xHCI) driver and
    make them cleaner;
    2. AMD chipset information will be probed only once and then stored.
    Currently they're probed during every OHCI/EHCI initialization, move
    the detect code to pci-quirks.c saves the repeat detect cost;
    3. Build up synchronization among OHCI/EHCI/xHCI driver. In current
    code, every host controller enable/disable PLL only according to
    its own status, and may enable PLL while there is still isoc transfer on
    other HCs. Move the quirk to pci-quirks.c prevents this issue.

    Signed-off-by: Andiry Xu
    Cc: David Brownell
    Cc: Alex He
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Andiry Xu
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

18 Nov, 2009

1 commit

  • The following patch in the driver is required to avoid USB 1.1 device
    failures that may occur due to requests from USB OHCI controllers may
    be overwritten if the latency for any pending request by the USB
    controller is very long (in the range of milliseconds).

    Signed-off-by: Libin Yang
    Cc: David Brownell
    Cc: Alan Stern
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Libin Yang
     

21 Sep, 2009

1 commit


14 Aug, 2008

1 commit

  • On some AMD 700 series southbridges, ISO OUT transfers (such as audio
    playback through speakers) on the USB OHCI controller may be corrupted
    when an A-Link express power saving feature is active.

    PLL power down mode in conjunction with link power management feature
    L1 being enabled is the bad combination ... this patch prevents them
    from being enabled when ISO transfers are pending.

    Signed-off-by: Crane Cai
    Signed-off-by: Libin Yang
    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Libin Yang
     

22 Jul, 2008

1 commit

  • If we do rmmod ohci_hcd while an application is doing something, the
    following may happen:

    - a control URB completes (in finish_urb) and the ohci's endpoint is
    set into ED_UNLINK in ed_deschedule
    - same URB is (re)submitted because of the open/close loop or other
    such application behaviour
    - rmmod sets the state to HC_STATE_QUESCING
    - finish_unlinks happens at next SOF; normally it would set ed into
    ED_IDLE and immediately call ed_schedule (since URB had extra TDs
    queued), which sets it into ED_OPER. But the check in ed_schedule
    makes it fail with -EAGAIN (which is ignored)
    - from now on we have a dead URB stuck; it cannot even be unlinked
    because the ed status is not ED_OPER, and thus start_ed_unlink is
    not invoked.

    This patch removes the check. In 2.6.25, all callers check for
    __ACTIVE bit before invoking ed_schedule, which is more appropriate.

    Alan Stern and David Brownell approved of this (cautiously).

    Signed-off-by: Pete Zaitcev
    Signed-off-by: Greg Kroah-Hartman

    Pete Zaitcev
     

04 Jul, 2008

1 commit

  • This patch fixes a problem with OHCI where canceling bulk or
    interrupt URBs may lose track of the right data toggle. This
    seems to be a longstanding bug, possibly dating back to the
    Linux 2.4 kernel, which stayed hidden because

    (a) about half the time the data toggle bit was correct;
    (b) canceling such URBs is unusual; and
    (c) the few drivers which cancel these URBs either
    [1] do it only as part of shutting down, or
    [2] have fault recovery logic, which recovers.

    For those transfer types, the toggle is normally written back
    into the ED when each TD is retired. But canceling bypasses
    the mechanism used to retire TDs ... so on average, half the
    time the toggle bit will be invalid after cancelation.

    The fix is simple: the toggle state of any canceled TDs are
    propagated back to the ED in the finish_unlinks function.

    (Issue found by leonidv11@gmail.com ...)

    Signed-off-by: David Brownell
    Cc: Leonid
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     

03 Apr, 2008

1 commit

  • Code inspection discovered in 2 places timers were being incorrectly setup
    using round_jiffies_relative(HZ). The timer would then fire at time (0 <
    HZ).

    Fix them to use round_jiffies(jiffies + HZ);

    Signed-off-by: Richard Kennedy
    Cc: Alan Stern
    Cc: David Brownell
    Cc: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Richard Kennedy
     

13 Oct, 2007

7 commits

  • This patch (as979) removes the last vestiges of urb->status from the
    host controller drivers and the root-hub emulator. Now the field
    doesn't get set until just before the URB's completion routine is
    called.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Yoshihiro Shimoda
    CC: Tony Olech
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as975) reorganizes the way ohci-hcd sets urb->status. It
    now keeps the information in a local variable until the last moment.

    Signed-off-by: Alan Stern
    CC: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as972) changes ohci-hcd so that after an error occurs, the
    remaining TDs for the URB will be skipped over entirely instead of
    going through the donelist. This enables the driver to give back the
    URB as soon as the error is detected, avoiding the need to store the
    error status in urb->status.

    Signed-off-by: Alan Stern
    CC: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as970) adds a new urb->unlinked field, which is used to
    store the status of unlinked URBs since we can't use urb->status for
    that purpose any more. To help simplify the HCDs, usbcore will check
    urb->unlinked before calling the completion handler; if the value is
    set it will automatically override the status reported by the HCD.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Yoshihiro Shimoda
    CC: Tony Olech
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as969) continues the ongoing changes to the way HCDs
    report URB statuses. The programming interface has been simplified by
    making usbcore responsible for clearing urb->hcpriv and for setting
    -EREMOTEIO status when an URB with the URB_SHORT_NOT_OK flag ends up
    as a short transfer.

    By moving the work out of the HCDs, this removes a fair amount of
    repeated code.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Yoshihiro Shimoda
    CC: Tony Olech
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as954) implements a suggestion of David Brownell's. Now
    the host controller drivers are responsible for linking and unlinking
    URBs to/from their endpoint queues. This eliminates the possiblity of
    strange situations where usbcore thinks an URB is linked but the HCD
    thinks it isn't. It also means HCDs no longer have to check for URBs
    being dequeued before they were fully enqueued.

    In addition to the core changes, this requires changing every host
    controller driver and the root-hub URB handler. For the most part the
    required changes are fairly small; drivers have to call
    usb_hcd_link_urb_to_ep() in their urb_enqueue method,
    usb_hcd_check_unlink_urb() in their urb_dequeue method, and
    usb_hcd_unlink_urb_from_ep() before giving URBs back. A few HCDs make
    matters more complicated by the way they split up the flow of control.

    In addition some method interfaces get changed. The endpoint argument
    for urb_enqueue is now redundant so it is removed. The unlink status
    is required by usb_hcd_check_unlink_urb(), so it has been added to
    urb_dequeue.

    Signed-off-by: Alan Stern
    CC: David Brownell
    CC: Olav Kongas
    CC: Tony Olech
    CC: Yoshihiro Shimoda
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • The ZF Micro OHCI controller exhibits unexpected behavior that seems to be
    related to high load. Under certain conditions, the controller will
    complete a TD, remove it from the endpoint's queue, and fail to add it to
    the donelist. This causes the endpoint to appear to stop responding. Worse,
    if the device is removed while in that state, OHCI will hang while waiting
    for the orphaned TD to complete. The situation is not recoverable without
    rebooting.

    This fix enhances the scope of the existing OHCI_QUIRK_ZFMICRO flag:

    1. A watchdog routine periodically scans the OHCI structures to check
    for orphaned TDs. In these cases the TD is taken back from the
    controller and completed normally.

    2. If a device is removed while the endpoint is hung but before the
    watchdog catches the situation, any outstanding TDs are taken back
    from the controller in the 'sanitize' phase.

    The ohci-hcd driver used to print "INTR_SF lossage" in this situation;
    this changes it to the universally accurate "ED unlink timeout". Other
    instances of this message presumably have different root causes.

    Both this Compaq quirk and a NEC quirk are now properly compiled out for
    non-PCI builds of this driver.

    Signed-off-by: Mike Nuss
    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    Mike Nuss
     

21 Dec, 2006

1 commit


06 Oct, 2006

1 commit


05 Oct, 2006

1 commit

  • 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: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

19 Apr, 2005

1 commit

  • This adds a quirk to the OHCI driver that lets it work with an old
    Compaq implementation. It also removes some needless strings from
    the non-debug version of the driver.

    Signed-off-by: Chris Clayton
    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     

17 Apr, 2005

1 commit

  • 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!

    Linus Torvalds