<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/usb/core, branch v3.12-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>usbcore: fix incorrect type in assignment in descriptors_changed()</title>
<updated>2013-08-31T01:50:43+00:00</updated>
<author>
<name>Xenia Ragiadakou</name>
<email>burzalodowa@gmail.com</email>
</author>
<published>2013-08-31T01:40:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b9a1048137f4ae43ee90f61a3f34f0efe863cfeb'/>
<id>b9a1048137f4ae43ee90f61a3f34f0efe863cfeb</id>
<content type='text'>
This patch fixes the incorrect assignment of a variable with type 'le16'
to a variable with type 'unsigned int'.

Signed-off-by: Xenia Ragiadakou &lt;burzalodowa@gmail.com&gt;
Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&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 patch fixes the incorrect assignment of a variable with type 'le16'
to a variable with type 'unsigned int'.

Signed-off-by: Xenia Ragiadakou &lt;burzalodowa@gmail.com&gt;
Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usbcore: compare and release one bos descriptor in usb_reset_and_verify_device()</title>
<updated>2013-08-30T19:02:08+00:00</updated>
<author>
<name>Xenia Ragiadakou</name>
<email>burzalodowa@gmail.com</email>
</author>
<published>2013-08-29T18:45:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e3376d6c87eea09bd65ece6073f6e5d47aa560a3'/>
<id>e3376d6c87eea09bd65ece6073f6e5d47aa560a3</id>
<content type='text'>
In usb_reset_and_verify_device(), hub_port_init() allocates a new bos
descriptor to hold the value read by the device. The new bos descriptor
has to be compared with the old one in order to figure out if device 's
firmware has changed in which case the device has to be reenumerated.
In the original code, none of the two descriptors was deallocated leading
to memory leaks.

This patch compares the old bos descriptor with the new one to detect change
in firmware and releases the newly allocated bos descriptor to prevent memory
leak.

Signed-off-by: Xenia Ragiadakou &lt;burzalodowa@gmail.com&gt;
Reported-by: Martin MOKREJS &lt;mmokrejs@gmail.com&gt;
Tested-by: Martin MOKREJS &lt;mmokrejs@gmail.com&gt;
Suggested-by: Alan Stern &lt;stern@rowland.harvard.edu&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>
In usb_reset_and_verify_device(), hub_port_init() allocates a new bos
descriptor to hold the value read by the device. The new bos descriptor
has to be compared with the old one in order to figure out if device 's
firmware has changed in which case the device has to be reenumerated.
In the original code, none of the two descriptors was deallocated leading
to memory leaks.

This patch compares the old bos descriptor with the new one to detect change
in firmware and releases the newly allocated bos descriptor to prevent memory
leak.

Signed-off-by: Xenia Ragiadakou &lt;burzalodowa@gmail.com&gt;
Reported-by: Martin MOKREJS &lt;mmokrejs@gmail.com&gt;
Tested-by: Martin MOKREJS &lt;mmokrejs@gmail.com&gt;
Suggested-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: core: be specific about attribute permissions</title>
<updated>2013-08-25T22:12:03+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-08-23T23:05:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d03f254f2ee2a708af9a7347402d9aed7f6cc4c1'/>
<id>d03f254f2ee2a708af9a7347402d9aed7f6cc4c1</id>
<content type='text'>
Instead of having to audit all sysfs attributes, to ensure we get them
right, use the default macros the driver core provides us (read-only,
read-write) to make the code simpler, and to prevent any mistakes from
ever happening.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of having to audit all sysfs attributes, to ensure we get them
right, use the default macros the driver core provides us (read-only,
read-write) to make the code simpler, and to prevent any mistakes from
ever happening.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: core: use DRIVER_ATTR_RW()</title>
<updated>2013-08-23T22:12:14+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-08-23T22:12:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=598d03610a0169eb88d2b08d6743be31b3b9c258'/>
<id>598d03610a0169eb88d2b08d6743be31b3b9c258</id>
<content type='text'>
Use DRIVER_ATTR_RW() to make it easier to audit sysfs file permissions.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use DRIVER_ATTR_RW() to make it easier to audit sysfs file permissions.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: don't use bNbrPorts after initialization</title>
<updated>2013-08-23T17:47:17+00:00</updated>
<author>
<name>Krzysztof Mazur</name>
<email>krzysiek@podlesie.net</email>
</author>
<published>2013-08-22T12:49:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3bbc47d8b07abad56780a8e214520259808c4f8b'/>
<id>3bbc47d8b07abad56780a8e214520259808c4f8b</id>
<content type='text'>
After successful initialization hub-&gt;descriptor-&gt;bNbrPorts and
hub-&gt;hdev-&gt;maxchild are equal, but using hub-&gt;hdev-&gt;maxchild is
preferred because that value is explicitly used for initialization
of hub-&gt;ports[].

Signed-off-by: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&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>
After successful initialization hub-&gt;descriptor-&gt;bNbrPorts and
hub-&gt;hdev-&gt;maxchild are equal, but using hub-&gt;hdev-&gt;maxchild is
preferred because that value is explicitly used for initialization
of hub-&gt;ports[].

Signed-off-by: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: fail on usb_hub_create_port_device() errors</title>
<updated>2013-08-23T17:47:17+00:00</updated>
<author>
<name>Krzysztof Mazur</name>
<email>krzysiek@podlesie.net</email>
</author>
<published>2013-08-22T12:49:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e58547eb9561a8a72d46e2d411090a614d33ac0e'/>
<id>e58547eb9561a8a72d46e2d411090a614d33ac0e</id>
<content type='text'>
Ignoring usb_hub_create_port_device() errors cause later NULL pointer
deference when uninitialized hub-&gt;ports[i] entries are dereferenced
after port memory allocation error.

Signed-off-by: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&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>
Ignoring usb_hub_create_port_device() errors cause later NULL pointer
deference when uninitialized hub-&gt;ports[i] entries are dereferenced
after port memory allocation error.

Signed-off-by: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: fix cleanup after failure in hub_configure()</title>
<updated>2013-08-23T17:46:03+00:00</updated>
<author>
<name>Krzysztof Mazur</name>
<email>krzysiek@podlesie.net</email>
</author>
<published>2013-08-22T12:49:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d0308d4b6b02597f39fc31a9bddf7bb3faad5622'/>
<id>d0308d4b6b02597f39fc31a9bddf7bb3faad5622</id>
<content type='text'>
If the hub_configure() fails after setting the hdev-&gt;maxchild
the hub-&gt;ports might be NULL or point to uninitialized kzallocated
memory causing NULL pointer dereference in hub_quiesce() during cleanup.

Now after such error the hdev-&gt;maxchild is set to 0 to avoid cleanup
of uninitialized ports.

Signed-off-by: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&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>
If the hub_configure() fails after setting the hdev-&gt;maxchild
the hub-&gt;ports might be NULL or point to uninitialized kzallocated
memory causing NULL pointer dereference in hub_quiesce() during cleanup.

Now after such error the hdev-&gt;maxchild is set to 0 to avoid cleanup
of uninitialized ports.

Signed-off-by: Krzysztof Mazur &lt;krzysiek@podlesie.net&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'for-usb-2013-08-15-step-1' into for-usb-next</title>
<updated>2013-08-16T01:00:46+00:00</updated>
<author>
<name>Sarah Sharp</name>
<email>sarah.a.sharp@linux.intel.com</email>
</author>
<published>2013-08-16T01:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5845c13a70b40f1ce4dfe83acb7796bed8a60672'/>
<id>5845c13a70b40f1ce4dfe83acb7796bed8a60672</id>
<content type='text'>
xhci: Step 1 to fix usb-linus and usb-next.

Hi Greg,

This is the first of three steps to fix your usb-linus and usb-next
trees.  As I mentioned, commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66
"USB: handle LPM errors during device suspend correctly" was incorrectly
added to usb-next when it should have been added to usb-linus and marked
for stable.

Two port power off bug fixes touch the same code that patch touches, but
it's not easy to simply move commit 4fae6f0f patch to usb-linus because
commit 28e861658e23ca94692f98e245d254c75c8088a7 "USB: refactor code for
enabling/disabling remote wakeup" also touched those code sections.

I propose a two step process to fix this:

1. Pull these four patches into usb-linus.

2. Revert commit 28e861658e23ca94692f98e245d254c75c8088a7 from usb-next.
   Merge usb-linus into usb-next, and resolve the conflicts.

I will be sending pull requests for these steps.

This pull request is step one, and contains the backported version of
commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66, the two port power off
fixes, and an unrelated xhci-plat bug fix.

Sarah Sharp

Resolved conflicts:
	drivers/usb/core/hub.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
xhci: Step 1 to fix usb-linus and usb-next.

Hi Greg,

This is the first of three steps to fix your usb-linus and usb-next
trees.  As I mentioned, commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66
"USB: handle LPM errors during device suspend correctly" was incorrectly
added to usb-next when it should have been added to usb-linus and marked
for stable.

Two port power off bug fixes touch the same code that patch touches, but
it's not easy to simply move commit 4fae6f0f patch to usb-linus because
commit 28e861658e23ca94692f98e245d254c75c8088a7 "USB: refactor code for
enabling/disabling remote wakeup" also touched those code sections.

I propose a two step process to fix this:

1. Pull these four patches into usb-linus.

2. Revert commit 28e861658e23ca94692f98e245d254c75c8088a7 from usb-next.
   Merge usb-linus into usb-next, and resolve the conflicts.

I will be sending pull requests for these steps.

This pull request is step one, and contains the backported version of
commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66, the two port power off
fixes, and an unrelated xhci-plat bug fix.

Sarah Sharp

Resolved conflicts:
	drivers/usb/core/hub.c
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: Don't fail port power resume on device disconnect.</title>
<updated>2013-08-15T17:52:35+00:00</updated>
<author>
<name>Sarah Sharp</name>
<email>sarah.a.sharp@linux.intel.com</email>
</author>
<published>2013-08-06T01:58:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d49dad3e11638f66be4e16573ffaa8c46a09e3b3'/>
<id>d49dad3e11638f66be4e16573ffaa8c46a09e3b3</id>
<content type='text'>
Userspace can tell the kernel to power off any USB port, including ones
that are visible and connectible to users.  When an attached USB device
goes into suspend, the port will be powered off if the
pm_qos_no_port_poweroff file for its port is set to 0, the device does
not have remote wakeup enabled, and the device is marked as persistent.

If the user disconnects the USB device while the port is powered off,
the current code does not handle that properly.  If you disconnect a
device, and then run `lsusb -v -s` for the device, the device disconnect
does not get handled by the USB core.  The runtime resume of the port
fails, because hub_port_debounce_be_connected() returns -ETIMEDOUT.

This means the port resume fails and khubd doesn't handle the USB device
disconnect.  This leaves the device listed in lsusb, and the port's
runtime_status will be permanently marked as "error".

Fix this by ignoring the return value of hub_port_debounce_be_connected.
Users can disconnect USB devices while the ports are powered off, and we
must be able to handle that.

This patch should be backported to kernels as old as 3.9, that
contain the commit ad493e5e580546e6c3024b76a41535476da1546a "usb: add
usb port auto power off mechanism"

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Cc: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Userspace can tell the kernel to power off any USB port, including ones
that are visible and connectible to users.  When an attached USB device
goes into suspend, the port will be powered off if the
pm_qos_no_port_poweroff file for its port is set to 0, the device does
not have remote wakeup enabled, and the device is marked as persistent.

If the user disconnects the USB device while the port is powered off,
the current code does not handle that properly.  If you disconnect a
device, and then run `lsusb -v -s` for the device, the device disconnect
does not get handled by the USB core.  The runtime resume of the port
fails, because hub_port_debounce_be_connected() returns -ETIMEDOUT.

This means the port resume fails and khubd doesn't handle the USB device
disconnect.  This leaves the device listed in lsusb, and the port's
runtime_status will be permanently marked as "error".

Fix this by ignoring the return value of hub_port_debounce_be_connected.
Users can disconnect USB devices while the ports are powered off, and we
must be able to handle that.

This patch should be backported to kernels as old as 3.9, that
contain the commit ad493e5e580546e6c3024b76a41535476da1546a "usb: add
usb port auto power off mechanism"

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Cc: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend()</title>
<updated>2013-08-15T17:52:33+00:00</updated>
<author>
<name>Lan Tianyu</name>
<email>tianyu.lan@intel.com</email>
</author>
<published>2013-07-03T14:17:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=98a4f1ff7bea8002ab79d6776e30d27932e88244'/>
<id>98a4f1ff7bea8002ab79d6776e30d27932e88244</id>
<content type='text'>
The pm qos NO_POWER_OFF flag is checked twice during usb device suspend
to see if the usb port power off condition is met. This is redundant and
also will prevent the port from being powered off if the NO_POWER_OFF
flag is changed to 1 from 0 after the device was already suspended.

More detail in the following link.
	http://marc.info/?l=linux-usb&amp;m=136543949130865&amp;w=2

This patch should be backported to kernels as old as 3.7, that
contain the commit f7ac7787ad361e31a7972e2854ed8dc2eedfac3b "usb/acpi:
Use ACPI methods to power off ports."

Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Cc: stable@vger.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The pm qos NO_POWER_OFF flag is checked twice during usb device suspend
to see if the usb port power off condition is met. This is redundant and
also will prevent the port from being powered off if the NO_POWER_OFF
flag is changed to 1 from 0 after the device was already suspended.

More detail in the following link.
	http://marc.info/?l=linux-usb&amp;m=136543949130865&amp;w=2

This patch should be backported to kernels as old as 3.7, that
contain the commit f7ac7787ad361e31a7972e2854ed8dc2eedfac3b "usb/acpi:
Use ACPI methods to power off ports."

Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Cc: stable@vger.kernel.org
</pre>
</div>
</content>
</entry>
</feed>
