1. 07 Nov, 2019 5 commits
    • Johan Hovold's avatar
      USB: idmouse: drop redundant open-count check from release · 6710f773
      Johan Hovold authored
      The open count will always be exactly one when release is called, so
      drop the redundant sanity check.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/r/20191105103638.4929-3-johan@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6710f773
    • Johan Hovold's avatar
      USB: idmouse: simplify disconnect handling · 79c36a70
      Johan Hovold authored
      Since commit d4ead16f ("USB: prevent char device open/deregister
      race") core prevents further calls to open() after usb_deregister_dev()
      returns so there's no need to use the interface data for
      synchronisation.
      
      This effectively reverts commit 54d2bc06 ("USB: fix locking in
      idmouse") with respect to the open-disconnect race.
      
      Note that the driver already uses a present flag to suppress I/O post
      disconnect (even if all USB I/O take place at open).
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/r/20191105103638.4929-2-johan@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      79c36a70
    • Kai-Heng Feng's avatar
      usb: Allow USB device to be warm reset in suspended state · e76b3bf7
      Kai-Heng Feng authored
      On Dell WD15 dock, sometimes USB ethernet cannot be detected after plugging
      cable to the ethernet port, the hub and roothub get runtime resumed and
      runtime suspended immediately:
      ...
      [  433.315169] xhci_hcd 0000:3a:00.0: hcd_pci_runtime_resume: 0
      [  433.315204] usb usb4: usb auto-resume
      [  433.315226] hub 4-0:1.0: hub_resume
      [  433.315239] xhci_hcd 0000:3a:00.0: Get port status 4-1 read: 0x10202e2, return 0x10343
      [  433.315264] usb usb4-port1: status 0343 change 0001
      [  433.315279] xhci_hcd 0000:3a:00.0: clear port1 connect change, portsc: 0x10002e2
      [  433.315293] xhci_hcd 0000:3a:00.0: Get port status 4-2 read: 0x2a0, return 0x2a0
      [  433.317012] xhci_hcd 0000:3a:00.0: xhci_hub_status_data: stopping port polling.
      [  433.422282] xhci_hcd 0000:3a:00.0: Get port status 4-1 read: 0x10002e2, return 0x343
      [  433.422307] usb usb4-port1: do warm reset
      [  433.422311] usb 4-1: device reset not allowed in state 8
      [  433.422339] hub 4-0:1.0: state 7 ports 2 chg 0002 evt 0000
      [  433.422346] xhci_hcd 0000:3a:00.0: Get port status 4-1 read: 0x10002e2, return 0x343
      [  433.422356] usb usb4-port1: do warm reset
      [  433.422358] usb 4-1: device reset not allowed in state 8
      [  433.422428] xhci_hcd 0000:3a:00.0: set port remote wake mask, actual port 0 status  = 0xf0002e2
      [  433.422455] xhci_hcd 0000:3a:00.0: set port remote wake mask, actual port 1 status  = 0xe0002a0
      [  433.422465] hub 4-0:1.0: hub_suspend
      [  433.422475] usb usb4: bus auto-suspend, wakeup 1
      [  433.426161] xhci_hcd 0000:3a:00.0: xhci_hub_status_data: stopping port polling.
      [  433.466209] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.510204] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.554051] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.598235] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.642154] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.686204] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.730205] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.774203] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.818207] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.862040] xhci_hcd 0000:3a:00.0: port 0 polling in bus suspend, waiting
      [  433.862053] xhci_hcd 0000:3a:00.0: xhci_hub_status_data: stopping port polling.
      [  433.862077] xhci_hcd 0000:3a:00.0: xhci_suspend: stopping port polling.
      [  433.862096] xhci_hcd 0000:3a:00.0: // Setting command ring address to 0x8578fc001
      [  433.862312] xhci_hcd 0000:3a:00.0: hcd_pci_runtime_suspend: 0
      [  433.862445] xhci_hcd 0000:3a:00.0: PME# enabled
      [  433.902376] xhci_hcd 0000:3a:00.0: restoring config space at offset 0xc (was 0x0, writing 0x20)
      [  433.902395] xhci_hcd 0000:3a:00.0: restoring config space at offset 0x4 (was 0x100000, writing 0x100403)
      [  433.902490] xhci_hcd 0000:3a:00.0: PME# disabled
      [  433.902504] xhci_hcd 0000:3a:00.0: enabling bus mastering
      [  433.902547] xhci_hcd 0000:3a:00.0: // Setting command ring address to 0x8578fc001
      [  433.902649] pcieport 0000:00:1b.0: PME: Spurious native interrupt!
      [  433.902839] xhci_hcd 0000:3a:00.0: Port change event, 4-1, id 3, portsc: 0xb0202e2
      [  433.902842] xhci_hcd 0000:3a:00.0: resume root hub
      [  433.902845] xhci_hcd 0000:3a:00.0: handle_port_status: starting port polling.
      [  433.902877] xhci_hcd 0000:3a:00.0: xhci_resume: starting port polling.
      [  433.902889] xhci_hcd 0000:3a:00.0: xhci_hub_status_data: stopping port polling.
      [  433.902891] xhci_hcd 0000:3a:00.0: hcd_pci_runtime_resume: 0
      [  433.902919] usb usb4: usb wakeup-resume
      [  433.902942] usb usb4: usb auto-resume
      [  433.902966] hub 4-0:1.0: hub_resume
      ...
      
      As Mathias pointed out, the hub enters Cold Attach Status state and
      requires a warm reset. However usb_reset_device() bails out early when
      the device is in suspended state, as its callers port_event() and
      hub_event() don't always resume the device.
      
      Since there's nothing wrong to reset a suspended device, allow
      usb_reset_device() to do so to solve the issue.
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20191106062710.29880-1-kai.heng.feng@canonical.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e76b3bf7
    • Gustavo A. R. Silva's avatar
      usb: gadget: pch_udc: fix use after free · 66d1b0c0
      Gustavo A. R. Silva authored
      Remove pointer dereference after free.
      
      pci_pool_free doesn't care about contents of td.
      It's just a void* for it
      
      Addresses-Coverity-ID: 1091173 ("Use after free")
      Cc: stable@vger.kernel.org
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Link: https://lore.kernel.org/r/20191106202821.GA20347@embeddedorSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      66d1b0c0
    • Yoshihiro Shimoda's avatar
  2. 04 Nov, 2019 32 commits
  3. 03 Nov, 2019 2 commits
    • Linus Torvalds's avatar
      Linux 5.4-rc6 · a99d8080
      Linus Torvalds authored
      a99d8080
    • Linus Torvalds's avatar
      Merge tag 'usb-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 3a69c9e5
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "The USB sub-maintainers woke up this past week and sent a bunch of
        tiny fixes. Here are a lot of small patches that that resolve a bunch
        of reported issues in the USB core, drivers, serial drivers, gadget
        drivers, and of course, xhci :)
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (31 commits)
        usb: dwc3: gadget: fix race when disabling ep with cancelled xfers
        usb: cdns3: gadget: Fix g_audio use case when connected to Super-Speed host
        usb: cdns3: gadget: reset EP_CLAIMED flag while unloading
        USB: serial: whiteheat: fix line-speed endianness
        USB: serial: whiteheat: fix potential slab corruption
        USB: gadget: Reject endpoints with 0 maxpacket value
        UAS: Revert commit 3ae62a42 ("UAS: fix alignment of scatter/gather segments")
        usb-storage: Revert commit 747668db ("usb-storage: Set virt_boundary_mask to avoid SG overflows")
        usbip: Fix free of unallocated memory in vhci tx
        usbip: tools: Fix read_usb_vudc_device() error path handling
        usb: xhci: fix __le32/__le64 accessors in debugfs code
        usb: xhci: fix Immediate Data Transfer endianness
        xhci: Fix use-after-free regression in xhci clear hub TT implementation
        USB: ldusb: fix control-message timeout
        USB: ldusb: use unsigned size format specifiers
        USB: ldusb: fix ring-buffer locking
        USB: Skip endpoints with 0 maxpacket length
        usb: cdns3: gadget: Don't manage pullups
        usb: dwc3: remove the call trace of USBx_GFLADJ
        usb: gadget: configfs: fix concurrent issue between composite APIs
        ...
      3a69c9e5
  4. 02 Nov, 2019 1 commit