From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161276AbWF0UQd (ORCPT ); Tue, 27 Jun 2006 16:16:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161274AbWF0UQc (ORCPT ); Tue, 27 Jun 2006 16:16:32 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:42880 "EHLO sous-sol.org") by vger.kernel.org with ESMTP id S1161275AbWF0UQa (ORCPT ); Tue, 27 Jun 2006 16:16:30 -0400 Message-Id: <20060627201358.197578000@sous-sol.org> References: <20060627200745.771284000@sous-sol.org> User-Agent: quilt/0.45-1 Date: Tue, 27 Jun 2006 00:00:14 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org, Greg KH Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, Michael Buesch Subject: [PATCH 14/25] bcm43xx: init fix for possible Machine Check Content-Disposition: inline; filename=bcm43xx-init-fix-for-possible-machine-check.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org -stable review patch. If anyone has any objections, please let us know. ------------------ From: Michael Buesch Place the Init-vs-IRQ workaround before any card register access, because we might not have the wireless core mapped at all times in init. So this will result in a Machine Check caused by a bus error. Signed-off-by: Michael Buesch Signed-off-by: Chris Wright --- drivers/net/wireless/bcm43xx/bcm43xx_main.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) --- linux-2.6.17.1.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ linux-2.6.17.1/drivers/net/wireless/bcm43xx/bcm43xx_main.c @@ -1870,6 +1870,15 @@ static irqreturn_t bcm43xx_interrupt_han spin_lock(&bcm->_lock); + /* Only accept IRQs, if we are initialized properly. + * This avoids an RX race while initializing. + * We should probably not enable IRQs before we are initialized + * completely, but some careful work is needed to fix this. I think it + * is best to stay with this cheap workaround for now... . + */ + if (unlikely(!bcm->initialized)) + goto out; + reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); if (reason == 0xffffffff) { /* irq not for us (shared irq) */ @@ -1891,20 +1900,11 @@ static irqreturn_t bcm43xx_interrupt_han bcm43xx_interrupt_ack(bcm, reason); - /* Only accept IRQs, if we are initialized properly. - * This avoids an RX race while initializing. - * We should probably not enable IRQs before we are initialized - * completely, but some careful work is needed to fix this. I think it - * is best to stay with this cheap workaround for now... . - */ - if (likely(bcm->initialized)) { - /* disable all IRQs. They are enabled again in the bottom half. */ - bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); - /* save the reason code and call our bottom half. */ - bcm->irq_reason = reason; - tasklet_schedule(&bcm->isr_tasklet); - } - + /* disable all IRQs. They are enabled again in the bottom half. */ + bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); + /* save the reason code and call our bottom half. */ + bcm->irq_reason = reason; + tasklet_schedule(&bcm->isr_tasklet); out: mmiowb(); spin_unlock(&bcm->_lock); --