diff options
author | JP Abgrall <jpa@google.com> | 2012-04-09 12:19:32 -0700 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2012-04-09 12:19:32 -0700 |
commit | 8723a0df077f1a99d6eae81bfb5f6da812b79b1b (patch) | |
tree | bfe1a4b5c4f1e38d152a49c5da37dbc2e732135d | |
parent | ce0fa42413821cbcbd0e22999374741f5979831d (diff) | |
download | kernel_samsung_aries-8723a0df077f1a99d6eae81bfb5f6da812b79b1b.zip kernel_samsung_aries-8723a0df077f1a99d6eae81bfb5f6da812b79b1b.tar.gz kernel_samsung_aries-8723a0df077f1a99d6eae81bfb5f6da812b79b1b.tar.bz2 |
net: wimax: fix system process not responding ANR.
This patch fixes the issue "5704273 system process not
responding ANR every time after soft reboot of device".
Issue can be reproduced by soft rebooting the device:
adb root
adb shell stop
adb shell start
The ANR was due to wimax power on fail due to wimax
firmware download failure. The modem was not responding after
driver send MSG_DRIVER_OK_REQ during f/w download process.
The issue is fixed by retrying the MSG_DRIVER_OK_REQ again after
waiting for 100ms, in case failed to get MSG_DRIVER_OK_RESP.
Change-Id: Id6c9e4ae53dfcf9f1755cd8c9b5946f8a2c926aa
Signed-off-by: sangamanatha <sangam.swamy@samsung.com>
-rwxr-xr-x | drivers/net/wimax/cmc7xx/download.h | 3 | ||||
-rwxr-xr-x | drivers/net/wimax/cmc7xx/hardware.c | 14 | ||||
-rwxr-xr-x | drivers/net/wimax/cmc7xx/receive.c | 2 | ||||
-rwxr-xr-x | drivers/net/wimax/cmc7xx/wimax_sdio.c | 2 | ||||
-rwxr-xr-x | drivers/net/wimax/cmc7xx/wimax_sdio.h | 2 |
5 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/wimax/cmc7xx/download.h b/drivers/net/wimax/cmc7xx/download.h index f99de4a..34851e0 100755 --- a/drivers/net/wimax/cmc7xx/download.h +++ b/drivers/net/wimax/cmc7xx/download.h @@ -24,7 +24,8 @@ #define MAX_IMAGE_DATA_LENGTH 3564 #define MAX_IMAGE_DATA_MSG_LENGTH 4096 -#define FWDOWNLOAD_TIMEOUT 5 +#define MODEM_RESP_RETRY 15 +#define FWDOWNLOAD_TIMEOUT 12 #define MAX_WIMAXFW_SIZE 2100000 /* used for host boot (firmware download) */ diff --git a/drivers/net/wimax/cmc7xx/hardware.c b/drivers/net/wimax/cmc7xx/hardware.c index 34c1b2e..52390e8 100755 --- a/drivers/net/wimax/cmc7xx/hardware.c +++ b/drivers/net/wimax/cmc7xx/hardware.c @@ -84,6 +84,7 @@ static void cmc732_release_wake_irq(struct net_adapter *adapter) int wimax_hw_start(struct net_adapter *adapter) { + int retry = 0; struct wimax732_platform_data *pdata = adapter->pdata; pdata->g_cfg->wimax_status = WIMAX_STATE_READY; @@ -113,7 +114,17 @@ int wimax_hw_start(struct net_adapter *adapter) if (adapter->downloading) { - send_cmd_packet(adapter, MSG_DRIVER_OK_REQ); + while (!adapter->modem_resp) { + send_cmd_packet(adapter, MSG_DRIVER_OK_REQ); + wait_event_interruptible_timeout( + adapter->modem_resp_event, + adapter->modem_resp, + HZ/10); + if (!adapter->modem_resp) + pr_err("no modem response"); + if (++retry > MODEM_RESP_RETRY) + goto download_fail; + } switch (wait_event_interruptible_timeout( adapter->download_event, @@ -192,6 +203,7 @@ int wimax_hw_init(struct net_adapter *adapter) spin_lock_init(&adapter->hw.lock); init_waitqueue_head(&adapter->download_event); + init_waitqueue_head(&adapter->modem_resp_event); init_completion(&adapter->wakeup_event); return STATUS_SUCCESS; diff --git a/drivers/net/wimax/cmc7xx/receive.c b/drivers/net/wimax/cmc7xx/receive.c index 37cf885..7126a62 100755 --- a/drivers/net/wimax/cmc7xx/receive.c +++ b/drivers/net/wimax/cmc7xx/receive.c @@ -29,6 +29,8 @@ static void process_indicate_packet(struct net_adapter *adapter, u8 *buffer) switch (be16_to_cpu(packet->id)) { case MSG_DRIVER_OK_RESP: + adapter->modem_resp = true; + wake_up_interruptible(&adapter->modem_resp_event); pr_debug("%s: MSG_DRIVER_OK_RESP\n", __func__); send_image_info_packet(adapter, MSG_IMAGE_INFO_REQ); break; diff --git a/drivers/net/wimax/cmc7xx/wimax_sdio.c b/drivers/net/wimax/cmc7xx/wimax_sdio.c index 25c15b0..65a20cc 100755 --- a/drivers/net/wimax/cmc7xx/wimax_sdio.c +++ b/drivers/net/wimax/cmc7xx/wimax_sdio.c @@ -630,6 +630,8 @@ static void adapter_remove(struct sdio_func *func) adapter->removed = true; adapter->download_complete = true; wake_up_interruptible(&adapter->download_event); + adapter->modem_resp = true; + wake_up_interruptible(&adapter->modem_resp_event); } if (!completion_done(&adapter->wakeup_event)) diff --git a/drivers/net/wimax/cmc7xx/wimax_sdio.h b/drivers/net/wimax/cmc7xx/wimax_sdio.h index 9594758..b9de36a 100755 --- a/drivers/net/wimax/cmc7xx/wimax_sdio.h +++ b/drivers/net/wimax/cmc7xx/wimax_sdio.h @@ -52,10 +52,12 @@ struct net_adapter { struct completion wakeup_event; struct wimax732_platform_data *pdata; wait_queue_head_t download_event; + wait_queue_head_t modem_resp_event; wait_queue_head_t receive_event; wait_queue_head_t send_event; u8 downloading; /* firmware downloading */ u8 download_complete; + u8 modem_resp; u8 mac_ready; u8 media_state;/* mac completion */ |