From: "Måns Rullgård" <mans@mansr.com>
To: Jeroen Hofstee <jhofstee@victronenergy.com>
Cc: linux-can@vger.kernel.org,
Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] can: ti_hecc: fix close when napi poll is active
Date: Fri, 01 Mar 2019 15:04:09 +0000 [thread overview]
Message-ID: <yw1xef7q63h2.fsf@mansr.com> (raw)
In-Reply-To: <1523132500-26070-1-git-send-email-jhofstee@victronenergy.com> (Jeroen Hofstee's message of "Sat, 7 Apr 2018 22:21:39 +0200")
Jeroen Hofstee <jhofstee@victronenergy.com> writes:
> When closing this CAN interface while napi poll is active, for example with:
> `ip link set can0 down` several interfaces freeze. This seemed to be caused
> by napi_disable called from ti_hecc_close expecting the scheduled probe to
> either return quota or call napi_complete. Since the poll functions has a
> check for netif_running it returns 0 and doesn't call napi_complete and hence
> violates the napi its expectation.
>
> So remove this check, so either napi_complete is called or quota is returned.
>
> Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
> ---
> drivers/net/can/ti_hecc.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
> index db6ea93..42813d3 100644
> --- a/drivers/net/can/ti_hecc.c
> +++ b/drivers/net/can/ti_hecc.c
> @@ -603,9 +603,6 @@ static int ti_hecc_rx_poll(struct napi_struct *napi, int quota)
> u32 mbx_mask;
> unsigned long pending_pkts, flags;
>
> - if (!netif_running(ndev))
> - return 0;
> -
> while ((pending_pkts = hecc_read(priv, HECC_CANRMP)) &&
> num_pkts < quota) {
> mbx_mask = BIT(priv->rx_next); /* next rx mailbox to process */
> --
> 2.7.4
This seems to have been lost or forgotten.
--
Måns Rullgård
prev parent reply other threads:[~2019-03-01 15:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-07 20:21 [PATCH] can: ti_hecc: fix close when napi poll is active Jeroen Hofstee
2019-03-01 15:04 ` Måns Rullgård [this message]
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=yw1xef7q63h2.fsf@mansr.com \
--to=mans@mansr.com \
--cc=jhofstee@victronenergy.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox