]> git.baikalelectronics.ru Git - kernel.git/commit
r8152: prevent the driver from transmitting packets with carrier off
authorhayeswang <hayeswang@realtek.com>
Thu, 23 Mar 2017 11:14:19 +0000 (19:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Mar 2017 19:31:02 +0000 (12:31 -0700)
commit6de5913303367a33ae29fd1661c34c92e01e393e
treef534c13a8f2981ba4617999a203bbd8d1301d857
parent021166d92af2f0a45e719869a91dad49f37281cd
r8152: prevent the driver from transmitting packets with carrier off

The linking status may be changed when autosuspend. And, after
autoresume, the driver may try to transmit packets when the device
is carrier off, because the interrupt transfer doesn't update the
linking status, yet. And, if the device is in ALDPS mode, the device
would stop working.

The another similar case is
 1. unplug the cable.
 2. interrupt transfer queue a work_queue for linking change.
 3. device enters the ALDPS mode.
 4. a tx occurs before the work_queue is called.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/r8152.c