1. 30 1月, 2013 1 次提交
  2. 26 1月, 2013 6 次提交
    • A
      USB: EHCI: fix timer bug affecting port resume · ee74290b
      Alan Stern 提交于
      This patch (as1652) fixes a long-standing bug in ehci-hcd.  The driver
      relies on status polls to know when to stop port-resume signalling.
      It uses the root-hub status timer to schedule these status polls.  But
      when the driver for the root hub is resumed, the timer is rescheduled
      to go off immediately -- before the port is ready.  When this happens
      the timer does not get re-enabled, which prevents the port resume from
      finishing until some other event occurs.
      
      The symptom is that when a new device is plugged in, it doesn't get
      recognized or enumerated until lsusb is run or something else happens.
      
      The solution is to re-enable the root-hub status timer after every
      status poll while a port resume is in progress.
      
      This bug hasn't surfaced before now because we never used to try to
      suspend the root hub in the middle of a port resume (except by
      coincidence).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NNorbert Preining <preining@logic.at>
      Tested-by: NMing Lei <ming.lei@canonical.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee74290b
    • A
      USB: UHCI: notify usbcore about port resumes · 840008bb
      Alan Stern 提交于
      This patch (as1651) adds calls to the new
      usb_hcd_{start,end}_port_resume() functions to uhci-hcd.  Now UHCI
      root hubs won't be runtime suspended while they are sending a resume
      signal to one of their ports.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      840008bb
    • A
      USB: EHCI: notify usbcore about port resumes · f292e7f9
      Alan Stern 提交于
      This patch (as1650) adds calls to the new
      usb_hcd_{start,end}_port_resume() functions to ehci-hcd.  Now EHCI
      root hubs won't be runtime suspended while they are sending a resume
      signal to one of their ports.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f292e7f9
    • A
      USB: add usb_hcd_{start,end}_port_resume · da0aa716
      Alan Stern 提交于
      This patch (as1649) adds a mechanism for host controller drivers to
      inform usbcore when they have begun or ended resume signalling on a
      particular root-hub port.  The core will then make sure that the root
      hub does not get runtime-suspended while the port resume is going on.
      
      Since commit 596d789a (USB: set hub's
      default autosuspend delay as 0), the system tries to suspend hubs
      whenever they aren't in use.  While a root-hub port is being resumed,
      the root hub does not appear to be in use.  Attempted runtime suspends
      fail because of the ongoing port resume, but the PM core just keeps on
      trying over and over again.  We want to prevent this wasteful effort.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      da0aa716
    • A
      USB: EHCI: unlink one async QH at a time · 6e0c3339
      Alan Stern 提交于
      This patch (as1648) fixes a regression affecting nVidia EHCI
      controllers.  Evidently they don't like to have more than one async QH
      unlinked at a time.  I can't imagine how they manage to mess it up,
      but at least one of them does.
      
      The patch changes the async unlink logic in two ways:
      
      	Each time an IAA cycle is started, only the first QH on the
      	async unlink list is handled (rather than all of them).
      
      	Async QHs do not all get unlinked as soon as they have been
      	empty for long enough.  Instead, only the last one (i.e., the
      	one that has been on the schedule the longest) is unlinked,
      	and then only if no other unlinks are in progress at the time.
      
      This means that when multiple QHs are empty, they won't be unlinked as
      quickly as before.  That's okay; it won't affect correct operation of
      the driver or add an excessive load.  Multiple unlinks tend to be
      relatively rare in any case.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NPiergiorgio Sartor <piergiorgio.sartor@nexgo.de>
      Cc: stable <stable@vger.kernel.org> # 3.6
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e0c3339
    • A
      USB: EHCI: remove ASS/PSS polling timeout · 55bcdce8
      Alan Stern 提交于
      This patch (as1647) attempts to work around a problem that seems to
      affect some nVidia EHCI controllers.  They sometimes take a very long
      time to turn off their async or periodic schedules.  I don't know if
      this is a result of other problems, but in any case it seems wise not
      to depend on schedule enables or disables taking effect in any
      specific length of time.
      
      The patch removes the existing 20-ms timeout for enabling and
      disabling the schedules.  The driver will now continue to poll the
      schedule state at 1-ms intervals until the controller finally decides
      to obey the most recent command issued by the driver.  Just in case
      this hides a problem, a debugging message will be logged if the
      controller takes longer than 20 polls.
      
      I don't know if this will actually fix anything, but it can't hurt.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NPiergiorgio Sartor <piergiorgio.sartor@nexgo.de>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55bcdce8
  3. 25 1月, 2013 6 次提交
    • L
      usb: Using correct way to clear usb3.0 device's remote wakeup feature. · 54a3ac0c
      Lan Tianyu 提交于
      Usb3.0 device defines function remote wakeup which is only for interface
      recipient rather than device recipient. This is different with usb2.0 device's
      remote wakeup feature which is defined for device recipient. According usb3.0
      spec 9.4.5, the function remote wakeup can be modified by the SetFeature()
      requests using the FUNCTION_SUSPEND feature selector. This patch is to use
      correct way to disable usb3.0 device's function remote wakeup after suspend
      error and resuming.
      
      This should be backported to kernels as old as 3.4, that contain the
      commit 623bef9e "USB/xhci: Enable remote
      wakeup for USB3 devices."
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      54a3ac0c
    • D
      usb: Prevent dead ports when xhci is not enabled · 58b2939b
      David Moore 提交于
      When the xHCI driver is not available, actively switch the ports to EHCI
      mode since some BIOSes leave them in xHCI mode where they would
      otherwise appear dead.  This was discovered on a  Dell Optiplex 7010,
      but it's possible other systems could be affected.
      
      This should be backported to kernels as old as 3.0, that contain the
      commit 69e848c2 "Intel xhci: Support
      EHCI/xHCI port switching."
      Signed-off-by: NDavid Moore <david.moore@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      58b2939b
    • A
      USB: XHCI: fix memory leak of URB-private data · 48c3375c
      Alan Stern 提交于
      This patch (as1640) fixes a memory leak in xhci-hcd.  The urb_priv
      data structure isn't always deallocated in the handle_tx_event()
      routine for non-control transfers.  The patch adds a kfree() call so
      that all paths end up freeing the memory properly.
      
      This patch should be backported to kernels as old as 2.6.36, that
      contain the commit 8e51adcc "USB: xHCI:
      Introduce urb_priv structure"
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-and-tested-by: NMartin Mokrejs <mmokrejs@fold.natur.cuni.cz>
      CC: <stable@vger.kernel.org>
      48c3375c
    • N
      drivers: xhci: fix incorrect bit test · ba7b5c22
      Nickolai Zeldovich 提交于
      Fix incorrect bit test that originally showed up in
      4ee823b8 "USB/xHCI: Support
      device-initiated USB 3.0 resume."
      
      Use '&' instead of '&&'.
      
      This should be backported to kernels as old as 3.4.
      Signed-off-by: NNickolai Zeldovich <nickolai@csail.mit.edu>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      ba7b5c22
    • S
      xhci: Fix TD size for isochronous URBs. · f18f8ed2
      Sarah Sharp 提交于
      To calculate the TD size for a particular TRB in an isoc TD, we need
      know the endpoint's max packet size.  Isochronous endpoints also encode
      the number of additional service opportunities in their wMaxPacketSize
      field.  The TD size calculation did not mask off those bits before using
      the field.  This resulted in incorrect TD size information for
      isochronous TRBs when an URB frame buffer crossed a 64KB boundary.
      
      For example:
       - an isoc endpoint has 2 additional service opportunites and
         a max packet size of 1020 bytes
       - a frame transfer buffer contains 3060 bytes
       - one frame buffer crosses a 64KB boundary, and must be split into
         one 1276 byte TRB, and one 1784 byte TRB.
      
      The TD size is is the number of packets that remain to be transferred
      for a TD after processing all the max packet sized packets in the
      current TRB and all previous TRBs.
      
      For this TD, the number of packets to be transferred is (3060 / 1020),
      or 3.  The first TRB contains 1276 bytes, which means it contains one
      full packet, and a 256 byte remainder.  After processing all the max
      packet-sized packets in the first TRB, the host will have 2 packets left
      to transfer.
      
      The old code would calculate the TD size for the first TRB as:
      
      total packet count = DIV_ROUND_UP (TD length / endpoint wMaxPacketSize)
      total packet count - (first TRB length / endpoint wMaxPacketSize)
      
      The math should have been:
      
      total packet count = DIV_ROUND_UP (3060 / 1020) = 3
      3 - (1276 / 1020) = 2
      
      Since the old code didn't mask off the additional service interval bits
      from the wMaxPacketSize field, the math ended up as
      
      total packet count = DIV_ROUND_UP (3060 / 5116) = 1
      1 - (1276 / 5116) = 1
      
      Fix this by masking off the number of additional service opportunities
      in the wMaxPacketSize field.
      
      This patch should be backported to stable kernels as old as 3.0, that
      contain the commit 4da6e6f2 "xhci 1.0:
      Update TD size field format."  It may not apply well to kernels older
      than 3.2 because of commit 29cc8897
      "USB: use usb_endpoint_maxp() instead of le16_to_cpu()".
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      f18f8ed2
    • S
      xhci: Fix isoc TD encoding. · 760973d2
      Sarah Sharp 提交于
      An isochronous TD is comprised of one isochronous TRB chained to zero or
      more normal TRBs.  Only the isoc TRB has the TBC and TLBPC fields.  The
      normal TRBs must set those fields to zeroes.  The code was setting the
      TBC and TLBPC fields for both isoc and normal TRBs.  Fix this.
      
      This should be backported to stable kernels as old as 3.0, that contain
      the commit b61d378f " xhci 1.0: Set
      transfer burst last packet count field."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      760973d2
  4. 24 1月, 2013 2 次提交
    • P
      mfd: vexpress-sysreg: Don't skip initialization on probe · 52666298
      Pawel Moll 提交于
      The vexpress-sysreg driver does not have to be initialized
      early, when the platform doesn't require this. Unfortunately
      in such case it wasn't initialized correctly - master site
      lookup and config bridge registration were missing. Fixed now.
      Signed-off-by: NPawel Moll <pawel.moll@arm.com>
      52666298
    • A
      USB: EHCI: fix build error in ehci-mxc · dba63b2f
      Alan Stern 提交于
      This patch (as1643b) fixes a build error in ehci-hcd when compiling for
      ARM with allmodconfig:
      
      drivers/usb/host/ehci-hcd.c:1285:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
      drivers/usb/host/ehci-hcd.c:1255:0: note: this is the location of the previous definition
      drivers/usb/host/ehci-mxc.c:280:31: warning: 'ehci_mxc_driver' defined but not used [-Wunused-variable]
      drivers/usb/host/ehci-hcd.c:1285:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
      drivers/usb/host/ehci-hcd.c:1255:0: note: this is the location of the previous definition
      
      The fix is to convert ehci-mxc over to the new "ehci-hcd is a library"
      scheme so that it can coexist peacefully with the ehci-platform
      driver.  As part of the conversion the ehci_mxc_priv data structure,
      which was allocated dynamically, is now placed where it belongs: in
      the private area at the end of struct ehci_hcd.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dba63b2f
  5. 23 1月, 2013 8 次提交
  6. 22 1月, 2013 12 次提交
  7. 21 1月, 2013 3 次提交
    • M
      i2c: mxs: Fix misuse init_completion · 85de7fac
      Marek Vasut 提交于
      The init_completion() call does reinit not only the variable carrying
      the flag that the completion finished, but also initialized the
      waitqueue associated with the completion. On the contrary, the
      INIT_COMPLETION() call only reinits the flag.
      
      In case there was anything still stuck in the waitqueue, subsequent call
      to init_completion() would be able to create possible race condition. This
      patch uses the proper function and moves init_completion() into .probe() call
      of the driver, to be issued only once.
      
      Note that such scenario is impossible, since two threads can never enter the
      mxs_i2c_xfer_msg(), since whole this section is protected by mutex in I2C core.
      This by no means allows this issue to exit though.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
      85de7fac
    • D
      ttm: on move memory failure don't leave a node dangling · 014b3440
      Dave Airlie 提交于
      if we have a move notify callback, when moving fails, we call move notify
      the opposite way around, however this ends up with *mem containing the mm_node
      from the bo, which means we double free it. This is a follow on to the previous
      fix.
      Reviewed-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      014b3440
    • D
      ttm: don't destroy old mm_node on memcpy failure · 63054186
      Dave Airlie 提交于
      When we are using memcpy to move objects around, and we fail to memcpy
      due to lack of memory to populate or failure to finish the copy, we don't
      want to destroy the mm_node that has been copied into old_copy.
      
      While working on a new kms driver that uses memcpy, if I overallocated bo's
      up to the memory limits, and eviction failed, then machine would oops soon
      after due to having an active bo with an already freed drm_mm embedded in it,
      freeing it a second time didn't end well.
      Reviewed-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      63054186
  8. 19 1月, 2013 2 次提交