On Mon, 2008-09-01 at 21:51 +0200, Karol Szkudlarek wrote: > I'm using Ubuntu 8.04 with compiled 1.2.26k linux wireless driver for > iwl3945 network card on my hp6710b laptop. > Script during suspend trying to remove the iwl3945 module and I > receive kernel crash. > This is repeatable. I attached screenshot of kernel stack. Has > somebody of iwl3945 developers can look on it? Please try attached patch. Thanks, -yi
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 53e234d..e312e93 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -8117,9 +8117,15 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n"); + sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group); + set_bit(STATUS_EXIT_PENDING, &priv->status); - iwl3945_down(priv); + if (priv->mac80211_registered) { + ieee80211_unregister_hw(priv->hw); + priv->mac80211_registered = 0; + } else + iwl3945_down(priv); /* make sure we flush any pending irq or * tasklet for the driver @@ -8130,8 +8136,6 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) iwl_synchronize_irq(priv); - sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group); - iwl3945_rfkill_unregister(priv); iwl3945_dealloc_ucode_pci(priv); @@ -8142,9 +8146,6 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) iwl3945_unset_hw_setting(priv); iwl3945_clear_stations_table(priv); - if (priv->mac80211_registered) - ieee80211_unregister_hw(priv->hw); - /*netif_stop_queue(dev); */ flush_workqueue(priv->workqueue);