summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsangamanatha <sangam.swamy@samsung.com>2011-04-01 02:57:57 +0900
committersangamanatha <sangam.swamy@samsung.com>2011-04-01 11:48:07 +0900
commitaa6a5ff61a696aa2c5d3beb0697285e5a49a15dc (patch)
treef5eeb212206741dc32ef98f3c41fa496da692db4
parent001eb762327c660937e7aaa29c0ef5b058cdddf9 (diff)
downloadsamsung-aa6a5ff61a696aa2c5d3beb0697285e5a49a15dc.tar.gz
Revert "net: wimax: prevent dpm timeout in send during suspend"
The removed mutex has an importance in maintaining concurrency in send and suspend code. So will be keeping the mutex and adding mutex_trylock in suspend code. This reverts commit 7b3fa7a7bf7027a8effa3cbe927e59d553a4503b.
-rwxr-xr-xdrivers/net/wimax/cmc7xx/send.c12
-rwxr-xr-xdrivers/net/wimax/cmc7xx/wimax_sdio.c6
-rw-r--r--include/linux/wimax/samsung/wimax732.h2
3 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/wimax/cmc7xx/send.c b/drivers/net/wimax/cmc7xx/send.c
index d997091de8e..63337bca5ef 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 95319c9c2f0..a750dfcf11b 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 4c647a792ed..9219c98015b 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) */