1. 05 Oct, 2017 5 commits
    • Lu Baolu's avatar
      usb: xhci: Fix potential memory leak in xhci_disable_slot() · cd3f1790
      Lu Baolu authored
      xhci_disable_slot() allows the invoker to pass a command pointer
      as paramenter. Otherwise, it will allocate one. This will cause
      memory leak when a command structure was allocated inside of this
      function while queuing command trb fails. Another problem comes up
      when the invoker passed a command pointer, but xhci_disable_slot()
      frees it when it detects a dead host.
      
      This patch fixes these two problems by removing the command parameter
      from xhci_disable_slot().
      
      Fixes: f9e609b8 ("usb: xhci: Add helper function xhci_disable_slot().")
      Cc: Guoqing Zhang <guoqing.zhang@intel.com>
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd3f1790
    • Lu Baolu's avatar
      usb: xhci: Disable slot even when virt-dev is null · b64149ca
      Lu Baolu authored
      xhci_disable_slot() is a helper for disabling a slot when a device
      goes away or recovers from error situations. Currently, it checks
      the corespoding virt-dev pointer and returns directly (w/o issuing
      disable slot command) if it's null.
      
      This is unnecessary and will cause problems in case where virt-dev
      allocation fails and xhci_disable_slot() is called to roll back the
      hardware state. Refer to the implementation of xhci_alloc_dev().
      
      This patch removes lines to check virt-dev in xhci_disable_slot().
      
      Fixes: f9e609b8 ("usb: xhci: Add helper function xhci_disable_slot().")
      Cc: Guoqing Zhang <guoqing.zhang@intel.com>
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b64149ca
    • Lu Baolu's avatar
      usb: xhci: Add debugfs interface for xHCI driver · 02b6fdc2
      Lu Baolu authored
      This adds debugfs consumer for xHCI driver. The debugfs entries
      read all host registers, device/endpoint contexts, command ring,
      event ring and various endpoint rings. With these entries, users
      can check the registers and memory spaces used by a host during
      run time, or save all the information with a simple 'cp -r' for
      post-mortem programs.
      
      The file hierarchy looks like this.
      
      [root of debugfs]
      |__usb
      |____[e,u,o]hci                 <---------[root for other HCIs]
      |____xhci                       <---------------[root for xHCI]
      |______0000:00:14.0             <--------------[xHCI host name]
      |________reg-cap                <--------[capability registers]
      |________reg-op                 <-------[operational registers]
      |________reg-runtime            <-----------[runtime registers]
      |________reg-ext-#cap_name      <----[extended capability regs]
      |________command-ring           <-------[root for command ring]
      |__________cycle                <------------------[ring cycle]
      |__________dequeue              <--------[ring dequeue pointer]
      |__________enqueue              <--------[ring enqueue pointer]
      |__________trbs                 <-------------------[ring trbs]
      |________event-ring             <---------[root for event ring]
      |__________cycle                <------------------[ring cycle]
      |__________dequeue              <--------[ring dequeue pointer]
      |__________enqueue              <--------[ring enqueue pointer]
      |__________trbs                 <-------------------[ring trbs]
      |________devices                <------------[root for devices]
      |__________#slot_id             <-----------[root for a device]
      |____________name               <-----------------[device name]
      |____________slot-context       <----------------[slot context]
      |____________ep-context         <-----------[endpoint contexts]
      |____________ep#ep_index        <--------[root for an endpoint]
      |______________cycle            <------------------[ring cycle]
      |______________dequeue          <--------[ring dequeue pointer]
      |______________enqueue          <--------[ring enqueue pointer]
      |______________trbs             <-------------------[ring trbs]
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      02b6fdc2
    • Mathias Nyman's avatar
      xhci: add port speed ID to portsc tracing · 8f114877
      Mathias Nyman authored
      Shows the port speed protocol speed ID (PSID) in use.
      speed ID may map to custom speeds, but in most cases it uses default
      
      1 = Full-Speed        12 MB/s
      2 = Low-Speed         1.5 Mb/s
      3 = High-speed        480 Mb/s
      4 = SuperSpeed        5 Gb/s
      5 = SuperSpeedPlus    10 Gb/s
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8f114877
    • Thang Q. Nguyen's avatar
      usb: host: xhci support option to disable the xHCI USB2 HW LPM · 4750bc78
      Thang Q. Nguyen authored
      XHCI specification 1.1 does not require xHCI-compliant controllers
      to always enable hardware USB2 LPM. However, the current xHCI
      driver always enable it when seeing HLC=1.
      This patch supports an option for users to control disabling
      USB2 Hardware LPM via DT/ACPI attribute.
      This option is needed in case user would like to disable this
      feature. For example, their xHCI controller has its USB2 HW LPM
      broken.
      Signed-off-by: default avatarTung Nguyen <tunguyen@apm.com>
      Signed-off-by: default avatarThang Q. Nguyen <tqnguyen@apm.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4750bc78
  2. 04 Oct, 2017 19 commits
  3. 18 Sep, 2017 7 commits
  4. 16 Sep, 2017 9 commits