<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/usb/host, branch v4.4.239</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int</title>
<updated>2020-10-01T09:11:55+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2020-05-15T16:54:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0ad482ca053285c76bdb960c386398c901ca8e36'/>
<id>0ad482ca053285c76bdb960c386398c901ca8e36</id>
<content type='text'>
[ Upstream commit a7f40c233a6b0540d28743267560df9cfb571ca9 ]

The comparison of hcd-&gt;irq to less than zero for an error check will
never be true because hcd-&gt;irq is an unsigned int.  Fix this by
assigning the int retval to the return of platform_get_irq and checking
this for the -ve error condition and assigning hcd-&gt;irq to retval.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: c856b4b0fdb5 ("USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Link: https://lore.kernel.org/r/20200515165453.104028-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit a7f40c233a6b0540d28743267560df9cfb571ca9 ]

The comparison of hcd-&gt;irq to less than zero for an error check will
never be true because hcd-&gt;irq is an unsigned int.  Fix this by
assigning the int retval to the return of platform_get_irq and checking
this for the -ve error condition and assigning hcd-&gt;irq to retval.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: c856b4b0fdb5 ("USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Link: https://lore.kernel.org/r/20200515165453.104028-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()</title>
<updated>2020-10-01T09:11:55+00:00</updated>
<author>
<name>Tang Bin</name>
<email>tangbin@cmss.chinamobile.com</email>
</author>
<published>2020-05-08T11:43:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3244190d24cc0269497483fd8fb6b73b9d09b0d3'/>
<id>3244190d24cc0269497483fd8fb6b73b9d09b0d3</id>
<content type='text'>
[ Upstream commit c856b4b0fdb5044bca4c0acf9a66f3b5cc01a37a ]

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
mv_ehci_probe(). And when get irq failed, the function
platform_get_irq() logs an error message, so remove redundant
message here.

Signed-off-by: Zhang Shengju &lt;zhangshengju@cmss.chinamobile.com&gt;
Signed-off-by: Tang Bin &lt;tangbin@cmss.chinamobile.com&gt;
Link: https://lore.kernel.org/r/20200508114305.15740-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit c856b4b0fdb5044bca4c0acf9a66f3b5cc01a37a ]

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
mv_ehci_probe(). And when get irq failed, the function
platform_get_irq() logs an error message, so remove redundant
message here.

Signed-off-by: Zhang Shengju &lt;zhangshengju@cmss.chinamobile.com&gt;
Signed-off-by: Tang Bin &lt;tangbin@cmss.chinamobile.com&gt;
Link: https://lore.kernel.org/r/20200508114305.15740-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ehci-hcd: Move include to keep CRC stable</title>
<updated>2020-09-23T06:44:28+00:00</updated>
<author>
<name>Quentin Perret</name>
<email>qperret@google.com</email>
</author>
<published>2020-09-16T17:18:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a3e76b92c61f9be6001b91db164a2bd8554228e6'/>
<id>a3e76b92c61f9be6001b91db164a2bd8554228e6</id>
<content type='text'>
commit 29231826f3bd65500118c473fccf31c0cf14dbc0 upstream.

The CRC calculation done by genksyms is triggered when the parser hits
EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the
types of the function parameters, and uses that as the input for the CRC
calculation. In the case of forward-declared structs, the type expands
to 'UNKNOWN'. Following this, it appears that the result of the
expansion of each type is cached somewhere, and seems to be re-used
when/if the same type is seen again for another exported symbol in the
same C file.

Unfortunately, this can cause CRC 'stability' issues when a struct
definition becomes visible in the middle of a C file. For example, let's
assume code with the following pattern:

    struct foo;

    int bar(struct foo *arg)
    {
	/* Do work ... */
    }
    EXPORT_SYMBOL_GPL(bar);

    /* This contains struct foo's definition */
    #include "foo.h"

    int baz(struct foo *arg)
    {
	/* Do more work ... */
    }
    EXPORT_SYMBOL_GPL(baz);

Here, baz's CRC will be computed using the expansion of struct foo that
was cached after bar's CRC calculation ('UNKOWN' here). But if
EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol
trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded
late, during baz's CRC calculation, which now has visibility over the
full struct definition, hence resulting in a different CRC for baz.

The proper fix for this certainly is in genksyms, but that will take me
some time to get right. In the meantime, we have seen one occurrence of
this in the ehci-hcd code which hits this problem because of the way it
includes C files halfway through the code together with an unlucky mix
of symbol trimming.

In order to workaround this, move the include done in ehci-hub.c early
in ehci-hcd.c, hence making sure the struct definitions are visible to
the entire file. This improves CRC stability of the ehci-hcd exports
even when symbol trimming is enabled.

Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Link: https://lore.kernel.org/r/20200916171825.3228122-1-qperret@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>
commit 29231826f3bd65500118c473fccf31c0cf14dbc0 upstream.

The CRC calculation done by genksyms is triggered when the parser hits
EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the
types of the function parameters, and uses that as the input for the CRC
calculation. In the case of forward-declared structs, the type expands
to 'UNKNOWN'. Following this, it appears that the result of the
expansion of each type is cached somewhere, and seems to be re-used
when/if the same type is seen again for another exported symbol in the
same C file.

Unfortunately, this can cause CRC 'stability' issues when a struct
definition becomes visible in the middle of a C file. For example, let's
assume code with the following pattern:

    struct foo;

    int bar(struct foo *arg)
    {
	/* Do work ... */
    }
    EXPORT_SYMBOL_GPL(bar);

    /* This contains struct foo's definition */
    #include "foo.h"

    int baz(struct foo *arg)
    {
	/* Do more work ... */
    }
    EXPORT_SYMBOL_GPL(baz);

Here, baz's CRC will be computed using the expansion of struct foo that
was cached after bar's CRC calculation ('UNKOWN' here). But if
EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol
trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded
late, during baz's CRC calculation, which now has visibility over the
full struct definition, hence resulting in a different CRC for baz.

The proper fix for this certainly is in genksyms, but that will take me
some time to get right. In the meantime, we have seen one occurrence of
this in the ehci-hcd code which hits this problem because of the way it
includes C files halfway through the code together with an unlucky mix
of symbol trimming.

In order to workaround this, move the include done in ehci-hub.c early
in ehci-hcd.c, hence making sure the struct definitions are visible to
the entire file. This improves CRC stability of the ehci-hcd exports
even when symbol trimming is enabled.

Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Quentin Perret &lt;qperret@google.com&gt;
Link: https://lore.kernel.org/r/20200916171825.3228122-1-qperret@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()</title>
<updated>2020-09-03T09:19:28+00:00</updated>
<author>
<name>Tang Bin</name>
<email>tangbin@cmss.chinamobile.com</email>
</author>
<published>2020-08-26T14:49:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3fae4606bc497728d4a3c11a83136623f555ec6f'/>
<id>3fae4606bc497728d4a3c11a83136623f555ec6f</id>
<content type='text'>
commit 1d4169834628d18b2392a2da92b7fbf5e8e2ce89 upstream.

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
exynos_ohci_probe(). And when get irq failed, the function
platform_get_irq() logs an error message, so remove redundant
message here.

Fixes: 62194244cf87 ("USB: Add Samsung Exynos OHCI diver")
Signed-off-by: Zhang Shengju &lt;zhangshengju@cmss.chinamobile.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Tang Bin &lt;tangbin@cmss.chinamobile.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Link: https://lore.kernel.org/r/20200826144931.1828-1-tangbin@cmss.chinamobile.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 1d4169834628d18b2392a2da92b7fbf5e8e2ce89 upstream.

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
exynos_ohci_probe(). And when get irq failed, the function
platform_get_irq() logs an error message, so remove redundant
message here.

Fixes: 62194244cf87 ("USB: Add Samsung Exynos OHCI diver")
Signed-off-by: Zhang Shengju &lt;zhangshengju@cmss.chinamobile.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Tang Bin &lt;tangbin@cmss.chinamobile.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Link: https://lore.kernel.org/r/20200826144931.1828-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>xhci: Do warm-reset when both CAS and XDEV_RESUME are set</title>
<updated>2020-09-03T09:19:27+00:00</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kai.heng.feng@canonical.com</email>
</author>
<published>2020-08-21T09:15:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6fa4be261454dd5091e045539138bff1c2dc5605'/>
<id>6fa4be261454dd5091e045539138bff1c2dc5605</id>
<content type='text'>
commit 904df64a5f4d5ebd670801d869ca0a6d6a6e8df6 upstream.

Sometimes re-plugging a USB device during system sleep renders the device
useless:
[  173.418345] xhci_hcd 0000:00:14.0: Get port status 2-4 read: 0x14203e2, return 0x10262
...
[  176.496485] usb 2-4: Waited 2000ms for CONNECT
[  176.496781] usb usb2-port4: status 0000.0262 after resume, -19
[  176.497103] usb 2-4: can't resume, status -19
[  176.497438] usb usb2-port4: logical disconnect

Because PLS equals to XDEV_RESUME, xHCI driver reports U3 to usbcore,
despite of CAS bit is flagged.

So proritize CAS over XDEV_RESUME to let usbcore handle warm-reset for
the port.

Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200821091549.20556-3-mathias.nyman@linux.intel.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 904df64a5f4d5ebd670801d869ca0a6d6a6e8df6 upstream.

Sometimes re-plugging a USB device during system sleep renders the device
useless:
[  173.418345] xhci_hcd 0000:00:14.0: Get port status 2-4 read: 0x14203e2, return 0x10262
...
[  176.496485] usb 2-4: Waited 2000ms for CONNECT
[  176.496781] usb usb2-port4: status 0000.0262 after resume, -19
[  176.497103] usb 2-4: can't resume, status -19
[  176.497438] usb usb2-port4: logical disconnect

Because PLS equals to XDEV_RESUME, xHCI driver reports U3 to usbcore,
despite of CAS bit is flagged.

So proritize CAS over XDEV_RESUME to let usbcore handle warm-reset for
the port.

Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200821091549.20556-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "usb/ohci-platform: Fix a warning when hibernating"</title>
<updated>2020-07-22T07:10:04+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>sashal@kernel.org</email>
</author>
<published>2020-07-17T16:39:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=797fe1728d489c93801d3af78cc540db8f7690e7'/>
<id>797fe1728d489c93801d3af78cc540db8f7690e7</id>
<content type='text'>
This reverts commit 652def4c63b99029fe8b898740f97329c26a2fd3.

Eugeniu Rosca writes:

On Thu, Jul 09, 2020 at 09:00:23AM +0200, Eugeniu Rosca wrote:
&gt;After integrating v4.14.186 commit 5410d158ca2a50 ("usb/ehci-platform:
&gt;Set PM runtime as active on resume") into downstream v4.14.x, we started
&gt;to consistently experience below panic [1] on every second s2ram of
&gt;R-Car H3 Salvator-X Renesas reference board.
&gt;
&gt;After some investigations, we concluded the following:
&gt; - the issue does not exist in vanilla v5.8-rc4+
&gt; - [bisecting shows that] the panic on v4.14.186 is caused by the lack
&gt;   of v5.6-rc1 commit 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support"). Getting evidence for that is easy. Reverting
&gt;   987351e1ea7772 in vanilla leads to a similar backtrace [2].
&gt;
&gt;Questions:
&gt; - Backporting 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support") to v4.14.187 looks challenging enough, so probably not
&gt;   worth it. Anybody to contradict this?
&gt; - Assuming no plans to backport the missing mainline commit to v4.14.x,
&gt;   should the following three v4.14.186 commits be reverted on v4.14.x?
&gt;   * baef809ea497a4 ("usb/ohci-platform: Fix a warning when hibernating")
&gt;   * 9f33eff4958885 ("usb/xhci-plat: Set PM runtime as active on resume")
&gt;   * 5410d158ca2a50 ("usb/ehci-platform: Set PM runtime as active on resume")

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 652def4c63b99029fe8b898740f97329c26a2fd3.

Eugeniu Rosca writes:

On Thu, Jul 09, 2020 at 09:00:23AM +0200, Eugeniu Rosca wrote:
&gt;After integrating v4.14.186 commit 5410d158ca2a50 ("usb/ehci-platform:
&gt;Set PM runtime as active on resume") into downstream v4.14.x, we started
&gt;to consistently experience below panic [1] on every second s2ram of
&gt;R-Car H3 Salvator-X Renesas reference board.
&gt;
&gt;After some investigations, we concluded the following:
&gt; - the issue does not exist in vanilla v5.8-rc4+
&gt; - [bisecting shows that] the panic on v4.14.186 is caused by the lack
&gt;   of v5.6-rc1 commit 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support"). Getting evidence for that is easy. Reverting
&gt;   987351e1ea7772 in vanilla leads to a similar backtrace [2].
&gt;
&gt;Questions:
&gt; - Backporting 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support") to v4.14.187 looks challenging enough, so probably not
&gt;   worth it. Anybody to contradict this?
&gt; - Assuming no plans to backport the missing mainline commit to v4.14.x,
&gt;   should the following three v4.14.186 commits be reverted on v4.14.x?
&gt;   * baef809ea497a4 ("usb/ohci-platform: Fix a warning when hibernating")
&gt;   * 9f33eff4958885 ("usb/xhci-plat: Set PM runtime as active on resume")
&gt;   * 5410d158ca2a50 ("usb/ehci-platform: Set PM runtime as active on resume")

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "usb/xhci-plat: Set PM runtime as active on resume"</title>
<updated>2020-07-22T07:10:04+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>sashal@kernel.org</email>
</author>
<published>2020-07-17T16:38:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5c47be82d6a939f7e5e0927c52c7caaa7600c232'/>
<id>5c47be82d6a939f7e5e0927c52c7caaa7600c232</id>
<content type='text'>
This reverts commit 737c975db35b0117fc5c702072ca2df6f2f7eb63.

Eugeniu Rosca writes:

On Thu, Jul 09, 2020 at 09:00:23AM +0200, Eugeniu Rosca wrote:
&gt;After integrating v4.14.186 commit 5410d158ca2a50 ("usb/ehci-platform:
&gt;Set PM runtime as active on resume") into downstream v4.14.x, we started
&gt;to consistently experience below panic [1] on every second s2ram of
&gt;R-Car H3 Salvator-X Renesas reference board.
&gt;
&gt;After some investigations, we concluded the following:
&gt; - the issue does not exist in vanilla v5.8-rc4+
&gt; - [bisecting shows that] the panic on v4.14.186 is caused by the lack
&gt;   of v5.6-rc1 commit 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support"). Getting evidence for that is easy. Reverting
&gt;   987351e1ea7772 in vanilla leads to a similar backtrace [2].
&gt;
&gt;Questions:
&gt; - Backporting 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support") to v4.14.187 looks challenging enough, so probably not
&gt;   worth it. Anybody to contradict this?
&gt; - Assuming no plans to backport the missing mainline commit to v4.14.x,
&gt;   should the following three v4.14.186 commits be reverted on v4.14.x?
&gt;   * baef809ea497a4 ("usb/ohci-platform: Fix a warning when hibernating")
&gt;   * 9f33eff4958885 ("usb/xhci-plat: Set PM runtime as active on resume")
&gt;   * 5410d158ca2a50 ("usb/ehci-platform: Set PM runtime as active on resume")

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 737c975db35b0117fc5c702072ca2df6f2f7eb63.

Eugeniu Rosca writes:

On Thu, Jul 09, 2020 at 09:00:23AM +0200, Eugeniu Rosca wrote:
&gt;After integrating v4.14.186 commit 5410d158ca2a50 ("usb/ehci-platform:
&gt;Set PM runtime as active on resume") into downstream v4.14.x, we started
&gt;to consistently experience below panic [1] on every second s2ram of
&gt;R-Car H3 Salvator-X Renesas reference board.
&gt;
&gt;After some investigations, we concluded the following:
&gt; - the issue does not exist in vanilla v5.8-rc4+
&gt; - [bisecting shows that] the panic on v4.14.186 is caused by the lack
&gt;   of v5.6-rc1 commit 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support"). Getting evidence for that is easy. Reverting
&gt;   987351e1ea7772 in vanilla leads to a similar backtrace [2].
&gt;
&gt;Questions:
&gt; - Backporting 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support") to v4.14.187 looks challenging enough, so probably not
&gt;   worth it. Anybody to contradict this?
&gt; - Assuming no plans to backport the missing mainline commit to v4.14.x,
&gt;   should the following three v4.14.186 commits be reverted on v4.14.x?
&gt;   * baef809ea497a4 ("usb/ohci-platform: Fix a warning when hibernating")
&gt;   * 9f33eff4958885 ("usb/xhci-plat: Set PM runtime as active on resume")
&gt;   * 5410d158ca2a50 ("usb/ehci-platform: Set PM runtime as active on resume")

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "usb/ehci-platform: Set PM runtime as active on resume"</title>
<updated>2020-07-22T07:10:04+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>sashal@kernel.org</email>
</author>
<published>2020-07-17T16:36:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=849bafb50c781733d0b26651bee6cc96c6e96c64'/>
<id>849bafb50c781733d0b26651bee6cc96c6e96c64</id>
<content type='text'>
This reverts commit 13af14dfadcb95030dc8e2e0cacbffc1990a9772.

Eugeniu Rosca writes:

On Thu, Jul 09, 2020 at 09:00:23AM +0200, Eugeniu Rosca wrote:
&gt;After integrating v4.14.186 commit 5410d158ca2a50 ("usb/ehci-platform:
&gt;Set PM runtime as active on resume") into downstream v4.14.x, we started
&gt;to consistently experience below panic [1] on every second s2ram of
&gt;R-Car H3 Salvator-X Renesas reference board.
&gt;
&gt;After some investigations, we concluded the following:
&gt; - the issue does not exist in vanilla v5.8-rc4+
&gt; - [bisecting shows that] the panic on v4.14.186 is caused by the lack
&gt;   of v5.6-rc1 commit 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support"). Getting evidence for that is easy. Reverting
&gt;   987351e1ea7772 in vanilla leads to a similar backtrace [2].
&gt;
&gt;Questions:
&gt; - Backporting 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support") to v4.14.187 looks challenging enough, so probably not
&gt;   worth it. Anybody to contradict this?
&gt; - Assuming no plans to backport the missing mainline commit to v4.14.x,
&gt;   should the following three v4.14.186 commits be reverted on v4.14.x?
&gt;   * baef809ea497a4 ("usb/ohci-platform: Fix a warning when hibernating")
&gt;   * 9f33eff4958885 ("usb/xhci-plat: Set PM runtime as active on resume")
&gt;   * 5410d158ca2a50 ("usb/ehci-platform: Set PM runtime as active on resume")

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 13af14dfadcb95030dc8e2e0cacbffc1990a9772.

Eugeniu Rosca writes:

On Thu, Jul 09, 2020 at 09:00:23AM +0200, Eugeniu Rosca wrote:
&gt;After integrating v4.14.186 commit 5410d158ca2a50 ("usb/ehci-platform:
&gt;Set PM runtime as active on resume") into downstream v4.14.x, we started
&gt;to consistently experience below panic [1] on every second s2ram of
&gt;R-Car H3 Salvator-X Renesas reference board.
&gt;
&gt;After some investigations, we concluded the following:
&gt; - the issue does not exist in vanilla v5.8-rc4+
&gt; - [bisecting shows that] the panic on v4.14.186 is caused by the lack
&gt;   of v5.6-rc1 commit 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support"). Getting evidence for that is easy. Reverting
&gt;   987351e1ea7772 in vanilla leads to a similar backtrace [2].
&gt;
&gt;Questions:
&gt; - Backporting 987351e1ea7772 ("phy: core: Add consumer device
&gt;   link support") to v4.14.187 looks challenging enough, so probably not
&gt;   worth it. Anybody to contradict this?
&gt; - Assuming no plans to backport the missing mainline commit to v4.14.x,
&gt;   should the following three v4.14.186 commits be reverted on v4.14.x?
&gt;   * baef809ea497a4 ("usb/ohci-platform: Fix a warning when hibernating")
&gt;   * 9f33eff4958885 ("usb/xhci-plat: Set PM runtime as active on resume")
&gt;   * 5410d158ca2a50 ("usb/ehci-platform: Set PM runtime as active on resume")

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xhci: Poll for U0 after disabling USB2 LPM</title>
<updated>2020-06-30T00:08:01+00:00</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kai.heng.feng@canonical.com</email>
</author>
<published>2020-06-24T13:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=09ec04369def1a92755d8dbb981e9f17e5319996'/>
<id>09ec04369def1a92755d8dbb981e9f17e5319996</id>
<content type='text'>
[ Upstream commit b3d71abd135e6919ca0b6cab463738472653ddfb ]

USB2 devices with LPM enabled may interrupt the system suspend:
[  932.510475] usb 1-7: usb suspend, wakeup 0
[  932.510549] hub 1-0:1.0: hub_suspend
[  932.510581] usb usb1: bus suspend, wakeup 0
[  932.510590] xhci_hcd 0000:00:14.0: port 9 not suspended
[  932.510593] xhci_hcd 0000:00:14.0: port 8 not suspended
..
[  932.520323] xhci_hcd 0000:00:14.0: Port change event, 1-7, id 7, portsc: 0x400e03
..
[  932.591405] PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
[  932.591414] PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -16
[  932.591418] PM: Device 0000:00:14.0 failed to suspend async: error -16

During system suspend, USB core will let HC suspends the device if it
doesn't have remote wakeup enabled and doesn't have any children.
However, from the log above we can see that the usb 1-7 doesn't get bus
suspended due to not in U0. After a while the port finished U2 -&gt; U0
transition, interrupts the suspend process.

The observation is that after disabling LPM, port doesn't transit to U0
immediately and can linger in U2. xHCI spec 4.23.5.2 states that the
maximum exit latency for USB2 LPM should be BESL + 10us. The BESL for
the affected device is advertised as 400us, which is still not enough
based on my testing result.

So let's use the maximum permitted latency, 10000, to poll for U0
status to solve the issue.

Cc: stable@vger.kernel.org
Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200624135949.22611-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit b3d71abd135e6919ca0b6cab463738472653ddfb ]

USB2 devices with LPM enabled may interrupt the system suspend:
[  932.510475] usb 1-7: usb suspend, wakeup 0
[  932.510549] hub 1-0:1.0: hub_suspend
[  932.510581] usb usb1: bus suspend, wakeup 0
[  932.510590] xhci_hcd 0000:00:14.0: port 9 not suspended
[  932.510593] xhci_hcd 0000:00:14.0: port 8 not suspended
..
[  932.520323] xhci_hcd 0000:00:14.0: Port change event, 1-7, id 7, portsc: 0x400e03
..
[  932.591405] PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
[  932.591414] PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -16
[  932.591418] PM: Device 0000:00:14.0 failed to suspend async: error -16

During system suspend, USB core will let HC suspends the device if it
doesn't have remote wakeup enabled and doesn't have any children.
However, from the log above we can see that the usb 1-7 doesn't get bus
suspended due to not in U0. After a while the port finished U2 -&gt; U0
transition, interrupts the suspend process.

The observation is that after disabling LPM, port doesn't transit to U0
immediately and can linger in U2. xHCI spec 4.23.5.2 states that the
maximum exit latency for USB2 LPM should be BESL + 10us. The BESL for
the affected device is advertised as 400us, which is still not enough
based on my testing result.

So let's use the maximum permitted latency, 10000, to poll for U0
status to solve the issue.

Cc: stable@vger.kernel.org
Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200624135949.22611-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xhci: Fix enumeration issue when setting max packet size for FS devices.</title>
<updated>2020-06-30T00:08:00+00:00</updated>
<author>
<name>Al Cooper</name>
<email>alcooperx@gmail.com</email>
</author>
<published>2020-06-24T13:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=08950ca6038a632a582ce3b173b1771eb3c7f6aa'/>
<id>08950ca6038a632a582ce3b173b1771eb3c7f6aa</id>
<content type='text'>
commit a73d9d9cfc3cfceabd91fb0b0c13e4062b6dbcd7 upstream.

Unable to complete the enumeration of a USB TV Tuner device.

Per XHCI spec (4.6.5), the EP state field of the input context shall
be cleared for a set address command. In the special case of an FS
device that has "MaxPacketSize0 = 8", the Linux XHCI driver does
not do this before evaluating the context. With an XHCI controller
that checks the EP state field for parameter context error this
causes a problem in cases such as the device getting reset again
after enumeration.

When that field is cleared, the problem does not occur.

This was found and fixed by Sasi Kumar.

Cc: stable@vger.kernel.org
Signed-off-by: Al Cooper &lt;alcooperx@gmail.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200624135949.22611-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.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>
commit a73d9d9cfc3cfceabd91fb0b0c13e4062b6dbcd7 upstream.

Unable to complete the enumeration of a USB TV Tuner device.

Per XHCI spec (4.6.5), the EP state field of the input context shall
be cleared for a set address command. In the special case of an FS
device that has "MaxPacketSize0 = 8", the Linux XHCI driver does
not do this before evaluating the context. With an XHCI controller
that checks the EP state field for parameter context error this
causes a problem in cases such as the device getting reset again
after enumeration.

When that field is cleared, the problem does not occur.

This was found and fixed by Sasi Kumar.

Cc: stable@vger.kernel.org
Signed-off-by: Al Cooper &lt;alcooperx@gmail.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200624135949.22611-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
