<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/usb/class, branch v4.19-rc4</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Revert "cdc-acm: implement put_char() and flush_chars()"</title>
<updated>2018-09-10T18:40:29+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2018-09-05T15:56:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=df3aa13c7bbb307e172c37f193f9a7aa058d4739'/>
<id>df3aa13c7bbb307e172c37f193f9a7aa058d4739</id>
<content type='text'>
This reverts commit a81cf9799ad7299b03a4dff020d9685f9ac5f3e0.

The patch causes a regression, which I cannot find the reason for.
So let's revert for now, as a revert hurts only performance.

Original report:
I was trying to resolve the problem with Oliver but we don't get any conclusion
for 5 months, so I am now sending this to mail list and cdc_acm authors.

I am using simple request-response protocol to obtain the boiller parameters
in constant intervals.

A simple one transaction is:
1. opening the /dev/ttyACM0
2. sending the following 10-bytes request to the device:
   unsigned char req[] = {0x02, 0xfe, 0x01, 0x05, 0x08, 0x02, 0x01, 0x69, 0xab, 0x03};
3. reading response (frame of 74 bytes length).
4. closing the descriptor
I am doing this transaction with 5 seconds intervals.

Before the bad commit everything was working correctly: I've got a requests and
a responses in a timely manner.

After the bad commit more time I am using the kernel module, more problems I have.
The graph [2] is showing the problem.

As you can see after module load all seems fine but after about 30 minutes I've got
a plenty of EAGAINs when doing read()'s and trying to read back the data.

When I rmmod and insmod the cdc_acm module again, then the situation is starting
over again: running ok shortly after load, and more time it is running, more EAGAINs
I have when calling read().

As a bonus I can see the problem on the device itself:
The device is configured as you can see here on this screen [3].
It has two transmision LEDs: TX and RX. Blink duration is set for 100ms.
This is a recording before the bad commit when all is working fine: [4]
And this is with the bad commit: [5]
As you can see the TX led is blinking wrongly long (indicating transmission?)
and I have problems doing read() calls (EAGAIN).

Reported-by: Mariusz Bialonczyk &lt;manio@skyboo.net&gt;
Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Fixes: a81cf9799ad7 ("cdc-acm: implement put_char() and flush_chars()")
Cc: stable &lt;stable@vger.kernel.org&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 reverts commit a81cf9799ad7299b03a4dff020d9685f9ac5f3e0.

The patch causes a regression, which I cannot find the reason for.
So let's revert for now, as a revert hurts only performance.

Original report:
I was trying to resolve the problem with Oliver but we don't get any conclusion
for 5 months, so I am now sending this to mail list and cdc_acm authors.

I am using simple request-response protocol to obtain the boiller parameters
in constant intervals.

A simple one transaction is:
1. opening the /dev/ttyACM0
2. sending the following 10-bytes request to the device:
   unsigned char req[] = {0x02, 0xfe, 0x01, 0x05, 0x08, 0x02, 0x01, 0x69, 0xab, 0x03};
3. reading response (frame of 74 bytes length).
4. closing the descriptor
I am doing this transaction with 5 seconds intervals.

Before the bad commit everything was working correctly: I've got a requests and
a responses in a timely manner.

After the bad commit more time I am using the kernel module, more problems I have.
The graph [2] is showing the problem.

As you can see after module load all seems fine but after about 30 minutes I've got
a plenty of EAGAINs when doing read()'s and trying to read back the data.

When I rmmod and insmod the cdc_acm module again, then the situation is starting
over again: running ok shortly after load, and more time it is running, more EAGAINs
I have when calling read().

As a bonus I can see the problem on the device itself:
The device is configured as you can see here on this screen [3].
It has two transmision LEDs: TX and RX. Blink duration is set for 100ms.
This is a recording before the bad commit when all is working fine: [4]
And this is with the bad commit: [5]
As you can see the TX led is blinking wrongly long (indicating transmission?)
and I have problems doing read() calls (EAGAIN).

Reported-by: Mariusz Bialonczyk &lt;manio@skyboo.net&gt;
Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Fixes: a81cf9799ad7 ("cdc-acm: implement put_char() and flush_chars()")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()</title>
<updated>2018-09-05T12:48:40+00:00</updated>
<author>
<name>Jia-Ju Bai</name>
<email>baijiaju1990@gmail.com</email>
</author>
<published>2018-09-01T08:12:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6e22e3af7bb3a7b9dc53cb4687659f6e63fca427'/>
<id>6e22e3af7bb3a7b9dc53cb4687659f6e63fca427</id>
<content type='text'>
wdm_in_callback() is a completion handler function for the USB driver.
So it should not sleep. But it calls service_outstanding_interrupt(),
which calls usb_submit_urb() with GFP_KERNEL.

To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;
Cc: stable &lt;stable@vger.kernel.org&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>
wdm_in_callback() is a completion handler function for the USB driver.
So it should not sleep. But it calls service_outstanding_interrupt(),
which calls usb_submit_urb() with GFP_KERNEL.

To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai &lt;baijiaju1990@gmail.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 4.18-rc7 into usb-next</title>
<updated>2018-07-30T08:04:58+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2018-07-30T08:04:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8a7b5d0f75f757fa88b0d17c19523161b27b8e80'/>
<id>8a7b5d0f75f757fa88b0d17c19523161b27b8e80</id>
<content type='text'>
We want the USB fixes in here as well to handle merge issues.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want the USB fixes in here as well to handle merge issues.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtmc: Add support for 32 bit compat applications</title>
<updated>2018-07-24T11:50:50+00:00</updated>
<author>
<name>Guido Kiener</name>
<email>guido@kiener-muenchen.de</email>
</author>
<published>2018-07-24T09:05:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=60207c8ef2a3a971567dd1207daa234aaa856faa'/>
<id>60207c8ef2a3a971567dd1207daa234aaa856faa</id>
<content type='text'>
32 bit applications can only call ioctl functions on 64 bit systems
when the field .compat_ioctl is defined for file operations.

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.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>
32 bit applications can only call ioctl functions on 64 bit systems
when the field .compat_ioctl is defined for file operations.

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtmc: Add ioctl for termination character</title>
<updated>2018-07-21T06:22:15+00:00</updated>
<author>
<name>Guido Kiener</name>
<email>guido@kiener-muenchen.de</email>
</author>
<published>2018-07-18T08:45:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=12dcaeb77e67c1162a2604f6b589266baec2d1ef'/>
<id>12dcaeb77e67c1162a2604f6b589266baec2d1ef</id>
<content type='text'>
add USBTMC_IOCTL_CONFIG_TERMCHAR to control TermChar handling
for next read(). Controls field 'TermChar' and Bit 1 of field
'bmTransferAttributes' of REQUEST_DEV_DEP_MSG_IN BULK-OUT header.

Allows enabling/disabling of terminating a read on reception of
term_char individually for each read request.

Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.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>
add USBTMC_IOCTL_CONFIG_TERMCHAR to control TermChar handling
for next read(). Controls field 'TermChar' and Bit 1 of field
'bmTransferAttributes' of REQUEST_DEV_DEP_MSG_IN BULK-OUT header.

Allows enabling/disabling of terminating a read on reception of
term_char individually for each read request.

Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtmc: Add ioctl for EOM bit</title>
<updated>2018-07-21T06:22:15+00:00</updated>
<author>
<name>Guido Kiener</name>
<email>guido@kiener-muenchen.de</email>
</author>
<published>2018-07-18T08:45:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fbd83971f9429849dd3a105b663822d15b7b992b'/>
<id>fbd83971f9429849dd3a105b663822d15b7b992b</id>
<content type='text'>
add USBTMC_IOCTL_EOM_ENABLE to specify EOM bit for next write()
call. Sets Bit 0 of field 'bmTransferAttributes' of DEV_DEP_MSG_OUT
Bulk-OUT Header.
Allows fine grained control over end of message handling on a
per file descriptor basis.

Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.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>
add USBTMC_IOCTL_EOM_ENABLE to specify EOM bit for next write()
call. Sets Bit 0 of field 'bmTransferAttributes' of DEV_DEP_MSG_OUT
Bulk-OUT Header.
Allows fine grained control over end of message handling on a
per file descriptor basis.

Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtmc: Add ioctl for trigger</title>
<updated>2018-07-21T06:22:15+00:00</updated>
<author>
<name>Guido Kiener</name>
<email>guido@kiener-muenchen.de</email>
</author>
<published>2018-07-18T08:45:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fe78a7c637057070f20ac9460608a18d775e6349'/>
<id>fe78a7c637057070f20ac9460608a18d775e6349</id>
<content type='text'>
add USBTMC488_IOCTL_TRIGGER to send TRIGGER Bulk-OUT header
according to Subclass USB488 Specification

The usbtmc trigger command is equivalent to the IEEE 488 GET (Group
Execute Trigger) action. While the "*TRG" command can be sent as
data to perform the same operation, in some situations an instrument
will be busy and unable to process the data immediately in which
case the USBTMC488_IOCTL_TRIGGER can be used to trigger the
instrument with lower latency.

Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.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>
add USBTMC488_IOCTL_TRIGGER to send TRIGGER Bulk-OUT header
according to Subclass USB488 Specification

The usbtmc trigger command is equivalent to the IEEE 488 GET (Group
Execute Trigger) action. While the "*TRG" command can be sent as
data to perform the same operation, in some situations an instrument
will be busy and unable to process the data immediately in which
case the USBTMC488_IOCTL_TRIGGER can be used to trigger the
instrument with lower latency.

Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtmc: Add ioctls to set/get usb timeout</title>
<updated>2018-07-21T06:22:15+00:00</updated>
<author>
<name>Guido Kiener</name>
<email>guido@kiener-muenchen.de</email>
</author>
<published>2018-07-18T08:45:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=048c6d88a0214757926f264823829e79154fcd4f'/>
<id>048c6d88a0214757926f264823829e79154fcd4f</id>
<content type='text'>
Add ioctls USBTMC_IOCTL_GET_TIMEOUT / USBTMC_IOCTL_SET_TIMEOUT to
get/set I/O timeout for specific file handle.

Different operations on an instrument can take different lengths of
time thus it is important to be able to set the timeout slightly
longer than the expected duration of each operation to optimise the
responsiveness of the application. As the instrument may be shared by
multiple applications the timeout should be settable on a per file
descriptor basis.

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.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>
Add ioctls USBTMC_IOCTL_GET_TIMEOUT / USBTMC_IOCTL_SET_TIMEOUT to
get/set I/O timeout for specific file handle.

Different operations on an instrument can take different lengths of
time thus it is important to be able to set the timeout slightly
longer than the expected duration of each operation to optimise the
responsiveness of the application. As the instrument may be shared by
multiple applications the timeout should be settable on a per file
descriptor basis.

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtmc: use consistent timeout error</title>
<updated>2018-07-21T06:22:15+00:00</updated>
<author>
<name>Guido Kiener</name>
<email>guido@kiener-muenchen.de</email>
</author>
<published>2018-07-18T08:45:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=19e6c57e96169cb3275fd40b7898454560b9ebba'/>
<id>19e6c57e96169cb3275fd40b7898454560b9ebba</id>
<content type='text'>
- use consistent error value ETIMEOUT instead of ETIME

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.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>
- use consistent error value ETIMEOUT instead of ETIME

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtmc: Support Read Status Byte with SRQ per file</title>
<updated>2018-07-21T06:22:15+00:00</updated>
<author>
<name>Guido Kiener</name>
<email>guido@kiener-muenchen.de</email>
</author>
<published>2018-07-18T08:45:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4f3c8d6eddc272b386464524235440a418ed2029'/>
<id>4f3c8d6eddc272b386464524235440a418ed2029</id>
<content type='text'>
Add 'struct usbtmc_file_data' for each file handle to cache last
srq_byte (=Status Byte with SRQ) received by usbtmc_interrupt(..)

usbtmc488_ioctl_read_stb returns cached srq_byte when available for
each file handle to avoid race conditions of concurrent applications.

SRQ now sets EPOLLPRI instead of EPOLLIN since EPOLLIN is now reserved
for asynchronous reads

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.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>
Add 'struct usbtmc_file_data' for each file handle to cache last
srq_byte (=Status Byte with SRQ) received by usbtmc_interrupt(..)

usbtmc488_ioctl_read_stb returns cached srq_byte when available for
each file handle to avoid race conditions of concurrent applications.

SRQ now sets EPOLLPRI instead of EPOLLIN since EPOLLIN is now reserved
for asynchronous reads

Tested-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Reviewed-by: Steve Bayless &lt;steve_bayless@keysight.com&gt;
Signed-off-by: Guido Kiener &lt;guido.kiener@rohde-schwarz.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
