ioctl on 870 FEC causes "badness in local_bh_enable at kernel/softirq.c"

2 messages, 2 authors, 2007-06-11 · open the first message on its own page

ioctl on 870 FEC causes "badness in local_bh_enable at kernel/softirq.c"

From: N. van Bolhuis <hidden>
Date: 2007-06-11 15:46:50

I found a minor problem for the linux PPC PowerQuic_II FEC driver.

When doing an:

ioctl(.. SIOCGMIIREG ..) or
ioctl(.. SIOCSMIIREG ..)

the following kernel message pops up:

Badness in local_bh_enable at kernel/softirq.c:137
Call Trace:
[C102FC80] [C0008E04]  (unreliable)
[C102FCA0] [C0003608]
[C102FCB0] [C0003EB0]
[C102FCD0] [C000310C]
[C102FD90] [C102FE40]
[C102FDA0] [C010794C]
[C102FDC0] [C01079C0]
[C102FDE0] [C010E7DC]
[C102FE00] [C01316C0]
[C102FE20] [C0132A08]
[C102FEA0] [C0126408]
[C102FEC0] [C0064B10]
[C102FEE0] [C0064F1C]
[C102FF10] [C0064F98]
[C102FF40] [C0002AC4]


This is because drivers/net/fs_enet/fs_enet-main.c:fs_ioctl
disables the interrupts with spin_lock_irqsave after which it calls
phy_mii_ioctl. This leads to drivers/net/phy/phy.c:phy_read
being called which does spin_lock_bh/spin_unlock_bh.
Obviously the spin_unlock_bh enables softirqs and it is correctly
complaining irqs are disabled.

fs_ioctl and phy_read are used by many others so I'm not sure
how to solve this. Therefore I ask this list.

Maybe fs_ioctl can use spin_(un)lock but I'm not sure.

Anybody has a fix or ideas about this ?

---
N. van Bolhuis.

-- 
This message has been scanned for viruses and is believed to be clean

Re: ioctl on 870 FEC causes "badness in local_bh_enable at kernel/softirq.c"

From: Andy Fleming <hidden>
Date: 2007-06-11 18:47:54

This is because drivers/net/fs_enet/fs_enet-main.c:fs_ioctl
disables the interrupts with spin_lock_irqsave after which it calls
phy_mii_ioctl. This leads to drivers/net/phy/phy.c:phy_read
being called which does spin_lock_bh/spin_unlock_bh.
Obviously the spin_unlock_bh enables softirqs and it is correctly
complaining irqs are disabled.
That's a programming error.  The PHY Layer's functions must not be  
called with interrupts disabled.


Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help