Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1566326
| From | Stephen Hemminger <stephen@networkplumber.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend |
| Date | 2017-01-25 06:10 +0100 |
| Message-ID | <t3o0h-5TO-9@gated-at.bofh.it> (permalink) |
| References | <t3lYu-4hv-9@gated-at.bofh.it> <t3lYt-4hv-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, 25 Jan 2017 10:50:51 +0800
Hayes Wang <hayeswang@realtek.com> wrote:
> Adjust the setting of the flag of SELECTIVE_SUSPEND to prevent start_xmit()
> from calling napi_schedule() directly during runtime suspend.
>
> After calling napi_disable() or clearing the flag of WORK_ENABLE,
> scheduling the napi is useless.
>
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
> drivers/net/usb/r8152.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index e1466b4..27b0b44 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -3585,10 +3585,13 @@ static int rtl8152_rumtime_suspend(struct r8152 *tp)
> struct net_device *netdev = tp->netdev;
> int ret = 0;
>
> + set_bit(SELECTIVE_SUSPEND, &tp->flags);
> +
> if (netif_running(netdev) && test_bit(WORK_ENABLE, &tp->flags)) {
> u32 rcr = 0;
>
> if (delay_autosuspend(tp)) {
> + clear_bit(SELECTIVE_SUSPEND, &tp->flags);
> ret = -EBUSY;
> goto out1;
> }
> @@ -3605,6 +3608,7 @@ static int rtl8152_rumtime_suspend(struct r8152 *tp)
> if (!(ocp_data & RXFIFO_EMPTY)) {
> rxdy_gated_en(tp, false);
> ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, rcr);
> + clear_bit(SELECTIVE_SUSPEND, &tp->flags);
> ret = -EBUSY;
If you are going to start using bit operations then you may need smp_mb_before/after_atomic.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
[PATCH net 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
Re: [PATCH net 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend Stephen Hemminger <stephen@networkplumber.org> - 2017-01-25 06:10 +0100
[PATCH net 4/4] r8152: check rx after napi is enabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
[PATCH net 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
[PATCH net 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 04:00 +0100
[PATCH net v2 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
[PATCH net v2 4/4] r8152: check rx after napi is enabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
[PATCH net v2 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
Re: [PATCH net v2 3/4] r8152: re-schedule napi for tx Eric Dumazet <eric.dumazet@gmail.com> - 2017-01-25 15:00 +0100
RE: [PATCH net v2 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:30 +0100
[PATCH net v2 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
[PATCH net v2 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend Hayes Wang <hayeswang@realtek.com> - 2017-01-25 09:20 +0100
Re: [PATCH net v2 0/4] r8152: fix scheduling napi David Miller <davem@davemloft.net> - 2017-01-25 20:40 +0100
RE: [PATCH net v2 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-26 04:10 +0100
Re: [PATCH net v2 0/4] r8152: fix scheduling napi David Miller <davem@davemloft.net> - 2017-01-26 04:50 +0100
[PATCH net v3 2/4] r8152: avoid start_xmit to schedule napi when napi is disabled Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
[PATCH net v3 3/4] r8152: re-schedule napi for tx Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
[PATCH net v3 1/4] r8152: avoid start_xmit to call napi_schedule during autosuspend Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
[PATCH net v3 4/4] r8152: check rx after napi is enabled Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:40 +0100
[PATCH net v3 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-26 02:50 +0100
Re: [PATCH net v3 0/4] r8152: fix scheduling napi David Miller <davem@davemloft.net> - 2017-01-26 04:50 +0100
RE: [PATCH net v3 0/4] r8152: fix scheduling napi Hayes Wang <hayeswang@realtek.com> - 2017-01-26 05:00 +0100
csiph-web