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

From: "N. van Bolhuis" <[email-masked]>
Date: Mon, 11 Jun 2007 17:44:43 +0200

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