Skip to content

Commit 8c53a7b

Browse files
diandersdavem330
authored andcommitted
r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1()
Delay loops in r8152 should break out if RTL8152_INACCESSIBLE is set so that they don't delay too long if the device becomes inaccessible. Add the break to the loop in r8153_pre_firmware_1(). Fixes: 9370f2d ("r8152: support request_firmware for RTL8153") Reviewed-by: Grant Grundler <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Acked-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8a67b47 commit 8c53a7b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/usb/r8152.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5645,6 +5645,8 @@ static int r8153_pre_firmware_1(struct r8152 *tp)
56455645
for (i = 0; i < 104; i++) {
56465646
u32 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_WDT1_CTRL);
56475647

5648+
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
5649+
return -ENODEV;
56485650
if (!(ocp_data & WTD1_EN))
56495651
break;
56505652
usleep_range(1000, 2000);

0 commit comments

Comments
 (0)