Skip to content

Commit 79321a7

Browse files
diandersdavem330
authored andcommitted
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: 4214cc5 ("r8152: check if disabling ALDPS is finished") 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 8c53a7b commit 79321a7

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
@@ -5803,6 +5803,8 @@ static void r8153_aldps_en(struct r8152 *tp, bool enable)
58035803
data &= ~EN_ALDPS;
58045804
ocp_reg_write(tp, OCP_POWER_CFG, data);
58055805
for (i = 0; i < 20; i++) {
5806+
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
5807+
return;
58065808
usleep_range(1000, 2000);
58075809
if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100)
58085810
break;

0 commit comments

Comments
 (0)