bcm43xx: Enable local IRQs while executing periodic work
Subsystems (3)
PATCH 1/1 bcm43xx: Enable local IRQs while executing periodic work
This patch is supposed to heavily increase overall system vitality. It reduces the time periodic work in the bcm43xx driver is run, with IRQs disabled, from several msecs to a few usecs.
I am not sure, if we still want to have this in 2.6.17, as it is not a crash fix or something. But it fixes "lost interrupt" problems for some people.
I would like to get this into wireless-2.6, but before that happens I would like to have a few regression tests by people. Please apply this and run high network traffic for 10-15 minutes. Please enable kernel spinlock lockup and recursion detection while testing.
--
Enable local CPU IRQs while executing periodic work handlers. Periodic work handlers may take a long time to execute, so disabling IRQs for the whole time is a bad idea.
This patch disables and synchronizes all bcm43xx IRQs on periodic work entry and re-enables CPU IRQs afterwards. It still tempoarly disables CPU IRQs while measuring the deviation value, as I have the feeling that this is time critical and may not be interrupted. This causes IRQs to be disabled for about 35usecs. I hope that does not hurt.
This is an attempt to reduce system IRQ pressure and avoid lost IRQs in other devices.
drivers/net/wireless/bcm43xx/bcm43xx.h +3 -5
@@ -647,9 +647,7 @@void __iomem *mmio_addr;unsigned int mmio_len; -/* Do not use the lock directly. Use the bcm43xx_lock* helper -* functions, to be MMIO-safe. */ -spinlock_t _lock; +spinlock_t lock;/* Driver status flags. */ u32 initialized:1, /* init_board() succeed */
@@ -753,8 +751,8 @@* the *_mmio lock functions. * MMIO read-access is allowed, though. */ -#define bcm43xx_lock (bcm, flags) spin_lock_irqsave(&(bcm)->_lock, flags) -#define bcm43xx_unlock (bcm, flags) spin_unlock_irqrestore(&(bcm)->_lock, flags) +#define bcm43xx_lock (bcm, flags) spin_lock_irqsave(&(bcm)->lock, flags) +#define bcm43xx_unlock (bcm, flags) spin_unlock_irqrestore(&(bcm)->lock, flags)/* bcm43xx_(un)lock_mmio() protect struct bcm43xx_private and MMIO. * MMIO write-access to the device is allowed. * All MMIO writes are flushed on unlock, so it is guaranteed to not
drivers/net/wireless/bcm43xx/bcm43xx_main.c +41 -9
106 lines not on this page · raw message
drivers/net/wireless/bcm43xx/bcm43xx_phy.c +6 -1
@@ -1410,7 +1410,10 @@u16 bcm43xx_phy_lo_g_deviation_subval (struct bcm43xx_private *bcm,u16 control) {struct bcm43xx_phyinfo *phy =bcm43xx_current_phy (bcm); +u16 ret; +unsigned long flags; +local_irq_save (flags);if (phy->connected) {bcm43xx_phy_write (bcm,0x15 ,0xE300 ); control <<=8 ;
@@ -1430,8 +1433,10 @@bcm43xx_phy_write (bcm,0x0015 , control |0xFFE0 );udelay (8 ); } + ret =bcm43xx_phy_read (bcm,0x002D ); +local_irq_restore (flags); -return bcm43xx_phy_read (bcm,0x002D ); +return ret; }static u32 bcm43xx_phy_lo_g_singledeviation (struct bcm43xx_private *bcm,u16 control)
Quoted 5 lines · Michael Buesch
I would like to get this into wireless-2.6, but before that happens I would like to have a few regression tests by people. Please apply this and run high network traffic for 10-15 minutes. Please enable kernel spinlock lockup and recursion detection while testing.
It has almost been two weeks...do we want this patch, or not?
John
Signature · 2 lines
John W. Linville [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · John W. Linville
Quoted 5 lines · Michael Buesch
I would like to get this into wireless-2.6, but before that happens I would like to have a few regression tests by people. Please apply this and run high network traffic for 10-15 minutes. Please enable kernel spinlock lockup and recursion detection while testing.
It has almost been two weeks...do we want this patch, or not?
The two patches
[PATCH 1/2] bcm43xx: redesign locking
[PATCH 2/2] bcm43xx: preemptible periodic work are the successors of it. ;) So, no, I don't want that old and broken patch any longer.
But thanks that you asked. I forgot about it.
Signature · 1 line
Greetings Michael.