mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
hso: don't change the state of a closed port
Don't change the state of a port if it's not open. This fixes an issue where a port sometimes has to be opened twice before data can be received. Signed-off-by: Jan Dumon <j.dumon@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d9ced80d10
commit
f4763e96c0
1 changed files with 5 additions and 5 deletions
|
@ -1915,18 +1915,18 @@ static void intr_callback(struct urb *urb)
|
|||
if (serial != NULL) {
|
||||
D1("Pending read interrupt on port %d\n", i);
|
||||
spin_lock(&serial->serial_lock);
|
||||
if (serial->rx_state == RX_IDLE) {
|
||||
if (serial->rx_state == RX_IDLE &&
|
||||
serial->open_count > 0) {
|
||||
/* Setup and send a ctrl req read on
|
||||
* port i */
|
||||
if (!serial->rx_urb_filled[0]) {
|
||||
if (!serial->rx_urb_filled[0]) {
|
||||
serial->rx_state = RX_SENT;
|
||||
hso_mux_serial_read(serial);
|
||||
} else
|
||||
serial->rx_state = RX_PENDING;
|
||||
|
||||
} else {
|
||||
D1("Already pending a read on "
|
||||
"port %d\n", i);
|
||||
D1("Already a read pending on "
|
||||
"port %d or port not open\n", i);
|
||||
}
|
||||
spin_unlock(&serial->serial_lock);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue