All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krishna Chaitanya <chaitanya.mgit@gmail.com>
To: Ben Greear <greearb@candelatech.com>
Cc: Wen Gong <wgong@codeaurora.org>,
	Kalle Valo <kvalo@codeaurora.org>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	ath10k <ath10k@lists.infradead.org>
Subject: Re: [RFC] ath10k: change to do napi_enable and napi_disable when insmod and rmmod for sdio
Date: Thu, 20 Aug 2020 22:30:28 +0530	[thread overview]
Message-ID: <CABPxzY+tPos8ByT76hU1ngoxwYcBHaRpFMCKGQJcc_ssoqGNSw@mail.gmail.com> (raw)
In-Reply-To: <acb2bd58-2f95-e09c-9575-b45c0e2aeb70@candelatech.com>

On Thu, Aug 20, 2020 at 10:02 PM Ben Greear <greearb@candelatech.com> wrote:
>
> On 8/20/20 9:08 AM, Krishna Chaitanya wrote:
> > On Thu, Aug 20, 2020 at 8:07 PM Wen Gong <wgong@codeaurora.org> wrote:
> >>
> >> On 2020-08-20 18:52, Krishna Chaitanya wrote:
> >>> On Thu, Aug 20, 2020 at 3:45 PM Wen Gong <wgong@codeaurora.org> wrote:
> >>>>
> >>>> On 2020-08-20 17:19, Krishna Chaitanya wrote:
> >> ...
> >>>>>> I'm not really convinced that this is the right fix, but I'm no NAPI
> >>>>>> expert. Can anyone else help?
> >>>>> Calling napi_disable() twice can lead to hangs, but moving NAPI from
> >>>>> start/stop to
> >>>>> the probe isn't the right approach as the datapath is tied to
> >>>>> start/stop.
> >>>>>
> >>>>> Maybe check the state of NAPI before disable?
> >>>>>
> >>>>>   if (test_bit(NAPI_STATE_SCHED, &ar->napi.napi.state))
> >>>>>    napi_disable(&ar->napi)
> >>>>> or maintain napi_state like this
> >>>>> https://patchwork.kernel.org/patch/10249365/
> >>>> it is better to use above link's patch.
> >>>> napi.state is controlled by napi API, it is better ath10k not know it.
> >>> Sure, but IMHO just canceling the async rx work should solve the issue.
> >> Oh no, canceling the async rx work will not solve this issue, rx worker
> >> ath10k_rx_indication_async_work call napi_schedule, after napi_complete,
> >> the NAPI_STATE_SCHED will clear.
> >> The issue of this patch is because 2 thread called to hif_stop and
> >> NAPI_STATE_SCHED not clear.
> > That fix is still valid and good to have.
> >
> > ndev_stop being called twice is typical scenarios (stop vs rmmod), so
> >   just checking the netdev_flags for IFF_UP and returning from hif_Stop
> > should suffice, no?
>
> My approach to fix this problem was to add a boolean in ath10k as to whether
> it had napi enabled or not, and then check that before trying to enable/disable
> it again.  Seems to work fine, and cleaner in my mind than checking internal
> napi flags.
A much simpler approach is just to check for IFF_UP and skip NAPI (and others)
in the hif_stop no? (provided proper RTNL locking is done if hif_stop
is being called
internally as well).

WARNING: multiple messages have this Message-ID (diff)
From: Krishna Chaitanya <chaitanya.mgit@gmail.com>
To: Ben Greear <greearb@candelatech.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	ath10k <ath10k@lists.infradead.org>,
	Kalle Valo <kvalo@codeaurora.org>,
	Wen Gong <wgong@codeaurora.org>
Subject: Re: [RFC] ath10k: change to do napi_enable and napi_disable when insmod and rmmod for sdio
Date: Thu, 20 Aug 2020 22:30:28 +0530	[thread overview]
Message-ID: <CABPxzY+tPos8ByT76hU1ngoxwYcBHaRpFMCKGQJcc_ssoqGNSw@mail.gmail.com> (raw)
In-Reply-To: <acb2bd58-2f95-e09c-9575-b45c0e2aeb70@candelatech.com>

On Thu, Aug 20, 2020 at 10:02 PM Ben Greear <greearb@candelatech.com> wrote:
>
> On 8/20/20 9:08 AM, Krishna Chaitanya wrote:
> > On Thu, Aug 20, 2020 at 8:07 PM Wen Gong <wgong@codeaurora.org> wrote:
> >>
> >> On 2020-08-20 18:52, Krishna Chaitanya wrote:
> >>> On Thu, Aug 20, 2020 at 3:45 PM Wen Gong <wgong@codeaurora.org> wrote:
> >>>>
> >>>> On 2020-08-20 17:19, Krishna Chaitanya wrote:
> >> ...
> >>>>>> I'm not really convinced that this is the right fix, but I'm no NAPI
> >>>>>> expert. Can anyone else help?
> >>>>> Calling napi_disable() twice can lead to hangs, but moving NAPI from
> >>>>> start/stop to
> >>>>> the probe isn't the right approach as the datapath is tied to
> >>>>> start/stop.
> >>>>>
> >>>>> Maybe check the state of NAPI before disable?
> >>>>>
> >>>>>   if (test_bit(NAPI_STATE_SCHED, &ar->napi.napi.state))
> >>>>>    napi_disable(&ar->napi)
> >>>>> or maintain napi_state like this
> >>>>> https://patchwork.kernel.org/patch/10249365/
> >>>> it is better to use above link's patch.
> >>>> napi.state is controlled by napi API, it is better ath10k not know it.
> >>> Sure, but IMHO just canceling the async rx work should solve the issue.
> >> Oh no, canceling the async rx work will not solve this issue, rx worker
> >> ath10k_rx_indication_async_work call napi_schedule, after napi_complete,
> >> the NAPI_STATE_SCHED will clear.
> >> The issue of this patch is because 2 thread called to hif_stop and
> >> NAPI_STATE_SCHED not clear.
> > That fix is still valid and good to have.
> >
> > ndev_stop being called twice is typical scenarios (stop vs rmmod), so
> >   just checking the netdev_flags for IFF_UP and returning from hif_Stop
> > should suffice, no?
>
> My approach to fix this problem was to add a boolean in ath10k as to whether
> it had napi enabled or not, and then check that before trying to enable/disable
> it again.  Seems to work fine, and cleaner in my mind than checking internal
> napi flags.
A much simpler approach is just to check for IFF_UP and skip NAPI (and others)
in the hif_stop no? (provided proper RTNL locking is done if hif_stop
is being called
internally as well).

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2020-08-20 17:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14  3:55 [RFC] ath10k: change to do napi_enable and napi_disable when insmod and rmmod for sdio Wen Gong
2020-02-14  3:55 ` Wen Gong
2020-08-20  8:32 ` Kalle Valo
2020-08-20  8:32   ` Kalle Valo
2020-08-20  9:19   ` Krishna Chaitanya
2020-08-20  9:19     ` Krishna Chaitanya
2020-08-20  9:26     ` Krishna Chaitanya
2020-08-20  9:26       ` Krishna Chaitanya
2020-08-20 10:20       ` Wen Gong
2020-08-20 10:20         ` Wen Gong
2020-08-20 10:14     ` Wen Gong
2020-08-20 10:14       ` Wen Gong
2020-08-20 10:52       ` Krishna Chaitanya
2020-08-20 10:52         ` Krishna Chaitanya
2020-08-20 14:37         ` Wen Gong
2020-08-20 14:37           ` Wen Gong
2020-08-20 16:08           ` Krishna Chaitanya
2020-08-20 16:08             ` Krishna Chaitanya
2020-08-20 16:32             ` Ben Greear
2020-08-20 16:32               ` Ben Greear
2020-08-20 17:00               ` Krishna Chaitanya [this message]
2020-08-20 17:00                 ` Krishna Chaitanya
2020-08-20 17:07                 ` Ben Greear
2020-08-20 17:07                   ` Ben Greear
2020-08-20 17:41                   ` Krishna Chaitanya
2020-08-20 17:41                     ` Krishna Chaitanya
2020-08-20 17:42                     ` Krishna Chaitanya
2020-08-20 17:42                       ` Krishna Chaitanya
2020-08-20 17:53                       ` Ben Greear
2020-08-20 17:53                         ` Ben Greear
2020-08-20 20:15                         ` Krishna Chaitanya
2020-08-20 20:15                           ` Krishna Chaitanya
2020-08-20 20:59                           ` Ben Greear
2020-08-20 20:59                             ` Ben Greear
2020-08-21  2:45                             ` Wen Gong
2020-08-21  2:45                               ` Wen Gong
2020-08-24  4:35                               ` Wen Gong
2020-08-24  4:35                                 ` Wen Gong
2020-09-07 16:07                             ` Kalle Valo
2020-09-07 16:07                             ` Kalle Valo
2020-09-07 17:18                               ` Ben Greear
2020-09-07 17:18                                 ` Ben Greear

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPxzY+tPos8ByT76hU1ngoxwYcBHaRpFMCKGQJcc_ssoqGNSw@mail.gmail.com \
    --to=chaitanya.mgit@gmail.com \
    --cc=ath10k@lists.infradead.org \
    --cc=greearb@candelatech.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wgong@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.