From: Simon Kagstrom <simon.kagstrom@netinsight.net>
To: netdev@vger.kernel.org, davem@davemloft.net, davej@redhat.com,
ben@decadent.org.uk
Subject: [PATCH 0/3]: via-velocity: Fixes for locking issues
Date: Fri, 5 Feb 2010 16:52:53 +0100 [thread overview]
Message-ID: <20100205165253.3f316b98@marrow.netinsight.se> (raw)
Hi!
This series of patches fixes a set of locking issues in the
via-velocity driver. Since some of the problems were introduced in
2.6.33-rc1 (with my patches, sorry!), it would be good if they could
get in before the final 2.6.33 release.
The patches are (the third one is the complex one):
* A small cleanup to remove unused parameters for rx_srv and tx_srv
* Take the spinlock from set_coalesce
* Fix races that occur with shared interrupts
We have a system where the interrupt for the VIA card is shared with a
USB controller. The last patch fixes a deadlock situation, which we can
trigger on our UP with spinlock debugging, where the VIA driver is
executing in velocity_poll (the NAPI poll callback) when the USB
controller interrupts the CPU. Since the interrupt controller takes the
(already held) lock, it will deadlock.
Some questions about the implementation though:
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().
With spin_trylock and spinlock debugging on our UP, we get a bug from
the debugging code:
BUG: spinlock trylock failure on UP on CPU#0, swapper/0
which looking at the debug code isn't unexpected since spin_trylock is
called from an interrupt handler. In this case though, I don't think
this is an actual error.
We don't have access to any multiprocessor machine with a VIA NIC (I
guess they are not very common), so I haven't been able to test these
patches on actual SMP hardware.
The locking in via-velocity in general would be good to look over, I
think.
// Simon
next reply other threads:[~2010-02-05 15:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 15:52 Simon Kagstrom [this message]
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 ` [PATCH 0/3]: via-velocity: Fixes for locking issues David Miller
2010-02-10 9:33 ` 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=20100205165253.3f316b98@marrow.netinsight.se \
--to=simon.kagstrom@netinsight.net \
--cc=ben@decadent.org.uk \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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).