<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/dwc3, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-06-14T16:41:35Z</updated>
<entry>
<title>extcon: Fix extcon_get_extcon_dev() error handling</title>
<updated>2022-06-14T16:41:35Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2021-12-17T06:28:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c33ca06578c147b63adaa1934cc8efedb9553a8e'/>
<id>urn:sha1:c33ca06578c147b63adaa1934cc8efedb9553a8e</id>
<content type='text'>
[ Upstream commit 58e4a2d27d3255e4e8c507fdc13734dccc9fc4c7 ]

The extcon_get_extcon_dev() function returns error pointers on error,
NULL when it's a -EPROBE_DEFER defer situation, and ERR_PTR(-ENODEV)
when the CONFIG_EXTCON option is disabled.  This is very complicated for
the callers to handle and a number of them had bugs that would lead to
an Oops.

In real life, there are two things which prevented crashes.  First,
error pointers would only be returned if there was bug in the caller
where they passed a NULL "extcon_name" and none of them do that.
Second, only two out of the eight drivers will build when CONFIG_EXTCON
is disabled.

The normal way to write this would be to return -EPROBE_DEFER directly
when appropriate and return NULL when CONFIG_EXTCON is disabled.  Then
the error handling is simple and just looks like:

	dev-&gt;edev = extcon_get_extcon_dev(acpi_dev_name(adev));
	if (IS_ERR(dev-&gt;edev))
		return PTR_ERR(dev-&gt;edev);

For the two drivers which can build with CONFIG_EXTCON disabled, then
extcon_get_extcon_dev() will now return NULL which is not treated as an
error and the probe will continue successfully.  Those two drivers are
"typec_fusb302" and "max8997-battery".  In the original code, the
typec_fusb302 driver had an 800ms hang in tcpm_get_current_limit() but
now that function is a no-op.  For the max8997-battery driver everything
should continue working as is.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: host: Stop setting the ACPI companion</title>
<updated>2022-06-14T16:41:35Z</updated>
<author>
<name>Heikki Krogerus</name>
</author>
<published>2022-04-28T11:10:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7f35934f7ab67bfd9adabc84207e59da9c19108'/>
<id>urn:sha1:d7f35934f7ab67bfd9adabc84207e59da9c19108</id>
<content type='text'>
[ Upstream commit 7fd069d65da2e20b1caec3b7bcf9dfbe28c04bb2 ]

It is no longer needed. The sysdev pointer is now used when
assigning the ACPI companions to the xHCI ports and USB
devices.

Assigning the ACPI companion here resulted in the
fwnode-&gt;secondary pointer to be replaced also for the parent
dwc3 device since the primary fwnode (the ACPI companion)
was shared. That was unintentional and it created potential
side effects like resource leaks.

Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220428111056.3558-3-heikki.krogerus@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>
</entry>
<entry>
<title>usb: dwc3: pci: Fix pm_runtime_get_sync() error checking</title>
<updated>2022-06-14T16:41:14Z</updated>
<author>
<name>Zheng Yongjun</name>
</author>
<published>2022-04-22T06:26:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24ce123abe7a789fe8b25696d858f2c6bea34718'/>
<id>urn:sha1:24ce123abe7a789fe8b25696d858f2c6bea34718</id>
<content type='text'>
[ Upstream commit a03e2ddab8e735e2cc315609b297b300e9cc60d2 ]

If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1, so a test for negative
value should be used to check for errors.

Fixes: 8eed00b237a28 ("usb: dwc3: pci: Runtime resume child device from wq")
Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Link: https://lore.kernel.org/r/20220422062652.10575-1-zhengyongjun3@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Replace list_for_each_entry_safe() if using giveback</title>
<updated>2022-06-14T16:41:14Z</updated>
<author>
<name>Wesley Cheng</name>
</author>
<published>2022-04-14T18:35:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2424307cdf421ac72075a1384eae4e4199ab6457'/>
<id>urn:sha1:2424307cdf421ac72075a1384eae4e4199ab6457</id>
<content type='text'>
[ Upstream commit bf594d1d0c1d7b895954018043536ffd327844f9 ]

The list_for_each_entry_safe() macro saves the current item (n) and
the item after (n+1), so that n can be safely removed without
corrupting the list.  However, when traversing the list and removing
items using gadget giveback, the DWC3 lock is briefly released,
allowing other routines to execute.  There is a situation where, while
items are being removed from the cancelled_list using
dwc3_gadget_ep_cleanup_cancelled_requests(), the pullup disable
routine is running in parallel (due to UDC unbind).  As the cleanup
routine removes n, and the pullup disable removes n+1, once the
cleanup retakes the DWC3 lock, it references a request who was already
removed/handled.  With list debug enabled, this leads to a panic.
Ensure all instances of the macro are replaced where gadget giveback
is used.

Example call stack:

Thread#1:
__dwc3_gadget_ep_set_halt() - CLEAR HALT
  -&gt; dwc3_gadget_ep_cleanup_cancelled_requests()
    -&gt;list_for_each_entry_safe()
    -&gt;dwc3_gadget_giveback(n)
      -&gt;dwc3_gadget_del_and_unmap_request()- n deleted[cancelled_list]
      -&gt;spin_unlock
      -&gt;Thread#2 executes
      ...
    -&gt;dwc3_gadget_giveback(n+1)
      -&gt;Already removed!

Thread#2:
dwc3_gadget_pullup()
  -&gt;waiting for dwc3 spin_lock
  ...
  -&gt;Thread#1 released lock
  -&gt;dwc3_stop_active_transfers()
    -&gt;dwc3_remove_requests()
      -&gt;fetches n+1 item from cancelled_list (n removed by Thread#1)
      -&gt;dwc3_gadget_giveback()
        -&gt;dwc3_gadget_del_and_unmap_request()- n+1 deleted[cancelled_list]
        -&gt;spin_unlock

Fixes: d4f1afe5e896 ("usb: dwc3: gadget: move requests to cancelled_list")
Signed-off-by: Wesley Cheng &lt;quic_wcheng@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220414183521.23451-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Move null pinter check to proper place</title>
<updated>2022-06-09T08:25:14Z</updated>
<author>
<name>Albert Wang</name>
</author>
<published>2022-05-18T06:13:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=26b11073d7e463c4664d5832b5896220281c4032'/>
<id>urn:sha1:26b11073d7e463c4664d5832b5896220281c4032</id>
<content type='text'>
commit 3c5880745b4439ac64eccdb040e37fc1cc4c5406 upstream.

When dwc3_gadget_ep_cleanup_completed_requests() called to
dwc3_gadget_giveback() where the dwc3 lock is released, other thread is
able to execute. In this situation, usb_ep_disable() gets the chance to
clear endpoint descriptor pointer which leds to the null pointer
dereference problem. So needs to move the null pointer check to a proper
place.

Example call stack:

Thread#1:
dwc3_thread_interrupt()
  spin_lock
  -&gt; dwc3_process_event_buf()
   -&gt; dwc3_process_event_entry()
    -&gt; dwc3_endpoint_interrupt()
     -&gt; dwc3_gadget_endpoint_trbs_complete()
      -&gt; dwc3_gadget_ep_cleanup_completed_requests()
       ...
       -&gt; dwc3_giveback()
          spin_unlock
          Thread#2 executes

Thread#2:
configfs_composite_disconnect()
  -&gt; __composite_disconnect()
   -&gt; ffs_func_disable()
    -&gt; ffs_func_set_alt()
     -&gt; ffs_func_eps_disable()
      -&gt; usb_ep_disable()
         wait for dwc3 spin_lock
         Thread#1 released lock
         clear endpoint.desc

Fixes: 26288448120b ("usb: dwc3: gadget: Fix null pointer exception")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Albert Wang &lt;albertccwang@google.com&gt;
Link: https://lore.kernel.org/r/20220518061315.3359198-1-albertccwang@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: pci: add support for the Intel Meteor Lake-P</title>
<updated>2022-05-09T07:16:13Z</updated>
<author>
<name>Heikki Krogerus</name>
</author>
<published>2022-04-25T10:35:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2bc325ec2004aea87c568f6b98af53172115b0df'/>
<id>urn:sha1:2bc325ec2004aea87c568f6b98af53172115b0df</id>
<content type='text'>
commit 973e0f7a847ef13ade840d4c30729ce329a66895 upstream.

This patch adds the necessary PCI IDs for Intel Meteor Lake-P
devices.

Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/r/20220425103518.44028-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Return proper request status</title>
<updated>2022-05-09T07:16:13Z</updated>
<author>
<name>Thinh Nguyen</name>
</author>
<published>2022-04-23T00:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac4900d831ad23a07f9211701f7d8cc03783a3ce'/>
<id>urn:sha1:ac4900d831ad23a07f9211701f7d8cc03783a3ce</id>
<content type='text'>
commit c7428dbddcf4ea1919e1c8e15f715b94ca359268 upstream.

If the user sets the usb_request's no_interrupt, then there will be no
completion event for the request. Currently the driver incorrectly uses
the event status of a different request to report the status for a
request with no_interrupt. The dwc3 driver needs to check the TRB status
associated with the request when reporting its status.

Note: this is only applicable to missed_isoc TRB completion status, but
the other status are also listed for completeness/documentation.

Fixes: 6d8a019614f3 ("usb: dwc3: gadget: check for Missed Isoc from event status")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/db2c80108286cfd108adb05bad52138b78d7c3a7.1650673655.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: core: Only handle soft-reset in DCTL</title>
<updated>2022-05-09T07:16:13Z</updated>
<author>
<name>Thinh Nguyen</name>
</author>
<published>2022-04-22T02:33:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9915ce17c420d594f99dd870a621949e5c9a6791'/>
<id>urn:sha1:9915ce17c420d594f99dd870a621949e5c9a6791</id>
<content type='text'>
commit f4fd84ae0765a80494b28c43b756a95100351a94 upstream.

Make sure not to set run_stop bit or link state change request while
initiating soft-reset. Register read-modify-write operation may
unintentionally start the controller before the initialization completes
with its previous DCTL value, which can cause initialization failure.

Fixes: f59dcab17629 ("usb: dwc3: core: improve reset sequence")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/6aecbd78328f102003d40ccf18ceeebd411d3703.1650594792.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: core: Fix tx/rx threshold settings</title>
<updated>2022-05-09T07:16:13Z</updated>
<author>
<name>Thinh Nguyen</name>
</author>
<published>2022-04-12T01:33:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4377eddfcc07eecce9b04130e8eb47daaafa688a'/>
<id>urn:sha1:4377eddfcc07eecce9b04130e8eb47daaafa688a</id>
<content type='text'>
commit f28ad9069363dec7deb88032b70612755eed9ee6 upstream.

The current driver logic checks against 0 to determine whether the
periodic tx/rx threshold settings are set, but we may get bogus values
from uninitialized variables if no device property is set. Properly
default these variables to 0.

Fixes: 938a5ad1d305 ("usb: dwc3: Check for ESS TX/RX threshold config")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Thinh Nguyen &lt;Thinh.Nguyen@synopsys.com&gt;
Link: https://lore.kernel.org/r/cccfce990b11b730b0dae42f9d217dc6fb988c90.1649727139.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: Try usb-role-switch first in dwc3_drd_init</title>
<updated>2022-05-09T07:16:13Z</updated>
<author>
<name>Sven Peter</name>
</author>
<published>2022-04-11T15:53:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d61d85e89b1cc3aa09a9691eb655dd3a366bbe21'/>
<id>urn:sha1:d61d85e89b1cc3aa09a9691eb655dd3a366bbe21</id>
<content type='text'>
commit ab7aa2866d295438dc60522f85c5421c6b4f1507 upstream.

If the PHY controller node has a "port" dwc3 tries to find an
extcon device even when "usb-role-switch" is present. This happens
because dwc3_get_extcon() sees that "port" node and then calls
extcon_find_edev_by_node() which will always return EPROBE_DEFER
in that case.

On the other hand, even if an extcon was present and dwc3_get_extcon()
was successful it would still be ignored in favor of "usb-role-switch".

Let's just first check if "usb-role-switch" is configured in the device
tree and directly use it instead and only try to look for an extcon
device otherwise.

Fixes: 8a0a13799744 ("usb: dwc3: Registering a role switch in the DRD code.")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
Link: https://lore.kernel.org/r/20220411155300.9766-1-sven@svenpeter.dev
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
