<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/core, branch v6.13</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.13</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.13'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-12-23T17:54:20Z</updated>
<entry>
<title>USB: core: Disable LPM only for non-suspended ports</title>
<updated>2024-12-23T17:54:20Z</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kaihengf@nvidia.com</email>
</author>
<published>2024-12-06T07:48:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59bfeaf5454b7e764288d84802577f4a99bf0819'/>
<id>urn:sha1:59bfeaf5454b7e764288d84802577f4a99bf0819</id>
<content type='text'>
There's USB error when tegra board is shutting down:
[  180.919315] usb 2-3: Failed to set U1 timeout to 0x0,error code -113
[  180.919995] usb 2-3: Failed to set U1 timeout to 0xa,error code -113
[  180.920512] usb 2-3: Failed to set U2 timeout to 0x4,error code -113
[  186.157172] tegra-xusb 3610000.usb: xHCI host controller not responding, assume dead
[  186.157858] tegra-xusb 3610000.usb: HC died; cleaning up
[  186.317280] tegra-xusb 3610000.usb: Timeout while waiting for evaluate context command

The issue is caused by disabling LPM on already suspended ports.

For USB2 LPM, the LPM is already disabled during port suspend. For USB3
LPM, port won't transit to U1/U2 when it's already suspended in U3,
hence disabling LPM is only needed for ports that are not suspended.

Cc: Wayne Chang &lt;waynec@nvidia.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Fixes: d920a2ed8620 ("usb: Disable USB3 LPM at shutdown")
Signed-off-by: Kai-Heng Feng &lt;kaihengf@nvidia.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Link: https://lore.kernel.org/r/20241206074817.89189-1-kaihengf@nvidia.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: fix reference leak in usb_new_device()</title>
<updated>2024-12-23T17:54:04Z</updated>
<author>
<name>Ma Ke</name>
<email>make_ruc2021@163.com</email>
</author>
<published>2024-12-18T07:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0df11fa8cee5a9cf8753d4e2672bb3667138c652'/>
<id>urn:sha1:0df11fa8cee5a9cf8753d4e2672bb3667138c652</id>
<content type='text'>
When device_add(&amp;udev-&gt;dev) succeeds and a later call fails,
usb_new_device() does not properly call device_del(). As comment of
device_add() says, 'if device_add() succeeds, you should call
device_del() when you want to get rid of it. If device_add() has not
succeeded, use only put_device() to drop the reference count'.

Found by code review.

Cc: stable &lt;stable@kernel.org&gt;
Fixes: 9f8b17e643fe ("USB: make usbdevices export their device nodes instead of using a separate class")
Signed-off-by: Ma Ke &lt;make_ruc2021@163.com&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20241218071346.2973980-1-make_ruc2021@163.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: core: hcd: only check primary hcd skip_phy_initialization</title>
<updated>2024-12-04T15:26:44Z</updated>
<author>
<name>Xu Yang</name>
<email>xu.yang_2@nxp.com</email>
</author>
<published>2024-11-05T09:01:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d2ec94fbc431cc77ed53d4480bdc856669c2b5aa'/>
<id>urn:sha1:d2ec94fbc431cc77ed53d4480bdc856669c2b5aa</id>
<content type='text'>
Before commit 53a2d95df836 ("usb: core: add phy notify connect and
disconnect"), phy initialization will be skipped even when shared hcd
doesn't set skip_phy_initialization flag. However, the situation is
changed after the commit. The hcd.c will initialize phy when add shared
hcd. This behavior is unexpected for some platforms which will handle phy
initialization by themselves. To avoid the issue, this will only check
skip_phy_initialization flag of primary hcd since shared hcd normally
follow primary hcd setting.

Fixes: 53a2d95df836 ("usb: core: add phy notify connect and disconnect")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Yang &lt;xu.yang_2@nxp.com&gt;
Link: https://lore.kernel.org/r/20241105090120.2438366-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'driver-core-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core</title>
<updated>2024-11-29T19:43:29Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-11-29T19:43:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55cb93fd243bad2c6e15f9151a32f575d2f5371f'/>
<id>urn:sha1:55cb93fd243bad2c6e15f9151a32f575d2f5371f</id>
<content type='text'>
Pull driver core updates from Greg KH:
 "Here is a small set of driver core changes for 6.13-rc1.

  Nothing major for this merge cycle, except for the two simple merge
  conflicts are here just to make life interesting.

  Included in here are:

   - sysfs core changes and preparations for more sysfs api cleanups
     that can come through all driver trees after -rc1 is out

   - fw_devlink fixes based on many reports and debugging sessions

   - list_for_each_reverse() removal, no one was using it!

   - last-minute seq_printf() format string bug found and fixed in many
     drivers all at once.

   - minor bugfixes and changes full details in the shortlog"

* tag 'driver-core-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (35 commits)
  Fix a potential abuse of seq_printf() format string in drivers
  cpu: Remove spurious NULL in attribute_group definition
  s390/con3215: Remove spurious NULL in attribute_group definition
  perf: arm-ni: Remove spurious NULL in attribute_group definition
  driver core: Constify bin_attribute definitions
  sysfs: attribute_group: allow registration of const bin_attribute
  firmware_loader: Fix possible resource leak in fw_log_firmware_info()
  drivers: core: fw_devlink: Fix excess parameter description in docstring
  driver core: class: Correct WARN() message in APIs class_(for_each|find)_device()
  cacheinfo: Use of_property_present() for non-boolean properties
  cdx: Fix cdx_mmap_resource() after constifying attr in -&gt;mmap()
  drivers: core: fw_devlink: Make the error message a bit more useful
  phy: tegra: xusb: Set fwnode for xusb port devices
  drm: display: Set fwnode for aux bus devices
  driver core: fw_devlink: Stop trying to optimize cycle detection logic
  driver core: Constify attribute arguments of binary attributes
  sysfs: bin_attribute: add const read/write callback variants
  sysfs: implement all BIN_ATTR_* macros in terms of __BIN_ATTR()
  sysfs: treewide: constify attribute callback of bin_attribute::llseek()
  sysfs: treewide: constify attribute callback of bin_attribute::mmap()
  ...
</content>
</entry>
<entry>
<title>USB: make to_usb_device_driver() use container_of_const()</title>
<updated>2024-11-14T16:57:33Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2024-11-13T14:04:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6fa15bbcf9604e3c14816410550d2cf22b955e4'/>
<id>urn:sha1:d6fa15bbcf9604e3c14816410550d2cf22b955e4</id>
<content type='text'>
Turns out that we have some const pointers being passed to
to_usb_device_driver() but were not catching this.  Change the macro to
properly propagate the const-ness of the pointer so that we will notice
when we try to write to memory that we shouldn't be writing to.

This requires fixing up the usb_driver_applicable() function as well,
because it can handle a const * to struct usb_driver.

Cc: Johan Hovold &lt;johan@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Grant Grundler &lt;grundler@chromium.org&gt;
Cc: Yajun Deng &lt;yajun.deng@linux.dev&gt;
Cc: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/2024111342-lagoon-reapprove-5e49@gregkh
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: make to_usb_driver() use container_of_const()</title>
<updated>2024-11-14T16:57:29Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2024-11-13T14:04:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f3aab7aecb827ba93c6222646eb0faa8228d590'/>
<id>urn:sha1:2f3aab7aecb827ba93c6222646eb0faa8228d590</id>
<content type='text'>
Turns out that we have some const pointers being passed to
to_usb_driver() but were not catching this.  Change the macro to
properly propagate the const-ness of the pointer so that we will notice
when we try to write to memory that we shouldn't be writing to.

This requires fixing up the usb_match_dynamic_id() function as well,
because it can handle a const * to struct usb_driver.

Cc: Johan Hovold &lt;johan@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Grant Grundler &lt;grundler@chromium.org&gt;
Cc: Yajun Deng &lt;yajun.deng@linux.dev&gt;
Cc: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/2024111339-shaky-goldsmith-b233@gregkh
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: properly lock dynamic id list when showing an id</title>
<updated>2024-11-14T16:05:25Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2024-11-13T06:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81f5c72d041b92490261354a528b60e66ed2fa3b'/>
<id>urn:sha1:81f5c72d041b92490261354a528b60e66ed2fa3b</id>
<content type='text'>
When walking the list of dynamic ids for a driver, no lock was being
held, which meant that an id could be removed or added while the list
was being iterated.  Fix this up by properly grabing the lock while we
walk the list.

Reported-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/2024111324-tubby-facecloth-d4a0@gregkh
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: make single lock for all usb dynamic id lists</title>
<updated>2024-11-14T16:05:20Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2024-11-13T06:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0b3144da31f855fce652303f588416a60991bdef'/>
<id>urn:sha1:0b3144da31f855fce652303f588416a60991bdef</id>
<content type='text'>
There are a number of places where we accidentally pass in a constant
structure to later cast it off to a dynamic one, and then attempt to
grab a lock on it, which is not a good idea.  To help resolve this, move
the dynamic id lock out of the dynamic id structure for the driver and
into one single lock for all USB dynamic ids.  As this lock should never
have any real contention (it's only every accessed when a device is
added or removed, which is always serialized) there should not be any
difference except for some memory savings.

Note, this just converts the existing use of the dynamic id lock to the
new static lock, there is one place that is accessing the dynamic id
list without grabbing the lock, that will be fixed up in a follow-on
change.

Cc: Johan Hovold &lt;johan@kernel.org&gt;
Cc: Herve Codina &lt;herve.codina@bootlin.com&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Grant Grundler &lt;grundler@chromium.org&gt;
Cc: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: Yajun Deng &lt;yajun.deng@linux.dev&gt;
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/2024111322-kindly-finalist-d247@gregkh
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/usb/core: refactor max with max_t</title>
<updated>2024-11-13T14:09:50Z</updated>
<author>
<name>Sabyrzhan Tasbolatov</name>
<email>snovitoll@gmail.com</email>
</author>
<published>2024-11-12T15:58:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28d96b7a925309a6a8024620d83a113f75a02b0d'/>
<id>urn:sha1:28d96b7a925309a6a8024620d83a113f75a02b0d</id>
<content type='text'>
Ensure type safety by using max_t() instead of max().

Signed-off-by: Sabyrzhan Tasbolatov &lt;snovitoll@gmail.com&gt;
Link: https://lore.kernel.org/r/20241112155817.3512577-3-snovitoll@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: core: remove dead code in do_proc_bulk()</title>
<updated>2024-11-13T06:06:41Z</updated>
<author>
<name>Rex Nie</name>
<email>rex.nie@jaguarmicro.com</email>
</author>
<published>2024-11-12T15:20:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fa518772fb63e201207bcdab7ea108198dc15f3c'/>
<id>urn:sha1:fa518772fb63e201207bcdab7ea108198dc15f3c</id>
<content type='text'>
Since len1 is unsigned int, len1 &lt; 0 always false. Remove it keep code
simple.

Signed-off-by: Rex Nie &lt;rex.nie@jaguarmicro.com&gt;
Rule: add
Link: https://lore.kernel.org/stable/20241108094255.2133-1-rex.nie%40jaguarmicro.com
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20241112152021.2236-1-rex.nie@jaguarmicro.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
