linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
To: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	<linux-wireless@vger.kernel.org>,
	Rodriguez Luis <rodrigue@qca.qualcomm.com>,
	<ath9k-devel@lists.ath9k.org>,
	Rajkumar Manoharan <rmanohar@qca.qualcomm.com>,
	<vadivel@qca.qualcomm.com>, <rhu@qca.qualcomm.com>,
	Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Subject: Re: [PATCH v3 09/10] ath9k: Add WoW related mac80211 callbacks
Date: Tue, 26 Jun 2012 10:54:14 +0530	[thread overview]
Message-ID: <4FE9477E.5000902@qca.qualcomm.com> (raw)
In-Reply-To: <20456.47690.633636.869442@gargle.gargle.HOWL>

Hi Sujith,

On Tuesday 26 June 2012 12:51 AM, Sujith Manoharan wrote:
> Mohammed Shafi Shajakhan wrote:
>> +#ifdef CONFIG_PM_SLEEP
>> +
>> +void ath_wow_cleanup(struct ath_softc *sc)
>> +{
>> +	struct ath9k_wow_info *wow_info =&sc->wow_info;
>> +	struct ath9k_wow_pattern *wow_pattern  = NULL, *tmp;
>> +
>> +	if (!(sc->wow_enabled&  AH_WOW_USER_PATTERN_EN))
>> +		return;
>> +
>> +	list_for_each_entry_safe(wow_pattern, tmp,
>> +				&wow_info->wow_patterns, list) {
>> +
>> +		list_del(&wow_pattern->list);
>> +		kfree(wow_pattern);
>> +	}
>> +
>> +}
>
> I am slightly unclear about this...
>
>> +	u8 dis_deauth_pattern[MAX_PATTERN_SIZE];
>> +	u8 dis_deauth_mask[MAX_PATTERN_SIZE];
>> +
>> +	memset(dis_deauth_pattern, 0, MAX_PATTERN_SIZE);
>> +	memset(dis_deauth_mask, 0, MAX_PATTERN_SIZE);
>
> MAX_PATTERN_MASK_SIZE ?

thanks, filling up 0xff requires MAX_PATTERN_MASK_SIZE.

>
>> +		memset(wow_pattern->pattern_bytes, 0, MAX_PATTERN_SIZE);
>> +		memset(wow_pattern->mask_bytes, 0, MAX_PATTERN_SIZE);
>
> The memset() calls are not needed, but maybe I am missing something -
> why exactly are we maintaining a list of patterns in the driver ?
> Can't the patterns be retrieved as part of the suspend() callback
> and just programmed in the HW ?

the user pattern needs bit more stuff, we need to convert it to our chip 
specific format(ie proper 802.11 format), previously there was
a logic of duplicate patterns before programming to HW, where a list in 
the driver was necessary, i removed it to simplify few things.
will check it out if its really needed for any enhancements in future.

>
>> +
>> +	if (!device_can_wakeup(sc->dev)) {
>> +		ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n");
>> +		ret = 1;
>> +		goto fail_wow;
>> +	}
>
> Can this happen ?

the wow capabilities are initialized only if
device_can_wakeup passes. would check it out if this is needed.

>
>> +	/*
>> +	 * we can now sync irq and kill any running tasklets, since we already
>> +	 * disabled interrupts and not holding a spin lock
>> +	 */
>> +	synchronize_irq(sc->irq);
>> +	tasklet_kill(&sc->intr_tq);
>> +
>> +	ath9k_hw_wow_enable(ah, wow_triggers_enabled);
>> +
>> +	ath9k_ps_restore(sc);
>> +	ath_dbg(common, ANY, "WoW enabled in ath9k\n");
>> +	sc->wow_sleep_proc_intr = true;
>
> This is racy with the ISR, atomic ops can be used instead, since this
> (along with wow_got_bmiss_intr) are just boolean variables.

thanks, will check this out.

>
>> +static void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
>> +{
>> +	struct ath_softc *sc = hw->priv;
>> +
>> +	mutex_lock(&sc->mutex);
>> +	device_init_wakeup(sc->dev, 1);
>> +	device_set_wakeup_enable(sc->dev, enabled);
>> +	mutex_unlock(&sc->mutex);
>> +}
>
> device_init_wakeup() should be part of the probe sequence, I think.
>

in v2 i had it in my pci_probe only, but device_init_wakeup seems to 
call device_set_wakeup_enable. we actually set device_set_wakeup_enable 
explicitly to 'true' only when wow triggers are enabled, otherwise
we would set our chip to wakeup capable during pci_probe.

-- 
thanks,
shafi

  reply	other threads:[~2012-06-26  5:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 14:12 [PATCH v3 00/10] Add support for WOW in ath9k Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 01/10] ath9k_hw: Add register definitions for WoW support Mohammed Shafi Shajakhan
2012-06-25 17:19   ` Sujith Manoharan
2012-06-26  4:28     ` Mohammed Shafi Shajakhan
2012-07-07 11:46       ` Mohammed Shafi
2012-06-25 14:12 ` [PATCH v3 02/10] ath9k: Add definitions and structures to support WoW Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 03/10] ath9k_hw: Add WoW hardware capability flags Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 04/10] ath9k_hw: advertise WoW support for capable chipsets Mohammed Shafi Shajakhan
2012-06-25 17:24   ` Sujith Manoharan
2012-06-26  4:34     ` Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 05/10] ath9k: advertise supported WoW flags to upper layer Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 06/10] ath9k_hw: INI changes for WoW for AR9002 chipsets Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 07/10] ath9k_hw: Add hardware code for WoW Mohammed Shafi Shajakhan
2012-06-25 18:44   ` Sujith Manoharan
2012-06-26  4:55     ` Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 08/10] ath: Add Wake-on-Wireless debug mask Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 09/10] ath9k: Add WoW related mac80211 callbacks Mohammed Shafi Shajakhan
2012-06-25 19:21   ` Sujith Manoharan
2012-06-26  5:24     ` Mohammed Shafi Shajakhan [this message]
2012-06-26  6:50       ` Johannes Berg
2012-06-26  7:28         ` Mohammed Shafi Shajakhan
2012-06-25 14:12 ` [PATCH v3 10/10] ath9k: do not disable hardware while wow is enabled Mohammed Shafi Shajakhan
2012-07-06 19:35 ` [PATCH v3 00/10] Add support for WOW in ath9k John W. Linville
2012-07-07  9:30   ` Mohammed Shafi Shajakhan

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=4FE9477E.5000902@qca.qualcomm.com \
    --to=mohammed@qca.qualcomm.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=c_manoha@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rhu@qca.qualcomm.com \
    --cc=rmanohar@qca.qualcomm.com \
    --cc=rodrigue@qca.qualcomm.com \
    --cc=senthilb@qca.qualcomm.com \
    --cc=vadivel@qca.qualcomm.com \
    /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).