<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/net/usb/hso.c, branch v4.2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-03-04T02:16:48+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-03-04T02:16:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=71a83a6db6138b9d41d8a0b6b91cb59f6dc4742c'/>
<id>71a83a6db6138b9d41d8a0b6b91cb59f6dc4742c</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/rocker/rocker.c

The rocker commit was two overlapping changes, one to rename
the -&gt;vport member to -&gt;pport, and another making the bitmask
expression use '1ULL' instead of plain '1'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/net/ethernet/rocker/rocker.c

The rocker commit was two overlapping changes, one to rename
the -&gt;vport member to -&gt;pport, and another making the bitmask
expression use '1ULL' instead of plain '1'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: replace current-&gt;state by __set_current_state()</title>
<updated>2015-02-22T20:24:10+00:00</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2015-02-20T18:12:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=50462ce0052c67b5a06f19fb7c7f308813006879'/>
<id>50462ce0052c67b5a06f19fb7c7f308813006879</id>
<content type='text'>
Use helper functions to access current-&gt;state.
Direct assignments are prone to races and therefore buggy.

Thanks to Peter Zijlstra for the exact definition of the problem.

Suggested-By: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use helper functions to access current-&gt;state.
Direct assignments are prone to races and therefore buggy.

Thanks to Peter Zijlstra for the exact definition of the problem.

Suggested-By: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: always read interface number from the current altsetting</title>
<updated>2015-02-20T20:21:31+00:00</updated>
<author>
<name>Aleksander Morgado</name>
<email>aleksander@aleksander.es</email>
</author>
<published>2015-02-17T10:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=64bea46e3ff28701aa34be48b93c7907ebbdb31e'/>
<id>64bea46e3ff28701aa34be48b93c7907ebbdb31e</id>
<content type='text'>
Always read bInterfaceNumber from the current altsetting, not from the first one
available in the altsetting array. This is coming from code review, not related
to any specific bug.

Signed-off-by: Aleksander Morgado &lt;aleksander@aleksander.es&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Always read bInterfaceNumber from the current altsetting, not from the first one
available in the altsetting array. This is coming from code review, not related
to any specific bug.

Signed-off-by: Aleksander Morgado &lt;aleksander@aleksander.es&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: fix rx parsing logic when skb allocation fails</title>
<updated>2015-02-13T15:17:05+00:00</updated>
<author>
<name>Aleksander Morgado</name>
<email>aleksander@aleksander.es</email>
</author>
<published>2015-02-13T13:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0416605548766782acee60701b5c712e9b9e1bc2'/>
<id>0416605548766782acee60701b5c712e9b9e1bc2</id>
<content type='text'>
If skb allocation fails once the IP header has been received, the rx state is
being set to WAIT_SYNC. The logic, though, shouldn't directly return, as the
buffer may contain a full packet, and therefore the WAIT_SYNC state needs to be
processed (resetting state to WAIT_IP, clearing rx_buf_size and re-initializing
rx_buf_missing).

So, just let the while loop continue so that in the next iteration the WAIT_SYNC
state cleanly stops the loop. The WAIT_SYNC processing will be done just after
that, only if the end of packet is flagged.

Signed-off-by: Aleksander Morgado &lt;aleksander@aleksander.es&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If skb allocation fails once the IP header has been received, the rx state is
being set to WAIT_SYNC. The logic, though, shouldn't directly return, as the
buffer may contain a full packet, and therefore the WAIT_SYNC state needs to be
processed (resetting state to WAIT_IP, clearing rx_buf_size and re-initializing
rx_buf_missing).

So, just let the while loop continue so that in the next iteration the WAIT_SYNC
state cleanly stops the loop. The WAIT_SYNC processing will be done just after
that, only if the end of packet is flagged.

Signed-off-by: Aleksander Morgado &lt;aleksander@aleksander.es&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: Use static attribute groups for sysfs entry</title>
<updated>2015-02-05T23:51:38+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-02-05T10:15:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4134069f3ea6cd96903e426bd3dfb9bb44165357'/>
<id>4134069f3ea6cd96903e426bd3dfb9bb44165357</id>
<content type='text'>
Pass the static attribute groups and the driver data via
tty_port_register_device_attr() instead of manual device_create_file()
and device_remove_file() calls.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pass the static attribute groups and the driver data via
tty_port_register_device_attr() instead of manual device_create_file()
and device_remove_file() calls.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: fix rfkill name conflicts</title>
<updated>2015-02-01T20:33:27+00:00</updated>
<author>
<name>Olivier Sobrie</name>
<email>olivier@sobrie.be</email>
</author>
<published>2015-01-30T12:22:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=38121067b10268385ca00978d1c1a241cd5eadfb'/>
<id>38121067b10268385ca00978d1c1a241cd5eadfb</id>
<content type='text'>
By using only the usb interface number for the rfkill name, we might
have a name conflicts in case two similar hso devices are connected.

In this patch, the name of the hso rfkill interface embed the value
of a counter that is incremented each time a new rfkill interface is
added.

Suggested-by: Dan Williams &lt;dcbw@redhat.com&gt;
Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By using only the usb interface number for the rfkill name, we might
have a name conflicts in case two similar hso devices are connected.

In this patch, the name of the hso rfkill interface embed the value
of a counter that is incremented each time a new rfkill interface is
added.

Suggested-by: Dan Williams &lt;dcbw@redhat.com&gt;
Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: add missing cancel_work_sync in disconnect()</title>
<updated>2015-02-01T20:33:27+00:00</updated>
<author>
<name>Olivier Sobrie</name>
<email>olivier@sobrie.be</email>
</author>
<published>2015-01-30T12:22:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cc491970f5cef560b9e5bf037f0c9dd1e4d6a4bd'/>
<id>cc491970f5cef560b9e5bf037f0c9dd1e4d6a4bd</id>
<content type='text'>
For hso serial devices, two cancel_work_sync were missing in the
disconnect method.

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For hso serial devices, two cancel_work_sync were missing in the
disconnect method.

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: update serial_table in usb disconnect method</title>
<updated>2015-02-01T20:33:27+00:00</updated>
<author>
<name>Olivier Sobrie</name>
<email>olivier@sobrie.be</email>
</author>
<published>2015-01-30T12:22:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=301d3b7e109e28171d99948467448fd12ebfba06'/>
<id>301d3b7e109e28171d99948467448fd12ebfba06</id>
<content type='text'>
The serial_table is used to map the minor number of the usb serial device
to its associated context. The table is updated in the probe method and
in hso_serial_ref_free() which is called either from the tty cleanup
method or from the usb disconnect method.
This patch ensures that the serial_table is updated in the disconnect
method and no more from the cleanup method to avoid the following
potential race condition.

 - hso_disconnect() is called for usb interface "x". Because the serial
   port was open and because the cleanup method of the tty_port hasn't
   been called yet, hso_serial_ref_free() is not run.
 - hso_probe() is called and fails for a new hso serial usb interface
   "y". The function hso_free_interface() is called and iterates
   over the element of serial_table to find the device associated to
   the usb interface context.
   If the usb interface context of usb interface "y" has been created
   at the same place as for usb interface "x", then the cleanup
   functions are called for usb interfaces "x" and "y" and
   hso_serial_ref_free() is called for both interfaces.
 - release_tty() is called for serial port linked to usb interface "x"
   and possibly crash because the tty_port structure contained in the
   hso_device structure has been freed.

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The serial_table is used to map the minor number of the usb serial device
to its associated context. The table is updated in the probe method and
in hso_serial_ref_free() which is called either from the tty cleanup
method or from the usb disconnect method.
This patch ensures that the serial_table is updated in the disconnect
method and no more from the cleanup method to avoid the following
potential race condition.

 - hso_disconnect() is called for usb interface "x". Because the serial
   port was open and because the cleanup method of the tty_port hasn't
   been called yet, hso_serial_ref_free() is not run.
 - hso_probe() is called and fails for a new hso serial usb interface
   "y". The function hso_free_interface() is called and iterates
   over the element of serial_table to find the device associated to
   the usb interface context.
   If the usb interface context of usb interface "y" has been created
   at the same place as for usb interface "x", then the cleanup
   functions are called for usb interfaces "x" and "y" and
   hso_serial_ref_free() is called for both interfaces.
 - release_tty() is called for serial port linked to usb interface "x"
   and possibly crash because the tty_port structure contained in the
   hso_device structure has been freed.

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: move tty_unregister outside hso_serial_common_free()</title>
<updated>2015-02-01T20:33:27+00:00</updated>
<author>
<name>Olivier Sobrie</name>
<email>olivier@sobrie.be</email>
</author>
<published>2015-01-30T12:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=69b377b31be622762ebde5e5e63e8bed2e22bcea'/>
<id>69b377b31be622762ebde5e5e63e8bed2e22bcea</id>
<content type='text'>
The function hso_serial_common_free() is called either by the cleanup
method of the tty or by the usb disconnect method.
In the former case, the usb_disconnect() has been already called
and the sysfs group associated to the device has been removed.
By calling tty_unregister directly from the usb_disconnect() method,
we avoid a warning due to the removal of the sysfs group of the usb
device.

Example of warning:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 778 at fs/sysfs/group.c:225 sysfs_remove_group+0x50/0x94()
sysfs group c0645a88 not found for kobject 'ttyHS5'
Modules linked in:
CPU: 0 PID: 778 Comm: kworker/0:3 Tainted: G        W      3.18.0+ #105
Workqueue: events release_one_tty
[&lt;c000dfe4&gt;] (unwind_backtrace) from [&lt;c000c014&gt;] (show_stack+0x14/0x1c)
[&lt;c000c014&gt;] (show_stack) from [&lt;c0016bac&gt;] (warn_slowpath_common+0x5c/0x7c)
[&lt;c0016bac&gt;] (warn_slowpath_common) from [&lt;c0016c60&gt;] (warn_slowpath_fmt+0x30/0x40)
[&lt;c0016c60&gt;] (warn_slowpath_fmt) from [&lt;c00ddd14&gt;] (sysfs_remove_group+0x50/0x94)
[&lt;c00ddd14&gt;] (sysfs_remove_group) from [&lt;c0221e44&gt;] (device_del+0x30/0x190)
[&lt;c0221e44&gt;] (device_del) from [&lt;c0221fb0&gt;] (device_unregister+0xc/0x18)
[&lt;c0221fb0&gt;] (device_unregister) from [&lt;c0221fec&gt;] (device_destroy+0x30/0x3c)
[&lt;c0221fec&gt;] (device_destroy) from [&lt;c01fe1dc&gt;] (tty_unregister_device+0x2c/0x5c)
[&lt;c01fe1dc&gt;] (tty_unregister_device) from [&lt;c029a428&gt;] (hso_serial_common_free+0x2c/0x88)
[&lt;c029a428&gt;] (hso_serial_common_free) from [&lt;c029a4c0&gt;] (hso_serial_ref_free+0x3c/0xb8)
[&lt;c029a4c0&gt;] (hso_serial_ref_free) from [&lt;c01ff430&gt;] (release_one_tty+0x30/0x84)
[&lt;c01ff430&gt;] (release_one_tty) from [&lt;c00271d4&gt;] (process_one_work+0x21c/0x3c8)
[&lt;c00271d4&gt;] (process_one_work) from [&lt;c0027758&gt;] (worker_thread+0x3d8/0x560)
[&lt;c0027758&gt;] (worker_thread) from [&lt;c002be4c&gt;] (kthread+0xc0/0xcc)
[&lt;c002be4c&gt;] (kthread) from [&lt;c0009630&gt;] (ret_from_fork+0x14/0x24)
---[ end trace cb88537fdc8fa208 ]---

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function hso_serial_common_free() is called either by the cleanup
method of the tty or by the usb disconnect method.
In the former case, the usb_disconnect() has been already called
and the sysfs group associated to the device has been removed.
By calling tty_unregister directly from the usb_disconnect() method,
we avoid a warning due to the removal of the sysfs group of the usb
device.

Example of warning:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 778 at fs/sysfs/group.c:225 sysfs_remove_group+0x50/0x94()
sysfs group c0645a88 not found for kobject 'ttyHS5'
Modules linked in:
CPU: 0 PID: 778 Comm: kworker/0:3 Tainted: G        W      3.18.0+ #105
Workqueue: events release_one_tty
[&lt;c000dfe4&gt;] (unwind_backtrace) from [&lt;c000c014&gt;] (show_stack+0x14/0x1c)
[&lt;c000c014&gt;] (show_stack) from [&lt;c0016bac&gt;] (warn_slowpath_common+0x5c/0x7c)
[&lt;c0016bac&gt;] (warn_slowpath_common) from [&lt;c0016c60&gt;] (warn_slowpath_fmt+0x30/0x40)
[&lt;c0016c60&gt;] (warn_slowpath_fmt) from [&lt;c00ddd14&gt;] (sysfs_remove_group+0x50/0x94)
[&lt;c00ddd14&gt;] (sysfs_remove_group) from [&lt;c0221e44&gt;] (device_del+0x30/0x190)
[&lt;c0221e44&gt;] (device_del) from [&lt;c0221fb0&gt;] (device_unregister+0xc/0x18)
[&lt;c0221fb0&gt;] (device_unregister) from [&lt;c0221fec&gt;] (device_destroy+0x30/0x3c)
[&lt;c0221fec&gt;] (device_destroy) from [&lt;c01fe1dc&gt;] (tty_unregister_device+0x2c/0x5c)
[&lt;c01fe1dc&gt;] (tty_unregister_device) from [&lt;c029a428&gt;] (hso_serial_common_free+0x2c/0x88)
[&lt;c029a428&gt;] (hso_serial_common_free) from [&lt;c029a4c0&gt;] (hso_serial_ref_free+0x3c/0xb8)
[&lt;c029a4c0&gt;] (hso_serial_ref_free) from [&lt;c01ff430&gt;] (release_one_tty+0x30/0x84)
[&lt;c01ff430&gt;] (release_one_tty) from [&lt;c00271d4&gt;] (process_one_work+0x21c/0x3c8)
[&lt;c00271d4&gt;] (process_one_work) from [&lt;c0027758&gt;] (worker_thread+0x3d8/0x560)
[&lt;c0027758&gt;] (worker_thread) from [&lt;c002be4c&gt;] (kthread+0xc0/0xcc)
[&lt;c002be4c&gt;] (kthread) from [&lt;c0009630&gt;] (ret_from_fork+0x14/0x24)
---[ end trace cb88537fdc8fa208 ]---

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hso: replace reset_device work by usb_queue_reset_device()</title>
<updated>2015-02-01T20:33:27+00:00</updated>
<author>
<name>Olivier Sobrie</name>
<email>olivier@sobrie.be</email>
</author>
<published>2015-01-30T12:21:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=26c1f1f544450d850971173725fe2f256ea2508b'/>
<id>26c1f1f544450d850971173725fe2f256ea2508b</id>
<content type='text'>
There is no need for a dedicated reset work in the hso driver since
there is already a reset work foreseen in usb_interface that does
the same.

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no need for a dedicated reset work in the hso driver since
there is already a reset work foreseen in usb_interface that does
the same.

Signed-off-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
