r8152: fix rx issue for runtime suspend
authorhayeswang <hayeswang@realtek.com>
Tue, 10 Jan 2017 09:04:07 +0000 (17:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Jan 2017 12:42:55 +0000 (13:42 +0100)
commit66f24d624baaa9934c3288cd01d2b6dd65a399d3
treec9849ae7985eb6dcf3160f40da141565c2cd640a
parentc8a89b4f5248e8d6742317b674010bdfeb31e06e
r8152: fix rx issue for runtime suspend

[ Upstream commit 75dc692eda114cb234a46cb11893a9c3ea520934 ]

Pause the rx and make sure the rx fifo is empty when the autosuspend
occurs.

If the rx data comes when the driver is canceling the rx urb, the host
controller would stop getting the data from the device and continue
it after next rx urb is submitted. That is, one continuing data is
split into two different urb buffers. That let the driver take the
data as a rx descriptor, and unexpected behavior happens.

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