1. 04 3月, 2016 18 次提交
    • D
      usb: dwc2: host: Add dwc2_hcd_get_future_frame_number() call · fae4e826
      Douglas Anderson 提交于
      As we start getting more exact about our scheduling it's becoming more
      and more important to know exactly how far through the current frame we
      are.  This lets us make decisions about whether there's still time left
      to start a new transaction in the current frame.
      
      We'll add dwc2_hcd_get_future_frame_number() which will tell you what
      the frame number will be a certain number of microseconds (us) from
      now.  We can use this information to help decide if there's enough time
      left in the frame for a transaction that will take a certain duration.
      
      This is expected to be used by a future change ("usb: dwc2: host:
      Properly set even/odd frame").
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      fae4e826
    • D
      usb: dwc2: host: Manage frame nums better in scheduler · fb616e3f
      Douglas Anderson 提交于
      The dwc2 scheduler (contained in hcd_queue.c) was a bit confusing in the
      way it initted / kept track of which frames a QH was going to be active
      in.  Let's clean things up a little bit in preparation for a rewrite of
      the microframe scheduler.
      
      Specifically:
      * Old code would pick a frame number in dwc2_qh_init() and would try to
        pick it "in a slightly future (micro)frame".  As far as I can tell the
        reason for this was that there was a delay between dwc2_qh_init() and
        when we actually wanted to dwc2_hcd_qh_add().  ...but apparently this
        attempt to be slightly in the future wasn't enough because
        dwc2_hcd_qh_add() then had code to reset things if the frame _wasn't_
        in the future.  There's no reason not to just pick the frame later.
        For non-periodic QH we now pick the frame in dwc2_hcd_qh_add().  For
        periodic QH we pick the frame at dwc2_schedule_periodic() time.
      * The old "dwc2_qh_init() actually assigned to "hsotg->frame_number".
        This doesn't seem like a great idea since that variable is supposed to
        be used to keep track of which SOF the interrupt handler has seen.
        Let's be clean: anyone who wants the current frame number (instead of
        the one as of the last interrupt) should ask for it.
      * The old code wasn't terribly consistent about trying to use the frame
        that the microframe scheduler assigned to it.  In
        dwc2_sched_periodic_split() when it was scheduling the first frame it
        always "ORed" in 0x7 (!).  Since the frame goes on the wire 1 uFrame
        after next_active_frame it meant that the SSPLIT would always try for
        uFrame 0 and the transaction would happen on the low speed bus during
        uFrame 1.  This is irregardless of what the microframe scheduler
        said.
      * The old code assumed it would get called to schedule the next in a
        periodic split very quickly.  That is if next_active_frame was
        0 (transfer on wire in uFrame 1) it assumed it was getting called to
        schedule the next uFrame during uFrame 1 too (so it could queue
        something up for uFrame 2).  It should be possible to actually queue
        something up for uFrame 2 while in uFrame 2 (AKA queue up ASAP).  To
        do this, code needs to look at the previously scheduled frame when
        deciding when to next be active, not look at the current frame number.
      * If there was no microframe scheduler, the old code would check for
        whether we should be active using "qh->next_active_frame ==
        frame_number".  This seemed like a race waiting to happen.  ...plus
        there's no way that you wouldn't want to schedule if next_active_frame
        was actually less than frame number.
      
      Note that this change doesn't make 100% sense on its own since it's
      expecting some sanity in the frame numbers assigned by the microframe
      scheduler and (as per the future patch which rewries it) I think that
      the current microframe scheduler is quite insane.  However, it seems
      like splitting this up from the microframe scheduler patch makes things
      into smaller chunks and hopefully adds to clarity rather than reduces
      it.  The two patches could certainly be squashed.  Not that in the very
      least, I don't see any obvious bad behavior introduced with just this
      patch.
      
      I've attempted to keep the config parameter to disable the microframe
      scheduler in tact in this change, though I'm not sure it's worth it.
      Obviously the code is touched a lot so it's possible I regressed
      something when the microframe scheduler is disabled, though I did some
      basic testing and it seemed to work OK.  I'm still not 100% sure why you
      wouldn't want the microframe scheduler (presuming it works), so maybe a
      future patch (or a future version of this patch?) could remove that
      parameter.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      fb616e3f
    • D
      usb: dwc2: host: Add scheduler logging for missed SOFs · 483bb254
      Douglas Anderson 提交于
      We'll use the new "scheduler verbose debugging" macro to log missed
      SOFs.  This is fast enough (assuming you configure it to use the ftrace
      buffer) that we can do it without worrying about the speed hit.  The
      overhead hit if the scheduler tracing is set to "no_printk" should be
      near zero.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      483bb254
    • D
      usb: dwc2: host: Split code out to make dwc2_do_reserve() · 2d3f1398
      Douglas Anderson 提交于
      This no-op change splits code out of dwc2_schedule_periodic() into a
      dwc2_do_reserve() function.  This makes it a little easier to follow the
      logic.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      2d3f1398
    • D
      usb: dwc2: host: Reorder things in hcd_queue.c · b951c6c7
      Douglas Anderson 提交于
      This no-op change just reorders a few functions in hcd_queue.c in order
      to prepare for future changes.  Motivations here:
      
      The functions dwc2_hcd_qh_free() and dwc2_hcd_qh_create() are exported
      functions.  They are not called within the file.  That means that they
      should be near the bottom so that they can easily call static helpers.
      
      The function dwc2_qh_init() is only called by dwc2_hcd_qh_create() and
      should move near the bottom with it.
      
      The only reason that the dwc2_unreserve_timer_fn() timer function (and
      its subroutine dwc2_do_unreserve()) were so high in the file was that
      they needed to be above dwc2_qh_init().  Now that dwc2_qh_init() has
      been moved down it can be moved down a bit.  A later patch will split
      the reserve code out of dwc2_schedule_periodic() and the reserve
      function should be near the unreserve function.  The reserve function
      needs to be below dwc2_find_uframe() since it calls that.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      b951c6c7
    • D
      usb: dwc2: host: Rename some fields in struct dwc2_qh · ced9eee1
      Douglas Anderson 提交于
      This no-op change just does some renames to simplify a future patch.
      
      1. The "interval" field is renamed to "host_interval" to make it more
         obvious that this interval may be 8 times the interval that the
         device sees (if we're doing split transactions).  A future patch will
         also add the "device_interval" field.
      2. The "usecs" field is renamed to "host_us" again to make it more
         obvious that this is the time for the transaction as seen by the
         host.  For split transactions the device may see a much longer
         transaction time.  A future patch will also add "device_us".
      3. The "sched_frame" field is renamed to "next_active_frame".  The name
         "sched_frame" kept confusing me because it felt like something more
         permament (the QH's reservation or something).  The name
         "next_active_frame" makes it more obvious that this field is
         constantly changing.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      ced9eee1
    • D
      usb: dwc2: host: Use periodic interrupt even with DMA · 4e50e011
      Douglas Anderson 提交于
      The old code in dwc2_process_periodic_channels() would only enable the
      "periodic empty" interrupt if we weren't using DMA.  That wasn't right
      since we can still get into cases where we have small FIFOs even on
      systems that have DMA (the rk3288 is a prime example).
      
      Let's always enable/disable the "periodic empty" when appropriate.  As
      part of this:
      
      * Always call dwc2_process_periodic_channels() even if there's nothing
        in periodic_sched_assigned (we move the queue empty check so we still
        avoid the extra work).  That will make extra certain that we will
        properly disable the "periodic empty" interrupt even if there's
        nothing queued up.
      
      * Move the enable of "periodic empty" due to non-empty
        periodic_sched_assigned to be for slave mode (non-DMA mode) only.
        Presumably this was the original intention of the check for DMA since
        it seems to match the comments above where in slave mode we leave
        things on the assigned queue.
      
      Note that even before this change slave mode didn't work for me, so I
      can't say for sure that my understanding of slave mode is correct.
      However, this shouldn't change anything for slave mode so if slave mode
      worked for someone in the past it ought to still work.
      
      With this change, I no longer get constant misses reported by my other
      debugging code (and with future patches) when I've got:
      * Rockchip rk3288 Chromebook, using port ff540000
        -> Pluggable 7-port Hub with Charging (powered)
           -> Microsoft Wireless Keyboard 2000 in port 1.
           -> Das Keyboard in port 2.
           -> Jabra Speaker in port 3
           -> Logitech, Inc. Webcam C600 in port 4
           -> Microsoft Sidewinder X6 Keyboard in port 5
      
      ...and I'm playing music on the USB speaker and capturing video from the
      webcam.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      4e50e011
    • D
      usb: dwc2: host: There's not really a TT for the root hub · d82a810e
      Douglas Anderson 提交于
      I find that when I plug a full speed (NOT high speed) hub into a dwc2
      port and then I plug a bunch of devices into that full speed hub that
      dwc2 goes bat guano crazy.  Specifically, it just spews errors like this
      in the console:
        usb usb1: clear tt 1 (9043) error -22
      
      The specific test case I used looks like this:
      /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc2/1p, 480M
          |__ Port 1: Dev 17, If 0, Class=Hub, Driver=hub/4p, 12M
              |__ Port 2: Dev 19, If 0, ..., Driver=usbhid, 1.5M
              |__ Port 4: Dev 20, If 0, ..., Driver=usbhid, 12M
              |__ Port 4: Dev 20, If 1, ..., Driver=usbhid, 12M
              |__ Port 4: Dev 20, If 2, ..., Driver=usbhid, 12M
      
      Showing VID/PID:
       Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
       Bus 001 Device 017: ID 03eb:3301 Atmel Corp. at43301 4-Port Hub
       Bus 001 Device 020: ID 045e:0745 Microsoft Corp. Nano Transceiver ...
       Bus 001 Device 019: ID 046d:c404 Logitech, Inc. TrackMan Wheel
      
      I spent a bunch of time trying to figure out why there are errors to
      begin with.  I believe that the issue may be a hardware issue where the
      transceiver sometimes accidentally sends a PREAMBLE packet if you send a
      packet to a full speed device right after one to a low speed device.
      Luckily the USB driver retries and the second time things work OK.
      
      In any case, things kinda seem work despite the errors, except for the
      "clear tt" spew mucking up my console.  Chalk it up for a win for
      retries and robust protocols.
      
      So getting back to the "clear tt" problem, it appears that we get those
      because there's not actually a TT here to clear.  It's my understanding
      that when dwc2 operates in low speed or full speed mode that there's no
      real TT out there.  That makes all these attempts to "clear the TT"
      somewhat meaningless and also causes the spew in the log.
      
      Let's just skip all the useless TT clears.  Eventually we should root
      cause the errors, but even if we do this is still a proper fix and is
      likely to avoid the "clear tt" error in the future.
      
      Note that hooking up a Full Speed USB Audio Device (Jabra 510) to this
      same hub with the keyboard / trackball shows that even audio works over
      this janky connection.  As a point to note, this particular change (skip
      bogus TT clears) compared to just commenting out the dev_err() in
      hub_tt_work() actually produces better audio.
      
      Note: don't ask me where I got a full speed USB hub or whether the
      massive amount of dust that accumulated on it while it was in my junk
      box affected its funtionality.  Just smile and nod.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Reviewed-by: NKever Yang <kever.yang@rock-chips.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      d82a810e
    • D
      usb: dwc2: host: Properly set the HFIR · 9ed04d97
      Douglas Anderson 提交于
      According to the most up to date version of the dwc2 databook, the FRINT
      field of the HFIR register should be programmed to:
      * 125 us * (PHY clock freq for HS) - 1
      * 1000 us * (PHY clock freq for FS/LS) - 1
      
      This is opposed to older versions of the doc that claimed it should be:
      * 125 us * (PHY clock freq for HS)
      * 1000 us * (PHY clock freq for FS/LS)
      
      In case you didn't spot it, the difference is the "- 1".
      
      Let's add the "- 1" to match the newest user manual.  It's presumed that
      the "- 1" should have always been there and that this was always a
      documentation error.  If some hardware needs the "- 1" and other
      hardware doesn't, we'll have to add a configuration parameter for it in
      the future.
      
      I checked things before and after this patch on rk3288 using a Total
      Phase Beagle 5000 analyzer.
      
      Before this patch, a low speed mouse shows constant Frame Timing Jitter
      errors.  After this patch errors have gone away.
      
      Before this patch SOF packets move forward about 1 us per 4 ms.  After
      this patch the SOF packets move backward about 1 us per 255 ms.  Some
      specific SOF timestamps from the analyzer are below.
      
      Before:
        6.603.790
        6.603.916
        6.604.041
        6.604.166
        ...
        6.607.541
        6.607.667
        6.607.792
        6.607.917
        ...
        6.611.417
        6.611.543
        6.611.668
        6.611.793
      
      After:
        6.215.159
        6.215.284
        6.215.408
        6.215.533
        6.215.658
        ...
        6.470.658
        6.470.783
        6.470.907
        ...
        6.726.032
        6.726.157
        6.725.281
        6.725.406
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      9ed04d97
    • D
      usb: dwc2: host: Giveback URB in tasklet context · 8add17cf
      Douglas Anderson 提交于
      In commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet
      context") support was added to give back the URB in tasklet context.
      Let's take advantage of this in dwc2.
      
      This speeds up the dwc2 interrupt handler considerably.
      
      Note that this requires the change ("usb: dwc2: host: Add a delay before
      releasing periodic bandwidth") to come first.
      
      Note that, as per Alan Stern in
      <https://patchwork.kernel.org/patch/7555771/>, we also need to make sure
      that the extra delay before the device drivers submit more data doesn't
      break the scheduler.  At the moment the scheduler is pretty broken (see
      future patches) so it's hard to be 100% certain, but I have yet to see
      any new breakage introduced by this delay.  ...and speeding up interrupt
      processing for dwc2 is a huge deal because it means we've got a better
      chance of not missing SOF interrupts.  That means we've got an overall
      win here.
      
      Note that when playing USB audio and using a USB webcam and having
      several USB keyboards plugged in, the crackling on the USB audio device
      is noticably reduced with this patch.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      8add17cf
    • D
      usb: dwc2: host: Add a delay before releasing periodic bandwidth · 17dd5b64
      Douglas Anderson 提交于
      We'd like to be able to use HCD_BH in order to speed up the dwc2 host
      interrupt handler quite a bit.  However, according to the kernel doc for
      usb_submit_urb() (specifically the part about "Reserved Bandwidth
      Transfers"), we need to keep a reservation active as long as a device
      driver keeps submitting.  That was easy to do when we gave back the URB
      in the interrupt context: we just looked at when our queue was empty and
      released the reserved bandwidth then.  ...but now we need a little more
      complexity.
      
      We'll follow EHCI's lead in commit 9118f9eb ("USB: EHCI: improve
      interrupt qh unlink") and add a 5ms delay.  Since we don't have a whole
      timer infrastructure in dwc2, we'll just add a timer per QH.  The
      overhead for this is very small.
      
      Note that the dwc2 scheduler is pretty broken (see future patches to fix
      it).  This patch attempts to replicate all old behavior and just add the
      proper delay.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      17dd5b64
    • D
      usb: dwc2: host: Add scheduler tracing · 74fc4a75
      Douglas Anderson 提交于
      In preparation for future changes to the scheduler let's add some
      tracing that makes it easy for us to see what's happening.  By default
      this tracing will be off.
      
      By changing "core.h" you can easily trace to ftrace, the console, or
      nowhere.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NKever Yang <kever.yang@rock-chips.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      74fc4a75
    • D
      usb: dwc2: host: fix split transfer schedule sequence · c9c8ac01
      Douglas Anderson 提交于
      We're supposed to keep outstanding splits in order.  Keep track of a
      list of the order of splits and process channel interrupts in that
      order.
      
      Without this change and the following setup:
      * Rockchip rk3288 Chromebook, using port ff540000
        -> Pluggable 7-port Hub with Charging (powered)
           -> Microsoft Wireless Keyboard 2000 in port 1.
           -> Das Keyboard in port 2.
      
      ...I find that I get dropped keys on the Microsoft keyboard (I'm sure
      there are other combinations that fail, but this documents my test).
      Specifically I've been typing "hahahahahahaha" on the keyboard and often
      see keys dropped or repeated.
      
      After this change the above setup works properly.  This patch is based
      on a previous patch proposed by Yunzhi Li ("usb: dwc2: hcd: fix periodic
      transfer schedule sequence")
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NYunzhi Li <lyz@rock-chips.com>
      Reviewed-by: NKever Yang <kever.yang@rock-chips.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NKever Yang <kever.yang@rock-chips.com>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      c9c8ac01
    • D
      usb: dwc2: host: Always add to the tail of queues · 94ef7aee
      Douglas Anderson 提交于
      The queues the the dwc2 host controller used are truly queues.  That
      means FIFO or first in first out.
      
      Unfortunately though the code was iterating through these queues
      starting from the head, some places in the code was adding things to the
      queue by adding at the head instead of the tail.  That means last in
      first out.  Doh.
      
      Go through and just always add to the tail.
      
      Doing this makes things much happier when I've got:
      * 7-port USB 2.0 Single-TT hub
      * - Microsoft 2.4 GHz Transceiver v7.0 dongle
      * - Jabra speakerphone playing music
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NKever Yang <kever.yang@rock-chips.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      94ef7aee
    • D
      usb: dwc2: host: Avoid use of chan->qh after qh freed · 16e80218
      Douglas Anderson 提交于
      When poking around with USB devices with slub_debug enabled, I found
      another obvious use after free.  Turns out that in dwc2_hc_n_intr() I
      was in a state when the contents of chan->qh was filled with 0x6b,
      indicating that chan->qh was freed but chan still had a reference to
      it.
      
      Let's make sure that whenever we free qh we also make sure we remove a
      reference from its channel.
      
      The bug fixed here doesn't appear to be new--I believe I just got lucky
      and happened to see it while stress testing.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NKever Yang <kever.yang@rock-chips.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      16e80218
    • D
      usb: dwc2: host: Set host_rx_fifo_size to 525 for rk3066 · 098c1ef8
      Douglas Anderson 提交于
      As documented in dwc2_calculate_dynamic_fifo(), host_rx_fifo_size should
      really be:
       2 * ((Largest Packet size / 4) + 1 + 1) + n
       with n = number of host channel.
      
      We have 9 host channels, so
       2 * ((1024/4) + 2) + 9 = 516 + 9 = 525
      
      We've got 960 / 972 total_fifo_size on rk3288 (and presumably on
      rk3066) and 525 + 128 + 256 = 909 so we're still under on both ports
      even when we increment by 5.
      
      In the future, it would be nice if dwc2_calculate_dynamic_fifo() could
      handle the "too small" FIFO case and come up with something more
      dynamically.  When we do that we can figure out how to allocate the
      extra 48 / 60 bytes of FIFO that we're currently wasting.
      
      NOTE: no known bugs are fixed by this patch, but it seems like a simple
      fix and ought to fix someone.
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NKever Yang <kever.yang@rock-chips.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      098c1ef8
    • D
      usb: dwc2: host: Get aligned DMA in a more supported way · 3bc04e28
      Douglas Anderson 提交于
      All other host controllers who want aligned buffers for DMA do it a
      certain way.  Let's do that too instead of working behind the USB core's
      back.  This makes our interrupt handler not take forever and also rips
      out a lot of code, simplifying things a bunch.
      
      This also has the side effect of removing the 65535 max transfer size
      limit.
      
      NOTE: The actual code to allocate the aligned buffers is ripped almost
      completely from the tegra EHCI driver.  At some point in the future we
      may want to add this functionality to the USB core to share more code
      everywhere.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Tested-by: NJohn Youn <johnyoun@synopsys.com>
      Tested-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      3bc04e28
    • D
      usb: dwc2: rockchip: Make the max_transfer_size automatic · 40eed7d7
      Douglas Anderson 提交于
      Previously we needed to set the max_transfer_size to explicitly be 65535
      because the old driver would detect that our hardware could support much
      bigger transfers and then would try to do them.  This wouldn't work
      since the DMA alignment code couldn't support it.
      
      Later in commit e8f8c14d ("usb: dwc2: clip max_transfer_size to
      65535") upstream added support for clipping this automatically.  Since
      that commit it has been OK to just use "-1" (default), but nobody
      bothered to change it.
      
      Let's change it to default now for two reasons:
      - It's nice to use autodetected params.
      - If we can remove the 65535 limit, we can transfer more!
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NJohn Youn <johnyoun@synopsys.com>
      Tested-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      40eed7d7
  2. 21 2月, 2016 1 次提交
  3. 17 2月, 2016 4 次提交
  4. 15 2月, 2016 1 次提交
  5. 04 2月, 2016 2 次提交
  6. 23 12月, 2015 14 次提交