linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raja Mani <rmani@qca.qualcomm.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: <linux-wireless@vger.kernel.org>, <ath6kl-devel@qualcomm.com>
Subject: Re: [PATCH v2 1/1] ath6kl: Check wow state before sending control and data pkt
Date: Tue, 28 Feb 2012 11:17:36 +0530	[thread overview]
Message-ID: <4F4C6A78.3070704@qca.qualcomm.com> (raw)
In-Reply-To: <4F4B95A7.2060809@qca.qualcomm.com>

On Monday 27 February 2012 08:09 PM, Kalle Valo wrote:
> On 02/09/2012 11:31 AM, rmani@qca.qualcomm.com wrote:
>> From: Raja Mani<rmani@qca.qualcomm.com>
>>
>> Below two scenarios are taken care in this patch which helped
>> to fix the firmware crash during wow suspend/resume.
>>
>> * TX operation (ctrl tx and data tx) has to be controlled based
>>    on suspend state. i.e, with respect to WOW mode, control packets
>>    are allowed to send from the host until the suspend state goes
>>    ATH6KL_STATE_WOW and the data packets are allowed until WOW
>>    suspend operation starts.
>>
>> * Similarly, wow resume is NOT allowed if WOW suspend is in progress.
>>
>> Signed-off-by: Raja Mani<rmani@qca.qualcomm.com>
>> ---
>> V2 changes:
>>
>> * Separate wow sub state introduced in V1 is removed and common
>>    states (ATH6KL_STATE_SUSPENDING and ATH6KL_STATE_RESUMING)
>>    are added in enum ath6kl_state.
>>
>> * netdev queue is stopped while dropping skb in ath6kl_data_tx()
>>    and resumed back in ath6kl_wow_resume().
>
> [...]
>
>> diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
>> index 4febee7..402087e 100644
>> --- a/drivers/net/wireless/ath/ath6kl/sdio.c
>> +++ b/drivers/net/wireless/ath/ath6kl/sdio.c
>> @@ -901,8 +901,12 @@ static int ath6kl_sdio_resume(struct ath6kl *ar)
>>
>>   	case ATH6KL_STATE_WOW:
>>   		break;
>> +
>>   	case ATH6KL_STATE_SCHED_SCAN:
>>   		break;
>> +
>> +	default:
>> +		break;
>>   	}
>
> Don't add the default case, instead add all states explicitly. That way
> it's easier to track state changes.

I don't see any value addition having CASE statement for each state
here. We are not doing any specific operation other than the state
ATH6KL_STATE_OFF and ATH6KL_STATE_CUTPOWER.

IMHO, cases can be added later if we want to do anything specific to the 
state in future.

To fix sparse errors, i added default case here.
>
>> --- a/drivers/net/wireless/ath/ath6kl/txrx.c
>> +++ b/drivers/net/wireless/ath/ath6kl/txrx.c
>> @@ -284,6 +284,9 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb,
>>   	int status = 0;
>>   	struct ath6kl_cookie *cookie = NULL;
>>
>> +	if (ar->state == ATH6KL_STATE_WOW)
>> +		return -EACCES;
>
> Should this have WARN_ON_ONCE()?

I'll correct this in V3.

>
>> @@ -359,6 +362,13 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
>>   		return 0;
>>   	}
>>
>> +	if (WARN_ON_ONCE(ar->state != ATH6KL_STATE_ON)) {
>> +		set_bit(NETQ_STOPPED,&vif->flags);
>> +		netif_stop_queue(dev);
>> +		dev_kfree_skb(skb);
>> +		return 0;
>> +	}
>
> Don't stop the queue here, dropping the packet is enough.

As per your comments in V1, i added this change.
Do you want me to change it again ?

This is what i received from you.

"Don't think about dropping packets, instead try to make sure that the
packet flow is _stopped_. Dropping packets should be the last resort,
instead we need to go to the source of the packets. For data packets
this means that we need to stop netdev queues. For control packets we
need to make sure that cfg80211 ops in cfg80211.c don't issue any new
wmi commands. And maybe we should also consider debugfs and wmi events
as they can also issue new wmi commands."

>
> Kalle

  reply	other threads:[~2012-02-28  5:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  9:31 [PATCH v2 1/1] ath6kl: Check wow state before sending control and data pkt rmani
2012-02-27 14:39 ` Kalle Valo
2012-02-28  5:47   ` Raja Mani [this message]
2012-03-05 16:59     ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F4C6A78.3070704@qca.qualcomm.com \
    --to=rmani@qca.qualcomm.com \
    --cc=ath6kl-devel@qualcomm.com \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).