From patchwork Mon Aug 31 02:18:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 44788 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7V2IsDp026971 for ; Mon, 31 Aug 2009 02:18:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753543AbZHaCSt (ORCPT ); Sun, 30 Aug 2009 22:18:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753499AbZHaCSt (ORCPT ); Sun, 30 Aug 2009 22:18:49 -0400 Received: from mail.tpi.com ([70.99.223.143]:2569 "EHLO mail.tpi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753388AbZHaCSs (ORCPT ); Sun, 30 Aug 2009 22:18:48 -0400 Received: from sepang.rtg.net (unknown [10.0.2.5]) by mail.tpi.com (Postfix) with ESMTP id A92051663E0; Sun, 30 Aug 2009 19:18:43 -0700 (PDT) Received: by sepang.rtg.net (Postfix, from userid 1000) id AE8FCF88F4; Sun, 30 Aug 2009 20:18:41 -0600 (MDT) To: j@w1.fi Subject: [PATCH] wireless: hostap, fix oops due to early probing interrupt Cc: linux-wireless@vger.kernel.org Message-Id: <20090831021841.AE8FCF88F4@sepang.rtg.net> Date: Sun, 30 Aug 2009 20:18:41 -0600 (MDT) From: timg@tpi.com (Tim Gardner) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Jouni, Did this ever get sent to you? rtg --------------------------------- From a72eaafae9186632add4ed01a340b4f1b39cc672 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 19 Aug 2009 15:39:21 +0100 Subject: [PATCH] wireless: hostap, fix oops due to early probing interrupt BugLink: https://bugs.launchpad.net/ubuntu/+bug/254837 Spurious shared interrupts or early probing interrupts can cause the hostap interrupt handler to oops before the driver has fully configured the IO base port addresses. In some cases the oops can be because the hardware shares an interrupt line, on other cases it is due to a race condition between probing for the hardware and configuring the IO base port. The latter occurs because the probing is required to determin the hardware port address which is only determined when the probe can interrupt the hardware (catch 22). This patch catches this pre-configured condition to avoid the oops. Signed-off-by: Colin Ian King Signed-off-by: Stefan Bader Acked-by: Tim Gardner Acked-by: Stefan Bader --- drivers/net/wireless/hostap/hostap_hw.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index d4d857e..0212ee3 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c @@ -2628,6 +2628,15 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id) int events = 0; u16 ev; + /* Detect early interrupt before driver is fully configued */ + if (!dev->base_addr) { + if (net_ratelimit()) { + printk(KERN_DEBUG "%s: Interrupt, but dev not configured\n", + dev->name); + } + return IRQ_HANDLED; + } + iface = netdev_priv(dev); local = iface->local;