Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4763e96 authored by Jan Dumon's avatar Jan Dumon Committed by David S. Miller
Browse files

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: default avatarJan Dumon <j.dumon@option.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d9ced80d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1915,7 +1915,8 @@ 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]) {
@@ -1923,10 +1924,9 @@ static void intr_callback(struct urb *urb)
						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);
			}