<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/core/generic.c, branch v5.9.12</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.9.12</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.9.12'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-11-05T10:51:39+00:00</updated>
<entry>
<title>usbcore: Check both id_table and match() when both available</title>
<updated>2020-11-05T10:51:39+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2020-10-22T13:55:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=347e6870d9b05624bbaf558f951ca78759d25780'/>
<id>urn:sha1:347e6870d9b05624bbaf558f951ca78759d25780</id>
<content type='text'>
commit 0942d59b0af46511d59dbf5bd69ec4a64d1a854c upstream.

From: Bastien Nocera &lt;hadess@hadess.net&gt;

When a USB device driver has both an id_table and a match() function, make
sure to check both to find a match, first matching the id_table, then
checking the match() function.

This makes it possible to have module autoloading done through the
id_table when devices are plugged in, before checking for further
device eligibility in the match() function.

Cc: &lt;stable@vger.kernel.org&gt; # 5.8
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Co-developed-by: M. Vefa Bicakci &lt;m.v.b@runbox.com&gt;
Tested-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: M. Vefa Bicakci &lt;m.v.b@runbox.com&gt;
Tested-by: Pan (Pany) YUAN &lt;pany@fedoraproject.org&gt;
Link: https://lore.kernel.org/r/20201022135521.375211-2-m.v.b@runbox.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: Also match device drivers using the -&gt;match vfunc</title>
<updated>2020-08-18T11:08:45+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2020-08-18T11:04:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=adb6e6ac20eedcf1dce19dc75b224e63c0828ea1'/>
<id>urn:sha1:adb6e6ac20eedcf1dce19dc75b224e63c0828ea1</id>
<content type='text'>
We only ever used the ID table matching before, but we should also support
open-coded match functions.

Fixes: 88b7381a939de ("USB: Select better matching USB drivers when available")
Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20200818110445.509668-1-hadess@hadess.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: Simplify USB ID table match</title>
<updated>2020-07-29T14:48:02+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2020-07-27T10:46:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0ed9498f9ecfde50c93f3f3dd64b4cd5414d9944'/>
<id>urn:sha1:0ed9498f9ecfde50c93f3f3dd64b4cd5414d9944</id>
<content type='text'>
usb_device_match_id() supports being passed NULL tables, so no need to
check for it.

Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Link: https://lore.kernel.org/r/20200727104644.149873-1-hadess@hadess.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: Fallback to generic driver when specific driver fails</title>
<updated>2020-02-12T19:01:55+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2019-10-16T09:39:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=77419aa403ca1395f66e1e3de87743f54ba144b6'/>
<id>urn:sha1:77419aa403ca1395f66e1e3de87743f54ba144b6</id>
<content type='text'>
If -&gt;probe fails for a device specific driver, ask the driver core to
reprobe us, after having flagged the device for the generic driver to be
forced.

Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20191016093933.693-6-hadess@hadess.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: Select better matching USB drivers when available</title>
<updated>2020-02-12T19:01:55+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2019-10-16T09:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=88b7381a939de0fa1f1b1629c56b03dca7077309'/>
<id>urn:sha1:88b7381a939de0fa1f1b1629c56b03dca7077309</id>
<content type='text'>
Now that USB device drivers can reuse code from the generic USB device
driver, we need to make sure that they get selected rather than the
generic driver. Add an id_table and match vfunc to the usb_device_driver
struct, which will get used to select a better matching driver at
-&gt;probe time.

This is a similar mechanism to that used in the HID drivers, with the
generic driver being selected unless there's a better matching one found
in the registered drivers (see hid_generic_match() in
drivers/hid/hid-generic.c).

Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20191016093933.693-5-hadess@hadess.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: Export generic USB device driver functions</title>
<updated>2020-02-12T19:01:54+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2019-10-16T09:39:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ef0f7d1877ac21fd926f2349e6a025c201651cf7'/>
<id>urn:sha1:ef0f7d1877ac21fd926f2349e6a025c201651cf7</id>
<content type='text'>
This will make it possible to implement device drivers which extend the
generic driver without needing to reimplement it.

Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20191016093933.693-2-hadess@hadess.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbfs: Add ioctls for runtime power management</title>
<updated>2019-08-09T05:55:45+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-08-07T14:29:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7794f486ed0b1fa8022dd0a27b9babf86a46d1cf'/>
<id>urn:sha1:7794f486ed0b1fa8022dd0a27b9babf86a46d1cf</id>
<content type='text'>
It has been requested that usbfs should implement runtime power
management, instead of forcing the device to remain at full power as
long as the device file is open.  This patch introduces that new
feature.

It does so by adding three new usbfs ioctls:

	USBDEVFS_FORBID_SUSPEND: Prevents the device from going into
	runtime suspend (and causes a resume if the device is already
	suspended).

	USBDEVFS_ALLOW_SUSPEND: Allows the device to go into runtime
	suspend.  Some time may elapse before the device actually is
	suspended, depending on things like the autosuspend delay.

	USBDEVFS_WAIT_FOR_RESUME: Blocks until the call is interrupted
	by a signal or at least one runtime resume has occurred since
	the most recent ALLOW_SUSPEND ioctl call (which may mean
	immediately, even if the device is currently suspended).  In
	the latter case, the device is prevented from suspending again
	just as if FORBID_SUSPEND was called before the ioctl returns.

For backward compatibility, when the device file is first opened
runtime suspends are forbidden.  The userspace program can then allow
suspends whenever it wants, and either resume the device directly (by
forbidding suspends again) or wait for a resume from some other source
(such as a remote wakeup).  URBs submitted to a suspended device will
fail or will complete with an appropriate error code.

This combination of ioctls is sufficient for user programs to have
nearly the same degree of control over a device's runtime power
behavior as kernel drivers do.

Still lacking is documentation for the new ioctls.  I intend to add it
later, after the existing documentation for the usbfs userspace API is
straightened out into a reasonable form.

Suggested-by: Mayuresh Kulkarni &lt;mkulkarni@opensource.cirrus.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;

Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.1908071013220.1514-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: Fix configuration selection issues introduced in v4.20.0</title>
<updated>2019-02-08T09:22:39+00:00</updated>
<author>
<name>Nikolay Yakimov</name>
<email>root@livid.pp.ru</email>
</author>
<published>2019-01-15T16:13:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=25b0161450363ed7fe9fe618cda202e15817311a'/>
<id>urn:sha1:25b0161450363ed7fe9fe618cda202e15817311a</id>
<content type='text'>
Commit f13912d3f014a introduced changes to the usb_choose_configuration function
to better support USB Audio UAC3-compatible devices. However, there are a few
problems with this patch. First of all, it adds new "if" clauses in the middle
of an existing "if"/"else if" tree, which obviously breaks pre-existing logic.
Secondly, since it continues iterating over configurations in one of the branches,
other code in the loop can choose an unintended configuration. Finally,
if an audio device's first configuration is UAC3-compatible, and there
are multiple UAC3 configurations, the second one would be chosen, due to
the first configuration never being checked for UAC3-compatibility.

Commit ff2a8c532c14 tries to fix the second issue, but it goes about it in a
somewhat unnecessarily convoluted way, in my opinion, and does nothing
to fix the first or the last one.

This patch tries to rectify problems described by essentially rewriting
code introduced in f13912d3f014a. Notice the code was moved to *before*
the "if"/"else if" tree.

Signed-off-by: Nikolay Yakimov &lt;root@livid.pp.ru&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbcore: Select only first configuration for non-UAC3 compliant devices</title>
<updated>2019-01-07T16:23:30+00:00</updated>
<author>
<name>Saranya Gopal</name>
<email>saranya.gopal@intel.com</email>
</author>
<published>2019-01-06T02:44:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff2a8c532c14fd22fb26a36574d9ff199afbbe54'/>
<id>urn:sha1:ff2a8c532c14fd22fb26a36574d9ff199afbbe54</id>
<content type='text'>
In most of the UAC1 and UAC2 audio devices, the first
configuration is most often the best configuration.
However, with recent patch to support UAC3 configuration,
second configuration was unintentionally chosen for
some of the UAC1/2 devices that had more than one
configuration. This was because of the existing check
after the audio config check which selected any config
which had a non-vendor class. This patch fixes this issue.

Fixes: f13912d3f014 ("usbcore: Select UAC3 configuration for audio if present")
Reported-by: Con Kolivas &lt;kernel@kolivas.org&gt;
Signed-off-by: Saranya Gopal &lt;saranya.gopal@intel.com&gt;
Tested-by: Con Kolivas &lt;kernel@kolivas.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbcore: Select UAC3 configuration for audio if present</title>
<updated>2018-09-20T11:12:05+00:00</updated>
<author>
<name>Saranya Gopal</name>
<email>saranya.gopal@intel.com</email>
</author>
<published>2018-09-12T03:16:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f13912d3f014a7f2fa5c35d25ee8c3f96bda6272'/>
<id>urn:sha1:f13912d3f014a7f2fa5c35d25ee8c3f96bda6272</id>
<content type='text'>
USB audio class 3.0 specification introduced many significant
changes like
 - new power domains, support for LPM/L1
 - new cluster descriptor
 - new high capability and class-specific string descriptors
 - BADD profiles
 - ... and many other things (check spec from link below:
http://www.usb.org/developers/docs/devclass_docs/USB_Audio_v3.0.zip)

Now that UAC3 is supported in linux, choose UAC3
configuration for audio if the device supports it.
Selecting this configuration will enable the system to
save power by leveraging the new power domains and LPM L1
capability and also support new codec types and data formats
for consumer audio applications.

Signed-off-by: Saranya Gopal &lt;saranya.gopal@intel.com&gt;
Reviewed-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
