linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mwifiex: fix corner case power save issue
@ 2016-10-21 15:15 Amitkumar Karwar
  2016-10-21 15:15 ` [PATCH 2/2] mwifiex: ignore calibration data failure Amitkumar Karwar
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Amitkumar Karwar @ 2016-10-21 15:15 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

We may get SLEEP event from firmware even if TXDone for last Tx packet
is still pending. In this case, we may end up accessing PCIe memory for
handling TXDone after power save handshake is completed. This causes
kernel crash with external abort.

We will delay sending SLEEP confirm to firmware in
this case to resolve the problem.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/cmdevt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index 5347728..f582f61 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -1118,7 +1118,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
 void
 mwifiex_check_ps_cond(struct mwifiex_adapter *adapter)
 {
-	if (!adapter->cmd_sent &&
+	if (!adapter->cmd_sent && !adapter->data_sent &&
 	    !adapter->curr_cmd && !IS_CARD_RX_RCVD(adapter))
 		mwifiex_dnld_sleep_confirm_cmd(adapter);
 	else
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] mwifiex: ignore calibration data failure
  2016-10-21 15:15 [PATCH 1/2] mwifiex: fix corner case power save issue Amitkumar Karwar
@ 2016-10-21 15:15 ` Amitkumar Karwar
  2016-11-18 11:11   ` [2/2] " Kalle Valo
  2016-10-24 23:07 ` [PATCH 1/2] mwifiex: fix corner case power save issue Brian Norris
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Amitkumar Karwar @ 2016-10-21 15:15 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

Firmware may reject calibration data from host for certain OTP
settings. In that case, we should continue initialisation ignoring
the failure.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index 2a162c3..638d30a 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -2228,19 +2228,13 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
 				adapter->hs_cfg.gpio = data;
 			}
 
-			ret = mwifiex_dnld_dt_cfgdata(priv, adapter->dt_node,
-						      "marvell,caldata");
-			if (ret)
-				return -1;
+			mwifiex_dnld_dt_cfgdata(priv, adapter->dt_node,
+						"marvell,caldata");
 		}
 
-		if (adapter->cal_data) {
-			ret = mwifiex_send_cmd(priv, HostCmd_CMD_CFG_DATA,
-					       HostCmd_ACT_GEN_SET, 0, NULL,
-					       true);
-			if (ret)
-				return -1;
-		}
+		if (adapter->cal_data)
+			mwifiex_send_cmd(priv, HostCmd_CMD_CFG_DATA,
+					 HostCmd_ACT_GEN_SET, 0, NULL, true);
 
 		/* Read MAC address from HW */
 		ret = mwifiex_send_cmd(priv, HostCmd_CMD_GET_HW_SPEC,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mwifiex: fix corner case power save issue
  2016-10-21 15:15 [PATCH 1/2] mwifiex: fix corner case power save issue Amitkumar Karwar
  2016-10-21 15:15 ` [PATCH 2/2] mwifiex: ignore calibration data failure Amitkumar Karwar
@ 2016-10-24 23:07 ` Brian Norris
  2016-11-01 16:41 ` Amitkumar Karwar
  2016-11-17 11:28 ` [1/2] " Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Brian Norris @ 2016-10-24 23:07 UTC (permalink / raw)
  To: Amitkumar Karwar; +Cc: linux-wireless, Cathy Luo, Nishant Sarmukadam

Hi,

On Fri, Oct 21, 2016 at 08:45:47PM +0530, Amitkumar Karwar wrote:
> We may get SLEEP event from firmware even if TXDone for last Tx packet
> is still pending. In this case, we may end up accessing PCIe memory for
> handling TXDone after power save handshake is completed. This causes
> kernel crash with external abort.
> 
> We will delay sending SLEEP confirm to firmware in
> this case to resolve the problem.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> ---
>  drivers/net/wireless/marvell/mwifiex/cmdevt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> index 5347728..f582f61 100644
> --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> @@ -1118,7 +1118,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
>  void
>  mwifiex_check_ps_cond(struct mwifiex_adapter *adapter)
>  {
> -	if (!adapter->cmd_sent &&
> +	if (!adapter->cmd_sent && !adapter->data_sent &&
>  	    !adapter->curr_cmd && !IS_CARD_RX_RCVD(adapter))
>  		mwifiex_dnld_sleep_confirm_cmd(adapter);
>  	else

Looks good to me, and tests out on my systems:

Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] mwifiex: fix corner case power save issue
  2016-10-21 15:15 [PATCH 1/2] mwifiex: fix corner case power save issue Amitkumar Karwar
  2016-10-21 15:15 ` [PATCH 2/2] mwifiex: ignore calibration data failure Amitkumar Karwar
  2016-10-24 23:07 ` [PATCH 1/2] mwifiex: fix corner case power save issue Brian Norris
@ 2016-11-01 16:41 ` Amitkumar Karwar
  2016-11-17 11:28 ` [1/2] " Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Amitkumar Karwar @ 2016-11-01 16:41 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org
  Cc: Cathy Luo, Nishant Sarmukadam, Brian Norris, Xinming Hu

Hi Kalle,

> From: Amitkumar Karwar [mailto:akarwar@marvell.com]
> Sent: Friday, October 21, 2016 8:46 PM
> To: linux-wireless@vger.kernel.org
> Cc: Cathy Luo; Nishant Sarmukadam; Amitkumar Karwar
> Subject: [PATCH 1/2] mwifiex: fix corner case power save issue
> 
> We may get SLEEP event from firmware even if TXDone for last Tx packet
> is still pending. In this case, we may end up accessing PCIe memory for
> handling TXDone after power save handshake is completed. This causes
> kernel crash with external abort.
> 
> We will delay sending SLEEP confirm to firmware in this case to resolve
> the problem.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> ---
>  drivers/net/wireless/marvell/mwifiex/cmdevt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Please drop this patch.
Xinming Hu has better and complete solution for this issue as discussed at https://patchwork.kernel.org/patch/9405119/

Regards,
Amitkumar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [1/2] mwifiex: fix corner case power save issue
  2016-10-21 15:15 [PATCH 1/2] mwifiex: fix corner case power save issue Amitkumar Karwar
                   ` (2 preceding siblings ...)
  2016-11-01 16:41 ` Amitkumar Karwar
@ 2016-11-17 11:28 ` Kalle Valo
  3 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2016-11-17 11:28 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: linux-wireless, Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

Amitkumar Karwar <akarwar@marvell.com> wrote:
> We may get SLEEP event from firmware even if TXDone for last Tx packet
> is still pending. In this case, we may end up accessing PCIe memory for
> handling TXDone after power save handshake is completed. This causes
> kernel crash with external abort.
> 
> We will delay sending SLEEP confirm to firmware in
> this case to resolve the problem.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Tested-by: Brian Norris <briannorris@chromium.org>
> Reviewed-by: Brian Norris <briannorris@chromium.org>

Dropped per request from Amitkumar.

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/patch/9389485/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [2/2] mwifiex: ignore calibration data failure
  2016-10-21 15:15 ` [PATCH 2/2] mwifiex: ignore calibration data failure Amitkumar Karwar
@ 2016-11-18 11:11   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2016-11-18 11:11 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: linux-wireless, Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

Amitkumar Karwar <akarwar@marvell.com> wrote:
> Firmware may reject calibration data from host for certain OTP
> settings. In that case, we should continue initialisation ignoring
> the failure.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>

Patch applied to wireless-drivers-next.git, thanks.

14e5e9375926 mwifiex: ignore calibration data failure

-- 
https://patchwork.kernel.org/patch/9389487/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-18 11:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-21 15:15 [PATCH 1/2] mwifiex: fix corner case power save issue Amitkumar Karwar
2016-10-21 15:15 ` [PATCH 2/2] mwifiex: ignore calibration data failure Amitkumar Karwar
2016-11-18 11:11   ` [2/2] " Kalle Valo
2016-10-24 23:07 ` [PATCH 1/2] mwifiex: fix corner case power save issue Brian Norris
2016-11-01 16:41 ` Amitkumar Karwar
2016-11-17 11:28 ` [1/2] " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).