diff options
-rwxr-xr-x | drivers/net/wimax/cmc7xx/send.c | 12 | ||||
-rwxr-xr-x | drivers/net/wimax/cmc7xx/wimax_sdio.c | 6 | ||||
-rw-r--r-- | include/linux/wimax/samsung/wimax732.h | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/wimax/cmc7xx/send.c b/drivers/net/wimax/cmc7xx/send.c index d997091..63337bc 100755 --- a/drivers/net/wimax/cmc7xx/send.c +++ b/drivers/net/wimax/cmc7xx/send.c @@ -13,6 +13,7 @@ */ #include "headers.h" #include "download.h" +#include <linux/mutex.h> static int hw_sdio_write_bank_index(struct net_adapter *adapter, int *write_idx) { @@ -247,7 +248,7 @@ int cmc732_send_thread(void *data) if ((!adapter) || adapter->halted) break; - wake_lock(&adapter->pdata->g_cfg->wimax_tx_lock); + mutex_lock(&pdata->g_cfg->suspend_mutex); pdata->wakeup_assert(1); if ((pdata->g_cfg->wimax_status == WIMAX_STATE_IDLE || @@ -255,8 +256,7 @@ int cmc732_send_thread(void *data) && !pdata->is_modem_awake()) { if (hw_device_wakeup(adapter)) { reset_modem = true; - wake_unlock( - &adapter->pdata->g_cfg->wimax_tx_lock); + mutex_unlock(&pdata->g_cfg->suspend_mutex); break; } } @@ -271,17 +271,19 @@ int cmc732_send_thread(void *data) if (!bufdsc) { pr_debug("Fail...node is null"); - wake_unlock(&adapter->pdata->g_cfg->wimax_tx_lock); + mutex_unlock(&pdata->g_cfg->suspend_mutex); continue; } nRet = sd_send_data(adapter, bufdsc); pdata->wakeup_assert(0); + mutex_unlock(&pdata->g_cfg->suspend_mutex); kfree(bufdsc->buffer); kfree(bufdsc); - wake_unlock(&adapter->pdata->g_cfg->wimax_tx_lock); if (nRet != STATUS_SUCCESS) { pr_debug("SendData Fail******"); ++adapter->XmitErr; + reset_modem = true; + break; } } while (adapter); diff --git a/drivers/net/wimax/cmc7xx/wimax_sdio.c b/drivers/net/wimax/cmc7xx/wimax_sdio.c index 0d2f6a6..6113a4d 100755 --- a/drivers/net/wimax/cmc7xx/wimax_sdio.c +++ b/drivers/net/wimax/cmc7xx/wimax_sdio.c @@ -665,6 +665,7 @@ int wimax_suspend(struct platform_device *pdev, pm_message_t state) return 0; pdata = pdev->dev.platform_data; + mutex_lock(&pdata->g_cfg->suspend_mutex); /* AP active pin LOW */ pdata->signal_ap_active(0); @@ -698,6 +699,7 @@ int wimax_resume(struct platform_device *pdev) /* wait wakeup noti for 1 sec otherwise suspend again */ wake_lock_timeout(&pdata->g_cfg->wimax_wake_lock, 1 * HZ); + mutex_unlock(&pdata->g_cfg->suspend_mutex); return 0; } @@ -726,6 +728,7 @@ static int wimax_probe(struct platform_device *pdev) pr_debug("misc_register() failed"); return error; } + mutex_init(&pdata->g_cfg->suspend_mutex); for (i = 0; i < ARRAY_SIZE(adapter_table); i++) adapter_table[i].driver_data = @@ -746,8 +749,6 @@ static int wimax_probe(struct platform_device *pdev) WAKE_LOCK_SUSPEND, "wimax_wakeup"); wake_lock_init(&pdata->g_cfg->wimax_rxtx_lock, WAKE_LOCK_SUSPEND, "wimax_rxtx"); - wake_lock_init(&pdata->g_cfg->wimax_tx_lock, - WAKE_LOCK_SUSPEND, "wimax_tx"); return error; } @@ -760,7 +761,6 @@ static int wimax_remove(struct platform_device *pdev) /* destroy wake locks */ wake_lock_destroy(&pdata->g_cfg->wimax_wake_lock); wake_lock_destroy(&pdata->g_cfg->wimax_rxtx_lock); - wake_lock_destroy(&pdata->g_cfg->wimax_tx_lock); sdio_unregister_driver(&adapter_driver); misc_deregister(&pdata->swmxctl_dev); diff --git a/include/linux/wimax/samsung/wimax732.h b/include/linux/wimax/samsung/wimax732.h index 4c647a7..9219c98 100644 --- a/include/linux/wimax/samsung/wimax732.h +++ b/include/linux/wimax/samsung/wimax732.h @@ -50,7 +50,7 @@ struct wimax_cfg { int temp_tgid; /* handles unexpected close */ struct wake_lock wimax_wake_lock; /* resume wake lock */ struct wake_lock wimax_rxtx_lock;/* sdio wake lock */ - struct wake_lock wimax_tx_lock;/* sdio send lock*/ + struct mutex suspend_mutex; u8 wimax_status; u8 wimax_mode;/* wimax mode (SDIO, USB, etc..) */ u8 sleep_mode;/* suspend mode (0: VI, 1: IDLE) */ |