From: Andrew Morton <akpm@linux-foundation.org>
To: Matteo Croce <matteo@openwrt.org>
Cc: jgarzik@pobox.com, ralf@linux-mips.org, nbd@openwrt.org,
ejka@imfi.kspu.ru, linux-mips@linux-mips.org,
netdev@vger.kernel.org
Subject: Re: [PATCH]: cpmac bugfixes and enhancements
Date: Mon, 5 May 2008 16:16:34 -0700 [thread overview]
Message-ID: <20080505161634.6964d46b.akpm@linux-foundation.org> (raw)
In-Reply-To: <200805041904.22726.matteo@openwrt.org>
On Sun, 4 May 2008 19:04:22 +0200
Matteo Croce <matteo@openwrt.org> wrote:
> This patch fixes an IRQ storm, a locking issues, moves platform code in the right sections
> and other small fixes.
>
Please feed this patch (and all future ones) through scripts/checkpatch.pl.
It picks up rather a lot of simple problems which there is no reason for
us to retain.
>
> ...
>
> + spin_unlock(&priv->rx_lock);
> + netif_rx_complete(priv->dev, napi);
> + netif_stop_queue(priv->dev);
> + napi_disable(&priv->napi);
> +
> + atomic_inc(&priv->reset_pending);
> + cpmac_hw_stop(priv->dev);
> + if (!schedule_work(&priv->reset_work))
> + atomic_dec(&priv->reset_pending);
> + return 0;
> +
> }
>
> static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
> @@ -456,6 +549,9 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
> struct cpmac_desc *desc;
> struct cpmac_priv *priv = netdev_priv(dev);
>
> + if (unlikely(atomic_read(&priv->reset_pending)))
> + return NETDEV_TX_BUSY;
> +
This looks a bit strange. schedule_work() will return zero if the work was
already scheduled, in which case we arrange for cpmac_start_xmit() to abort
early.
But if schedule_work() *doesn't* return zero, there is a time window in
which the reset is still pending. Because it takes time for keventd to be
awoken and to run the work function.
I would have thought that we would want to prevent cpmac_start_xmit() from
running within that time window also?
But that's just a guess - the text which you used to describe your work is
missing much information, so I don't have a lot to work with here.
next prev parent reply other threads:[~2008-05-05 23:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-04 17:04 [PATCH]: cpmac bugfixes and enhancements Matteo Croce
2008-05-04 17:14 ` Ralf Baechle
2008-05-05 23:16 ` Andrew Morton [this message]
2008-05-13 22:58 ` Matteo Croce
2008-05-13 23:06 ` Andrew Morton
2008-05-13 23:31 ` Matteo Croce
2008-05-22 10:22 ` Jeff Garzik
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=20080505161634.6964d46b.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ejka@imfi.kspu.ru \
--cc=jgarzik@pobox.com \
--cc=linux-mips@linux-mips.org \
--cc=matteo@openwrt.org \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).