Commit 8c53a7bd authored by Douglas Anderson's avatar Douglas Anderson Committed by David S. Miller
Browse files

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: 9370f2d0 ("r8152: support request_firmware for RTL8153")
Reviewed-by: default avatarGrant Grundler <grundler@chromium.org>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Acked-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a67b47f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5645,6 +5645,8 @@ static int r8153_pre_firmware_1(struct r8152 *tp)
	for (i = 0; i < 104; i++) {
		u32 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_WDT1_CTRL);

		if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
			return -ENODEV;
		if (!(ocp_data & WTD1_EN))
			break;
		usleep_range(1000, 2000);