From patchwork Sun Sep 6 18:07:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 45987 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 n86IBGJE014262 for ; Sun, 6 Sep 2009 18:11:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758089AbZIFSLM (ORCPT ); Sun, 6 Sep 2009 14:11:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758087AbZIFSLL (ORCPT ); Sun, 6 Sep 2009 14:11:11 -0400 Received: from bu3sch.de ([62.75.166.246]:56752 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758085AbZIFSLK (ORCPT ); Sun, 6 Sep 2009 14:11:10 -0400 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1MkMCk-0005lW-G6; Sun, 06 Sep 2009 18:11:10 +0000 From: Michael Buesch To: Luis Rodriguez Subject: [COMPAT PATCH] b43: Threaded interrupts wrapper Date: Sun, 6 Sep 2009 20:07:26 +0200 User-Agent: KMail/1.9.9 Cc: Broadcom Wireless , "linux-wireless" , John Linville MIME-Version: 1.0 Message-Id: <200909062007.27279.mb@bu3sch.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org A patch converting b43 to threaded interrupts will be merged soon. This will completely break b43 on compat-wireless, because working threaded IRQ support requires kernel >= 2.6.31. This patchset implements a workqueue based workaround wrapper, which works on kernels with and without threaded IRQ support. It's split up into a generic header and a b43 specific patch. The generic header needs to be put somewhere into the compat include search path. The b43 specific patch needs to be applied to compat-b43. (The #include for the header file will also need to be adjusted) Index: wireless-testing/drivers/net/wireless/b43/main.c =================================================================== --- wireless-testing.orig/drivers/net/wireless/b43/main.c 2009-09-06 19:48:52.000000000 +0200 +++ wireless-testing/drivers/net/wireless/b43/main.c 2009-09-06 19:54:28.000000000 +0200 @@ -3841,7 +3841,7 @@ redo: /* Synchronize the interrupt handlers. Unlock to avoid deadlocks. */ orig_dev = dev; mutex_unlock(&wl->mutex); - synchronize_irq(dev->dev->irq); + compat_synchronize_threaded_irq(&dev->irq_compat); mutex_lock(&wl->mutex); dev = wl->current_dev; if (!dev) @@ -3858,7 +3858,7 @@ redo: dev_kfree_skb(skb_dequeue(&wl->tx_queue)); b43_mac_suspend(dev); - free_irq(dev->dev->irq, dev); + compat_free_threaded_irq(&dev->irq_compat); b43_leds_exit(dev); b43dbg(wl, "Wireless interface stopped\n"); @@ -3873,9 +3873,11 @@ static int b43_wireless_core_start(struc B43_WARN_ON(b43_status(dev) != B43_STAT_INITIALIZED); drain_txstatus_queue(dev); - err = request_threaded_irq(dev->dev->irq, b43_interrupt_handler, - b43_interrupt_thread_handler, - IRQF_SHARED, KBUILD_MODNAME, dev); + err = compat_request_threaded_irq(&dev->irq_compat, + dev->dev->irq, + b43_interrupt_handler, + b43_interrupt_thread_handler, + IRQF_SHARED, KBUILD_MODNAME, dev); if (err) { b43err(dev->wl, "Cannot request IRQ-%d\n", dev->dev->irq); goto out; @@ -4576,6 +4578,7 @@ static int b43_setup_bands(struct b43_wl static void b43_wireless_core_detach(struct b43_wldev *dev) { + compat_destroy_threaded_irq(&dev->irq_compat); /* We release firmware that late to not be required to re-request * is all the time when we reinit the core. */ b43_release_firmware(dev); Index: wireless-testing/drivers/net/wireless/b43/b43.h =================================================================== --- wireless-testing.orig/drivers/net/wireless/b43/b43.h 2009-09-06 19:48:52.000000000 +0200 +++ wireless-testing/drivers/net/wireless/b43/b43.h 2009-09-06 19:49:46.000000000 +0200 @@ -7,6 +7,7 @@ #include #include #include +#include #include "debugfs.h" #include "leds.h" @@ -818,6 +819,8 @@ struct b43_wldev { #ifdef CONFIG_B43_DEBUG struct b43_dfsentry *dfsentry; #endif + + struct compat_threaded_irq irq_compat; }; static inline struct b43_wl *hw_to_b43_wl(struct ieee80211_hw *hw)