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

r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en()

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

Fixes: 4214cc550bf9 ("r8152: check if disabling ALDPS is finished")
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
79321a79 8c53a7bd

+2
+2
drivers/net/usb/r8152.c
··· 5803 5803 data &= ~EN_ALDPS; 5804 5804 ocp_reg_write(tp, OCP_POWER_CFG, data); 5805 5805 for (i = 0; i < 20; i++) { 5806 + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) 5807 + return; 5806 5808 usleep_range(1000, 2000); 5807 5809 if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100) 5808 5810 break;