aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsangamanatha <sangam.swamy@samsung.com>2011-04-01 03:14:04 +0900
committerArve Hjønnevåg <arve@android.com>2011-11-17 17:54:13 -0800
commitd21de594dd40298134cab8e795fcd29714e8716f (patch)
tree2c0fdeda527a4b85eb2925cf05c426afe2c601c7
parenta49936b2e9ddcc087e6b4391fd9c2f26f6ca2740 (diff)
downloadkernel_samsung_crespo-d21de594dd40298134cab8e795fcd29714e8716f.zip
kernel_samsung_crespo-d21de594dd40298134cab8e795fcd29714e8716f.tar.gz
kernel_samsung_crespo-d21de594dd40298134cab8e795fcd29714e8716f.tar.bz2
net: wimax: prevent dpm timeout during device busy
Added mutex_trylock to check device busy state. added wake_lock to avoid suspend during send. Change-Id: Iaae7c952b3718e66e50eb26639415e4afc4b3d22 Signed-off-by: sangamanatha <sangam.swamy@samsung.com>
-rwxr-xr-xdrivers/net/wimax/cmc7xx/send.c4
-rwxr-xr-xdrivers/net/wimax/cmc7xx/wimax_sdio.c9
-rw-r--r--include/linux/wimax/samsung/wimax732.h1
3 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/wimax/cmc7xx/send.c b/drivers/net/wimax/cmc7xx/send.c
index 63337bc..46eaa5c 100755
--- a/drivers/net/wimax/cmc7xx/send.c
+++ b/drivers/net/wimax/cmc7xx/send.c
@@ -248,6 +248,7 @@ int cmc732_send_thread(void *data)
if ((!adapter) || adapter->halted)
break;
+ wake_lock(&pdata->g_cfg->wimax_tx_lock);
mutex_lock(&pdata->g_cfg->suspend_mutex);
pdata->wakeup_assert(1);
@@ -257,6 +258,7 @@ int cmc732_send_thread(void *data)
if (hw_device_wakeup(adapter)) {
reset_modem = true;
mutex_unlock(&pdata->g_cfg->suspend_mutex);
+ wake_unlock(&pdata->g_cfg->wimax_tx_lock);
break;
}
}
@@ -272,11 +274,13 @@ int cmc732_send_thread(void *data)
if (!bufdsc) {
pr_debug("Fail...node is null");
mutex_unlock(&pdata->g_cfg->suspend_mutex);
+ wake_unlock(&pdata->g_cfg->wimax_tx_lock);
continue;
}
nRet = sd_send_data(adapter, bufdsc);
pdata->wakeup_assert(0);
mutex_unlock(&pdata->g_cfg->suspend_mutex);
+ wake_unlock(&pdata->g_cfg->wimax_tx_lock);
kfree(bufdsc->buffer);
kfree(bufdsc);
if (nRet != STATUS_SUCCESS) {
diff --git a/drivers/net/wimax/cmc7xx/wimax_sdio.c b/drivers/net/wimax/cmc7xx/wimax_sdio.c
index 6113a4d..25c15b0 100755
--- a/drivers/net/wimax/cmc7xx/wimax_sdio.c
+++ b/drivers/net/wimax/cmc7xx/wimax_sdio.c
@@ -665,8 +665,10 @@ 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);
-
+ if (!mutex_trylock(&pdata->g_cfg->suspend_mutex)) {
+ pr_debug("wimax send processing\n");
+ return -EBUSY;
+ }
/* AP active pin LOW */
pdata->signal_ap_active(0);
@@ -749,6 +751,8 @@ 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;
}
@@ -761,6 +765,7 @@ 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 9219c98..94d5620 100644
--- a/include/linux/wimax/samsung/wimax732.h
+++ b/include/linux/wimax/samsung/wimax732.h
@@ -50,6 +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 tx lock */
struct mutex suspend_mutex;
u8 wimax_status;
u8 wimax_mode;/* wimax mode (SDIO, USB, etc..) */