<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/usb, branch v5.14</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>usb: gadget: u_audio: fix race condition on endpoint stop</title>
<updated>2021-08-27T14:07:23+00:00</updated>
<author>
<name>Jerome Brunet</name>
<email>jbrunet@baylibre.com</email>
</author>
<published>2021-08-27T09:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=068fdad20454f815e61e6f6eb9f051a8b3120e88'/>
<id>068fdad20454f815e61e6f6eb9f051a8b3120e88</id>
<content type='text'>
If the endpoint completion callback is call right after the ep_enabled flag
is cleared and before usb_ep_dequeue() is call, we could do a double free
on the request and the associated buffer.

Fix this by clearing ep_enabled after all the endpoint requests have been
dequeued.

Fixes: 7de8681be2cd ("usb: gadget: u_audio: Free requests only after callback")
Cc: stable &lt;stable@vger.kernel.org&gt;
Reported-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Link: https://lore.kernel.org/r/20210827092927.366482-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the endpoint completion callback is call right after the ep_enabled flag
is cleared and before usb_ep_dequeue() is call, we could do a double free
on the request and the associated buffer.

Fix this by clearing ep_enabled after all the endpoint requests have been
dequeued.

Fixes: 7de8681be2cd ("usb: gadget: u_audio: Free requests only after callback")
Cc: stable &lt;stable@vger.kernel.org&gt;
Reported-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Link: https://lore.kernel.org/r/20210827092927.366482-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: f_uac2: fixup feedback endpoint stop</title>
<updated>2021-08-27T14:06:53+00:00</updated>
<author>
<name>Jerome Brunet</name>
<email>jbrunet@baylibre.com</email>
</author>
<published>2021-08-27T07:58:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=75432ba583a8a374b8d1ad2d3ba559a78f7454fc'/>
<id>75432ba583a8a374b8d1ad2d3ba559a78f7454fc</id>
<content type='text'>
When the uac2 function is stopped, there seems to be an issue reported on
some platforms (Intel Merrifield at least)

BUG: kernel NULL pointer dereference, address: 0000000000000008
...
RIP: 0010:dwc3_gadget_del_and_unmap_request+0x19/0xe0
...
Call Trace:
 dwc3_remove_requests.constprop.0+0x12f/0x170
 __dwc3_gadget_ep_disable+0x7a/0x160
 dwc3_gadget_ep_disable+0x3d/0xd0
 usb_ep_disable+0x1c/0x70
 u_audio_stop_capture+0x79/0x120 [u_audio]
 afunc_set_alt+0x73/0x80 [usb_f_uac2]
 composite_setup+0x224/0x1b90 [libcomposite]

The issue happens only when the gadget is using the sync type "async", not
"adaptive". This indicates that problem is coming from the feedback
endpoint, which is only used with async synchronization mode.

The problem is that request is freed regardless of usb_ep_dequeue(), which
ends up badly if the request is not actually dequeued yet.

Update the feedback endpoint free function to release the endpoint the same
way it is done for the data endpoint, which takes care of the problem.

Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")
Reported-by: Ferry Toth &lt;ftoth@exalondelft.nl&gt;
Tested-by: Ferry Toth &lt;ftoth@exalondelft.nl&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Link: https://lore.kernel.org/r/20210827075853.266912-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the uac2 function is stopped, there seems to be an issue reported on
some platforms (Intel Merrifield at least)

BUG: kernel NULL pointer dereference, address: 0000000000000008
...
RIP: 0010:dwc3_gadget_del_and_unmap_request+0x19/0xe0
...
Call Trace:
 dwc3_remove_requests.constprop.0+0x12f/0x170
 __dwc3_gadget_ep_disable+0x7a/0x160
 dwc3_gadget_ep_disable+0x3d/0xd0
 usb_ep_disable+0x1c/0x70
 u_audio_stop_capture+0x79/0x120 [u_audio]
 afunc_set_alt+0x73/0x80 [usb_f_uac2]
 composite_setup+0x224/0x1b90 [libcomposite]

The issue happens only when the gadget is using the sync type "async", not
"adaptive". This indicates that problem is coming from the feedback
endpoint, which is only used with async synchronization mode.

The problem is that request is freed regardless of usb_ep_dequeue(), which
ends up badly if the request is not actually dequeued yet.

Update the feedback endpoint free function to release the endpoint the same
way it is done for the data endpoint, which takes care of the problem.

Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")
Reported-by: Ferry Toth &lt;ftoth@exalondelft.nl&gt;
Tested-by: Ferry Toth &lt;ftoth@exalondelft.nl&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Link: https://lore.kernel.org/r/20210827075853.266912-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: typec: tcpm: Raise vdm_sm_running flag only when VDM SM is running</title>
<updated>2021-08-26T12:59:04+00:00</updated>
<author>
<name>Kyle Tso</name>
<email>kyletso@google.com</email>
</author>
<published>2021-08-26T12:42:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ef52b4a9fcc24e17e81cc60357e6107ae4e9c48e'/>
<id>ef52b4a9fcc24e17e81cc60357e6107ae4e9c48e</id>
<content type='text'>
If the port is going to send Discover_Identity Message, vdm_sm_running
flag was intentionally set before entering Ready States in order to
avoid the conflict because the port and the port partner might start
AMS at almost the same time after entering Ready States.

However, the original design has a problem. When the port is doing
DR_SWAP from Device to Host, it raises the flag. Later in the
tcpm_send_discover_work, the flag blocks the procedure of sending the
Discover_Identity and it might never be cleared until disconnection.

Since there exists another flag send_discover representing that the port
is going to send Discover_Identity or not, it is enough to use that flag
to prevent the conflict. Also change the timing of the set/clear of
vdm_sm_running to indicate whether the VDM SM is actually running or
not.

Fixes: c34e85fa69b9 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work")
Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Badhri Jagan Sridharan &lt;badhri@google.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Kyle Tso &lt;kyletso@google.com&gt;
Link: https://lore.kernel.org/r/20210826124201.1562502-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the port is going to send Discover_Identity Message, vdm_sm_running
flag was intentionally set before entering Ready States in order to
avoid the conflict because the port and the port partner might start
AMS at almost the same time after entering Ready States.

However, the original design has a problem. When the port is doing
DR_SWAP from Device to Host, it raises the flag. Later in the
tcpm_send_discover_work, the flag blocks the procedure of sending the
Discover_Identity and it might never be cleared until disconnection.

Since there exists another flag send_discover representing that the port
is going to send Discover_Identity or not, it is enough to use that flag
to prevent the conflict. Also change the timing of the set/clear of
vdm_sm_running to indicate whether the VDM SM is actually running or
not.

Fixes: c34e85fa69b9 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work")
Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Badhri Jagan Sridharan &lt;badhri@google.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Kyle Tso &lt;kyletso@google.com&gt;
Link: https://lore.kernel.org/r/20210826124201.1562502-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: renesas-xhci: Prefer firmware loading on unknown ROM state</title>
<updated>2021-08-26T12:56:59+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2021-08-26T12:41:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c82cacd2f1e622a461a77d275a75d7e19e7635a3'/>
<id>c82cacd2f1e622a461a77d275a75d7e19e7635a3</id>
<content type='text'>
The recent attempt to handle an unknown ROM state in the commit
d143825baf15 ("usb: renesas-xhci: Fix handling of unknown ROM state")
resulted in a regression and reverted later by the commit 44cf53602f5a
("Revert "usb: renesas-xhci: Fix handling of unknown ROM state"").
The problem of the former fix was that it treated the failure of
firmware loading as a fatal error.  Since the firmware files aren't
included in the standard linux-firmware tree, most users don't have
them, hence they got the non-working system after that.  The revert
fixed the regression, but also it didn't make the firmware loading
triggered even on the devices that do need it.  So we need still a fix
for them.

This is another attempt to handle the unknown ROM state.  Like the
previous fix, this also tries to load the firmware when ROM shows
unknown state.  In this patch, however, the failure of a firmware
loading (such as a missing firmware file) isn't handled as a fatal
error any longer when ROM has been already detected, but it falls back
to the ROM mode like before.  The error is returned only when no ROM
is detected and the firmware loading failed.

Along with it, for simplifying the code flow, the detection and the
check of ROM is factored out from renesas_fw_check_running() and done
in the caller side, renesas_xhci_check_request_fw().  It avoids the
redundant ROM checks.

The patch was tested on Lenovo Thinkpad T14 gen (BIOS 1.34).  Also it
was confirmed that no regression is seen on another Thinkpad T14
machine that has worked without the patch, too.

Fixes: 44cf53602f5a ("Revert "usb: renesas-xhci: Fix handling of unknown ROM state"")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1189207
Link: https://lore.kernel.org/r/20210826124127.14789-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The recent attempt to handle an unknown ROM state in the commit
d143825baf15 ("usb: renesas-xhci: Fix handling of unknown ROM state")
resulted in a regression and reverted later by the commit 44cf53602f5a
("Revert "usb: renesas-xhci: Fix handling of unknown ROM state"").
The problem of the former fix was that it treated the failure of
firmware loading as a fatal error.  Since the firmware files aren't
included in the standard linux-firmware tree, most users don't have
them, hence they got the non-working system after that.  The revert
fixed the regression, but also it didn't make the firmware loading
triggered even on the devices that do need it.  So we need still a fix
for them.

This is another attempt to handle the unknown ROM state.  Like the
previous fix, this also tries to load the firmware when ROM shows
unknown state.  In this patch, however, the failure of a firmware
loading (such as a missing firmware file) isn't handled as a fatal
error any longer when ROM has been already detected, but it falls back
to the ROM mode like before.  The error is returned only when no ROM
is detected and the firmware loading failed.

Along with it, for simplifying the code flow, the detection and the
check of ROM is factored out from renesas_fw_check_running() and done
in the caller side, renesas_xhci_check_request_fw().  It avoids the
redundant ROM checks.

The patch was tested on Lenovo Thinkpad T14 gen (BIOS 1.34).  Also it
was confirmed that no regression is seen on another Thinkpad T14
machine that has worked without the patch, too.

Fixes: 44cf53602f5a ("Revert "usb: renesas-xhci: Fix handling of unknown ROM state"")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1189207
Link: https://lore.kernel.org/r/20210826124127.14789-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Stop EP0 transfers during pullup disable</title>
<updated>2021-08-26T11:48:58+00:00</updated>
<author>
<name>Wesley Cheng</name>
<email>wcheng@codeaurora.org</email>
</author>
<published>2021-08-25T04:28:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4a1e25c0a029b97ea4a3d423a6392bfacc3b2e39'/>
<id>4a1e25c0a029b97ea4a3d423a6392bfacc3b2e39</id>
<content type='text'>
During a USB cable disconnect, or soft disconnect scenario, a pending
SETUP transaction may not be completed, leading to the following
error:

    dwc3 a600000.dwc3: timed out waiting for SETUP phase

If this occurs, then the entire pullup disable routine is skipped and
proper cleanup and halting of the controller does not complete.

Instead of returning an error (which is ignored from the UDC
perspective), allow the pullup disable routine to continue, which
will also handle disabling of EP0/1.  This will end any active
transfers as well.  Ensure to clear any delayed_status also, as the
timeout could happen within the STATUS stage.

Fixes: bb0147364850 ("usb: dwc3: gadget: don't clear RUN/STOP when it's invalid to do so")
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Wesley Cheng &lt;wcheng@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210825042855.7977-1-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During a USB cable disconnect, or soft disconnect scenario, a pending
SETUP transaction may not be completed, leading to the following
error:

    dwc3 a600000.dwc3: timed out waiting for SETUP phase

If this occurs, then the entire pullup disable routine is skipped and
proper cleanup and halting of the controller does not complete.

Instead of returning an error (which is ignored from the UDC
perspective), allow the pullup disable routine to continue, which
will also handle disabling of EP0/1.  This will end any active
transfers as well.  Ensure to clear any delayed_status also, as the
timeout could happen within the STATUS stage.

Fixes: bb0147364850 ("usb: dwc3: gadget: don't clear RUN/STOP when it's invalid to do so")
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Wesley Cheng &lt;wcheng@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210825042855.7977-1-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Fix dwc3_calc_trbs_left()</title>
<updated>2021-08-26T11:47:03+00:00</updated>
<author>
<name>Thinh Nguyen</name>
<email>Thinh.Nguyen@synopsys.com</email>
</author>
<published>2021-08-19T01:17:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=51f1954ad853d01ba4dc2b35dee14d8490ee05a1'/>
<id>51f1954ad853d01ba4dc2b35dee14d8490ee05a1</id>
<content type='text'>
We can't depend on the TRB's HWO bit to determine if the TRB ring is
"full". A TRB is only available when the driver had processed it, not
when the controller consumed and relinquished the TRB's ownership to the
driver. Otherwise, the driver may overwrite unprocessed TRBs. This can
happen when many transfer events accumulate and the system is slow to
process them and/or when there are too many small requests.

If a request is in the started_list, that means there is one or more
unprocessed TRBs remained. Check this instead of the TRB's HWO bit
whether the TRB ring is full.

Fixes: c4233573f6ee ("usb: dwc3: gadget: prepare TRBs on update transfers too")
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/e91e975affb0d0d02770686afc3a5b9eb84409f6.1629335416.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can't depend on the TRB's HWO bit to determine if the TRB ring is
"full". A TRB is only available when the driver had processed it, not
when the controller consumed and relinquished the TRB's ownership to the
driver. Otherwise, the driver may overwrite unprocessed TRBs. This can
happen when many transfer events accumulate and the system is slow to
process them and/or when there are too many small requests.

If a request is in the started_list, that means there is one or more
unprocessed TRBs remained. Check this instead of the TRB's HWO bit
whether the TRB ring is full.

Fixes: c4233573f6ee ("usb: dwc3: gadget: prepare TRBs on update transfers too")
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Felipe Balbi &lt;balbi@kernel.org&gt;
Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/e91e975affb0d0d02770686afc3a5b9eb84409f6.1629335416.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "USB: serial: ch341: fix character loss at high transfer rates"</title>
<updated>2021-08-25T07:13:33+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2021-08-24T12:19:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=df7b16d1c00ecb3da3a30c999cdb39f273c99a2f'/>
<id>df7b16d1c00ecb3da3a30c999cdb39f273c99a2f</id>
<content type='text'>
This reverts commit 3c18e9baee0ef97510dcda78c82285f52626764b.

These devices do not appear to send a zero-length packet when the
transfer size is a multiple of the bulk-endpoint max-packet size. This
means that incoming data may not be processed by the driver until a
short packet is received or the receive buffer is full.

Revert back to using endpoint-sized receive buffers to avoid stalled
reads.

Reported-by: Paul Größel &lt;pb.g@gmx.de&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214131
Fixes: 3c18e9baee0e ("USB: serial: ch341: fix character loss at high transfer rates")
Cc: stable@vger.kernel.org
Cc: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20210824121926.19311-1-johan@kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 3c18e9baee0ef97510dcda78c82285f52626764b.

These devices do not appear to send a zero-length packet when the
transfer size is a multiple of the bulk-endpoint max-packet size. This
means that incoming data may not be processed by the driver until a
short packet is received or the receive buffer is full.

Revert back to using endpoint-sized receive buffers to avoid stalled
reads.

Reported-by: Paul Größel &lt;pb.g@gmx.de&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214131
Fixes: 3c18e9baee0e ("USB: serial: ch341: fix character loss at high transfer rates")
Cc: stable@vger.kernel.org
Cc: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20210824121926.19311-1-johan@kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: serial: option: add new VID/PID to support Fibocom FG150</title>
<updated>2021-08-24T13:46:09+00:00</updated>
<author>
<name>Zhengjun Zhang</name>
<email>zhangzhengjun@aicrobo.com</email>
</author>
<published>2021-08-09T13:35:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2829a4e3cf3a6ac2fa3cdb681b37574630fb9c1a'/>
<id>2829a4e3cf3a6ac2fa3cdb681b37574630fb9c1a</id>
<content type='text'>
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:

&gt; T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
&gt; D:  Ver= 3.20 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
&gt; P:  Vendor=2cb7 ProdID=010b Rev=04.14
&gt; S:  Manufacturer=Fibocom
&gt; S:  Product=Fibocom Modem_SN:XXXXXXXX
&gt; S:  SerialNumber=XXXXXXXX
&gt; C:  #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
&gt; I:  If#=0x0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
&gt; I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
&gt; I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
&gt; I:  If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none)
&gt; I:  If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)

&gt; Bus 002 Device 002: ID 2cb7:010b Fibocom Fibocom Modem_SN:XXXXXXXX
&gt; Device Descriptor:
&gt;   bLength                18
&gt;   bDescriptorType         1
&gt;   bcdUSB               3.20
&gt;   bDeviceClass            0
&gt;   bDeviceSubClass         0
&gt;   bDeviceProtocol         0
&gt;   bMaxPacketSize0         9
&gt;   idVendor           0x2cb7 Fibocom
&gt;   idProduct          0x010b
&gt;   bcdDevice            4.14
&gt;   iManufacturer           1 Fibocom
&gt;   iProduct                2 Fibocom Modem_SN:XXXXXXXX
&gt;   iSerial                 3 XXXXXXXX
&gt;   bNumConfigurations      1
&gt;   Configuration Descriptor:
&gt;     bLength                 9
&gt;     bDescriptorType         2
&gt;     wTotalLength       0x00e6
&gt;     bNumInterfaces          5
&gt;     bConfigurationValue     1
&gt;     iConfiguration          4 RNDIS_DUN_DIAG_ADB
&gt;     bmAttributes         0xa0
&gt;       (Bus Powered)
&gt;       Remote Wakeup
&gt;     MaxPower              896mA
&gt;     Interface Association:
&gt;       bLength                 8
&gt;       bDescriptorType        11
&gt;       bFirstInterface         0
&gt;       bInterfaceCount         2
&gt;       bFunctionClass        239 Miscellaneous Device
&gt;       bFunctionSubClass       4
&gt;       bFunctionProtocol       1
&gt;       iFunction               7 RNDIS
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        0
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           1
&gt;       bInterfaceClass       239 Miscellaneous Device
&gt;       bInterfaceSubClass      4
&gt;       bInterfaceProtocol      1
&gt;       iInterface              0
&gt;       ** UNRECOGNIZED:  05 24 00 10 01
&gt;       ** UNRECOGNIZED:  05 24 01 00 01
&gt;       ** UNRECOGNIZED:  04 24 02 00
&gt;       ** UNRECOGNIZED:  05 24 06 00 01
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x81  EP 1 IN
&gt;         bmAttributes            3
&gt;           Transfer Type            Interrupt
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0008  1x 8 bytes
&gt;         bInterval               9
&gt;         bMaxBurst               0
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        1
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           2
&gt;       bInterfaceClass        10 CDC Data
&gt;       bInterfaceSubClass      0
&gt;       bInterfaceProtocol      0
&gt;       iInterface              0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x8e  EP 14 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               6
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x0f  EP 15 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               6
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        2
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           3
&gt;       bInterfaceClass       255 Vendor Specific Class
&gt;       bInterfaceSubClass      0
&gt;       bInterfaceProtocol      0
&gt;       iInterface              0
&gt;       ** UNRECOGNIZED:  05 24 00 10 01
&gt;       ** UNRECOGNIZED:  05 24 01 00 00
&gt;       ** UNRECOGNIZED:  04 24 02 02
&gt;       ** UNRECOGNIZED:  05 24 06 00 00
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x83  EP 3 IN
&gt;         bmAttributes            3
&gt;           Transfer Type            Interrupt
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x000a  1x 10 bytes
&gt;         bInterval               9
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x82  EP 2 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x01  EP 1 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        3
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           2
&gt;       bInterfaceClass       255 Vendor Specific Class
&gt;       bInterfaceSubClass    255 Vendor Specific Subclass
&gt;       bInterfaceProtocol     48
&gt;       iInterface              0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x84  EP 4 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x02  EP 2 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        4
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           2
&gt;       bInterfaceClass       255 Vendor Specific Class
&gt;       bInterfaceSubClass     66
&gt;       bInterfaceProtocol      1
&gt;       iInterface              0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x03  EP 3 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x85  EP 5 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt; Binary Object Store Descriptor:
&gt;   bLength                 5
&gt;   bDescriptorType        15
&gt;   wTotalLength       0x0016
&gt;   bNumDeviceCaps          2
&gt;   USB 2.0 Extension Device Capability:
&gt;     bLength                 7
&gt;     bDescriptorType        16
&gt;     bDevCapabilityType      2
&gt;     bmAttributes   0x00000006
&gt;       BESL Link Power Management (LPM) Supported
&gt;   SuperSpeed USB Device Capability:
&gt;     bLength                10
&gt;     bDescriptorType        16
&gt;     bDevCapabilityType      3
&gt;     bmAttributes         0x00
&gt;     wSpeedsSupported   0x000f
&gt;       Device can operate at Low Speed (1Mbps)
&gt;       Device can operate at Full Speed (12Mbps)
&gt;       Device can operate at High Speed (480Mbps)
&gt;       Device can operate at SuperSpeed (5Gbps)
&gt;     bFunctionalitySupport   1
&gt;       Lowest fully-functional device speed is Full Speed (12Mbps)
&gt;     bU1DevExitLat           1 micro seconds
&gt;     bU2DevExitLat         500 micro seconds
&gt; Device Status:     0x0000
&gt;   (Bus Powered)

Signed-off-by: Zhengjun Zhang &lt;zhangzhengjun@aicrobo.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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:

&gt; T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=5000 MxCh= 0
&gt; D:  Ver= 3.20 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
&gt; P:  Vendor=2cb7 ProdID=010b Rev=04.14
&gt; S:  Manufacturer=Fibocom
&gt; S:  Product=Fibocom Modem_SN:XXXXXXXX
&gt; S:  SerialNumber=XXXXXXXX
&gt; C:  #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
&gt; I:  If#=0x0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
&gt; I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
&gt; I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
&gt; I:  If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none)
&gt; I:  If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)

&gt; Bus 002 Device 002: ID 2cb7:010b Fibocom Fibocom Modem_SN:XXXXXXXX
&gt; Device Descriptor:
&gt;   bLength                18
&gt;   bDescriptorType         1
&gt;   bcdUSB               3.20
&gt;   bDeviceClass            0
&gt;   bDeviceSubClass         0
&gt;   bDeviceProtocol         0
&gt;   bMaxPacketSize0         9
&gt;   idVendor           0x2cb7 Fibocom
&gt;   idProduct          0x010b
&gt;   bcdDevice            4.14
&gt;   iManufacturer           1 Fibocom
&gt;   iProduct                2 Fibocom Modem_SN:XXXXXXXX
&gt;   iSerial                 3 XXXXXXXX
&gt;   bNumConfigurations      1
&gt;   Configuration Descriptor:
&gt;     bLength                 9
&gt;     bDescriptorType         2
&gt;     wTotalLength       0x00e6
&gt;     bNumInterfaces          5
&gt;     bConfigurationValue     1
&gt;     iConfiguration          4 RNDIS_DUN_DIAG_ADB
&gt;     bmAttributes         0xa0
&gt;       (Bus Powered)
&gt;       Remote Wakeup
&gt;     MaxPower              896mA
&gt;     Interface Association:
&gt;       bLength                 8
&gt;       bDescriptorType        11
&gt;       bFirstInterface         0
&gt;       bInterfaceCount         2
&gt;       bFunctionClass        239 Miscellaneous Device
&gt;       bFunctionSubClass       4
&gt;       bFunctionProtocol       1
&gt;       iFunction               7 RNDIS
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        0
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           1
&gt;       bInterfaceClass       239 Miscellaneous Device
&gt;       bInterfaceSubClass      4
&gt;       bInterfaceProtocol      1
&gt;       iInterface              0
&gt;       ** UNRECOGNIZED:  05 24 00 10 01
&gt;       ** UNRECOGNIZED:  05 24 01 00 01
&gt;       ** UNRECOGNIZED:  04 24 02 00
&gt;       ** UNRECOGNIZED:  05 24 06 00 01
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x81  EP 1 IN
&gt;         bmAttributes            3
&gt;           Transfer Type            Interrupt
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0008  1x 8 bytes
&gt;         bInterval               9
&gt;         bMaxBurst               0
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        1
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           2
&gt;       bInterfaceClass        10 CDC Data
&gt;       bInterfaceSubClass      0
&gt;       bInterfaceProtocol      0
&gt;       iInterface              0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x8e  EP 14 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               6
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x0f  EP 15 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               6
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        2
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           3
&gt;       bInterfaceClass       255 Vendor Specific Class
&gt;       bInterfaceSubClass      0
&gt;       bInterfaceProtocol      0
&gt;       iInterface              0
&gt;       ** UNRECOGNIZED:  05 24 00 10 01
&gt;       ** UNRECOGNIZED:  05 24 01 00 00
&gt;       ** UNRECOGNIZED:  04 24 02 02
&gt;       ** UNRECOGNIZED:  05 24 06 00 00
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x83  EP 3 IN
&gt;         bmAttributes            3
&gt;           Transfer Type            Interrupt
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x000a  1x 10 bytes
&gt;         bInterval               9
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x82  EP 2 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x01  EP 1 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        3
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           2
&gt;       bInterfaceClass       255 Vendor Specific Class
&gt;       bInterfaceSubClass    255 Vendor Specific Subclass
&gt;       bInterfaceProtocol     48
&gt;       iInterface              0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x84  EP 4 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x02  EP 2 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;     Interface Descriptor:
&gt;       bLength                 9
&gt;       bDescriptorType         4
&gt;       bInterfaceNumber        4
&gt;       bAlternateSetting       0
&gt;       bNumEndpoints           2
&gt;       bInterfaceClass       255 Vendor Specific Class
&gt;       bInterfaceSubClass     66
&gt;       bInterfaceProtocol      1
&gt;       iInterface              0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x03  EP 3 OUT
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt;       Endpoint Descriptor:
&gt;         bLength                 7
&gt;         bDescriptorType         5
&gt;         bEndpointAddress     0x85  EP 5 IN
&gt;         bmAttributes            2
&gt;           Transfer Type            Bulk
&gt;           Synch Type               None
&gt;           Usage Type               Data
&gt;         wMaxPacketSize     0x0400  1x 1024 bytes
&gt;         bInterval               0
&gt;         bMaxBurst               0
&gt; Binary Object Store Descriptor:
&gt;   bLength                 5
&gt;   bDescriptorType        15
&gt;   wTotalLength       0x0016
&gt;   bNumDeviceCaps          2
&gt;   USB 2.0 Extension Device Capability:
&gt;     bLength                 7
&gt;     bDescriptorType        16
&gt;     bDevCapabilityType      2
&gt;     bmAttributes   0x00000006
&gt;       BESL Link Power Management (LPM) Supported
&gt;   SuperSpeed USB Device Capability:
&gt;     bLength                10
&gt;     bDescriptorType        16
&gt;     bDevCapabilityType      3
&gt;     bmAttributes         0x00
&gt;     wSpeedsSupported   0x000f
&gt;       Device can operate at Low Speed (1Mbps)
&gt;       Device can operate at Full Speed (12Mbps)
&gt;       Device can operate at High Speed (480Mbps)
&gt;       Device can operate at SuperSpeed (5Gbps)
&gt;     bFunctionalitySupport   1
&gt;       Lowest fully-functional device speed is Full Speed (12Mbps)
&gt;     bU1DevExitLat           1 micro seconds
&gt;     bU2DevExitLat         500 micro seconds
&gt; Device Status:     0x0000
&gt;   (Bus Powered)

Signed-off-by: Zhengjun Zhang &lt;zhangzhengjun@aicrobo.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: typec: tcpm: Fix VDMs sometimes not being forwarded to alt-mode drivers</title>
<updated>2021-08-18T13:59:23+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2021-08-16T15:46:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5571ea3117ca22849072adb58074fb5a2fd12c00'/>
<id>5571ea3117ca22849072adb58074fb5a2fd12c00</id>
<content type='text'>
Commit a20dcf53ea98 ("usb: typec: tcpm: Respond Not_Supported if no
snk_vdo"), stops tcpm_pd_data_request() calling tcpm_handle_vdm_request()
when port-&gt;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: a20dcf53ea98 ("usb: typec: tcpm: Respond Not_Supported if no snk_vdo")
Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Kyle Tso &lt;kyletso@google.com&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Acked-by: Kyle Tso &lt;kyletso@google.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20210816154632.381968-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit a20dcf53ea98 ("usb: typec: tcpm: Respond Not_Supported if no
snk_vdo"), stops tcpm_pd_data_request() calling tcpm_handle_vdm_request()
when port-&gt;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: a20dcf53ea98 ("usb: typec: tcpm: Respond Not_Supported if no snk_vdo")
Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Kyle Tso &lt;kyletso@google.com&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Acked-by: Kyle Tso &lt;kyletso@google.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20210816154632.381968-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "usb: dwc3: gadget: Use list_replace_init() before traversing lists"</title>
<updated>2021-08-10T07:12:32+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2021-08-10T07:10:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=664cc971fb259007e49cc8a3ac43b0787d89443f'/>
<id>664cc971fb259007e49cc8a3ac43b0787d89443f</id>
<content type='text'>
This reverts commit d25d85061bd856d6be221626605319154f9b5043 as it is
reported to cause problems on many different types of boards.

Reported-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Reported-by: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Ray Chi &lt;raychi@google.com&gt;
Link: https://lore.kernel.org/r/CANcMJZCEVxVLyFgLwK98hqBEdc0_n4P0x_K6Gih8zNH3ouzbJQ@mail.gmail.com
Fixes: d25d85061bd8 ("usb: dwc3: gadget: Use list_replace_init() before traversing lists")
Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: Wesley Cheng &lt;wcheng@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d25d85061bd856d6be221626605319154f9b5043 as it is
reported to cause problems on many different types of boards.

Reported-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Reported-by: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Ray Chi &lt;raychi@google.com&gt;
Link: https://lore.kernel.org/r/CANcMJZCEVxVLyFgLwK98hqBEdc0_n4P0x_K6Gih8zNH3ouzbJQ@mail.gmail.com
Fixes: d25d85061bd8 ("usb: dwc3: gadget: Use list_replace_init() before traversing lists")
Cc: stable &lt;stable@vger.kernel.org&gt;
Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: Wesley Cheng &lt;wcheng@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
