Skip to content

Commit

Permalink
libertas: fix card cleanup order in SDIO driver
Browse files Browse the repository at this point in the history
The SDIO driver sets the surpriseremoved flag before calling
lbs_remove_card.  With IEEE PS enabled, lbs_remove_card must issue a
command to exit IEEE PS mode, however with that flag set the command
path is blocked and the card is never taken out of IEEE PS mode.  This
step is required to ensure that the driver can be reloaded.  This patch
moves the setting of surpriseremoved after lbs_remove_card is called.

Tested with V9 firmware by ensuring that IEEE PS is disabled when the
driver is removed.  Reloading the driver is not fully tested due to a
separate issue with module reload in the SDIO driver, however this
patch at least leaves the card in a better state when we bring the
driver down.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Andrey Yurovsky authored and John W. Linville committed Jul 10, 2009
1 parent efcfd1f commit 23b149c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/libertas/if_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,11 +1093,11 @@ static void if_sdio_remove(struct sdio_func *func)
lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
}

card->priv->surpriseremoved = 1;

lbs_deb_sdio("call remove card\n");
lbs_stop_card(card->priv);
lbs_remove_card(card->priv);
card->priv->surpriseremoved = 1;

flush_workqueue(card->workqueue);
destroy_workqueue(card->workqueue);
Expand Down

0 comments on commit 23b149c

Please sign in to comment.