aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsangamanatha <sangam.swamy@samsung.com>2011-03-30 17:18:01 +0900
committerArve Hjønnevåg <arve@android.com>2011-11-17 17:54:11 -0800
commit8e137ff254e1b2b3598205795e5ec1ca0d8b8baf (patch)
tree98527228dd45de46c8678a98cb3cc0585a5d5fe7
parent8165d14c76e525c1d412706b25fed02a0f997255 (diff)
downloadkernel_samsung_crespo-8e137ff254e1b2b3598205795e5ec1ca0d8b8baf.zip
kernel_samsung_crespo-8e137ff254e1b2b3598205795e5ec1ca0d8b8baf.tar.gz
kernel_samsung_crespo-8e137ff254e1b2b3598205795e5ec1ca0d8b8baf.tar.bz2
net: wimax: prevent dpm timeout in send during suspend
removed the mutex lock in wimax suspend which might hold driver suspend for long time causing dpm timeout. packet send error not handled in case data send during suspend. Change-Id: I28f24e14dd6451db3065d0a170b8d2ec035e4112 Signed-off-by: sangamanatha <sangam.swamy@samsung.com>
-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, 9 insertions, 11 deletions
diff --git a/drivers/net/wimax/cmc7xx/send.c b/drivers/net/wimax/cmc7xx/send.c
index 63337bc..d997091 100755
--- a/drivers/net/wimax/cmc7xx/send.c
+++ b/drivers/net/wimax/cmc7xx/send.c
@@ -13,7 +13,6 @@
*/
#include "headers.h"
#include "download.h"
-#include <linux/mutex.h>
static int hw_sdio_write_bank_index(struct net_adapter *adapter, int *write_idx)
{
@@ -248,7 +247,7 @@ int cmc732_send_thread(void *data)
if ((!adapter) || adapter->halted)
break;
- mutex_lock(&pdata->g_cfg->suspend_mutex);
+ wake_lock(&adapter->pdata->g_cfg->wimax_tx_lock);
pdata->wakeup_assert(1);
if ((pdata->g_cfg->wimax_status == WIMAX_STATE_IDLE ||
@@ -256,7 +255,8 @@ int cmc732_send_thread(void *data)
&& !pdata->is_modem_awake()) {
if (hw_device_wakeup(adapter)) {
reset_modem = true;
- mutex_unlock(&pdata->g_cfg->suspend_mutex);
+ wake_unlock(
+ &adapter->pdata->g_cfg->wimax_tx_lock);
break;
}
}
@@ -271,19 +271,17 @@ int cmc732_send_thread(void *data)
if (!bufdsc) {
pr_debug("Fail...node is null");
- mutex_unlock(&pdata->g_cfg->suspend_mutex);
+ wake_unlock(&adapter->pdata->g_cfg->wimax_tx_lock);
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 6113a4d..0d2f6a6 100755
--- a/drivers/net/wimax/cmc7xx/wimax_sdio.c
+++ b/drivers/net/wimax/cmc7xx/wimax_sdio.c
@@ -665,7 +665,6 @@ 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);
@@ -699,7 +698,6 @@ 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;
}
@@ -728,7 +726,6 @@ 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 =
@@ -749,6 +746,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 +760,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..4c647a7 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 mutex suspend_mutex;
+ struct wake_lock wimax_tx_lock;/* sdio send lock*/
u8 wimax_status;
u8 wimax_mode;/* wimax mode (SDIO, USB, etc..) */
u8 sleep_mode;/* suspend mode (0: VI, 1: IDLE) */