From: David Miller <davem@davemloft.net>
To: simon.kagstrom@netinsight.net
Cc: netdev@vger.kernel.org, davej@redhat.com, ben@decadent.org.uk
Subject: Re: [PATCH 0/3]: via-velocity: Fixes for locking issues
Date: Tue, 09 Feb 2010 16:31:33 -0800 (PST) [thread overview]
Message-ID: <20100209.163133.38216503.davem@davemloft.net> (raw)
In-Reply-To: <20100205165253.3f316b98@marrow.netinsight.se>
From: Simon Kagstrom <simon.kagstrom@netinsight.net>
Date: Fri, 5 Feb 2010 16:52:53 +0100
> The patch uses spin_trylock in the interrupt handler, and returns
> IRQ_NONE if it's already held. Here is a place where I'm unsure about
> the right way though. Another alternative is to use spin_lock_irqsave
> in velocity_poll(), but I'd like to avoid turning the interrupts off
> for "long" periods of time when the actual velocity interrupt can't
> happen anyway (since it is turned off while executing velocity_poll().
It can happen in this situation and this is not the right way to
handle this.
You will lose interrupt events if the situation is that the interrupt
for the VIA has migrated from one cpu to another and another cpu is in
the VIA interrupt handler when we see the lock held.
Consider also the case where another cpu has the VIA lock as
a result of a device sharing the IRQ with VIA firing.
You'll lose events and jam the chip in that case too.
What this comes down to is not using the lock correctly, you
can't paper around it with this trylock stuff.
The proper thing to do is make the ->poll() handler use the lock
correctly by disabling interrupts.
If the VIA driver wants to avoid holding interrupts disabled for long
periods of time in ->poll(), it's locking mechanisms will need to be
rewritten completely. The only safe way to do this is to do something
like how the tg3 driver works, wherein the interrupt handler runs
lockless, there is a special IRQ quiesce sequence when shutting down
the chip, and the ->poll() handler et al. use softirq safe locks
instead of hardirq safe ones.
For now you're going to have to accept interrupts being disabled in
order to fix this bug for the time being.
Please resubmit this patch series once you've worked this out.
Thanks!
next prev parent reply other threads:[~2010-02-10 0:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 15:52 [PATCH 0/3]: via-velocity: Fixes for locking issues Simon Kagstrom
2010-02-05 15:54 ` [PATCH 1/3] via-velocity: Remove unused IRQ status parameter from rx_srv and tx_srv Simon Kagstrom
2010-02-05 15:55 ` [PATCH 2/3] via-velocity: Take spinlock on set coalesce Simon Kagstrom
2010-02-05 15:55 ` [PATCH 3/3] via-velocity: Fix races on shared interrupts Simon Kagstrom
2010-02-10 17:41 ` Laurent Chavey
2010-02-11 8:05 ` Simon Kagstrom
2010-02-10 0:31 ` David Miller [this message]
2010-02-10 9:33 ` [PATCH 0/3]: via-velocity: Fixes for locking issues Simon Kagstrom
2010-02-10 9:37 ` [PATCH v2 1/3] via-velocity: Remove unused IRQ status parameter from rx_srv and tx_srv Simon Kagstrom
2010-02-10 9:38 ` [PATCH v2 2/3] via-velocity: Take spinlock on set coalesce Simon Kagstrom
2010-02-10 9:38 ` [PATCH v2 3/3] via-velocity: Fix races on shared interrupts Simon Kagstrom
2010-02-10 18:55 ` [PATCH 0/3]: via-velocity: Fixes for locking issues David Miller
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=20100209.163133.38216503.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ben@decadent.org.uk \
--cc=davej@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=simon.kagstrom@netinsight.net \
/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).