1. 26 8月, 2021 2 次提交
  2. 25 8月, 2021 1 次提交
  3. 24 8月, 2021 1 次提交
    • Z
      USB: serial: option: add new VID/PID to support Fibocom FG150 · 2829a4e3
      Zhengjun Zhang 提交于
      Fibocom FG150 is a 5G module based on Qualcomm SDX55 platform,
      support Sub-6G band.
      
      Here are the outputs of lsusb -v and usb-devices:
      
      > T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
      > D:  Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
      > P:  Vendor=2cb7 ProdID=010b Rev=04.14
      > S:  Manufacturer=Fibocom
      > S:  Product=Fibocom Modem_SN:XXXXXXXX
      > S:  SerialNumber=XXXXXXXX
      > C:  #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
      > I:  If#=0x0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
      > I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
      > I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
      > I:  If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none)
      > I:  If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
      
      > Bus 002 Device 002: ID 2cb7:010b Fibocom Fibocom Modem_SN:XXXXXXXX
      > Device Descriptor:
      >   bLength                18
      >   bDescriptorType         1
      >   bcdUSB               3.20
      >   bDeviceClass            0
      >   bDeviceSubClass         0
      >   bDeviceProtocol         0
      >   bMaxPacketSize0         9
      >   idVendor           0x2cb7 Fibocom
      >   idProduct          0x010b
      >   bcdDevice            4.14
      >   iManufacturer           1 Fibocom
      >   iProduct                2 Fibocom Modem_SN:XXXXXXXX
      >   iSerial                 3 XXXXXXXX
      >   bNumConfigurations      1
      >   Configuration Descriptor:
      >     bLength                 9
      >     bDescriptorType         2
      >     wTotalLength       0x00e6
      >     bNumInterfaces          5
      >     bConfigurationValue     1
      >     iConfiguration          4 RNDIS_DUN_DIAG_ADB
      >     bmAttributes         0xa0
      >       (Bus Powered)
      >       Remote Wakeup
      >     MaxPower              896mA
      >     Interface Association:
      >       bLength                 8
      >       bDescriptorType        11
      >       bFirstInterface         0
      >       bInterfaceCount         2
      >       bFunctionClass        239 Miscellaneous Device
      >       bFunctionSubClass       4
      >       bFunctionProtocol       1
      >       iFunction               7 RNDIS
      >     Interface Descriptor:
      >       bLength                 9
      >       bDescriptorType         4
      >       bInterfaceNumber        0
      >       bAlternateSetting       0
      >       bNumEndpoints           1
      >       bInterfaceClass       239 Miscellaneous Device
      >       bInterfaceSubClass      4
      >       bInterfaceProtocol      1
      >       iInterface              0
      >       ** UNRECOGNIZED:  05 24 00 10 01
      >       ** UNRECOGNIZED:  05 24 01 00 01
      >       ** UNRECOGNIZED:  04 24 02 00
      >       ** UNRECOGNIZED:  05 24 06 00 01
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x81  EP 1 IN
      >         bmAttributes            3
      >           Transfer Type            Interrupt
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0008  1x 8 bytes
      >         bInterval               9
      >         bMaxBurst               0
      >     Interface Descriptor:
      >       bLength                 9
      >       bDescriptorType         4
      >       bInterfaceNumber        1
      >       bAlternateSetting       0
      >       bNumEndpoints           2
      >       bInterfaceClass        10 CDC Data
      >       bInterfaceSubClass      0
      >       bInterfaceProtocol      0
      >       iInterface              0
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x8e  EP 14 IN
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               6
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x0f  EP 15 OUT
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               6
      >     Interface Descriptor:
      >       bLength                 9
      >       bDescriptorType         4
      >       bInterfaceNumber        2
      >       bAlternateSetting       0
      >       bNumEndpoints           3
      >       bInterfaceClass       255 Vendor Specific Class
      >       bInterfaceSubClass      0
      >       bInterfaceProtocol      0
      >       iInterface              0
      >       ** UNRECOGNIZED:  05 24 00 10 01
      >       ** UNRECOGNIZED:  05 24 01 00 00
      >       ** UNRECOGNIZED:  04 24 02 02
      >       ** UNRECOGNIZED:  05 24 06 00 00
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x83  EP 3 IN
      >         bmAttributes            3
      >           Transfer Type            Interrupt
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x000a  1x 10 bytes
      >         bInterval               9
      >         bMaxBurst               0
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x82  EP 2 IN
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               0
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x01  EP 1 OUT
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               0
      >     Interface Descriptor:
      >       bLength                 9
      >       bDescriptorType         4
      >       bInterfaceNumber        3
      >       bAlternateSetting       0
      >       bNumEndpoints           2
      >       bInterfaceClass       255 Vendor Specific Class
      >       bInterfaceSubClass    255 Vendor Specific Subclass
      >       bInterfaceProtocol     48
      >       iInterface              0
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x84  EP 4 IN
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               0
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x02  EP 2 OUT
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               0
      >     Interface Descriptor:
      >       bLength                 9
      >       bDescriptorType         4
      >       bInterfaceNumber        4
      >       bAlternateSetting       0
      >       bNumEndpoints           2
      >       bInterfaceClass       255 Vendor Specific Class
      >       bInterfaceSubClass     66
      >       bInterfaceProtocol      1
      >       iInterface              0
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x03  EP 3 OUT
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               0
      >       Endpoint Descriptor:
      >         bLength                 7
      >         bDescriptorType         5
      >         bEndpointAddress     0x85  EP 5 IN
      >         bmAttributes            2
      >           Transfer Type            Bulk
      >           Synch Type               None
      >           Usage Type               Data
      >         wMaxPacketSize     0x0400  1x 1024 bytes
      >         bInterval               0
      >         bMaxBurst               0
      > Binary Object Store Descriptor:
      >   bLength                 5
      >   bDescriptorType        15
      >   wTotalLength       0x0016
      >   bNumDeviceCaps          2
      >   USB 2.0 Extension Device Capability:
      >     bLength                 7
      >     bDescriptorType        16
      >     bDevCapabilityType      2
      >     bmAttributes   0x00000006
      >       BESL Link Power Management (LPM) Supported
      >   SuperSpeed USB Device Capability:
      >     bLength                10
      >     bDescriptorType        16
      >     bDevCapabilityType      3
      >     bmAttributes         0x00
      >     wSpeedsSupported   0x000f
      >       Device can operate at Low Speed (1Mbps)
      >       Device can operate at Full Speed (12Mbps)
      >       Device can operate at High Speed (480Mbps)
      >       Device can operate at SuperSpeed (5Gbps)
      >     bFunctionalitySupport   1
      >       Lowest fully-functional device speed is Full Speed (12Mbps)
      >     bU1DevExitLat           1 micro seconds
      >     bU2DevExitLat         500 micro seconds
      > Device Status:     0x0000
      >   (Bus Powered)
      Signed-off-by: NZhengjun Zhang <zhangzhengjun@aicrobo.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      2829a4e3
  4. 18 8月, 2021 1 次提交
    • H
      usb: typec: tcpm: Fix VDMs sometimes not being forwarded to alt-mode drivers · 5571ea31
      Hans de Goede 提交于
      Commit a20dcf53 ("usb: typec: tcpm: Respond Not_Supported if no
      snk_vdo"), stops tcpm_pd_data_request() calling tcpm_handle_vdm_request()
      when port->nr_snk_vdo is not set. But the VDM might be intended for an
      altmode-driver, in which case nr_snk_vdo does not matter.
      
      This change breaks the forwarding of connector hotplug (HPD) events
      for displayport altmode on devices which don't set nr_snk_vdo.
      
      tcpm_pd_data_request() is the only caller of tcpm_handle_vdm_request(),
      so we can move the nr_snk_vdo check to inside it, at which point we
      have already looked up the altmode device so we can check for this too.
      
      Doing this check here also ensures that vdm_state gets set to
      VDM_STATE_DONE if it was VDM_STATE_BUSY, even if we end up with
      responding with PD_MSG_CTRL_NOT_SUPP later.
      
      Note that tcpm_handle_vdm_request() was already sending
      PD_MSG_CTRL_NOT_SUPP in some circumstances, after moving the nr_snk_vdo
      check the same error-path is now taken when that check fails. So that
      we have only one error-path for this and not two. Replace the
      tcpm_queue_message(PD_MSG_CTRL_NOT_SUPP) used by the existing error-path
      with the more robust tcpm_pd_handle_msg() from the (now removed) second
      error-path.
      
      Fixes: a20dcf53 ("usb: typec: tcpm: Respond Not_Supported if no snk_vdo")
      Cc: stable <stable@vger.kernel.org>
      Cc: Kyle Tso <kyletso@google.com>
      Acked-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Acked-by: NKyle Tso <kyletso@google.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210816154632.381968-1-hdegoede@redhat.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5571ea31
  5. 10 8月, 2021 1 次提交
  6. 05 8月, 2021 4 次提交
  7. 04 8月, 2021 2 次提交
  8. 30 7月, 2021 1 次提交
  9. 29 7月, 2021 5 次提交
  10. 28 7月, 2021 1 次提交
  11. 27 7月, 2021 7 次提交
  12. 22 7月, 2021 1 次提交
  13. 21 7月, 2021 13 次提交
    • V
      Revert "USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem" · f3a1a937
      Vincent Palatin 提交于
      This reverts commit 0bd86049.
      
      While the patch was working as stated,ie preventing the L850-GL LTE modem
      from crashing on some U3 wake-ups due to a race condition between the
      host wake-up and the modem-side wake-up, when using the MBIM interface,
      this would force disabling the USB runtime PM on the device.
      
      The increased power consumption is significant for LTE laptops,
      and given that with decently recent modem firmwares, when the modem hits
      the bug, it automatically recovers (ie it drops from the bus, but
      automatically re-enumerates after less than half a second, rather than being
      stuck until a power cycle as it was doing with ancient firmware), for
      most people, the trade-off now seems in favor of re-enabling it by
      default.
      
      For people with access to the platform code, the bug can also be worked-around
      successfully by changing the USB3 LFPM polling off-time for the XHCI
      controller in the BIOS code.
      Signed-off-by: NVincent Palatin <vpalatin@chromium.org>
      Link: https://lore.kernel.org/r/20210721092516.2775971-1-vpalatin@chromium.org
      Fixes: 0bd86049 ("USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem")
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f3a1a937
    • W
      usb: cdc-wdm: fix build error when CONFIG_WWAN_CORE is not set · 5c912e67
      Wei Yongjun 提交于
      Gcc report build error as following when CONFIG_WWAN_CORE is not set:
      
      x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_disconnect':
      cdc-wdm.c:(.text+0xb2a): undefined reference to `wwan_remove_port'
      x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_in_callback':
      cdc-wdm.c:(.text+0xf23): undefined reference to `wwan_port_rx'
      x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_stop':
      cdc-wdm.c:(.text+0x127d): undefined reference to `wwan_port_get_drvdata'
      x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_tx':
      cdc-wdm.c:(.text+0x12d9): undefined reference to `wwan_port_get_drvdata'
      x86_64-linux-gnu-ld: cdc-wdm.c:(.text+0x13c1): undefined reference to `wwan_port_txoff'
      x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_start':
      cdc-wdm.c:(.text+0x13e0): undefined reference to `wwan_port_get_drvdata'
      x86_64-linux-gnu-ld: cdc-wdm.c:(.text+0x1431): undefined reference to `wwan_port_txon'
      x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_tx_complete':
      cdc-wdm.c:(.text+0x14a4): undefined reference to `wwan_port_txon'
      x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_create.cold':
      cdc-wdm.c:(.text.unlikely+0x209): undefined reference to `wwan_create_port'
      
      Using CONFIG_WWAN_CORE instead of CONFIG_WWAN to avoid build error.
      
      Fixes: cac6fb01 ("usb: class: cdc-wdm: WWAN framework integration")
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Reviewed-by: NLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Link: https://lore.kernel.org/r/20210521021010.2490930-1-weiyongjun1@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c912e67
    • M
      usb: dwc2: gadget: Fix sending zero length packet in DDMA mode. · d53dc388
      Minas Harutyunyan 提交于
      Sending zero length packet in DDMA mode perform by DMA descriptor
      by setting SP (short packet) flag.
      
      For DDMA in function dwc2_hsotg_complete_in() does not need to send
      zlp.
      
      Tested by USBCV MSC tests.
      
      Fixes: f71b5e25 ("usb: dwc2: gadget: fix zero length packet transfers")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
      Link: https://lore.kernel.org/r/967bad78c55dd2db1c19714eee3d0a17cf99d74a.1626777738.git.Minas.Harutyunyan@synopsys.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d53dc388
    • M
      usb: dwc2: Skip clock gating on Samsung SoCs · c4a0f7a6
      Marek Szyprowski 提交于
      Commit 0112b7ce ("usb: dwc2: Update dwc2_handle_usb_suspend_intr
      function.") changed the way the driver handles power down modes in a such
      way that it uses clock gating when no other power down mode is available.
      
      This however doesn't work well on the DWC2 implementation used on the
      Samsung SoCs. When a clock gating is enabled, system hangs. It looks that
      the proper clock gating requires some additional glue code in the shared
      USB2 PHY and/or Samsung glue code for the DWC2. To restore driver
      operation on the Samsung SoCs simply skip enabling clock gating mode
      until one finds what is really needed to make it working reliably.
      
      Fixes: 0112b7ce ("usb: dwc2: Update dwc2_handle_usb_suspend_intr function.")
      Cc: stable <stable@vger.kernel.org>
      Acked-by: NKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Link: https://lore.kernel.org/r/20210716050127.4406-1-m.szyprowski@samsung.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4a0f7a6
    • Y
      usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() · 5719df24
      Yoshihiro Shimoda 提交于
      This driver has a potential issue which this driver is possible to
      cause superfluous irqs after usb_pkt_pop() is called. So, after
      the commit 3af32605 ("usb: renesas_usbhs: fix error return
      code of usbhsf_pkt_handler()") had been applied, we could observe
      the following error happened when we used g_audio.
      
          renesas_usbhs e6590000.usb: irq_ready run_error 1 : -22
      
      To fix the issue, disable the tx or rx interrupt in usb_pkt_pop().
      
      Fixes: 2743e7f9 ("usb: renesas_usbhs: fix the usb_pkt_pop()")
      Cc: <stable@vger.kernel.org> # v4.4+
      Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Link: https://lore.kernel.org/r/20210624122039.596528-1-yoshihiro.shimoda.uh@renesas.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5719df24
    • M
      usb: dwc2: gadget: Fix GOUTNAK flow for Slave mode. · fecb3a17
      Minas Harutyunyan 提交于
      Because of dwc2_hsotg_ep_stop_xfr() function uses poll
      mode, first need to mask GINTSTS_GOUTNAKEFF interrupt.
      In Slave mode GINTSTS_GOUTNAKEFF interrupt will be
      aserted only after pop OUT NAK status packet from RxFIFO.
      
      In dwc2_hsotg_ep_sethalt() function before setting
      DCTL_SGOUTNAK need to unmask GOUTNAKEFF interrupt.
      
      Tested by USBCV CH9 and MSC tests set in Slave, BDMA and DDMA.
      All tests are passed.
      
      Fixes: a4f82771 ("usb: dwc2: gadget: Disable enabled HW endpoint in dwc2_hsotg_ep_disable")
      Fixes: 6070636c ("usb: dwc2: Fix Stalling a Non-Isochronous OUT EP")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
      Link: https://lore.kernel.org/r/e17fad802bbcaf879e1ed6745030993abb93baf8.1626152924.git.Minas.Harutyunyan@synopsys.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fecb3a17
    • A
      usb: phy: Fix page fault from usb_phy_uevent · 3d11de2d
      Artur Petrosyan 提交于
      When the dwc2 platform device is removed, it unregisters the generic
      phy. usb_remove_phy() is called and the dwc2 usb_phy is removed from the
      "phy_list", but the uevent may still attempt to get the usb_phy from the
      list, resulting in a page fault bug. Currently we can't access the usb_phy
      from the "phy_list" after the device is removed. As a fix check to make
      sure that we can get the usb_phy before moving forward with the uevent.
      
      [   84.949345] BUG: unable to handle page fault for address:00000007935688d8
      [   84.949349] #PF: supervisor read access in kernel mode
      [   84.949351] #PF: error_code(0x0000) - not-present page
      [   84.949353] PGD 0 P4D 0
      [   84.949356] Oops: 0000 [#1] SMP PTI
      [   84.949360] CPU: 2 PID: 2081 Comm: rmmod Not tainted 5.13.0-rc4-snps-16547-ga8534cb0-dirty #32
      [   84.949363] Hardware name: Hewlett-Packard HP Z400 Workstation/0B4Ch, BIOS 786G3 v03.54 11/02/2011
      [   84.949365] RIP: 0010:usb_phy_uevent+0x99/0x121
      [   84.949372] Code: 8d 83 f8 00 00 00 48 3d b0 12 22 94 74 05 4c 3b 23
      75 5b 8b 83 9c 00 00 00 be 32 00 00 00 48 8d 7c 24 04 48 c7 c2 d4 5d 7b
      93 <48> 8b 0c c5 e0 88 56 93 e8 0f 63 8a ff 8b 83 98 00 00 00 be 32 00
      [   84.949375] RSP: 0018:ffffa46bc0f2fc70 EFLAGS: 00010246
      [   84.949378] RAX: 00000000ffffffff RBX: ffffffff942211b8 RCX: 0000000000000027
      [   84.949380] RDX: ffffffff937b5dd4 RSI: 0000000000000032 RDI: ffffa46bc0f2fc74
      [   84.949383] RBP: ffff94a306613000 R08: 0000000000000000 R09: 00000000fffeffff
      [   84.949385] R10: ffffa46bc0f2faa8 R11: ffffa46bc0f2faa0 R12: ffff94a30186d410
      [   84.949387] R13: ffff94a32d188a80 R14: ffff94a30029f960 R15: ffffffff93522dd0
      [   84.949389] FS:  00007efdbd417540(0000) GS:ffff94a513a80000(0000) knlGS:0000000000000000
      [   84.949392] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   84.949394] CR2: 00000007935688d8 CR3: 0000000165606000 CR4: 00000000000006e0
      [   84.949396] Call Trace:
      [   84.949401]  dev_uevent+0x190/0x1ad
      [   84.949408]  kobject_uevent_env+0x18e/0x46c
      [   84.949414]  device_release_driver_internal+0x17f/0x18e
      [   84.949418]  bus_remove_device+0xd3/0xe5
      [   84.949421]  device_del+0x1c3/0x31d
      [   84.949425]  ? kobject_put+0x97/0xa8
      [   84.949428]  platform_device_del+0x1c/0x63
      [   84.949432]  platform_device_unregister+0xa/0x11
      [   84.949436]  dwc2_pci_remove+0x1e/0x2c [dwc2_pci]
      [   84.949440]  pci_device_remove+0x31/0x81
      [   84.949445]  device_release_driver_internal+0xea/0x18e
      [   84.949448]  driver_detach+0x68/0x72
      [   84.949450]  bus_remove_driver+0x63/0x82
      [   84.949453]  pci_unregister_driver+0x1a/0x75
      [   84.949457]  __do_sys_delete_module+0x149/0x1e9
      [   84.949462]  ? task_work_run+0x64/0x6e
      [   84.949465]  ? exit_to_user_mode_prepare+0xd4/0x10d
      [   84.949471]  do_syscall_64+0x5d/0x70
      [   84.949475]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [   84.949480] RIP: 0033:0x7efdbd563bcb
      [   84.949482] Code: 73 01 c3 48 8b 0d c5 82 0c 00 f7 d8 64 89 01 48 83
      c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f
      05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 95 82 0c 00 f7 d8 64 89 01 48
      [   84.949485] RSP: 002b:00007ffe944d7d98 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      [   84.949489] RAX: ffffffffffffffda RBX: 00005651072eb700 RCX: 00007efdbd563bcb
      [   84.949491] RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005651072eb768
      [   84.949493] RBP: 00007ffe944d7df8 R08: 0000000000000000 R09: 0000000000000000
      [   84.949495] R10: 00007efdbd5dfac0 R11: 0000000000000206 R12: 00007ffe944d7fd0
      [   84.949497] R13: 00007ffe944d8610 R14: 00005651072eb2a0 R15: 00005651072eb700
      [   84.949500] Modules linked in: uas configfs dwc2_pci(-) phy_generic fuse crc32c_intel [last unloaded: udc_core]
      [   84.949508] CR2: 00000007935688d8
      [   84.949510] ---[ end trace e40c871ca3e4dc9e ]---
      [   84.949512] RIP: 0010:usb_phy_uevent+0x99/0x121
      
      Fixes: a8534cb0 ("usb: phy: introduce usb_phy device type with its own uevent handler")
      Reviewed-by: NPeter Chen <peter.chen@kernel.org>
      Signed-off-by: NArtur Petrosyan <Arthur.Petrosyan@synopsys.com>
      Signed-off-by: NThinh Nguyen <Thinh.Nguyen@synopsys.com>
      Link: https://lore.kernel.org/r/20210710092247.D7AFEA005D@mailhost.synopsys.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3d11de2d
    • G
      usb: xhci: avoid renesas_usb_fw.mem when it's unusable · 0665e387
      Greg Thelen 提交于
      Commit a66d21d7 ("usb: xhci: Add support for Renesas controller with
      memory") added renesas_usb_fw.mem firmware reference to xhci-pci.  Thus
      modinfo indicates xhci-pci.ko has "firmware: renesas_usb_fw.mem".  But
      the firmware is only actually used with CONFIG_USB_XHCI_PCI_RENESAS.  An
      unusable firmware reference can trigger safety checkers which look for
      drivers with unmet firmware dependencies.
      
      Avoid referring to renesas_usb_fw.mem in circumstances when it cannot be
      loaded (when CONFIG_USB_XHCI_PCI_RENESAS isn't set).
      
      Fixes: a66d21d7 ("usb: xhci: Add support for Renesas controller with memory")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Thelen <gthelen@google.com>
      Link: https://lore.kernel.org/r/20210702071224.3673568-1-gthelen@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0665e387
    • C
      usb: gadget: u_serial: remove WARN_ON on null port · 4bb233b7
      Colin Ian King 提交于
      Loading and then unloading module g_dpgp on a VM that does not
      support the driver currently throws a WARN_ON message because
      the port has not been initialized. Removing an unused driver
      is a valid use-case and the WARN_ON kernel warning is a bit
      excessive, so remove it.
      
      Cleans up:
      
      [27654.638698] ------------[ cut here ]------------
      [27654.638705] WARNING: CPU: 6 PID: 2956336 at drivers/usb/gadget/function/u_serial.c:1201 gserial_free_line+0x7c/0x90 [u_serial]
      [27654.638728] Modules linked in: g_dbgp(-) u_serial usb_f_tcm target_core_mod libcomposite udc_core vmw_vmci mcb i2c_nforce2 i2c_amd756 nfit cx8800 videobuf2_dma_sg videobuf2_memops videobuf2_v4l2 cx88xx tveeprom videobuf2_common videodev mc ccp hid_generic hid intel_ishtp cros_ec mc13xxx_core vfio_mdev mdev i915 i2c_algo_bit kvm ppdev parport zatm eni suni uPD98402 atm rio_scan binder_linux hwmon_vid video ipmi_devintf ipmi_msghandler zstd nls_utf8 decnet qrtr ns sctp ip6_udp_tunnel udp_tunnel fcrypt pcbc nhc_udp nhc_ipv6 nhc_routing nhc_mobility nhc_hop nhc_dest nhc_fragment 6lowpan ts_kmp dccp_ipv6 dccp_ipv4 dccp snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq_dummy snd_seq snd_seq_device xen_front_pgdir_shbuf binfmt_misc nls_iso8859_1 dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua intel_rapl_msr intel_rapl_common snd_hda_codec_generic ledtrig_audio snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd rapl soundcore joydev input_leds mac_hid serio_raw efi_pstore
      [27654.638880]  qemu_fw_cfg sch_fq_codel msr virtio_rng autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear qxl drm_ttm_helper crct10dif_pclmul ttm drm_kms_helper syscopyarea sysfillrect sysimgblt virtio_net fb_sys_fops cec net_failover rc_core ahci psmouse drm libahci lpc_ich virtio_blk failover [last unloaded: u_ether]
      [27654.638949] CPU: 6 PID: 2956336 Comm: modprobe Tainted: P           O      5.13.0-9-generic #9
      [27654.638956] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
      [27654.638969] RIP: 0010:gserial_free_line+0x7c/0x90 [u_serial]
      [27654.638981] Code: 20 00 00 00 00 e8 74 1a ba c9 4c 89 e7 e8 8c fe ff ff 48 8b 3d 75 3b 00 00 44 89 f6 e8 3d 7c 69 c9 5b 41 5c 41 5d 41 5e 5d c3 <0f> 0b 4c 89 ef e8 4a 1a ba c9 5b 41 5c 41 5d 41 5e 5d c3 90 0f 1f
      [27654.638986] RSP: 0018:ffffba0b81403da0 EFLAGS: 00010246
      [27654.638992] RAX: 0000000000000000 RBX: ffffffffc0eaf6a0 RCX: 0000000000000000
      [27654.638996] RDX: ffff8e21c0cac8c0 RSI: 0000000000000006 RDI: ffffffffc0eaf6a0
      [27654.639000] RBP: ffffba0b81403dc0 R08: ffffba0b81403de0 R09: fefefefefefefeff
      [27654.639003] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
      [27654.639006] R13: ffffffffc0eaf6a0 R14: 0000000000000000 R15: 0000000000000000
      [27654.639010] FS:  00007faa1935e740(0000) GS:ffff8e223bd80000(0000) knlGS:0000000000000000
      [27654.639015] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [27654.639019] CR2: 00007ffc840cd4e8 CR3: 000000000e1ac006 CR4: 0000000000370ee0
      [27654.639028] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [27654.639031] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [27654.639035] Call Trace:
      [27654.639044]  dbgp_exit+0x1c/0xa1a [g_dbgp]
      [27654.639054]  __do_sys_delete_module.constprop.0+0x144/0x260
      [27654.639066]  ? call_rcu+0xe/0x10
      [27654.639073]  __x64_sys_delete_module+0x12/0x20
      [27654.639081]  do_syscall_64+0x61/0xb0
      [27654.639092]  ? exit_to_user_mode_loop+0xec/0x160
      [27654.639098]  ? exit_to_user_mode_prepare+0x37/0xb0
      [27654.639104]  ? syscall_exit_to_user_mode+0x27/0x50
      [27654.639110]  ? __x64_sys_close+0x12/0x40
      [27654.639119]  ? do_syscall_64+0x6e/0xb0
      [27654.639126]  ? exit_to_user_mode_prepare+0x37/0xb0
      [27654.639132]  ? syscall_exit_to_user_mode+0x27/0x50
      [27654.639137]  ? __x64_sys_newfstatat+0x1e/0x20
      [27654.639146]  ? do_syscall_64+0x6e/0xb0
      [27654.639154]  ? exc_page_fault+0x8f/0x170
      [27654.639159]  ? asm_exc_page_fault+0x8/0x30
      [27654.639166]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [27654.639173] RIP: 0033:0x7faa194a4b2b
      [27654.639179] Code: 73 01 c3 48 8b 0d 3d 73 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 0d 73 0c 00 f7 d8 64 89 01 48
      [27654.639185] RSP: 002b:00007ffc840d0578 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      [27654.639191] RAX: ffffffffffffffda RBX: 000056060f9f4e70 RCX: 00007faa194a4b2b
      [27654.639194] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000056060f9f4ed8
      [27654.639197] RBP: 000056060f9f4e70 R08: 0000000000000000 R09: 0000000000000000
      [27654.639200] R10: 00007faa1951eac0 R11: 0000000000000206 R12: 000056060f9f4ed8
      [27654.639203] R13: 0000000000000000 R14: 000056060f9f4ed8 R15: 00007ffc840d06c8
      [27654.639219] ---[ end trace 8dd0ea0bb32ce94a ]---
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Link: https://lore.kernel.org/r/20210701144305.110078-1-colin.king@canonical.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4bb233b7
    • L
      usb: dwc3: avoid NULL access of usb_gadget_driver · 40edb522
      Linyu Yuan 提交于
      we found crash in dwc3_disconnect_gadget(),
      it is because dwc->gadget_driver become NULL before async access.
      7dc0c55e ('USB: UDC core: Add udc_async_callbacks gadget op')
      suggest a common way to avoid such kind of issue.
      
      this change implment the callback in dwc3 and
      change related functions which have callback to usb gadget driver.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NLinyu Yuan <linyyuan@codeaurora.org>
      Link: https://lore.kernel.org/r/20210629015118.7944-1-linyyuan@codeaurora.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      40edb522
    • M
      usb: max-3421: Prevent corruption of freed memory · b5fdf5c6
      Mark Tomlinson 提交于
      The MAX-3421 USB driver remembers the state of the USB toggles for a
      device/endpoint. To save SPI writes, this was only done when a new
      device/endpoint was being used. Unfortunately, if the old device was
      removed, this would cause writes to freed memory.
      
      To fix this, a simpler scheme is used. The toggles are read from
      hardware when a URB is completed, and the toggles are always written to
      hardware when any URB transaction is started. This will cause a few more
      SPI transactions, but no causes kernel panics.
      
      Fixes: 2d53139f ("Add support for using a MAX3421E chip as a host driver.")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
      Link: https://lore.kernel.org/r/20210625031456.8632-1-mark.tomlinson@alliedtelesis.co.nzSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5fdf5c6
    • Z
      usb: gadget: Fix Unbalanced pm_runtime_enable in tegra_xudc_probe · 5b012481
      Zhang Qilong 提交于
      Add missing pm_runtime_disable() when probe error out. It could
      avoid pm_runtime implementation complains when removing and probing
      again the driver.
      
      Fixes: 49db4272 ("usb: gadget: Add UDC driver for tegra XUSB device mode controller")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NZhang Qilong <zhangqilong3@huawei.com>
      Link: https://lore.kernel.org/r/20210618141441.107817-1-zhangqilong3@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5b012481
    • A
      usb: typec: stusb160x: Don't block probing of consumer of "connector" nodes · 6b633767
      Amelie Delaunay 提交于
      Similar as with tcpm this patch lets fw_devlink know not to wait on the
      fwnode to be populated as a struct device.
      
      Without this patch, USB functionality can be broken on some previously
      supported boards.
      
      Fixes: 28ec344b ("usb: typec: tcpm: Don't block probing of consumers of "connector" nodes")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NAmelie Delaunay <amelie.delaunay@foss.st.com>
      Link: https://lore.kernel.org/r/20210716120718.20398-3-amelie.delaunay@foss.st.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6b633767