Commit 8c7ae357 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by John W. Linville

ath9k: fix race in setting ATH_OP_INVALID

The commit "ath9k: move sc_flags to ath_common" moved setting
ATH_OP_INVALID flag below ieee80211_register_hw. This is causing
the flag never being cleared randomly as the drv_start is called
prior to setting flag. Fix this by setting the flag prior to
register_hw.
Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c82552c5
...@@ -86,7 +86,6 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -86,7 +86,6 @@ static int ath_ahb_probe(struct platform_device *pdev)
int irq; int irq;
int ret = 0; int ret = 0;
struct ath_hw *ah; struct ath_hw *ah;
struct ath_common *common;
char hw_name[64]; char hw_name[64];
if (!dev_get_platdata(&pdev->dev)) { if (!dev_get_platdata(&pdev->dev)) {
...@@ -146,9 +145,6 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -146,9 +145,6 @@ static int ath_ahb_probe(struct platform_device *pdev)
wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n", wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
hw_name, (unsigned long)mem, irq); hw_name, (unsigned long)mem, irq);
common = ath9k_hw_common(sc->sc_ah);
/* Will be cleared in ath9k_start() */
set_bit(ATH_OP_INVALID, &common->op_flags);
return 0; return 0;
err_irq: err_irq:
......
...@@ -783,6 +783,9 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, ...@@ -783,6 +783,9 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
common = ath9k_hw_common(ah); common = ath9k_hw_common(ah);
ath9k_set_hw_capab(sc, hw); ath9k_set_hw_capab(sc, hw);
/* Will be cleared in ath9k_start() */
set_bit(ATH_OP_INVALID, &common->op_flags);
/* Initialize regulatory */ /* Initialize regulatory */
error = ath_regd_init(&common->regulatory, sc->hw->wiphy, error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
ath9k_reg_notifier); ath9k_reg_notifier);
......
...@@ -784,7 +784,6 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -784,7 +784,6 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ {
struct ath_softc *sc; struct ath_softc *sc;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct ath_common *common;
u8 csz; u8 csz;
u32 val; u32 val;
int ret = 0; int ret = 0;
...@@ -877,10 +876,6 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -877,10 +876,6 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n", wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
hw_name, (unsigned long)sc->mem, pdev->irq); hw_name, (unsigned long)sc->mem, pdev->irq);
/* Will be cleared in ath9k_start() */
common = ath9k_hw_common(sc->sc_ah);
set_bit(ATH_OP_INVALID, &common->op_flags);
return 0; return 0;
err_init: err_init:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment