@@ -999,6 +999,7 @@ static void read_bulk_callback(struct urb *urb)
999
999
struct hso_net * odev = urb -> context ;
1000
1000
struct net_device * net ;
1001
1001
int result ;
1002
+ unsigned long flags ;
1002
1003
int status = urb -> status ;
1003
1004
1004
1005
/* is al ok? (Filip: Who's Al ?) */
@@ -1028,11 +1029,11 @@ static void read_bulk_callback(struct urb *urb)
1028
1029
if (urb -> actual_length ) {
1029
1030
/* Handle the IP stream, add header and push it onto network
1030
1031
* stack if the packet is complete. */
1031
- spin_lock (& odev -> net_lock );
1032
+ spin_lock_irqsave (& odev -> net_lock , flags );
1032
1033
packetizeRx (odev , urb -> transfer_buffer , urb -> actual_length ,
1033
1034
(urb -> transfer_buffer_length >
1034
1035
urb -> actual_length ) ? 1 : 0 );
1035
- spin_unlock (& odev -> net_lock );
1036
+ spin_unlock_irqrestore (& odev -> net_lock , flags );
1036
1037
}
1037
1038
1038
1039
/* We are done with this URB, resubmit it. Prep the USB to wait for
@@ -1193,6 +1194,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
1193
1194
{
1194
1195
struct hso_serial * serial = urb -> context ;
1195
1196
int status = urb -> status ;
1197
+ unsigned long flags ;
1196
1198
1197
1199
hso_dbg (0x8 , "--- Got serial_read_bulk callback %02x ---\n" , status );
1198
1200
@@ -1216,10 +1218,10 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
1216
1218
if (serial -> parent -> port_spec & HSO_INFO_CRC_BUG )
1217
1219
fix_crc_bug (urb , serial -> in_endp -> wMaxPacketSize );
1218
1220
/* Valid data, handle RX data */
1219
- spin_lock (& serial -> serial_lock );
1221
+ spin_lock_irqsave (& serial -> serial_lock , flags );
1220
1222
serial -> rx_urb_filled [hso_urb_to_index (serial , urb )] = 1 ;
1221
1223
put_rxbuf_data_and_resubmit_bulk_urb (serial );
1222
- spin_unlock (& serial -> serial_lock );
1224
+ spin_unlock_irqrestore (& serial -> serial_lock , flags );
1223
1225
}
1224
1226
1225
1227
/*
@@ -1502,12 +1504,13 @@ static void tiocmget_intr_callback(struct urb *urb)
1502
1504
DUMP (serial_state_notification ,
1503
1505
sizeof (struct hso_serial_state_notification ));
1504
1506
} else {
1507
+ unsigned long flags ;
1505
1508
1506
1509
UART_state_bitmap = le16_to_cpu (serial_state_notification ->
1507
1510
UART_state_bitmap );
1508
1511
prev_UART_state_bitmap = tiocmget -> prev_UART_state_bitmap ;
1509
1512
icount = & tiocmget -> icount ;
1510
- spin_lock (& serial -> serial_lock );
1513
+ spin_lock_irqsave (& serial -> serial_lock , flags );
1511
1514
if ((UART_state_bitmap & B_OVERRUN ) !=
1512
1515
(prev_UART_state_bitmap & B_OVERRUN ))
1513
1516
icount -> parity ++ ;
@@ -1530,7 +1533,7 @@ static void tiocmget_intr_callback(struct urb *urb)
1530
1533
(prev_UART_state_bitmap & B_RX_CARRIER ))
1531
1534
icount -> dcd ++ ;
1532
1535
tiocmget -> prev_UART_state_bitmap = UART_state_bitmap ;
1533
- spin_unlock (& serial -> serial_lock );
1536
+ spin_unlock_irqrestore (& serial -> serial_lock , flags );
1534
1537
tiocmget -> intr_completed = 1 ;
1535
1538
wake_up_interruptible (& tiocmget -> waitq );
1536
1539
}
@@ -1852,6 +1855,7 @@ static void intr_callback(struct urb *urb)
1852
1855
struct hso_serial * serial ;
1853
1856
unsigned char * port_req ;
1854
1857
int status = urb -> status ;
1858
+ unsigned long flags ;
1855
1859
int i ;
1856
1860
1857
1861
usb_mark_last_busy (urb -> dev );
@@ -1879,7 +1883,7 @@ static void intr_callback(struct urb *urb)
1879
1883
if (serial != NULL ) {
1880
1884
hso_dbg (0x1 , "Pending read interrupt on port %d\n" ,
1881
1885
i );
1882
- spin_lock (& serial -> serial_lock );
1886
+ spin_lock_irqsave (& serial -> serial_lock , flags );
1883
1887
if (serial -> rx_state == RX_IDLE &&
1884
1888
serial -> port .count > 0 ) {
1885
1889
/* Setup and send a ctrl req read on
@@ -1893,7 +1897,8 @@ static void intr_callback(struct urb *urb)
1893
1897
hso_dbg (0x1 , "Already a read pending on port %d or port not open\n" ,
1894
1898
i );
1895
1899
}
1896
- spin_unlock (& serial -> serial_lock );
1900
+ spin_unlock_irqrestore (& serial -> serial_lock ,
1901
+ flags );
1897
1902
}
1898
1903
}
1899
1904
}
@@ -1920,16 +1925,17 @@ static void hso_std_serial_write_bulk_callback(struct urb *urb)
1920
1925
{
1921
1926
struct hso_serial * serial = urb -> context ;
1922
1927
int status = urb -> status ;
1928
+ unsigned long flags ;
1923
1929
1924
1930
/* sanity check */
1925
1931
if (!serial ) {
1926
1932
hso_dbg (0x1 , "serial == NULL\n" );
1927
1933
return ;
1928
1934
}
1929
1935
1930
- spin_lock (& serial -> serial_lock );
1936
+ spin_lock_irqsave (& serial -> serial_lock , flags );
1931
1937
serial -> tx_urb_used = 0 ;
1932
- spin_unlock (& serial -> serial_lock );
1938
+ spin_unlock_irqrestore (& serial -> serial_lock , flags );
1933
1939
if (status ) {
1934
1940
handle_usb_error (status , __func__ , serial -> parent );
1935
1941
return ;
@@ -1971,14 +1977,15 @@ static void ctrl_callback(struct urb *urb)
1971
1977
struct hso_serial * serial = urb -> context ;
1972
1978
struct usb_ctrlrequest * req ;
1973
1979
int status = urb -> status ;
1980
+ unsigned long flags ;
1974
1981
1975
1982
/* sanity check */
1976
1983
if (!serial )
1977
1984
return ;
1978
1985
1979
- spin_lock (& serial -> serial_lock );
1986
+ spin_lock_irqsave (& serial -> serial_lock , flags );
1980
1987
serial -> tx_urb_used = 0 ;
1981
- spin_unlock (& serial -> serial_lock );
1988
+ spin_unlock_irqrestore (& serial -> serial_lock , flags );
1982
1989
if (status ) {
1983
1990
handle_usb_error (status , __func__ , serial -> parent );
1984
1991
return ;
@@ -1994,9 +2001,9 @@ static void ctrl_callback(struct urb *urb)
1994
2001
(USB_DIR_IN | USB_TYPE_OPTION_VENDOR | USB_RECIP_INTERFACE )) {
1995
2002
/* response to a read command */
1996
2003
serial -> rx_urb_filled [0 ] = 1 ;
1997
- spin_lock (& serial -> serial_lock );
2004
+ spin_lock_irqsave (& serial -> serial_lock , flags );
1998
2005
put_rxbuf_data_and_resubmit_ctrl_urb (serial );
1999
- spin_unlock (& serial -> serial_lock );
2006
+ spin_unlock_irqrestore (& serial -> serial_lock , flags );
2000
2007
} else {
2001
2008
hso_put_activity (serial -> parent );
2002
2009
tty_port_tty_wakeup (& serial -> port );
0 commit comments