b43legacy: Remove unnecessary MMIO in interrupt hotpath
PATCH 1/2 b43legacy: Remove unnecessary MMIO in interrupt hotpath
From: Stefano Brivio <[email protected]>
This removes unnecessary MMIO accesses in the interrupt hotpath. The patch by Michael Buesch for b43 has been ported to b43legacy.
---
John,
This is 2.6.31 material. I am submitting this for Stefano because this patch touches a section of the code that had to be changed to fix the locking problem addressed in Patch 2/2.
I hope this patch does not cause any problems. My normal method is not available while I'm away from home.
Larry
---
drivers/net/wireless/b43legacy/b43legacy.h +2 -2
@@ -694,8 +694,8 @@ struct b43legacy_wldev {/* Reason code of the last interrupt. */ u32 irq_reason;u32 dma_reason[6 ]; -/* saved irq enable/disable state bitfield. */ -u32 irq_savedstate; +/* The currently active generic-interrupt mask. */ +u32 irq_mask;/* Link Quality calculation context. */ struct b43legacy_noise_calculation noisecalc;/* if > 0 MAC is suspended. if == 0 MAC is enabled. */
drivers/net/wireless/b43legacy/main.c +51 -81
261 lines not on this page · raw message
drivers/net/wireless/b43legacy/pio.c +1 -1
@@ -443,7 +443,7 @@ int b43legacy_pio_init(struct b43legacy_ pio->queue3 = queue;if (dev->dev->id.revision <3 ) - dev->irq_savedstate |= B43legacy_IRQ_PIO_WORKAROUND; + dev->irq_mask |= B43legacy_IRQ_PIO_WORKAROUND;b43legacydbg (dev->wl,"PIO initialized\n" ); err =0 ;
Quoted 25 lines · On Friday 15 May 2009 01:20:53 Larry Finger wrote:
drivers/net/wireless/b43legacy/main.c +7
-15dev->dma_reason[0 ] =b43legacy_read32 (dev, B43legacy_MMIO_DMA0_REASON) &0x0001DC00 ; - dev->dma_reason[1 ] =b43legacy_read32 (dev, - B43legacy_MMIO_DMA1_REASON) - &0x0000DC00 ; - dev->dma_reason[2 ] =b43legacy_read32 (dev, - B43legacy_MMIO_DMA2_REASON) - &0x0000DC00 ; - dev->dma_reason[3 ] =b43legacy_read32 (dev, - B43legacy_MMIO_DMA3_REASON) - &0x0001DC00 ; - dev->dma_reason[4 ] =b43legacy_read32 (dev, - B43legacy_MMIO_DMA4_REASON) - &0x0000DC00 ; - dev->dma_reason[5 ] =b43legacy_read32 (dev, - B43legacy_MMIO_DMA5_REASON) - &0x0000DC00 ; +/* Unused rings. +* dev->dma_reason[1] = b43legacy_read32(dev, +* B43legacy_MMIO_DMA1_REASON) +* & 0x0000DC00; +* dev->dma_reason[2] = b43legacy_read32(dev, +* B43legacy_MMIO_DMA2_REASON) +* & 0x0000DC00;
drivers/net/wireless/b43legacy/main.c static irqreturn_t b43legacy_interrupt_h · line 1459
Quoted 10 lines
drivers/net/wireless/b43legacy/main.c +10
-0+* dev->dma_reason[3] = b43legacy_read32(dev, +* B43legacy_MMIO_DMA3_REASON) +* & 0x0001DC00; +* dev->dma_reason[4] = b43legacy_read32(dev, +* B43legacy_MMIO_DMA4_REASON) +* & 0x0000DC00; +* dev->dma_reason[5] = b43legacy_read32(dev, +* B43legacy_MMIO_DMA5_REASON) +* & 0x0000DC00; +*/
This is not correct. Ring1 is used for transmission.
With this patch applied, you won't receive error notification interrupts for the TX ring anymore.
And ring3 is used for transmission status reporting on old devices. This patch breaks it for these devices.
Signature · 1 line
Greetings, Michael.
Quoted 6 lines · Michael Buesch
This is not correct. Ring1 is used for transmission.
With this patch applied, you won't receive error notification interrupts for the TX ring anymore.
And ring3 is used for transmission status reporting on old devices. This patch breaks it for these devices.
Thanks for the comments. I had thought that you had signed off on Stefano's original posting of this patch, which was sent to me for testing. I obviously misunderstood.
V2 will not touch any of this part of the code. If there are DMA reason codes that do not need to be used, they can be eliminated in a future patch.
Larry