]> git.baikalelectronics.ru Git - kernel.git/commit
8139cp: Don't blindly enable interrupts
authorChris Lalancette <clalance@redhat.com>
Tue, 16 Jan 2007 21:41:44 +0000 (16:41 -0500)
committerJeff Garzik <jeff@garzik.org>
Thu, 18 Jan 2007 16:47:22 +0000 (11:47 -0500)
commiteca8b6cfaf526c4ef6bdc2fbe35c4c678c2e94c3
tree1b8e9c5feb2bdaa2f61adb3a6f87d96f4afd21db
parentd57d37404a551487dcf261e907852162bab25661
8139cp: Don't blindly enable interrupts

Similar to this commit:

http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=29a3b013ea6e234bc9c3bffa77e83095d63ee287

It's not safe in cp_start_xmit to blindly call spin_lock_irq and then
spin_unlock_irq, since it may very well be the case that cp_start_xmit
was called with interrupts already disabled (I came across this bug in
the context of netdump in RedHat kernels, but the same issue holds, for
example, in netconsole). Therefore, replace all instances of
spin_lock_irq and spin_unlock_irq with spin_lock_irqsave and
spin_unlock_irqrestore, respectively, in cp_start_xmit(). I tested this
against a fully-virtualized Xen guest using netdump, which happens to
use the 8139cp driver to talk to the emulated hardware. I don't have a
real piece of 8139cp hardware to test on, so someone else will have to
do that.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/8139cp.c