aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJohn Efstathiades <john.efstathiades@pebblebay.com>2021-08-24 19:56:11 +0100
committerDavid S. Miller <davem@davemloft.net>2021-08-25 10:55:43 +0100
commit5f4cc6e25148cc141f97afb41b4dfe9eb1cce613 (patch)
treec26ef7c9831735336c70c038dfa2192939e05edb /Documentation
parentlan78xx: Fix partial packet errors on suspend/resume (diff)
downloadlinux-dev-5f4cc6e25148cc141f97afb41b4dfe9eb1cce613.tar.xz
linux-dev-5f4cc6e25148cc141f97afb41b4dfe9eb1cce613.zip
lan78xx: Fix race conditions in suspend/resume handling
If the interface is given an IP address while the device is suspended (as a result of an auto-suspend event) there is a race between lan78xx_resume() and lan78xx_open() that can result in an exception or failure to handle incoming packets. The following changes fix this problem. Introduce a mutex to serialise operations in the network interface open and stop entry points with respect to the USB driver suspend and resume entry points. Move Tx and Rx data path start/stop to lan78xx_start() and lan78xx_stop() respectively and flush the packet FIFOs before starting the Tx and Rx data paths. This prevents the MAC and FIFOs getting out of step and delivery of malformed packets to the network stack. Stop processing of received packets before disconnecting the PHY from the MAC to prevent a kernel exception caused by handling packets after the PHY device has been removed. Refactor device auto-suspend code to make it consistent with the the system suspend code and make the suspend handler easier to read. Add new code to stop wake-on-lan packets or PHY events resuming the host or device from suspend if the device has not been opened (typically after an IP address is assigned). This patch is dependent on changes to lan78xx_suspend() and lan78xx_resume() introduced in the previous patch of this patch set. Signed-off-by: John Efstathiades <john.efstathiades@pebblebay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions