Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash()

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
r8156b_wait_loading_flash().

Fixes: 195aae321c82 ("r8152: support new chips")
Reviewed-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Douglas Anderson and committed by
David S. Miller
8a67b47f 32a574c7

+2
+2
drivers/net/usb/r8152.c
··· 5521 5521 int i; 5522 5522 5523 5523 for (i = 0; i < 100; i++) { 5524 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 5525 + break; 5524 5526 if (ocp_read_word(tp, MCU_TYPE_USB, USB_GPHY_CTRL) & GPHY_PATCH_DONE) 5525 5527 break; 5526 5528 usleep_range(1000, 2000);