* Re: [PATCH] mac80211: allow selection of minstrel_ht as default rc algo
From: Helmut Schaa @ 2010-06-21 19:18 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: John Linville, linux-wireless, Johannes Berg, Felix Fietkau
In-Reply-To: <AANLkTinj36oA6QpEiYywGGkRqCmNRHSeR643HpiUsXC-@mail.gmail.com>
Am Montag 21 Juni 2010 schrieb Luis R. Rodriguez:
> On Mon, Jun 21, 2010 at 1:59 AM, Helmut Schaa
> <helmut.schaa@googlemail.com> wrote:
> > Allow selection of minstrel_ht as default rate control algorithm. At the
> > moment minstrel_ht can only be requested by the driver code but not selected
> > as default in make menuconfig.
> >
> > Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
>
> Shouldn't this just be enabled when you enable minstrel? I don't get
> why we would split up the two.
Would be fine for me as well. But I'm not sure if we want minstrel_ht already
as default and we want definitely keep the possibility to only select minstrel
(if compiling on an embedded system with just bg wifi for example).
Felix, any objections against selecting minstrel_ht as default if minstrel
was selected as default rc algo and minstrel_ht is compiled in?
In case of an embedded system without minstrel_ht minstrel would stay as default.
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 83eec7a..4d6f865 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -69,6 +69,7 @@ endchoice
config MAC80211_RC_DEFAULT
string
+ default "minstrel_ht" if MAC80211_RC_DEFAULT_MINSTREL && MAC80211_RC_MINSTREL_HT
default "minstrel" if MAC80211_RC_DEFAULT_MINSTREL
default "pid" if MAC80211_RC_DEFAULT_PID
default ""
Thanks,
Helmut
^ permalink raw reply related
* Re: ATH5k - Signal measurement reports wrong values
From: Jaroslav Fojtik @ 2010-06-21 19:28 UTC (permalink / raw)
To: linux-wireless; +Cc: Bruno Randolf
In-Reply-To: <201006211650.50766.br1@einfach.org>
Dear Bruno,
> that would make more sense. there are changes in noise floor calibration and
> in antenna diversity setup between these two (2010-05-30 and 2010-06-18).
> either one may be the reason...
good
> > The directory /sys/kernel/debug is empty.
> > It looks that I have to recompile kernel. Or do you know any option to
> > pass to kernel to allow this feature?
>
> maybe you need to:
> mount -t debugfs debugfs /sys/kernel/debug
> ?
>
> also you need to compile ath5k with debugging enabled.
I will do this.
> can you tell us which chipset you are using (output of dmesg |grep
> "ath5.*chip")?
root@dvouramenna:~# dmesg |grep "ath5.*chip"
[ 6.632843] ath5k phy0: Atheros AR2413 chip found (MAC: 0x78, PHY: 0x45)
[ 7.101528] ath5k phy1: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
Both chipsets suffer with a same problem.
> also it would be interesting to know how you generate your graphs?
RODGASIGNAL=`iwconfig wlan0 | grep "Signal level" | sed -e 's/.*Signal level=\([0123456789-]*\)[ \/].*/\1/'`
if [[ $RODGASIGNAL == "" ]]; then
RODGASIGNAL="U"
else
if [[ $RODGASIGNAL > "0" ]]; then
RODGASIGNAL=-95
fi
fi
/usr/sbin/rrdupdate /var/rrd/rodgarssi.rrd N:$RODGASIGNAL
When rrd is feed, the chart could be rendered:
LABEL=`/usr/bin/date "+Rodga signal strength %d.%m.%Y"`
/usr/sbin/rrdtool graph /tmp/www/rodga-day.png --start -86400 \
-t "$LABEL" --vertical-label "Signal Strength [dBi]" -w 650 -h 95 \
DEF:rodga=/var/rrd/rodgarssi.rrd:rssi:AVERAGE \
DEF:bullet=/var/rrd/bulletrssi.rrd:rssi:AVERAGE \
LINE1:rodga#FF00FF:"rodga->dvrmn" \
LINE1:bullet#00FF00:"dvrmn->rodga" >/dev/null
regards
Jara
PS: I have replaced MAC address by 0:
/usr/sbin/iw wlan1 station dump | sed -n -e '/Station/p' -e '/signal/p' >/tmp/sta.txt
MARTIN=`grep "00:00:00:00:00:00" -A 1 -i /tmp/sta.txt | grep "signal" | sed -e 's/.*\(-[0123456789]*\) .*/\1/'`
if [[ $MARTIN == "" ]]
then
MARTIN="U"
fi
RACEK=`grep "00:00:00:00:00:00" -A 1 -i /tmp/sta.txt | grep "signal" | sed -e 's/.*\(-[0123456789]*\) .*/\1/'`
if [[ $RACEK == "" ]]
then
RACEK="U"
fi
/usr/sbin/rrdupdate /var/rrd/klienti.rrd N:$MARTIN:$RACEK
^ permalink raw reply
* Re: [PATCH] mac80211: allow selection of minstrel_ht as default rc algo
From: Felix Fietkau @ 2010-06-21 19:26 UTC (permalink / raw)
To: Helmut Schaa
Cc: Luis R. Rodriguez, John Linville, linux-wireless, Johannes Berg
In-Reply-To: <201006212118.06767.helmut.schaa@googlemail.com>
On 2010-06-21 9:18 PM, Helmut Schaa wrote:
> Am Montag 21 Juni 2010 schrieb Luis R. Rodriguez:
>> On Mon, Jun 21, 2010 at 1:59 AM, Helmut Schaa
>> <helmut.schaa@googlemail.com> wrote:
>> > Allow selection of minstrel_ht as default rate control algorithm. At the
>> > moment minstrel_ht can only be requested by the driver code but not selected
>> > as default in make menuconfig.
>> >
>> > Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
>>
>> Shouldn't this just be enabled when you enable minstrel? I don't get
>> why we would split up the two.
>
> Would be fine for me as well. But I'm not sure if we want minstrel_ht already
> as default and we want definitely keep the possibility to only select minstrel
> (if compiling on an embedded system with just bg wifi for example).
>
> Felix, any objections against selecting minstrel_ht as default if minstrel
> was selected as default rc algo and minstrel_ht is compiled in?
>
> In case of an embedded system without minstrel_ht minstrel would stay as default.
>
> diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
> index 83eec7a..4d6f865 100644
> --- a/net/mac80211/Kconfig
> +++ b/net/mac80211/Kconfig
> @@ -69,6 +69,7 @@ endchoice
>
> config MAC80211_RC_DEFAULT
> string
> + default "minstrel_ht" if MAC80211_RC_DEFAULT_MINSTREL && MAC80211_RC_MINSTREL_HT
> default "minstrel" if MAC80211_RC_DEFAULT_MINSTREL
> default "pid" if MAC80211_RC_DEFAULT_PID
> default ""
Looks good, I think we should do it this way.
- Felix
^ permalink raw reply
* Re: [RFC PATCHv2 1/2] cfg80211/mac80211: Update set_tx_power to use mBm instead of dBm units
From: Jussi Kivilinna @ 2010-06-21 19:31 UTC (permalink / raw)
To: Juuso Oikarinen; +Cc: linux-wireless, Samuel Ortiz
In-Reply-To: <1277116766-4764-1-git-send-email-juuso.oikarinen@nokia.com>
Quoting "Juuso Oikarinen" <juuso.oikarinen@nokia.com>:
> In preparation for a TX power setting interface in the nl80211, change the
> .set_tx_power function to use mBm units instead of dBm for greater
> accuracy and
> smaller power levels.
>
> Also, already in advance move the tx_power_setting enumeration to nl80211.
>
> This change affects the .tx_set_power function prototype. As a result, the
> corresponding changes are needed to modules using it. These are mac80211,
> iwmc3200wifi and rndis_wlan.
rndis_wlan part:
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
-Jussi
^ permalink raw reply
* Re: wireless-regdb: Add A band in IL - And general point regarding tx power limits in the dbase
From: Luis R. Rodriguez @ 2010-06-21 19:40 UTC (permalink / raw)
To: Johannes Berg
Cc: Michael Green, John W. Linville, linux-wireless@vger.kernel.org,
David Quan, Emmanuel Grumbach
In-Reply-To: <1277147731.3635.12.camel@jlt3.sipsolutions.net>
On Mon, Jun 21, 2010 at 12:15 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2010-06-21 at 07:51 -0700, Michael Green wrote:
>
>> b) I think all entries in the dbase should be in dBm (not mW). dBm
>> vs. mW are absolutely equivalent. No reason to retain "mW" unit from
>> the source docs. I think this was agreed by all before, but wanted to
>> reiterate.
>
> Why? The tools automatically convert one into the other as required, so
> if the source documents state mW it is _much_ easier to retain it for
> future review. Hence I think it should be retained. As you say, it's
> absolutely equivalent, so there's no reason _not_ to retain it as in the
> source.
I think the concern is not that but the other way around -- checking
db.txt against some internal docs which already have stuff in dBm. So
how about a simple solution: we write a script which parses db.txt and
gives you all entries in either format?
Luis
^ permalink raw reply
* Re: [ath5k-devel] [PATCH v2] ath5k: disable ASPM
From: Jussi Kivilinna @ 2010-06-21 20:01 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Maxim Levitsky, David Quan, Bob Copeland, Luis R. Rodriguez,
ath5k-devel, linux-wireless, linux-kernel
In-Reply-To: <AANLkTim8iZmm8pEERJUsrQWOiLSjPUfCN-TFFzZZQWx2@mail.gmail.com>
Quoting "Luis R. Rodriguez" <mcgrof@gmail.com>:
>> Also Jussi Kivilinna said that he found that in windows .inf file there
>> are some instructions to enable L1 but not L0s.
>
> For which chipsets?
I uploaded windows driver I have to:
http://www.student.oulu.fi/~jukivili/ath5k/XP32_XP64_WHQL_Dri-7-6-1-149_ACU-7-0-2-48_LEAP_Acer_81024
In inf, all ASPM entries are either ASPM off or ASPM L0s:off/L1:on.
There is also user option for changing ASPM setting with options
L0s:off/L1:off and L0s:off/L1:on.
-Jussi
^ permalink raw reply
* Re: [ath5k-devel] [PATCH v2] ath5k: disable ASPM
From: Maxim Levitsky @ 2010-06-21 20:16 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: David Quan, Bob Copeland, Luis R. Rodriguez, Jussi Kivilinna,
ath5k-devel, linux-wireless, linux-kernel
In-Reply-To: <AANLkTim8iZmm8pEERJUsrQWOiLSjPUfCN-TFFzZZQWx2@mail.gmail.com>
Luis, let me explain again, exactly the situation:
First of all AR5001 and AR5001X devices (former was usualy listed as
AR2425, and I have it, later I don't know about much), don't work well
with ASPM L0s enabled.
I told that many times, but I tell again.
As soon as card it put on medium to high transmit load
(for example even if transmission consists mostly of TCP ACK packets),
it dies.
Usualy it will stop transmitting, and then after few seconds it will
send RXORN intrrupt to the host, even though the channel was idle.
(Tested by sending a stream of UDP packets on channel that is neighbor
free).
I didn't see it, but some users reported seeing jumbo frames at this
time as well.
Overall it doesn't matter because card just goes south.
A reset sometimes brings card to life, sometimes causes another storm of
RXORN and sometimes just results in quiet dead card.
A next reset might bring it to life, or not.
Card (at least mine) advertises its as a 'pre pci 1.1 device'.
Therefore if I enable CONFIG_PCIEASPM, the pci core will automaticly
disable ASPM (both L0s and L1) on this card.
I won't be surprised that windows does the same.
Therefore the patch I sent it useless because it only works when
CONFIG_PCIEASPM is enabled.
In addition to that using the original version of this patch from Jussi
Kivilinna contains code that disables ASPM (I modified it to disable
only L0s) with or without CONFIG_PCIEASPM.
But without CONFIG_PCIEASPM it uses open coded function that should
belong to pci core.
And it is also copied from e1000 which shouldn't do that too.
Best regards,
Maxim Levitsky
^ permalink raw reply
* Re: [ath5k-devel] [PATCH v2] ath5k: disable ASPM
From: Jussi Kivilinna @ 2010-06-21 20:33 UTC (permalink / raw)
To: Maxim Levitsky
Cc: Luis R. Rodriguez, David Quan, Bob Copeland, Luis R. Rodriguez,
ath5k-devel, linux-wireless, linux-kernel
In-Reply-To: <1277151410.5409.33.camel@maxim-laptop>
Quoting "Maxim Levitsky" <maximlevitsky@gmail.com>:
> Card (at least mine) advertises its as a 'pre pci 1.1 device'.
> Therefore if I enable CONFIG_PCIEASPM, the pci core will automaticly
> disable ASPM (both L0s and L1) on this card.
> I won't be surprised that windows does the same.
>
Even if CONFIG_PCIEASPM compiled in, ASPM code can be disabled by user
with pcie_aspm=off option, leaving BIOS-enabled L0s on.
-Jussi
^ permalink raw reply
* Re: [ath5k-devel] [PATCH v2] ath5k: disable ASPM
From: Luis R. Rodriguez @ 2010-06-21 20:37 UTC (permalink / raw)
To: Maxim Levitsky
Cc: David Quan, Bob Copeland, Luis R. Rodriguez, Jussi Kivilinna,
ath5k-devel, linux-wireless, linux-kernel, Jonathan May
In-Reply-To: <1277151410.5409.33.camel@maxim-laptop>
On Mon, Jun 21, 2010 at 1:16 PM, Maxim Levitsky <maximlevitsky@gmail.com> wrote:
> Luis, let me explain again, exactly the situation:
>
> First of all AR5001 and AR5001X devices (former was usualy listed as
> AR2425, and I have it, later I don't know about much), don't work well
> with ASPM L0s enabled.
Thanks for the clarification. David, do you see this as well on your end?
> I told that many times, but I tell again.
> As soon as card it put on medium to high transmit load
> (for example even if transmission consists mostly of TCP ACK packets),
> it dies.
>
> Usualy it will stop transmitting, and then after few seconds it will
> send RXORN intrrupt to the host, even though the channel was idle.
> (Tested by sending a stream of UDP packets on channel that is neighbor
> free).
>
> I didn't see it, but some users reported seeing jumbo frames at this
> time as well.
> Overall it doesn't matter because card just goes south.
>
> A reset sometimes brings card to life, sometimes causes another storm of
> RXORN and sometimes just results in quiet dead card.
> A next reset might bring it to life, or not.
>
> Card (at least mine) advertises its as a 'pre pci 1.1 device'.
> Therefore if I enable CONFIG_PCIEASPM, the pci core will automaticly
> disable ASPM (both L0s and L1) on this card.
> I won't be surprised that windows does the same.
I am not sure when L0s was enabled as per the spec as mandatory, I
thought it was optional. Interesting to hear this behavior on Linux
with CONFIG_PCIEASPM. That Kconfig description and code really need
some spit shining.
> Therefore the patch I sent it useless because it only works when
> CONFIG_PCIEASPM is enabled.
How so ? Your patch disables L0s, I can use ASPM with L0s and L1 with
or without CONFIG_PCIEASPM. If I added your calls to ath9k I would
disable L0s.
Luis
^ permalink raw reply
* Re: [ath5k-devel] [PATCH v2] ath5k: disable ASPM
From: Luis R. Rodriguez @ 2010-06-21 20:39 UTC (permalink / raw)
To: Jussi Kivilinna
Cc: Maxim Levitsky, David Quan, Bob Copeland, Luis R. Rodriguez,
ath5k-devel, linux-wireless, linux-kernel
In-Reply-To: <20100621233333.21262abjfxl8j1xc@hayate.sektori.org>
On Mon, Jun 21, 2010 at 1:33 PM, Jussi Kivilinna
<jussi.kivilinna@mbnet.fi> wrote:
> Quoting "Maxim Levitsky" <maximlevitsky@gmail.com>:
>
>> Card (at least mine) advertises its as a 'pre pci 1.1 device'.
>> Therefore if I enable CONFIG_PCIEASPM, the pci core will automaticly
>> disable ASPM (both L0s and L1) on this card.
>> I won't be surprised that windows does the same.
>>
>
> Even if CONFIG_PCIEASPM compiled in, ASPM code can be disabled by user with
> pcie_aspm=off option, leaving BIOS-enabled L0s on.
Last I reviewed CONFIG_PCIEASPM won't buy you *anything* other than
debugging knobs. With it you can force all devices to enable ASPM
completely on or disable it. Both of which I think are not really
useful and instead should be done in userspace given that if you are
testing ASPM you likely want to test only one one device and its
respective root complex, not all at the same time.
Luis
^ permalink raw reply
* [PATCH] mac80211: avoid scheduling while atomic in mesh_rx_plink_frame
From: John W. Linville @ 2010-06-21 21:09 UTC (permalink / raw)
To: linux-wireless
Cc: Javier Cardona, Andrey Yurovsky, Gertjan van Wingerde,
Ivo van Doorn, John W. Linville
While mesh_rx_plink_frame holds sta->lock...
mesh_rx_plink_frame ->
mesh_plink_inc_estab_count ->
ieee80211_bss_info_change_notify
...but ieee80211_bss_info_change_notify is allowed to sleep. A driver
taking advantage of that allowance can cause a scheduling while
atomic bug. Similar paths exist for mesh_plink_dec_estab_count,
so work around those as well.
http://bugzilla.kernel.org/show_bug.cgi?id=16099
Also, correct a minor kerneldoc comment error (mismatched function names).
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
net/mac80211/mesh_plink.c | 39 +++++++++++++++++++++++++++++----------
1 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 3cd5f7b..350f9a8 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -73,7 +73,6 @@ void mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata)
{
atomic_dec(&sdata->u.mesh.mshstats.estab_plinks);
mesh_accept_plinks_update(sdata);
- ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
}
/**
@@ -115,7 +114,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
}
/**
- * mesh_plink_deactivate - deactivate mesh peer link
+ * __mesh_plink_deactivate - deactivate mesh peer link
*
* @sta: mesh peer link to deactivate
*
@@ -123,18 +122,23 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
*
* Locking: the caller must hold sta->lock
*/
-static void __mesh_plink_deactivate(struct sta_info *sta)
+static bool __mesh_plink_deactivate(struct sta_info *sta)
{
struct ieee80211_sub_if_data *sdata = sta->sdata;
+ bool deactivated = false;
- if (sta->plink_state == PLINK_ESTAB)
+ if (sta->plink_state == PLINK_ESTAB) {
mesh_plink_dec_estab_count(sdata);
+ deactivated = true;
+ }
sta->plink_state = PLINK_BLOCKED;
mesh_path_flush_by_nexthop(sta);
+
+ return deactivated;
}
/**
- * __mesh_plink_deactivate - deactivate mesh peer link
+ * mesh_plink_deactivate - deactivate mesh peer link
*
* @sta: mesh peer link to deactivate
*
@@ -142,9 +146,15 @@ static void __mesh_plink_deactivate(struct sta_info *sta)
*/
void mesh_plink_deactivate(struct sta_info *sta)
{
+ struct ieee80211_sub_if_data *sdata = sta->sdata;
+ bool deactivated;
+
spin_lock_bh(&sta->lock);
- __mesh_plink_deactivate(sta);
+ deactivated = __mesh_plink_deactivate(sta);
spin_unlock_bh(&sta->lock);
+
+ if (deactivated)
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
}
static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
@@ -381,10 +391,16 @@ int mesh_plink_open(struct sta_info *sta)
void mesh_plink_block(struct sta_info *sta)
{
+ struct ieee80211_sub_if_data *sdata = sta->sdata;
+ bool deactivated;
+
spin_lock_bh(&sta->lock);
- __mesh_plink_deactivate(sta);
+ deactivated = __mesh_plink_deactivate(sta);
sta->plink_state = PLINK_BLOCKED;
spin_unlock_bh(&sta->lock);
+
+ if (deactivated)
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
}
@@ -397,6 +413,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
enum plink_event event;
enum plink_frame_type ftype;
size_t baselen;
+ bool deactivated;
u8 ie_len;
u8 *baseaddr;
__le16 plid, llid, reason;
@@ -651,8 +668,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
case CNF_ACPT:
del_timer(&sta->plink_timer);
sta->plink_state = PLINK_ESTAB;
- mesh_plink_inc_estab_count(sdata);
spin_unlock_bh(&sta->lock);
+ mesh_plink_inc_estab_count(sdata);
mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
sta->sta.addr);
break;
@@ -684,8 +701,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
case OPN_ACPT:
del_timer(&sta->plink_timer);
sta->plink_state = PLINK_ESTAB;
- mesh_plink_inc_estab_count(sdata);
spin_unlock_bh(&sta->lock);
+ mesh_plink_inc_estab_count(sdata);
mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
sta->sta.addr);
mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
@@ -702,11 +719,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
case CLS_ACPT:
reason = cpu_to_le16(MESH_CLOSE_RCVD);
sta->reason = reason;
- __mesh_plink_deactivate(sta);
+ deactivated = __mesh_plink_deactivate(sta);
sta->plink_state = PLINK_HOLDING;
llid = sta->llid;
mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata));
spin_unlock_bh(&sta->lock);
+ if (deactivated)
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
plid, reason);
break;
--
1.7.0.1
^ permalink raw reply related
* [PATCH v2] mac80211: avoid scheduling while atomic in mesh_rx_plink_frame
From: John W. Linville @ 2010-06-21 21:14 UTC (permalink / raw)
To: linux-wireless
Cc: Javier Cardona, Andrey Yurovsky, Gertjan van Wingerde,
Ivo van Doorn, John W. Linville
In-Reply-To: <1277154547-5851-1-git-send-email-linville@tuxdriver.com>
While mesh_rx_plink_frame holds sta->lock...
mesh_rx_plink_frame ->
mesh_plink_inc_estab_count ->
ieee80211_bss_info_change_notify
...but ieee80211_bss_info_change_notify is allowed to sleep. A driver
taking advantage of that allowance can cause a scheduling while
atomic bug. Similar paths exist for mesh_plink_dec_estab_count,
so work around those as well.
http://bugzilla.kernel.org/show_bug.cgi?id=16099
Also, correct a minor kerneldoc comment error (mismatched function names).
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
v2 -> move ieee80211_bss_info_change_notify call outside of
mesh_plink_inc_estab_count to balance the API with the modifications
to mesh_plink_dec_estab_count.
net/mac80211/mesh_plink.c | 42 +++++++++++++++++++++++++++++++-----------
1 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 3cd5f7b..ea13a80 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -65,7 +65,6 @@ void mesh_plink_inc_estab_count(struct ieee80211_sub_if_data *sdata)
{
atomic_inc(&sdata->u.mesh.mshstats.estab_plinks);
mesh_accept_plinks_update(sdata);
- ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
}
static inline
@@ -73,7 +72,6 @@ void mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata)
{
atomic_dec(&sdata->u.mesh.mshstats.estab_plinks);
mesh_accept_plinks_update(sdata);
- ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
}
/**
@@ -115,7 +113,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
}
/**
- * mesh_plink_deactivate - deactivate mesh peer link
+ * __mesh_plink_deactivate - deactivate mesh peer link
*
* @sta: mesh peer link to deactivate
*
@@ -123,18 +121,23 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
*
* Locking: the caller must hold sta->lock
*/
-static void __mesh_plink_deactivate(struct sta_info *sta)
+static bool __mesh_plink_deactivate(struct sta_info *sta)
{
struct ieee80211_sub_if_data *sdata = sta->sdata;
+ bool deactivated = false;
- if (sta->plink_state == PLINK_ESTAB)
+ if (sta->plink_state == PLINK_ESTAB) {
mesh_plink_dec_estab_count(sdata);
+ deactivated = true;
+ }
sta->plink_state = PLINK_BLOCKED;
mesh_path_flush_by_nexthop(sta);
+
+ return deactivated;
}
/**
- * __mesh_plink_deactivate - deactivate mesh peer link
+ * mesh_plink_deactivate - deactivate mesh peer link
*
* @sta: mesh peer link to deactivate
*
@@ -142,9 +145,15 @@ static void __mesh_plink_deactivate(struct sta_info *sta)
*/
void mesh_plink_deactivate(struct sta_info *sta)
{
+ struct ieee80211_sub_if_data *sdata = sta->sdata;
+ bool deactivated;
+
spin_lock_bh(&sta->lock);
- __mesh_plink_deactivate(sta);
+ deactivated = __mesh_plink_deactivate(sta);
spin_unlock_bh(&sta->lock);
+
+ if (deactivated)
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
}
static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
@@ -381,10 +390,16 @@ int mesh_plink_open(struct sta_info *sta)
void mesh_plink_block(struct sta_info *sta)
{
+ struct ieee80211_sub_if_data *sdata = sta->sdata;
+ bool deactivated;
+
spin_lock_bh(&sta->lock);
- __mesh_plink_deactivate(sta);
+ deactivated = __mesh_plink_deactivate(sta);
sta->plink_state = PLINK_BLOCKED;
spin_unlock_bh(&sta->lock);
+
+ if (deactivated)
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
}
@@ -397,6 +412,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
enum plink_event event;
enum plink_frame_type ftype;
size_t baselen;
+ bool deactivated;
u8 ie_len;
u8 *baseaddr;
__le16 plid, llid, reason;
@@ -651,8 +667,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
case CNF_ACPT:
del_timer(&sta->plink_timer);
sta->plink_state = PLINK_ESTAB;
- mesh_plink_inc_estab_count(sdata);
spin_unlock_bh(&sta->lock);
+ mesh_plink_inc_estab_count(sdata);
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
sta->sta.addr);
break;
@@ -684,8 +701,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
case OPN_ACPT:
del_timer(&sta->plink_timer);
sta->plink_state = PLINK_ESTAB;
- mesh_plink_inc_estab_count(sdata);
spin_unlock_bh(&sta->lock);
+ mesh_plink_inc_estab_count(sdata);
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
sta->sta.addr);
mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
@@ -702,11 +720,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
case CLS_ACPT:
reason = cpu_to_le16(MESH_CLOSE_RCVD);
sta->reason = reason;
- __mesh_plink_deactivate(sta);
+ deactivated = __mesh_plink_deactivate(sta);
sta->plink_state = PLINK_HOLDING;
llid = sta->llid;
mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata));
spin_unlock_bh(&sta->lock);
+ if (deactivated)
+ ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
plid, reason);
break;
--
1.7.0.1
^ permalink raw reply related
* Re: 2.6.35-rc3: Reported regressions 2.6.33 -> 2.6.34
From: Pavel Roskin @ 2010-06-21 22:01 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, Rafael J. Wysocki, j, Tim Gardner
In-Reply-To: <AANLkTinRKbRPPzEqhdcexISRJKViBldG01cj9aF0wPx-@mail.gmail.com>
On Mon, 2010-06-21 at 11:32 -0700, Luis R. Rodriguez wrote:
> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=16111
> > Subject : hostap_pci: infinite registered netdevice wifi0
> > Submitter : Petr Pisar <petr.pisar@atlas.cz>
> > Date : 2010-06-02 20:55 (19 days old)
>
> The last entry on this one says we are not sure how to fix this...
That was a patch posted for that by Tim Gardner:
https://patchwork.kernel.org/patch/105008/
The patch is applied to wireless-testing
(d6a574ff6bfb842bdb98065da053881ff527be46)
$ git describe d6a574ff6bfb842bdb98065da053881ff527be46
v2.6.34-4694-gd6a574f
I understand it was applied after 2.6.34, so it should be backported to
2.6.34 and whatever older kernels are affected.
--
Regards,
Pavel Roskin
^ permalink raw reply
* [PATCH 1/5 v2]wireless:hostap_main.c warning: variable 'iface' set but not used
From: Justin P. Mattock @ 2010-06-21 22:02 UTC (permalink / raw)
To: linux-wireless; +Cc: netdev, linux-kernel, Justin P. Mattock
This is a resend from version one due to trying a different approach
than the original(probably important to leave netdev_priv() in).
In any case have a look, if there's another approach let me know
and ill test it out. The below patch fixes a warning im seeing
when compiling with gcc 4.6.0
CC [M] drivers/net/wireless/hostap/hostap_main.o
drivers/net/wireless/hostap/hostap_main.c: In function 'hostap_set_multicast_list_queue':
drivers/net/wireless/hostap/hostap_main.c:744:27: warning: variable 'iface' set but not used
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
drivers/net/wireless/hostap/hostap_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index eb57d1e..a866e7a 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -741,9 +741,8 @@ void hostap_set_multicast_list_queue(struct work_struct *work)
local_info_t *local =
container_of(work, local_info_t, set_multicast_list_queue);
struct net_device *dev = local->dev;
- struct hostap_interface *iface;
- iface = netdev_priv(dev);
+ netdev_priv(dev);
if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE,
local->is_promisc)) {
printk(KERN_INFO "%s: %sabling promiscuous mode failed\n",
--
1.7.1.rc1.21.gf3bd6
^ permalink raw reply related
* Re: 2.6.35-rc3: Reported regressions from 2.6.34
From: reinette chatre @ 2010-06-21 22:07 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, linux-bluetooth, Rafael J. Wysocki
In-Reply-To: <AANLkTikVpTyNyYWf5xIO_3ok4OwbhxoiD40G3PAK8zp8@mail.gmail.com>
On Mon, 2010-06-21 at 11:49 -0700, Luis R. Rodriguez wrote:
> On Sun, Jun 20, 2010 at 3:11 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=16235
> > Subject : [REGRESSION] [IWL3945] Broadcast is broken?
> > Submitter : Maciej Rutecki <maciej.rutecki@gmail.com>
> > Date : 2010-06-14 17:24 (7 days old)
> > Message-ID : <201006141924.24061.maciej.rutecki@gmail.com>
> > References : http://marc.info/?l=linux-kernel&m=127653628301300&w=2
>
> As noted by Maxim, the fix is in some Intel tree, but not upstream yet
> (if so why ?)
The patch was merged into our tree a few days ago. It will be sent
upstream after our validation passes, which should be by the end of this
week. The repo in which it was merged is accessible to all if the patch
is needed sooner - a link is now included in that bug report.
Reinette
^ permalink raw reply
* Re: 2.6.35-rc3: Reported regressions 2.6.33 -> 2.6.34
From: Luis R. Rodriguez @ 2010-06-21 22:18 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linux-wireless, Rafael J. Wysocki, j, Tim Gardner
In-Reply-To: <1277157673.24550.5.camel@mj>
On Mon, Jun 21, 2010 at 3:01 PM, Pavel Roskin <proski@gnu.org> wrote:
> On Mon, 2010-06-21 at 11:32 -0700, Luis R. Rodriguez wrote:
>
>> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=16111
>> > Subject : hostap_pci: infinite registered netdevice wifi0
>> > Submitter : Petr Pisar <petr.pisar@atlas.cz>
>> > Date : 2010-06-02 20:55 (19 days old)
>>
>> The last entry on this one says we are not sure how to fix this...
>
> That was a patch posted for that by Tim Gardner:
> https://patchwork.kernel.org/patch/105008/
>
> The patch is applied to wireless-testing
> (d6a574ff6bfb842bdb98065da053881ff527be46)
>
> $ git describe d6a574ff6bfb842bdb98065da053881ff527be46
> v2.6.34-4694-gd6a574f
>
> I understand it was applied after 2.6.34, so it should be backported to
> 2.6.34 and whatever older kernels are affected.
Tim can this be sent for stable?
Luis, a stable whore
^ permalink raw reply
* [PATCH 5/5] ath9k_hw: add an extra delay when reseting AR_RTC_RESET
From: Luis R. Rodriguez @ 2010-06-21 22:38 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Luis R. Rodriguez, Aeolus Yang, Madhan Jaganathan
In-Reply-To: <1277159931-7797-1-git-send-email-lrodriguez@atheros.com>
Without this we could start trying to work with the device without
it being fully functional yet and loose some packets upon resume.
Cc: Aeolus Yang <aeolus.yang@atheros.com>
Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com>
signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/hw.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index e9764dc..1ed1440 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1070,6 +1070,7 @@ static bool ath9k_hw_set_reset_power_on(struct ath_hw *ah)
REG_WRITE(ah, AR_RC, AR_RC_AHB);
REG_WRITE(ah, AR_RTC_RESET, 0);
+ udelay(2);
REGWRITE_BUFFER_FLUSH(ah);
DISABLE_REGWRITE_BUFFER(ah);
--
1.6.3.3
^ permalink raw reply related
* [PATCH 1/5] ath9k_hw: fix ASPM setting for AR9003
From: Luis R. Rodriguez @ 2010-06-21 22:38 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Luis R. Rodriguez, Aeolus Yang, Madhan Jaganathan
In-Reply-To: <1277159931-7797-1-git-send-email-lrodriguez@atheros.com>
The AR_WA register should not be read when in sleep state so
add a variable we can stash its value into for when we need
to set it. Additionally the AR_WA_D3_TO_L1_DISABLE_REAL
(bit 16) needs to be removed.
Cc: Aeolus Yang <aeolus.yang@atheros.com>
Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com>
signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/ar9003_hw.c | 2 +
drivers/net/wireless/ath/ath9k/hw.c | 45 ++++++++++++++++++++++++----
drivers/net/wireless/ath/ath9k/hw.h | 6 ++++
drivers/net/wireless/ath/ath9k/reg.h | 5 +++
4 files changed, 52 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index 82c3ab7..b4a9441 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -295,6 +295,8 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
/* Several PCIe massages to ensure proper behaviour */
if (ah->config.pcie_waen)
REG_WRITE(ah, AR_WA, ah->config.pcie_waen);
+ else
+ REG_WRITE(ah, AR_WA, ah->WARegVal);
}
}
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 62597f4..fb09042 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -575,14 +575,8 @@ static int __ath9k_hw_init(struct ath_hw *ah)
* This enables PCIe low power mode.
*/
if (AR_SREV_9300_20_OR_LATER(ah)) {
- u32 regval;
unsigned int i;
- /* Set Bits 16 and 17 in the AR_WA register. */
- regval = REG_READ(ah, AR_WA);
- regval |= 0x00030000;
- REG_WRITE(ah, AR_WA, regval);
-
for (i = 0; i < ah->iniPcieSerdesLowPower.ia_rows; i++) {
REG_WRITE(ah,
INI_RA(&ah->iniPcieSerdesLowPower, i, 0),
@@ -590,6 +584,15 @@ static int __ath9k_hw_init(struct ath_hw *ah)
}
}
+ /*
+ * Read back AR_WA into a permanent copy and set bits 14 and 17.
+ * We need to do this to avoid RMW of this register. We cannot
+ * read the reg when chip is asleep.
+ */
+ ah->WARegVal = REG_READ(ah, AR_WA);
+ ah->WARegVal |= (AR_WA_D3_L1_DISABLE |
+ AR_WA_ASPM_TIMER_BASED_DISABLE);
+
if (ah->is_pciexpress)
ath9k_hw_configpcipowersave(ah, 0, 0);
else
@@ -1009,6 +1012,11 @@ static bool ath9k_hw_set_reset(struct ath_hw *ah, int type)
ENABLE_REGWRITE_BUFFER(ah);
+ if (AR_SREV_9300_20_OR_LATER(ah)) {
+ REG_WRITE(ah, AR_WA, ah->WARegVal);
+ udelay(10);
+ }
+
REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN |
AR_RTC_FORCE_WAKE_ON_INT);
@@ -1063,6 +1071,11 @@ static bool ath9k_hw_set_reset_power_on(struct ath_hw *ah)
{
ENABLE_REGWRITE_BUFFER(ah);
+ if (AR_SREV_9300_20_OR_LATER(ah)) {
+ REG_WRITE(ah, AR_WA, ah->WARegVal);
+ udelay(10);
+ }
+
REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN |
AR_RTC_FORCE_WAKE_ON_INT);
@@ -1099,6 +1112,11 @@ static bool ath9k_hw_set_reset_power_on(struct ath_hw *ah)
static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type)
{
+ if (AR_SREV_9300_20_OR_LATER(ah)) {
+ REG_WRITE(ah, AR_WA, ah->WARegVal);
+ udelay(10);
+ }
+
REG_WRITE(ah, AR_RTC_FORCE_WAKE,
AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT);
@@ -1768,6 +1786,11 @@ static void ath9k_set_power_sleep(struct ath_hw *ah, int setChip)
REG_CLR_BIT(ah, (AR_RTC_RESET),
AR_RTC_RESET_EN);
}
+
+ /* Clear Bit 14 of AR_WA after putting chip into Full Sleep mode. */
+ if (AR_SREV_9300_20_OR_LATER(ah))
+ REG_WRITE(ah, AR_WA,
+ ah->WARegVal & ~AR_WA_D3_L1_DISABLE);
}
/*
@@ -1794,6 +1817,10 @@ static void ath9k_set_power_network_sleep(struct ath_hw *ah, int setChip)
AR_RTC_FORCE_WAKE_EN);
}
}
+
+ /* Clear Bit 14 of AR_WA after putting chip into Net Sleep mode. */
+ if (AR_SREV_9300_20_OR_LATER(ah))
+ REG_WRITE(ah, AR_WA, ah->WARegVal & ~AR_WA_D3_L1_DISABLE);
}
static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
@@ -1801,6 +1828,12 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
u32 val;
int i;
+ /* Set Bits 14 and 17 of AR_WA before powering on the chip. */
+ if (AR_SREV_9300_20_OR_LATER(ah)) {
+ REG_WRITE(ah, AR_WA, ah->WARegVal);
+ udelay(10);
+ }
+
if (setChip) {
if ((REG_READ(ah, AR_RTC_STATUS) &
AR_RTC_STATUS_M) == AR_RTC_STATUS_SHUTDOWN) {
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 5ecbfcf..6c6d47b 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -819,6 +819,12 @@ struct ath_hw {
u32 paprd_gain_table_entries[PAPRD_GAIN_TABLE_ENTRIES];
u8 paprd_gain_table_index[PAPRD_GAIN_TABLE_ENTRIES];
+ /*
+ * Store the permanent value of Reg 0x4004in WARegVal
+ * so we dont have to R/M/W. We should not be reading
+ * this register when in sleep states.
+ */
+ u32 WARegVal;
};
static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah)
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index 3e3ccef..47be667 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -704,6 +704,11 @@
#define AR_WA_BIT7 (1 << 7)
#define AR_WA_BIT23 (1 << 23)
#define AR_WA_D3_L1_DISABLE (1 << 14)
+#define AR_WA_D3_TO_L1_DISABLE_REAL (1 << 16)
+#define AR_WA_ASPM_TIMER_BASED_DISABLE (1 << 17)
+#define AR_WA_RESET_EN (1 << 18) /* Sw Control to enable PCI-Reset to POR (bit 15) */
+#define AR_WA_ANALOG_SHIFT (1 << 20)
+#define AR_WA_POR_SHORT (1 << 21) /* PCI-E Phy reset control */
#define AR9285_WA_DEFAULT 0x004a050b
#define AR9280_WA_DEFAULT 0x0040073b
#define AR_WA_DEFAULT 0x0000073f
--
1.6.3.3
^ permalink raw reply related
* [PATCH 3/5] ath9k_hw: add pcieSerDesWrite to disable SERDES ASPM tweaks
From: Luis R. Rodriguez @ 2010-06-21 22:38 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Luis R. Rodriguez, Aeolus Yang, Madhan Jaganathan
In-Reply-To: <1277159931-7797-1-git-send-email-lrodriguez@atheros.com>
This can be useful during testing of new ASPM tweaks which often
have to be done through the PCI Serializer-Deserializer (SERDES).
Cc: Aeolus Yang <aeolus.yang@atheros.com>
Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/ar9003_hw.c | 2 +-
drivers/net/wireless/ath/ath9k/hw.c | 1 +
drivers/net/wireless/ath/ath9k/hw.h | 1 +
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index efabab8..99bde5f 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -303,7 +303,7 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
* Configire PCIE after Ini init. SERDES values now come from ini file
* This enables PCIe low power mode.
*/
- if (AR_SREV_9300_20_OR_LATER(ah)) {
+ if (ah->config.pcieSerDesWrite) {
unsigned int i;
for (i = 0; i < ah->iniPcieSerdesLowPower.ia_rows; i++) {
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 3ee7d4e..e9764dc 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -388,6 +388,7 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
ah->config.ht_enable = 0;
ah->config.rx_intr_mitigation = true;
+ ah->config.pcieSerDesWrite = true;
/*
* We need this for PCI devices only (Cardbus, PCI, miniPCI)
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 6c6d47b..e9578a4 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -235,6 +235,7 @@ struct ath9k_ops_config {
int ack_6mb;
u32 cwm_ignore_extcca;
u8 pcie_powersave_enable;
+ bool pcieSerDesWrite;
u8 pcie_clock_req;
u32 pcie_waen;
u8 analog_shiftreg;
--
1.6.3.3
^ permalink raw reply related
* [PATCH 0/5] ath9K_hw: few ASPM fixes for AR9003
From: Luis R. Rodriguez @ 2010-06-21 22:38 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis R. Rodriguez
Here are a few ASPM fixes for the AR9003 family. With it
I now have L0s and L1 enabled on my AR9003. I threw an
unrelated but super small patch at the end of the series
as it was the only one left on my queue.
Luis R. Rodriguez (5):
ath9k_hw: fix ASPM setting for AR9003
ath9k_hw: move LowPower array writes to
ar9003_hw_configpcipowersave()
ath9k_hw: add pcieSerDesWrite to disable SERDES ASPM tweaks
ath9k_hw: dynamically choose the SERDES array for low power
ath9k_hw: add an extra delay when reseting AR_RTC_RESET
drivers/net/wireless/ath/ath9k/ar9003_hw.c | 20 ++++++++++
drivers/net/wireless/ath/ath9k/hw.c | 55 +++++++++++++++++++---------
drivers/net/wireless/ath/ath9k/hw.h | 7 ++++
drivers/net/wireless/ath/ath9k/reg.h | 5 +++
4 files changed, 70 insertions(+), 17 deletions(-)
^ permalink raw reply
* [PATCH 2/5] ath9k_hw: move LowPower array writes to ar9003_hw_configpcipowersave()
From: Luis R. Rodriguez @ 2010-06-21 22:38 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Luis R. Rodriguez, Aeolus Yang, Madhan Jaganathan
In-Reply-To: <1277159931-7797-1-git-send-email-lrodriguez@atheros.com>
The LowPower array writes disables the PLL when ASPM is enabled.
The host driver makes quite a few calls to ath9k_hw_configpcipowersave()
and these same calls also need to ensure the PLL is off when they issue
it.
Cc: Aeolus Yang <aeolus.yang@atheros.com>
Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/ar9003_hw.c | 14 ++++++++++++++
drivers/net/wireless/ath/ath9k/hw.c | 14 --------------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index b4a9441..efabab8 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -298,6 +298,20 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
else
REG_WRITE(ah, AR_WA, ah->WARegVal);
}
+
+ /*
+ * Configire PCIE after Ini init. SERDES values now come from ini file
+ * This enables PCIe low power mode.
+ */
+ if (AR_SREV_9300_20_OR_LATER(ah)) {
+ unsigned int i;
+
+ for (i = 0; i < ah->iniPcieSerdesLowPower.ia_rows; i++) {
+ REG_WRITE(ah,
+ INI_RA(&ah->iniPcieSerdesLowPower, i, 0),
+ INI_RA(&ah->iniPcieSerdesLowPower, i, 1));
+ }
+ }
}
/* Sets up the AR9003 hardware familiy callbacks */
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index fb09042..3ee7d4e 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -571,20 +571,6 @@ static int __ath9k_hw_init(struct ath_hw *ah)
ath9k_hw_init_mode_regs(ah);
/*
- * Configire PCIE after Ini init. SERDES values now come from ini file
- * This enables PCIe low power mode.
- */
- if (AR_SREV_9300_20_OR_LATER(ah)) {
- unsigned int i;
-
- for (i = 0; i < ah->iniPcieSerdesLowPower.ia_rows; i++) {
- REG_WRITE(ah,
- INI_RA(&ah->iniPcieSerdesLowPower, i, 0),
- INI_RA(&ah->iniPcieSerdesLowPower, i, 1));
- }
- }
-
- /*
* Read back AR_WA into a permanent copy and set bits 14 and 17.
* We need to do this to avoid RMW of this register. We cannot
* read the reg when chip is asleep.
--
1.6.3.3
^ permalink raw reply related
* [PATCH 4/5] ath9k_hw: dynamically choose the SERDES array for low power
From: Luis R. Rodriguez @ 2010-06-21 22:38 UTC (permalink / raw)
To: linville
Cc: linux-wireless, Luis R. Rodriguez, Aeolus Yang, Madhan Jaganathan
In-Reply-To: <1277159931-7797-1-git-send-email-lrodriguez@atheros.com>
The array we use will vary depending on whether or not we are
to go to lower power or not. The default values (iniPcieSerdes)
are a copy or what go into the registers through the INI files.
Cc: Aeolus Yang <aeolus.yang@atheros.com>
Cc: Madhan Jaganathan <madhan.jaganathan@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/ar9003_hw.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index 99bde5f..0641689 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -305,11 +305,15 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
*/
if (ah->config.pcieSerDesWrite) {
unsigned int i;
+ struct ar5416IniArray *array;
- for (i = 0; i < ah->iniPcieSerdesLowPower.ia_rows; i++) {
+ array = power_off ? &ah->iniPcieSerdes :
+ &ah->iniPcieSerdesLowPower;
+
+ for (i = 0; i < array->ia_rows; i++) {
REG_WRITE(ah,
- INI_RA(&ah->iniPcieSerdesLowPower, i, 0),
- INI_RA(&ah->iniPcieSerdesLowPower, i, 1));
+ INI_RA(array, i, 0),
+ INI_RA(array, i, 1));
}
}
}
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
From: Grazvydas Ignotas @ 2010-06-21 22:48 UTC (permalink / raw)
To: Denis 'GNUtoo' Carikli
Cc: Bob Copeland, Kalle Valo, John W.Linville, linux-wireless
In-Reply-To: <1277145901.28895.29.camel@gnutoo-laptop>
>> Probably not relevant to power saving, but:
>>
>> Are you using the dedicated irq line or sdio interrupt?
>> It makes a big difference in overall throughput to use
>> the former.
> I don't know. what should I grep for?
It might actually be related.. Try adding this to your board file to
enable GPIO irq:
static void wl1251_set_power(bool enable)
{
}
static struct wl12xx_platform_data wl1251_pdata = {
.set_power = wl1251_set_power,
};
static struct platform_device wl1251_data = {
.name = "wl1251_data",
.id = -1,
.dev = {
.platform_data = &wl1251_pdata,
},
};
.. then from some init function:
// WIFI_IRQ_GPIO is the GPIO number connected to wl1251 irq line
wl1251_pdata.irq = gpio_to_irq(WIFI_IRQ_GPIO);
platform_device_register(&wl1251_pdata);
>
>> > + /*
>> > + * FIXME: scanning while associated causes lockups,
>> > + * so we don't allow that
>> > + */
>> > + if (wl->associated)
>> > + return -EBUSY;
>>
>> Any idea why? Could you turn on lockdep?
> No I just used the patches that weren't mine
> I took them from openpandora wireless repository,looked if they were
> already included,and include the one that weren't.
This is a workaround we use on pandora, otherwise with NetworkManager
running the driver locks up. I didn't have a chance to properly debug
this, but I can do some backtraces if you are interested.
^ permalink raw reply
* Linux script to enable ASPM / Documentation for ASPM
From: Luis R. Rodriguez @ 2010-06-21 22:58 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-wireless, Martin Mares
ASPM was a dark magic when I first started looking at it. Some of it
is still dark but what I was able to understand with the help of
colleagues at work I've managed to stash here for now:
http://wireless.kernel.org/en/users/Documentation/ASPM
Then enabling ASPM was also quite a challenge and I always had to go
back and revisit the procedures, so to help with that instead I wrote
a script to do this for you correctly:
http://kernel.org/pub/linux/kernel/people/mcgrof/aspm/enable-aspm
Its sha1sum is: f5804fdab512065f219e55addf78c6654f1fc045
If any of that looks confusing refer to the documentation above.
There's a TODO there, so I'll get to the different items when I can
but if you like feel free to send me patches as well:
TODO: patches are welcomed to me until we submit to to
PCI Utilities upstream.
This can be improved by in this order:
* Accept arguments for endpoint and root complex address, and
desired ASPM settings
* Look for your ASPM capabilities by quering your
LnkCap register first. Use these values to let you
select whether you want to enable only L1 or L1 & L0s
* Searching for your root complex for you
* Search for your PCI device by using the driver
* Disable your driver and ask to reboot ?
* Rewrite in C
* Write ncurses interface [ wishlist ]
* Write GTK/QT interface [ wishlist ]
* Submit upstream as aspm.c to the PCI Utilities, which are
maintained by Martin Mares <mj@ucw.cz>
Luis
^ permalink raw reply
* Re: Linux script to enable ASPM / Documentation for ASPM
From: Luis R. Rodriguez @ 2010-06-21 23:02 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-wireless, Martin Mares
In-Reply-To: <AANLkTikmFJAHEBwAZ_lPosAZH3JO2zA5KetXuHvfe4WT@mail.gmail.com>
On Mon, Jun 21, 2010 at 3:58 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> ASPM was a dark magic when I first started looking at it. Some of it
> is still dark but what I was able to understand with the help of
> colleagues at work I've managed to stash here for now:
>
> http://wireless.kernel.org/en/users/Documentation/ASPM
>
> Then enabling ASPM was also quite a challenge and I always had to go
> back and revisit the procedures, so to help with that instead I wrote
> a script to do this for you correctly:
>
> http://kernel.org/pub/linux/kernel/people/mcgrof/aspm/enable-aspm
>
> Its sha1sum is: f5804fdab512065f219e55addf78c6654f1fc045
>
> If any of that looks confusing refer to the documentation above.
>
> There's a TODO there, so I'll get to the different items when I can
> but if you like feel free to send me patches as well:
>
> TODO: patches are welcomed to me until we submit to to
> PCI Utilities upstream.
>
> This can be improved by in this order:
>
> * Accept arguments for endpoint and root complex address, and
> desired ASPM settings
> * Look for your ASPM capabilities by quering your
> LnkCap register first. Use these values to let you
> select whether you want to enable only L1 or L1 & L0s
> * Searching for your root complex for you
> * Search for your PCI device by using the driver
> * Disable your driver and ask to reboot ?
> * Rewrite in C
> * Write ncurses interface [ wishlist ]
> * Write GTK/QT interface [ wishlist ]
> * Submit upstream as aspm.c to the PCI Utilities, which are
> maintained by Martin Mares <mj@ucw.cz>
Come to think of it, would this be welcomed upstream in the PCI utils
as is for now?
Luis
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox