1. 23 7月, 2015 1 次提交
  2. 31 5月, 2015 1 次提交
  3. 25 5月, 2015 1 次提交
    • C
      usb: host: xhci: add mutex for non-thread-safe data · a00918d0
      Chris Bainbridge 提交于
      Regression in commit 638139eb ("usb: hub: allow to process more usb
      hub events in parallel")
      
      The regression resulted in intermittent failure to initialise a 10-port
      hub (with three internal VL812 4-port hub controllers) on boot, with a
      failure rate of around 8%, due to multiple race conditions when
      accessing addr_dev and slot_id in struct xhci_hcd.
      
      This regression also exposed a problem with xhci_setup_device, which
      "should be protected by the usb_address0_mutex" but no longer is due to
      
      commit 6fecd4f2 ("USB: separate usb_address0 mutexes for each bus")
      
      With separate buses (and locks) it is no longer the case that a single
      lock will protect xhci_setup_device from accesses by two parallel
      threads processing events on the two buses.
      
      Fix this by adding a mutex to protect addr_dev and slot_id in struct
      xhci_hcd, and by making the assignment of slot_id atomic.
      
      Fixes multiple boot errors:
      
      [ 0.583008] xhci_hcd 0000:00:14.0: Bad Slot ID 2
      [ 0.583009] xhci_hcd 0000:00:14.0: Could not allocate xHCI USB device data structures
      [ 0.583012] usb usb1-port3: couldn't allocate usb_device
      
      And:
      
      [ 0.637409] xhci_hcd 0000:00:14.0: Error while assigning device slot ID
      [ 0.637417] xhci_hcd 0000:00:14.0: Max number of devices this xHCI host supports is 32.
      [ 0.637421] usb usb1-port1: couldn't allocate usb_device
      
      And:
      
      [ 0.753372] xhci_hcd 0000:00:14.0: ERROR: unexpected setup context command completion code 0x0.
      [ 0.753373] usb 1-3: hub failed to enable device, error -22
      [ 0.753400] xhci_hcd 0000:00:14.0: Error while assigning device slot ID
      [ 0.753402] xhci_hcd 0000:00:14.0: Max number of devices this xHCI host supports is 32.
      [ 0.753403] usb usb1-port3: couldn't allocate usb_device
      
      And:
      
      [ 11.018386] usb 1-3: device descriptor read/all, error -110
      
      And:
      
      [ 5.753838] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
      
      Tested with 200 reboots, resulting in no USB hub init related errors.
      
      Fixes: 638139eb ("usb: hub: allow to process more usb hub events in parallel")
      Link: https://lkml.kernel.org/g/CAP-bSRb=A0iEYobdGCLpwynS7pkxpt_9ZnwyZTPVAoy0Y=Zo3Q@mail.gmail.comSigned-off-by: NChris Bainbridge <chris.bainbridge@gmail.com>
      Cc: <stable@vger.kernel.org> # 3.18+
      [changed git commit description style for checkpatch -Mathias]
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a00918d0
  4. 10 5月, 2015 1 次提交
    • M
      xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256 · 18cc2f4c
      Mathias Nyman 提交于
      Our event ring consists of only one segment, and we risk filling
      the event ring in case we get isoc transfers with short intervals
      such as webcams that fill a TD every microframe (125us)
      
      With 64 TRB segment size one usb camera could fill the event ring in 8ms.
      A setup with several cameras and other devices can fill up the
      event ring as it is shared between all devices.
      This has occurred when uvcvideo queues 5 * 32TD URBs which then
      get cancelled when the video mode changes. The cancelled URBs are returned
      in the xhci interrupt context and blocks the interrupt handler from
      handling the new events.
      
      A full event ring will block xhci from scheduling traffic and affect all
      devices conneted to the xhci, will see errors such as Missed Service
      Intervals for isoc devices, and  and Split transaction errors for LS/FS
      interrupt devices.
      
      Increasing the TRB_PER_SEGMENT will also increase the default endpoint ring
      size, which is welcome as for most isoc transfer we had to dynamically
      expand the endpoint ring anyway to be able to queue the 5 * 32TDs uvcvideo
      queues.
      
      The default size used to be 64 TRBs per segment
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      18cc2f4c
  5. 11 3月, 2015 1 次提交
  6. 07 3月, 2015 2 次提交
    • M
      xhci: Workaround for PME stuck issues in Intel xhci · b8cb91e0
      Mathias Nyman 提交于
      The xhci in Intel Sunrisepoint and Cherryview platforms need a driver
      workaround for a Stuck PME that might either block PME events in suspend,
      or create spurious PME events preventing runtime suspend.
      
      Workaround is to clear a internal PME flag, BIT(28) in a vendor specific
      PMCTRL register at offset 0x80a4, in both suspend resume callbacks
      
      Without this, xhci connected usb devices might never be able to wake up the
      system from suspend, or prevent device from going to suspend (xhci d3)
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8cb91e0
    • A
      xhci: fix reporting of 0-sized URBs in control endpoint · 45ba2154
      Aleksander Morgado 提交于
      When a control transfer has a short data stage, the xHCI controller generates
      two transfer events: a COMP_SHORT_TX event that specifies the untransferred
      amount, and a COMP_SUCCESS event. But when the data stage is not short, only the
      COMP_SUCCESS event occurs. Therefore, xhci-hcd must set urb->actual_length to
      urb->transfer_buffer_length while processing the COMP_SUCCESS event, unless
      urb->actual_length was set already by a previous COMP_SHORT_TX event.
      
      The driver checks this by seeing whether urb->actual_length == 0, but this alone
      is the wrong test, as it is entirely possible for a short transfer to have an
      urb->actual_length = 0.
      
      This patch changes the xhci driver to rely on a new td->urb_length_set flag,
      which is set to true when a COMP_SHORT_TX event is received and the URB length
      updated at that stage.
      
      This fixes a bug which affected the HSO plugin, which relies on URBs with
      urb->actual_length == 0 to halt re-submitting the RX URB in the control
      endpoint.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAleksander Morgado <aleksander@aleksander.es>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45ba2154
  7. 25 2月, 2015 2 次提交
  8. 25 1月, 2015 1 次提交
  9. 10 1月, 2015 2 次提交
  10. 03 12月, 2014 2 次提交
  11. 22 11月, 2014 1 次提交
  12. 04 10月, 2014 3 次提交
  13. 24 9月, 2014 2 次提交
  14. 02 8月, 2014 1 次提交
    • H
      xhci: Blacklist using streams on the Etron EJ168 controller · 8f873c1f
      Hans de Goede 提交于
      Streams on the EJ168 do not work as they should. I've spend 2 days trying
      to get them to work, but without success.
      
      The first problem is that when ever you ring the stream-ring doorbell, the
      controller starts executing trbs at the beginning of the first ring segment,
      event if it ended somewhere else previously. This can be worked around by
      allowing enqueing only one td (not a problem with how streams are typically
      used) and then resetting our copies of the enqueueing en dequeueing pointers
      on a td completion to match what the controller seems to be doing.
      
      This way things seem to start working with uas and instead of being able
      to complete only the very first scsi command, the scsi core can probe the disk.
      
      But then things break later on when td-s get enqueued with more then one
      trb. The controller does seem to increase its dequeue pointer while executing
      a stream-ring (data transfer events I inserted for debugging do trigger).
      However execution seems to stop at the final normal trb of a multi trb td,
      even if there is a data transfer event inserted after the final trb.
      
      The first problem alone is a serious deviation from the spec, and esp.
      dealing with cancellation would have been very tricky if not outright
      impossible, but the second problem simply is a deal breaker altogether,
      so this patch simply disables streams.
      
      Note this will cause the usb-storage + uas driver pair to automatically switch
      to using usb-storage instead of uas on these devices, essentially reverting
      to the 3.14 and earlier behavior when uas was marked CONFIG_BROKEN.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1121288
      https://bugzilla.kernel.org/show_bug.cgi?id=80101
      
      Cc: stable@vger.kernel.org # 3.15
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8f873c1f
  15. 28 5月, 2014 1 次提交
  16. 20 5月, 2014 5 次提交
    • M
      xhci: rework command timeout and cancellation, · c311e391
      Mathias Nyman 提交于
      Use one timer to control command timeout.
      
      start/kick the timer every time a command is completed and a
      new command is waiting, or a new command is added to a empty list.
      
      If the timer runs out, then tag the current command as "aborted", and
      start the xhci command abortion process.
      
      Previously each function that submitted a command had its own timer.
      If that command timed out, a new command structure for the
      command was created and it was put on a cancel_cmd_list list,
      then a pci write to abort the command ring was issued.
      
      when the ring was aborted, it checked if the current command
      was the one to be canceled, later when the ring was stopped the
      driver got ownership of the TRBs in the command ring,
      compared then to the TRBs in the cancel_cmd_list,
      and turned them into No-ops.
      
      Now, instead, at timeout we tag the status of the command in the
      command queue to be aborted, and start the ring abortion.
      Ring abortion stops the command ring and gives control of the
      commands to us.
      All the aborted commands are now turned into No-ops.
      
      If the ring is already stopped when the command times outs its not possible
      to start the ring abortion, in this case the command is turnd to No-op
      right away.
      
      All these changes allows us to remove the entire cancel_cmd_list code.
      
      The functions waiting for a command to finish no longer have their own timeouts.
      They will wait either until the command completes normally,
      or until the whole command abortion is done.
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c311e391
    • M
      xhci: Use completion and status in global command queue · 9ea1833e
      Mathias Nyman 提交于
      Remove the per-device command list and handle_cmd_in_cmd_wait_list()
      and use the completion and status variables found in the
      command structure in the global command list.
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ea1833e
    • M
      xhci: Add a global command queue · c9aa1a2d
      Mathias Nyman 提交于
      Create a list to store command structures, add a structure to it every time
      a command is submitted, and remove it from the list once we get a
      command completion event matching the command.
      
      Callers that wait for completion will free their command structures themselves.
      The other command structures are freed in the command completion event handler.
      
      Also add a check that prevents queuing commands if host is dying
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c9aa1a2d
    • M
      xhci: Use command structures when queuing commands on the command ring · ddba5cd0
      Mathias Nyman 提交于
      To create a global command queue we require that each command put on the
      command ring is submitted with a command structure.
      
      Functions that queue commands and wait for completion need to allocate a command
      before submitting it, and free it once completed. The following command queuing
      functions need to be modified.
      
      xhci_configure_endpoint()
      xhci_address_device()
      xhci_queue_slot_control()
      xhci_queue_stop_endpoint()
      xhci_queue_new_dequeue_state()
      xhci_queue_reset_ep()
      xhci_configure_endpoint()
      
      xhci_configure_endpoint() could already be called with a command structure,
      and only xhci_check_maxpacket and xhci_check_bandwidth did not do so. These
      are changed and a command structure is now required. This change also simplifies
      the configure endpoint command completion handling and the "goto bandwidth_change"
      handling code can be removed.
      
      In some cases the command queuing function is called in interrupt context.
      These commands needs to be allocated atomically, and they can't wait for
      completion. These commands will in this patch be freed directly after queuing,
      but freeing will be moved to the command completion event handler in a later
      patch once we get the global command queue up.(Just so that we won't leak
      memory in the middle of the patch set)
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ddba5cd0
    • F
      usb: xhci: Use IS_ENABLED() macro · 961b3d0a
      Fabio Estevam 提交于
      Using the IS_ENABLED() macro can make the code shorter and easier to read.
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      961b3d0a
  17. 26 4月, 2014 1 次提交
    • J
      usb: xhci: Prefer endpoint context dequeue pointer over stopped_trb · 1f81b6d2
      Julius Werner 提交于
      We have observed a rare cycle state desync bug after Set TR Dequeue
      Pointer commands on Intel LynxPoint xHCs (resulting in an endpoint that
      doesn't fetch new TRBs and thus an unresponsive USB device). It always
      triggers when a previous Set TR Dequeue Pointer command has set the
      pointer to the final Link TRB of a segment, and then another URB gets
      enqueued and cancelled again before it can be completed. Further
      investigation showed that the xHC had returned the Link TRB in the TRB
      Pointer field of the Transfer Event (CC == Stopped -- Length Invalid),
      but when xhci_find_new_dequeue_state() later accesses the Endpoint
      Context's TR Dequeue Pointer field it is set to the first TRB of the
      next segment.
      
      The driver expects those two values to be the same in this situation,
      and uses the cycle state of the latter together with the address of the
      former. This should be fine according to the XHCI specification, since
      the endpoint ring should be stopped when returning the Transfer Event
      and thus should not advance over the Link TRB before it gets restarted.
      However, real-world XHCI implementations apparently don't really care
      that much about these details, so the driver should follow a more
      defensive approach to try to work around HC spec violations.
      
      This patch removes the stopped_trb variable that had been used to store
      the TRB Pointer from the last Transfer Event of a stopped TRB. Instead,
      xhci_find_new_dequeue_state() now relies only on the Endpoint Context,
      requiring a small amount of additional processing to find the virtual
      address corresponding to the TR Dequeue Pointer. Some other parts of the
      function were slightly rearranged to better fit into this model.
      
      This patch should be backported to kernels as old as 2.6.31 that contain
      the commit ae636747 "USB: xhci: URB
      cancellation support."
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1f81b6d2
  18. 05 3月, 2014 3 次提交
    • H
      xhci: For streams the dequeue ptr must be read from the stream ctx · 9aad95e2
      Hans de Goede 提交于
      This fixes TR dequeue validation failing on Intel XHCI controllers with the
      following warning:
      
      Mismatch between completed Set TR Deq Ptr command & xHCI internal state.
      
      Interestingly enough reading the deq ptr from the ep ctx after a
      TR Deq Ptr command does work on a Nec XHCI controller, it seems the Nec
      writes the ptr to both the ep and stream contexts when streams are used.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      9aad95e2
    • H
      xhci: Set SCT field for Set TR dequeue on streams · 95241dbd
      Hans de Goede 提交于
      Nec XHCI controllers don't seem to care, but without this Intel XHCI
      controllers reject Set TR dequeue commands with a COMP_TRB_ERR, leading
      to the following warning:
      
      WARN Set TR Deq Ptr cmd invalid because of stream ID configuration
      
      And very shortly after this the system completely freezes.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      95241dbd
    • G
      xhci: fix usb3 streams · 15341303
      Gerd Hoffmann 提交于
      xhci maintains a radix tree for each stream endpoint because it must
      be able to map a trb address to the stream ring.  Each ring segment
      must be added to the ring for this to work.  Currently xhci sticks
      only the first segment of each stream ring into the radix tree.
      
      Result is that things work initially, but as soon as the first segment
      is full xhci can't map the trb address from the completion event to the
      stream ring any more -> BOOM.  You'll find this message in the logs:
      
        ERROR Transfer event for disabled endpoint or incorrect stream ring
      
      This patch adds a helper function to update the radix tree, and a
      function to remove ring segments from the tree.  Both functions loop
      over the segment list and handles all segments instead of just the
      first.
      
      [Note: Sarah changed this patch to add radix_tree_maybe_preload() and
      radix_tree_preload_end() calls around the radix tree insert, since we
      can now insert entries in interrupt context.  There are now two helper
      functions to make the code cleaner, and those functions are moved to
      make them static.]
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      15341303
  19. 08 2月, 2014 1 次提交
  20. 31 1月, 2014 1 次提交
  21. 30 1月, 2014 1 次提交
    • S
      Revert "xhci: replace xhci_write_64() with writeq()" · 477632df
      Sarah Sharp 提交于
      This reverts commit 7dd09a1a.
      
      Many xHCI host controllers can only handle 32-bit addresses, and writing
      64-bits at a time causes them to fail.  Rafał reports that USB devices
      simply do not enumerate, and reverting this patch helps.  Branimir
      reports that his host controller doesn't respond to an Enable Slot
      command and dies:
      
      [   75.576160] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [   88.991634] xhci_hcd 0000:03:00.0: Stopped the command ring failed, maybe the host is dead
      [   88.991748] xhci_hcd 0000:03:00.0: Abort command ring failed
      [   88.991845] xhci_hcd 0000:03:00.0: HC died; cleaning up
      [   93.985489] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [   93.985494] xhci_hcd 0000:03:00.0: Abort the command ring, but the xHCI is dead.
      [   98.982586] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [   98.982591] xhci_hcd 0000:03:00.0: Abort the command ring, but the xHCI is dead.
      [  103.979696] xhci_hcd 0000:03:00.0: Timeout while waiting for a slot
      [  103.979702] xhci_hcd 0000:03:00.0: Abort the command ring, but the xHCI is dead
      Signed-off-by: NSarah Sharp <sarah.a.sharp@intel.com>
      Reported-by: NRafał Miłecki <zajec5@gmail.com>
      Reported-by: NBranimir Maksimovic <branimir.maksimovic@gmail.com>
      Cc: Xenia Ragiadakou <burzalodowa@gmail.com>
      477632df
  22. 09 1月, 2014 1 次提交
    • S
      xhci: Set scatter-gather limit to avoid failed block writes. · f2d9b991
      Sarah Sharp 提交于
      Commit 35773dac "usb: xhci: Link TRB
      must not occur within a USB payload burst" attempted to fix an issue
      found with USB ethernet adapters, and inadvertently broke USB storage
      devices.  The patch attempts to ensure that transfers never span a
      segment, and rejects transfers that have more than 63 entries (or
      possibly less, if some entries cross 64KB boundaries).
      
      usb-storage limits the maximum transfer size to 120K, and we had assumed
      the block layer would pass a scatter-gather list of 4K entries,
      resulting in no more than 31 sglist entries:
      
      http://marc.info/?l=linux-usb&m=138498190419312&w=2
      
      That assumption was wrong, since we've seen the driver reject a write
      that was 218 sectors long (of probably 512 bytes each):
      
      Jan  1 07:04:49 jidanni5 kernel: [  559.624704] xhci_hcd 0000:00:14.0: Too many fragments 79, max 63
      ...
      Jan  1 07:04:58 jidanni5 kernel: [  568.622583] Write(10): 2a 00 00 06 85 0e 00 00 da 00
      
      Limit the number of scatter-gather entries to half a ring segment.  That
      should be margin enough in case some entries cross 64KB boundaries.
      Increase the number of TRBs per segment from 64 to 256, which should
      result in ring segments fitting on a 4K page.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: jidanni@jidanni.org
      References: http://bugs.debian.org/733907
      Fixes: 35773dac ('usb: xhci: Link TRB must not occur within a USB payload burst')
      Cc: stable <stable@vger.kernel.org> # 3.12
      f2d9b991
  23. 11 12月, 2013 1 次提交
    • D
      usb: xhci: change enumeration scheme to 'new scheme' by default · 48fc7dbd
      Dan Williams 提交于
      Change the default enumeration scheme for xhci attached non-SuperSpeed
      devices from:
      
         Reset
         SetAddress [xhci address-device BSR = 0]
         GetDescriptor(8)
         GetDescriptor(18)
      
      ...to:
      
         Reset
         [xhci address-device BSR = 1]
         GetDescriptor(64)
         Reset
         SetAddress [xhci address-device BSR = 0]
         GetDescriptor(18)
      
      ...as some devices misbehave when encountering a SetAddress command
      prior to GetDescriptor.  There are known legacy devices that require
      this scheme, but testing has found at least one USB3 device that fails
      enumeration when presented with this ordering.  For now, follow the ehci
      case and enable 'new scheme' by default for non-SuperSpeed devices.
      
      To support this enumeration scheme on xhci the AddressDevice operation
      needs to be performed twice.  The first instance of the command enables
      the HC's device and slot context info for the device, but omits sending
      the device a SetAddress command (BSR == block set address request).
      Then, after GetDescriptor completes, follow up with the full
      AddressDevice+SetAddress operation.
      
      As mentioned before, this ordering of events with USB3 devices causes an
      extra state transition to be exposed to xhci.  Previously USB3 devices
      would transition directly from 'enabled' to 'addressed' and never need
      to underrun responses to 'get descriptor'. We do see the 64-byte
      descriptor fetch the correct data, but the following 18-byte descriptor
      read after the reset gets:
      
      bLength            = 0
      bDescriptorType    = 0
      bcdUSB             = 0
      bDeviceClass       = 0
      bDeviceSubClass    = 0
      bDeviceProtocol    = 0
      bMaxPacketSize0    = 9
      
      instead of:
      
      bLength            = 12
      bDescriptorType    = 1
      bcdUSB             = 300
      bDeviceClass       = 0
      bDeviceSubClass    = 0
      bDeviceProtocol    = 0
      bMaxPacketSize0    = 9
      
      which results in the discovery process looping until falling back to
      'old scheme' enumeration.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-by: NDavid Moore <david.moore@gmail.com>
      Suggested-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      48fc7dbd
  24. 03 12月, 2013 4 次提交
    • X
      xhci: replace xhci_write_64() with writeq() · 7dd09a1a
      Xenia Ragiadakou 提交于
      Function xhci_write_64() is used to write 64bit xHC registers residing in MMIO.
      On 32bit systems, xHC registers need to be written with 32bit accesses by
      writing first the lower 32bits and then the higher 32bits. The header file
      asm-generic/io-64-nonatomic-lo-hi.h ensures that on 32bit systems writeq() will
      will write 64bit registers in 32bit chunks with low-high order.
      
      Replace all calls to xhci_write_64() with calls to writeq().
      
      This is done to reduce code duplication since 64bit low-high write logic
      is already implemented and to take advantage of inherent "atomic" 64bit
      write operations on 64bit systems.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      7dd09a1a
    • X
      xhci: replace xhci_read_64() with readq() · e8b37332
      Xenia Ragiadakou 提交于
      Function xhci_read_64() is used to read 64bit xHC registers residing in MMIO.
      On 32bit systems, xHC registers need to be read with 32bit accesses by
      reading first the lower 32bits and then the higher 32bits.
      
      Replace all calls to xhci_read_64() with calls to readq() and include
      asm-generic/io-64-nonatomic-lo-hi.h header file, so that if the system
      is not 64bit, readq() will read registers in 32bit chunks with low-high order.
      
      This is done to reduce code duplication since 64bit low-high read logic
      is already implemented and to take advantage of inherent "atomic" 64bit
      read operations on 64bit systems.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      e8b37332
    • X
      xhci: replace xhci_writel() with writel() · 204b7793
      Xenia Ragiadakou 提交于
      Function xhci_writel() is used to write a 32bit value in xHC registers residing
      in MMIO address space. It takes as first argument a pointer to the xhci_hcd
      although it does not use it. xhci_writel() internally simply calls writel().
      This creates an illusion that xhci_writel() is an xhci specific function that
      has to be called in a context where a pointer to xhci_hcd is available.
      
      Remove xhci_writel() wrapper function and replace its calls with calls to
      writel() to make the code more straight-forward.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      204b7793
    • X
      xhci: replace xhci_readl() with readl() · b0ba9720
      Xenia Ragiadakou 提交于
      Function xhci_readl() is used to read 32bit xHC registers residing in MMIO
      address space. It takes as first argument a pointer to the xhci_hcd although
      it does not use it. xhci_readl() internally simply calls readl(). This creates
      an illusion that xhci_readl() is an xhci specific function that has to be
      called in a context where a pointer to xhci_hcd is available.
      
      Remove the unnecessary xhci_readl() wrapper function and replace its calls to
      with calls to readl() to make the code more straightforward.
      Signed-off-by: NXenia Ragiadakou <burzalodowa@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      b0ba9720