提交 23b149c1 编写于 作者: A Andrey Yurovsky 提交者: John W. Linville

libertas: fix card cleanup order in SDIO driver

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: NAndrey Yurovsky <andrey@cozybit.com>
Acked-by: NDan Williams <dcbw@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 efcfd1f2
...@@ -1093,11 +1093,11 @@ static void if_sdio_remove(struct sdio_func *func) ...@@ -1093,11 +1093,11 @@ static void if_sdio_remove(struct sdio_func *func)
lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n"); lbs_pr_alert("CMD_FUNC_SHUTDOWN cmd failed\n");
} }
card->priv->surpriseremoved = 1;
lbs_deb_sdio("call remove card\n"); lbs_deb_sdio("call remove card\n");
lbs_stop_card(card->priv); lbs_stop_card(card->priv);
lbs_remove_card(card->priv); lbs_remove_card(card->priv);
card->priv->surpriseremoved = 1;
flush_workqueue(card->workqueue); flush_workqueue(card->workqueue);
destroy_workqueue(card->workqueue); destroy_workqueue(card->workqueue);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册