* Re: [PATCH 2/3] mac80211: remove bogus skb vif assignment
From: Toke Høiland-Jørgensen @ 2016-11-04 11:47 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, johannes
In-Reply-To: <20161104092754.91649-2-nbd@nbd.name>
Felix Fietkau <nbd@nbd.name> writes:
> The call to ieee80211_txq_enqueue overwrites the vif pointer with the
> codel enqueue time, so setting it just before that call makes no
> sense.
Yeah, I think this was leftover from earlier version when the flow was
different. Or maybe I just missed it...
Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk>
-Toke
^ permalink raw reply
* Re: [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue
From: Toke Høiland-Jørgensen @ 2016-11-04 11:46 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, johannes
In-Reply-To: <20161104092754.91649-1-nbd@nbd.name>
Felix Fietkau <nbd@nbd.name> writes:
> The sequence number counter is used to derive the starting sequence
> number. Since that counter is updated on tx dequeue, the A-MPDU flag
> needs to be up to date at the tme of dequeue as well.
>
> This patch prevents sending more A-MPDU frames after the session has
> been terminated and also ensures that aggregation starts right after the
> session has been established
Makes sense. Suppose there's no reason why the session couldn't be
started/ended while packets were queued.
Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk>
^ permalink raw reply
* [PATCH 1/3] mac80211: update A-MPDU flag on tx dequeue
From: Felix Fietkau @ 2016-11-04 9:27 UTC (permalink / raw)
To: linux-wireless; +Cc: toke, johannes
The sequence number counter is used to derive the starting sequence
number. Since that counter is updated on tx dequeue, the A-MPDU flag
needs to be up to date at the tme of dequeue as well.
This patch prevents sending more A-MPDU frames after the session has
been terminated and also ensures that aggregation starts right after the
session has been established
Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/tx.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 62ccaf6..c380e85 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3451,6 +3451,11 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
goto begin;
}
+ if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags))
+ info->flags |= IEEE80211_TX_CTL_AMPDU;
+ else
+ info->flags &= ~IEEE80211_TX_CTL_AMPDU;
+
if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
struct sta_info *sta = container_of(txq->sta, struct sta_info,
sta);
--
2.10.1
^ permalink raw reply related
* [PATCH 3/3] mac80211: fix A-MSDU aggregation with fast-xmit + txq
From: Felix Fietkau @ 2016-11-04 9:27 UTC (permalink / raw)
To: linux-wireless; +Cc: toke, johannes
In-Reply-To: <20161104092754.91649-1-nbd@nbd.name>
A-MSDU aggregation alters the QoS header after a frame has been
enqueued, so it needs to be ready before enqueue and not overwritten
again afterwards
Fixes: bb42f2d13ffc ("mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/tx.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 390b425..2c21b70 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3235,7 +3235,6 @@ static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
- *ieee80211_get_qos_ctl(hdr) = tid;
hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
} else {
info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
@@ -3360,6 +3359,11 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
(tid_tx ? IEEE80211_TX_CTL_AMPDU : 0);
info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT;
+ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
+ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+ *ieee80211_get_qos_ctl(hdr) = tid;
+ }
+
__skb_queue_head_init(&tx.skbs);
tx.flags = IEEE80211_TX_UNICAST;
--
2.10.1
^ permalink raw reply related
* [PATCH 2/3] mac80211: remove bogus skb vif assignment
From: Felix Fietkau @ 2016-11-04 9:27 UTC (permalink / raw)
To: linux-wireless; +Cc: toke, johannes
In-Reply-To: <20161104092754.91649-1-nbd@nbd.name>
The call to ieee80211_txq_enqueue overwrites the vif pointer with the
codel enqueue time, so setting it just before that call makes no sense.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/tx.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c380e85..390b425 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1500,7 +1500,6 @@ static bool ieee80211_queue_skb(struct ieee80211_local *local,
struct sta_info *sta,
struct sk_buff *skb)
{
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct fq *fq = &local->fq;
struct ieee80211_vif *vif;
struct txq_info *txqi;
@@ -1525,8 +1524,6 @@ static bool ieee80211_queue_skb(struct ieee80211_local *local,
if (!txqi)
return false;
- info->control.vif = vif;
-
spin_lock_bh(&fq->lock);
ieee80211_txq_enqueue(local, txqi, skb);
spin_unlock_bh(&fq->lock);
--
2.10.1
^ permalink raw reply related
* [PATCH] ath10k: Fix crash during rmmod when probe firmware fails
From: Mohammed Shafi Shajakhan @ 2016-11-04 8:38 UTC (permalink / raw)
To: ath10k; +Cc: mohammed, linux-wireless, Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
This fixes the below crash when ath10k probe firmware fails,
NAPI polling tries to access a rx ring resource which was never
allocated, fix this by disabling NAPI right away once the probe
firmware fails
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
__ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
Call Trace:
[<ffffffffa113ec62>] ath10k_htt_rx_msdu_buff_replenish+0x42/0x90
[ath10k_core]
[<ffffffffa113f393>] ath10k_htt_txrx_compl_task+0x433/0x17d0
[ath10k_core]
[<ffffffff8114406d>] ? __wake_up_common+0x4d/0x80
[<ffffffff811349ec>] ? cpu_load_update+0xdc/0x150
[<ffffffffa119301d>] ? ath10k_pci_read32+0xd/0x10 [ath10k_pci]
[<ffffffffa1195b17>] ath10k_pci_napi_poll+0x47/0x110 [ath10k_pci]
[<ffffffff817863af>] net_rx_action+0x20f/0x370
Reported-by: Ben Greear <greearb@candelatech.com>
Fixes: 3c97f5de1f28 ("ath10k: implement NAPI support")
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 7005e2a..8187eb2 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2165,6 +2165,8 @@ err_free_firmware_files:
err_power_down:
ath10k_hif_power_down(ar);
+ napi_synchronize(&ar->napi);
+ napi_disable(&ar->napi);
return ret;
}
--
1.9.1
^ permalink raw reply related
* RE: [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv
From: Xinming Hu @ 2016-11-04 3:02 UTC (permalink / raw)
To: Dmitry Torokhov, Brian Norris
Cc: Amitkumar Karwar, linux-wireless@vger.kernel.org, Cathy Luo,
Nishant Sarmukadam, rajatja@google.com
In-Reply-To: <CAKdAkRQb-rnEqOxG6MLkvM068Up-+jvYqxKCNXM+OvPgn3kdwA@mail.gmail.com>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogRG1pdHJ5IFRvcm9raG92
IFttYWlsdG86ZG1pdHJ5LnRvcm9raG92QGdtYWlsLmNvbV0NCj4gU2VudDogMjAxNuW5tDEx5pyI
NOaXpSAyOjQ5DQo+IFRvOiBCcmlhbiBOb3JyaXMNCj4gQ2M6IFhpbm1pbmcgSHU7IEFtaXRrdW1h
ciBLYXJ3YXI7IGxpbnV4LXdpcmVsZXNzQHZnZXIua2VybmVsLm9yZzsgQ2F0aHkgTHVvOw0KPiBO
aXNoYW50IFNhcm11a2FkYW07IHJhamF0amFAZ29vZ2xlLmNvbQ0KPiBTdWJqZWN0OiBSZTogW1BB
VENIIHYyIDIvNV0gbXdpZmlleDogdXNlIHNwaW5sb2NrIGZvciAnbXdpZmlleF9wcm9jZXNzaW5n
JyBpbg0KPiBzaHV0ZG93bl9kcnYNCj4gDQo+IE9uIFRodSwgTm92IDMsIDIwMTYgYXQgMTI6Mjcg
UE0sIEJyaWFuIE5vcnJpcyA8YnJpYW5ub3JyaXNAY2hyb21pdW0ub3JnPg0KPiB3cm90ZToNCj4g
PiBPbiBUaHUsIE5vdiAwMywgMjAxNiBhdCAwOToxNTowNEFNIC0wNzAwLCBEbWl0cnkgVG9yb2to
b3Ygd3JvdGU6DQo+ID4+IE9uIFRodSwgTm92IDAzLCAyMDE2IGF0IDA4OjM0OjA2QU0gKzAwMDAs
IFhpbm1pbmcgSHUgd3JvdGU6DQo+ID4+ID4gPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0K
PiA+PiA+ID4gRnJvbTogbGludXgtd2lyZWxlc3Mtb3duZXJAdmdlci5rZXJuZWwub3JnDQo+ID4+
ID4gPiBbbWFpbHRvOmxpbnV4LXdpcmVsZXNzLW93bmVyQHZnZXIua2VybmVsLm9yZ10gT24gQmVo
YWxmIE9mIERtaXRyeQ0KPiA+PiA+ID4gVG9yb2tob3YNCj4gPj4gPiA+DQo+ID4+ID4gPiBJbnN0
ZWFkIHBsZWFzZSByZW1vdmUgY2FsbCB0byBtd2lmaWV4X3NodXRkb3duX2RydigpIGluIHRoZSBt
YWluDQo+ID4+ID4gPiByb3V0aW5lIGFuZCAiaWYgKGFkYXB0ZXItPm13aWZpZXhfcHJvY2Vzc2lu
ZykiIGNoZWNrIGhlcmUuDQo+ID4+ID4gPg0KPiA+PiA+DQo+ID4+ID4gbXdpZmlleF9tYWluX3By
b2Nlc3Mgd2lsbCBiZSB1c2VkIGZyb20gaW50ZXJydXB0IG9yIHdvcmtxdWV1ZS4NCj4gPj4gPiBO
b3cgd2UgaGF2ZSBkaXNhYmxlZCBpbnRlcnJ1cHQgYW5kIGZsdXNoIHdvcmtxdWV1ZSwgc28NCj4g
Pj4gPiBtd2lmaWV4X21haW5fcHJvY2VzcyB3b24ndCBiZSBzY2hlZHVsZWQgaW4gdGhlIGZ1dHVy
ZS4NCj4gPj4gPiBCdXQgbXdpZmlleF9tYWluX3Byb2Nlc3MgbWlnaHQganVzdCBydW5uaW5nIGlu
IGNvbnRleHQgb2YgbGFzdA0KPiA+PiA+IGludGVycnVwdCwgc28gd2UgbmVlZCB3YWl0IGN1cnJl
bnQgbWFpbl9wcm9jZXNzIGNvbXBsZXRlIGluDQo+ID4+ID4gbXdpZmlleF9zaHV0ZG93bl9kcnYu
DQo+ID4+DQo+ID4+IHN5bmNocm9uaXplX2lycSgpIGlzIHlvdXIgZnJpZW5kIHRoZW4uDQo+ID4N
Cj4gPiBIbW0sIHRoYXQgc291bmRzIHJpZ2h0LCBidXQgSUlVQywgdGhlICJpbnRlcnJ1cHQgY29u
dGV4dCIgaXMgYWN0dWFsbHkNCj4gPiBvbmx5IHVzZWQgZm9yIFNESU8sIGFuZCBmb3IgU0RJTywg
dGhlIGRyaXZlciBkb2Vzbid0IGFjdHVhbGx5IGhhdmUNCj4gPiBhY2Nlc3MgdG8gdGhlIElSUSBu
dW1iZXIuIFRoZSBNTUMvU0RJTyBsYXllciBoYXMgc29tZSBleHRyYQ0KPiA+IGFic3RyYWN0aW9u
IGFyb3VuZCB0aGUgSVJRLiBTbyB0aGlzIG1heSBiZSBtb3JlIGRpZmZpY3VsdCB0aGFuIGl0IGFw
cGVhcnMuDQo+ID4NCj4gPiBEbyB3ZSBuZWVkIGEgc2Rpb19zeW5jaHJvbml6ZV9pcnEoKSBBUEk/
DQo+IA0KPiBBY3R1YWxseSB0aGUgLT5kaXNhYmxlX2lycSgpIG1ldGhvZCBzaG91bGQgYmUgcmVz
cG9uc2libGUgZm9yIG1ha2luZyBzdXJlIGl0DQo+IGRvZXMgbm90IGNvbXBsZXRlIHdoaWxlIGlu
dGVycnVwdCBoYW5kbGVyIGlzIHJ1bm5pbmcuIEFzIGZhciBhcyBJIGNhbiBzZWUsIGZvcg0KPiBT
RElPIGNhc2UsIHdlIGVuZCB1cCBjYWxsaW5nIHNkaW9fY2FyZF9pcnFfcHV0KCkgd2hpY2ggc3Rv
cHMga2VybmVsIHRocmVhZA0KPiBhbmQgd29uJ3QgcmV0dXJuIHdoaWxlIHRoZSB0aHJlYWQgaXMg
cnVubmluZy4gRm9yIG90aGVyIGludGVyZmFjZXMgd2UgbmVlZCB0bw0KPiBjaGVjay4gSUlSQyBV
U0IgbGFja3MNCj4gLT5kaXNhYmxlX2lycSgpIGFsdG9nZXRoZXIgYW5kIHRoaXMgaXMgc29tZXRo
aW5nIHRoYXQgc2hvdWRsIGJlIGZpeGVkDQo+IChieSBkb2luZyB1c2Jfa2lsbF91cmIoKSBhdCB0
aGUgbWluaW11bSkuDQo+IA0KDQpUaGFua3MgZm9yIHRoZSBleHBsYWluLCB3aWxsIGtlZXAgdGhp
cyBjbGVhbnVwIHdvcmsuDQoNCj4gVGhhbmtzLg0KPiANCj4gLS0NCj4gRG1pdHJ5DQoNClJlZ2Fy
ZHMsDQpYaW5taW5nDQo=
^ permalink raw reply
* Re: Avery's notes from LPC2016 wireless track (Santa Fe)
From: Avery Pennarun @ 2016-11-04 2:01 UTC (permalink / raw)
To: Kathy Giori; +Cc: linux-wireless
In-Reply-To: <CAMowtuMeCYGY09SG-CrYYtgPAg3=P6sufBHLZdWmY3eodW0RwQ@mail.gmail.com>
On Thu, Nov 3, 2016 at 7:55 PM, Kathy Giori <kathy.giori@gmail.com> wrote:
> On Thu, Nov 3, 2016 at 1:43 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
>> We talked about many topics at the Linux Plumbers' Conference in Santa
>> Fe on Tuesday. I took fairly detailed notes, which you can find at
>> the links below.
>
> Great notes Avery. Did you happen to take note of how many
> participants there were? Or was the attendee list posted on the wiki
> beforehand fairly accurate?
> https://wireless.wiki.kernel.org/en/developers/summits/santa-fe-2016
There were quite a few people not on the list. Google sent an
extra-large contingent last year. People estimated about 50% of the
wireless meeting were Googlers, which comes to maybe 15 out of around
30-ish. Google is doing a lot of (sometimes redundant :)) wireless
work lately.
> Was there any talk about having more frequent "live" discussions of
> these topics (via video conf or conf call or scheduled IRC), to help
> overall collaboration without having to wait for the next f2f summit?
> Mailing list interaction doesn't seem to elicit the same energy as
> occurs over live dialog. Quarterly?
It didn't come up. Honestly, it feels to me like 6 months is the
right cadence. A lot of work does happen in the background, such as
the fq_codel work (yay!) which was definitely launched by one or two
of these, but proceeded well afterwards.
Hope you're doing well at whatever you're doing now!
Have fun,
Avery
^ permalink raw reply
* Re: Avery's notes from LPC2016 wireless track (Santa Fe)
From: Avery Pennarun @ 2016-11-04 1:59 UTC (permalink / raw)
To: Barry Day, Avery Pennarun, linux-wireless
In-Reply-To: <20161103215525.GA25551@testbox>
On Thu, Nov 3, 2016 at 5:55 PM, Barry Day <briselec@gmail.com> wrote:
> Thanks for that. Can I take this as meaning there won't be any videos?
> I would like to have seen Jes Sorensen's talk on rtl8xxxu
As far as I know, no talks at this LPC were recorded.
^ permalink raw reply
* Re: Avery's notes from LPC2016 wireless track (Santa Fe)
From: Kathy Giori @ 2016-11-03 23:55 UTC (permalink / raw)
To: Avery Pennarun; +Cc: linux-wireless
In-Reply-To: <CAHqTa-07wpAYdwTFKBm7QT6mn3PBOY5PiuSo6iZ6T9GgDd75ig@mail.gmail.com>
On Thu, Nov 3, 2016 at 1:43 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
> Hi all,
>
> We talked about many topics at the Linux Plumbers' Conference in Santa
> Fe on Tuesday. I took fairly detailed notes, which you can find at
> the links below.
Great notes Avery. Did you happen to take note of how many
participants there were? Or was the attendee list posted on the wiki
beforehand fairly accurate?
https://wireless.wiki.kernel.org/en/developers/summits/santa-fe-2016
Was there any talk about having more frequent "live" discussions of
these topics (via video conf or conf call or scheduled IRC), to help
overall collaboration without having to wait for the next f2f summit?
Mailing list interaction doesn't seem to elicit the same energy as
occurs over live dialog. Quarterly?
kathy
^ permalink raw reply
* Re: Avery's notes from LPC2016 wireless track (Santa Fe)
From: Barry Day @ 2016-11-03 21:55 UTC (permalink / raw)
To: Avery Pennarun; +Cc: linux-wireless
In-Reply-To: <CAHqTa-07wpAYdwTFKBm7QT6mn3PBOY5PiuSo6iZ6T9GgDd75ig@mail.gmail.com>
Thanks for that. Can I take this as meaning there won't be any videos?
I would like to have seen Jes Sorensen's talk on rtl8xxxu
Barry
^ permalink raw reply
* Avery's notes from LPC2016 wireless track (Santa Fe)
From: Avery Pennarun @ 2016-11-03 20:43 UTC (permalink / raw)
To: linux-wireless
Hi all,
We talked about many topics at the Linux Plumbers' Conference in Santa
Fe on Tuesday. I took fairly detailed notes, which you can find at
the links below.
Fancy html commentable version:
https://docs.google.com/document/d/1Cr2bEf23wLkhiXXtyuBJtvvpb9xvCw7zsU-m1q1g4tA/edit
Less fancy version that (I think) will not ask for a Google account
(let me know if it gives you trouble):
https://docs.google.com/document/u/1/d/e/2PACX-1vQXbVQ-3zQt3Bcr3OWfwzbw_C49tTvf0ed8Hmf7b20E6tXc3a40tWZmPku49iGDE-OhgxNmO_lkkHEn/pub
Thanks, everyone, for the great discussion!
Have fun,
Avery
^ permalink raw reply
* Re: [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv
From: Dmitry Torokhov @ 2016-11-03 18:48 UTC (permalink / raw)
To: Brian Norris
Cc: Xinming Hu, Amitkumar Karwar, linux-wireless@vger.kernel.org,
Cathy Luo, Nishant Sarmukadam, rajatja@google.com
In-Reply-To: <20161103182705.GA1153@google.com>
On Thu, Nov 3, 2016 at 12:27 PM, Brian Norris <briannorris@chromium.org> wrote:
> On Thu, Nov 03, 2016 at 09:15:04AM -0700, Dmitry Torokhov wrote:
>> On Thu, Nov 03, 2016 at 08:34:06AM +0000, Xinming Hu wrote:
>> > > -----Original Message-----
>> > > From: linux-wireless-owner@vger.kernel.org
>> > > [mailto:linux-wireless-owner@vger.kernel.org] On Behalf Of Dmitry Torokhov
>> > >
>> > > Instead please remove call to mwifiex_shutdown_drv() in the main routine
>> > > and "if (adapter->mwifiex_processing)" check here.
>> > >
>> >
>> > mwifiex_main_process will be used from interrupt or workqueue.
>> > Now we have disabled interrupt and flush workqueue, so
>> > mwifiex_main_process won't be scheduled in the future.
>> > But mwifiex_main_process might just running in context of last
>> > interrupt, so we need wait current main_process complete in
>> > mwifiex_shutdown_drv.
>>
>> synchronize_irq() is your friend then.
>
> Hmm, that sounds right, but IIUC, the "interrupt context" is actually
> only used for SDIO, and for SDIO, the driver doesn't actually have
> access to the IRQ number. The MMC/SDIO layer has some extra abstraction
> around the IRQ. So this may be more difficult than it appears.
>
> Do we need a sdio_synchronize_irq() API?
Actually the ->disable_irq() method should be responsible for making
sure it does not complete while interrupt handler is running. As far
as I can see, for SDIO case, we end up calling sdio_card_irq_put()
which stops kernel thread and won't return while the thread is
running. For other interfaces we need to check. IIRC USB lacks
->disable_irq() altogether and this is something that shoudl be fixed
(by doing usb_kill_urb() at the minimum).
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv
From: Brian Norris @ 2016-11-03 18:27 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Xinming Hu, Amitkumar Karwar, linux-wireless@vger.kernel.org,
Cathy Luo, Nishant Sarmukadam, rajatja@google.com
In-Reply-To: <20161103161504.GA15366@dtor-ws>
On Thu, Nov 03, 2016 at 09:15:04AM -0700, Dmitry Torokhov wrote:
> On Thu, Nov 03, 2016 at 08:34:06AM +0000, Xinming Hu wrote:
> > > -----Original Message-----
> > > From: linux-wireless-owner@vger.kernel.org
> > > [mailto:linux-wireless-owner@vger.kernel.org] On Behalf Of Dmitry Torokhov
> > >
> > > Instead please remove call to mwifiex_shutdown_drv() in the main routine
> > > and "if (adapter->mwifiex_processing)" check here.
> > >
> >
> > mwifiex_main_process will be used from interrupt or workqueue.
> > Now we have disabled interrupt and flush workqueue, so
> > mwifiex_main_process won't be scheduled in the future.
> > But mwifiex_main_process might just running in context of last
> > interrupt, so we need wait current main_process complete in
> > mwifiex_shutdown_drv.
>
> synchronize_irq() is your friend then.
Hmm, that sounds right, but IIUC, the "interrupt context" is actually
only used for SDIO, and for SDIO, the driver doesn't actually have
access to the IRQ number. The MMC/SDIO layer has some extra abstraction
around the IRQ. So this may be more difficult than it appears.
Do we need a sdio_synchronize_irq() API?
Brian
^ permalink raw reply
* Re: [PATCH v2] rtl8xxxu: Fix for agressive power saving by rtl8723bu wireless IC
From: Jes Sorensen @ 2016-11-03 16:21 UTC (permalink / raw)
To: John Heenan; +Cc: Kalle Valo, linux-wireless
In-Reply-To: <20161101072447.GA21575@cube>
John Heenan <john@zgus.com> writes:
> The rtl8723bu wireless IC shows evidence of a more agressive approach to
> power saving, powering down its RF side when there is no wireless
> interfacing but leaving USB interfacing intact. This makes the wireless
> IC more suitable for use in devices which need to keep their power use
> as low as practical, such as tablets and Surface Pro type devices.
>
> In effect this means that a full initialisation must be performed
> whenever a wireless interface is brought up. It also means that
> interpretations of power status from general wireless registers should
> not be relied on to influence an init sequence.
>
> The patch works by forcing a fuller initialisation and forcing it to
> occur more often in code paths (such as occurs during a low level
> authentication that initiates wireless interfacing).
>
> The initialisation sequence is now more consistent with code based
> directly on vendor code. For example while the vendor derived code
> interprets a register as indcating a particular powered state, it does
> not use this information to influence its init sequence.
>
> Only devices that use the rtl8723bu driver are affected by this patch.
>
> With this patch wpa_supplicant reliably and consistently connects with
> an AP. Before a workaround such as executing rmmod and modprobe before
> each call to wpa_supplicant worked with some distributions.
>
> Signed-off-by: John Heenan <john@zgus.com>
> ---
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
I am at Linux Plumbers this week, so my response time is slow. Next week
I am on PTO, so I will not respond.
First of all, why do you keep CC'ing multiple mailing lists that do not
matter? This discussion belongs on linux-wireless not on netdev or lkml.
CC'ing Kalle directly is not going to get him to apply this broken patch
for you.
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 04141e5..ab2f2ef 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -3900,7 +3900,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
> * Fix 92DU-VC S3 hang with the reason is that secondary mac is not
> * initialized. First MAC returns 0xea, second MAC returns 0x00
> */
> - if (val8 == 0xea)
> + if (val8 == 0xea || priv->fops == &rtl8723bu_fops)
> macpower = false;
> else
> macpower = true;
Why oh why do you insist on not using the *standard* way of coping with
this? 'priv-rtl_chip' is used everywhere else, but you just have to do
something awful like this?
> @@ -5779,6 +5779,12 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
>
> ret = 0;
>
> + if(priv->fops == &rtl8723bu_fops) {
> + ret = rtl8xxxu_init_device(hw);
> + if (ret)
> + goto error_out;
> + }
> +
> init_usb_anchor(&priv->rx_anchor);
> init_usb_anchor(&priv->tx_anchor);
> init_usb_anchor(&priv->int_anchor);
Read Documentation/CodingStyle - as others already pointed you at.
> @@ -6080,9 +6086,11 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
> goto exit;
> }
>
> - ret = rtl8xxxu_init_device(hw);
> - if (ret)
> - goto exit;
> + if(priv->fops != &rtl8723bu_fops) {
> + ret = rtl8xxxu_init_device(hw);
> + if (ret)
> + goto exit;
> + }
>
> hw->wiphy->max_scan_ssids = 1;
> hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
Again coding style violation.
Second, I am NOT going to accept any patches that fundamentally changes
the init sequence of the code for just one device.
I already told you I want to find out *why* this matters, and what part
of rtl8xxxu_init_device() is the culprit. I want to understand the
actual problem, not just blindly move stuff around.
Jes
^ permalink raw reply
* Re: [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv
From: Dmitry Torokhov @ 2016-11-03 16:15 UTC (permalink / raw)
To: Xinming Hu
Cc: Amitkumar Karwar, linux-wireless@vger.kernel.org, Cathy Luo,
Nishant Sarmukadam, rajatja@google.com, briannorris@google.com
In-Reply-To: <b9fed0716cfb46818b0a93a925e5d37a@SC-EXCH02.marvell.com>
On Thu, Nov 03, 2016 at 08:34:06AM +0000, Xinming Hu wrote:
> Hi Dmitry,
>
> > -----Original Message-----
> > From: linux-wireless-owner@vger.kernel.org
> > [mailto:linux-wireless-owner@vger.kernel.org] On Behalf Of Dmitry Torokhov
> > Sent: 2016年10月28日 1:44
> > To: Amitkumar Karwar
> > Cc: linux-wireless@vger.kernel.org; Cathy Luo; Nishant Sarmukadam;
> > rajatja@google.com; briannorris@google.com
> > Subject: Re: [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in
> > shutdown_drv
> >
> > Hi Amit,
> >
> > On Thu, Oct 27, 2016 at 02:42:40PM +0530, Amitkumar Karwar wrote:
> > > This variable is guarded by spinlock at all other places. This patch
> > > takes care of missing spinlock usage in mwifiex_shutdown_drv().
> >
> > Since in the previous discussion you stated that we inhibit interrupts and flush
> > the workqueue so that mwifiex_shutdown_drv() can't run simultaneously with
> > the main processing routine, why do we need this?
> >
> > Instead please remove call to mwifiex_shutdown_drv() in the main routine
> > and "if (adapter->mwifiex_processing)" check here.
> >
>
> mwifiex_main_process will be used from interrupt or workqueue.
> Now we have disabled interrupt and flush workqueue, so mwifiex_main_process won't be scheduled in the future.
> But mwifiex_main_process might just running in context of last interrupt, so we need wait current main_process complete in mwifiex_shutdown_drv.
synchronize_irq() is your friend then.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2 01/12] mwifiex: check tx_hw_pending before downloading sleep confirm
From: Brian Norris @ 2016-11-03 16:11 UTC (permalink / raw)
To: Xinming Hu
Cc: Linux Wireless, Kalle Valo, Dmitry Torokhov, Amitkumar Karwar,
Cathy Luo, Shengzhen Li, Xinming Hu, Wei-Ning Huang
In-Reply-To: <1478002098-14189-1-git-send-email-huxinming820@marvell.com>
+ Wei-Ning
On Tue, Nov 01, 2016 at 08:08:17PM +0800, Xinming Hu wrote:
> From: Shengzhen Li <szli@marvell.com>
>
> We may get SLEEP event from firmware even if TXDone interrupt
> 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.
>
> This patch will only allow downloading sleep confirm
> when no tx done interrupt is pending in the hardware.
>
> ---
> v2: address format issues(Brain)
> ---
Nit: typically, it's best if the changelog is placed after the
Sign-offs, so that the first "---" line denotes the beginning of text
that can be discarded. (Typically the changelog doesn't go into the
final git commit, and it also happens that git-am discards everything
between the first "---" line and the actual patch content.)
> Signed-off-by: Cathy Luo <cluo@marvell.com>
> Signed-off-by: Shengzhen Li <szli@marvell.com>
> Signed-off-by: Xinming Hu <huxm@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> ---
> drivers/net/wireless/marvell/mwifiex/cmdevt.c | 5 +++--
> drivers/net/wireless/marvell/mwifiex/init.c | 1 +
> drivers/net/wireless/marvell/mwifiex/main.h | 1 +
> drivers/net/wireless/marvell/mwifiex/pcie.c | 5 +++++
> 4 files changed, 10 insertions(+), 2 deletions(-)
Overall, I think this change is good, and it tests out fine for me so
far. Do we have the same problem for other interfaces too? e.g., SDIO?
It seems to me that the root problem is generic (i.e., don't try to
SLEEP while processing TX traffic) but the symptom just happened to be
fatal on a particular PCIe controller.
Brian
> diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> index 5347728..25a7475 100644
> --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
> @@ -1118,13 +1118,14 @@ 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 && !atomic_read(&adapter->tx_hw_pending) &&
> !adapter->curr_cmd && !IS_CARD_RX_RCVD(adapter))
> mwifiex_dnld_sleep_confirm_cmd(adapter);
> else
> mwifiex_dbg(adapter, CMD,
> - "cmd: Delay Sleep Confirm (%s%s%s)\n",
> + "cmd: Delay Sleep Confirm (%s%s%s%s)\n",
> (adapter->cmd_sent) ? "D" : "",
> + atomic_read(&adapter->tx_hw_pending) ? "T" : "",
> (adapter->curr_cmd) ? "C" : "",
> (IS_CARD_RX_RCVD(adapter)) ? "R" : "");
> }
> diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
> index 82839d9..b36cb3f 100644
> --- a/drivers/net/wireless/marvell/mwifiex/init.c
> +++ b/drivers/net/wireless/marvell/mwifiex/init.c
> @@ -270,6 +270,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
> adapter->adhoc_11n_enabled = false;
>
> mwifiex_wmm_init(adapter);
> + atomic_set(&adapter->tx_hw_pending, 0);
>
> sleep_cfm_buf = (struct mwifiex_opt_sleep_confirm *)
> adapter->sleep_cfm->data;
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
> index d61fe3a..7f67f23 100644
> --- a/drivers/net/wireless/marvell/mwifiex/main.h
> +++ b/drivers/net/wireless/marvell/mwifiex/main.h
> @@ -857,6 +857,7 @@ struct mwifiex_adapter {
> atomic_t rx_pending;
> atomic_t tx_pending;
> atomic_t cmd_pending;
> + atomic_t tx_hw_pending;
> struct workqueue_struct *workqueue;
> struct work_struct main_work;
> struct workqueue_struct *rx_workqueue;
> diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
> index 063c707..4aa5d91 100644
> --- a/drivers/net/wireless/marvell/mwifiex/pcie.c
> +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
> @@ -516,6 +516,7 @@ static int mwifiex_pcie_enable_host_int(struct mwifiex_adapter *adapter)
> }
> }
>
> + atomic_set(&adapter->tx_hw_pending, 0);
> return 0;
> }
>
> @@ -689,6 +690,7 @@ static void mwifiex_cleanup_txq_ring(struct mwifiex_adapter *adapter)
> card->tx_buf_list[i] = NULL;
> }
>
> + atomic_set(&adapter->tx_hw_pending, 0);
> return;
> }
>
> @@ -1126,6 +1128,7 @@ static int mwifiex_pcie_send_data_complete(struct mwifiex_adapter *adapter)
> -1);
> else
> mwifiex_write_data_complete(adapter, skb, 0, 0);
> + atomic_dec(&adapter->tx_hw_pending);
> }
>
> card->tx_buf_list[wrdoneidx] = NULL;
> @@ -1218,6 +1221,7 @@ mwifiex_pcie_send_data(struct mwifiex_adapter *adapter, struct sk_buff *skb,
> wrindx = (card->txbd_wrptr & reg->tx_mask) >> reg->tx_start_ptr;
> buf_pa = MWIFIEX_SKB_DMA_ADDR(skb);
> card->tx_buf_list[wrindx] = skb;
> + atomic_inc(&adapter->tx_hw_pending);
>
> if (reg->pfu_enabled) {
> desc2 = card->txbd_ring[wrindx];
> @@ -1295,6 +1299,7 @@ mwifiex_pcie_send_data(struct mwifiex_adapter *adapter, struct sk_buff *skb,
> done_unmap:
> mwifiex_unmap_pci_memory(adapter, skb, PCI_DMA_TODEVICE);
> card->tx_buf_list[wrindx] = NULL;
> + atomic_dec(&adapter->tx_hw_pending);
> if (reg->pfu_enabled)
> memset(desc2, 0, sizeof(*desc2));
> else
> --
> 1.8.1.4
>
^ permalink raw reply
* Re: [PATCH 2/2] rtl8xxxu: Fix for bogus data used to determine macpower
From: Larry Finger @ 2016-11-03 15:43 UTC (permalink / raw)
To: Joe Perches, Jes Sorensen, John Heenan
Cc: Kalle Valo, linux-wireless, netdev, linux-kernel
In-Reply-To: <1478162497.1924.16.camel@perches.com>
On 11/03/2016 03:41 AM, Joe Perches wrote:
> On Sun, 2016-10-30 at 19:02 -0400, Jes Sorensen wrote:
>> Code is 80 characters wide, and comments are /* */ never the ugly C++
>> crap.
>
> You might look at the recent Linus Torvalds authored commit
> 5e467652ffef (?printk: re-organize log_output() to be more legible")
> which does both of those: c99 // comments and > 80 columns.
>
> Absolutes are for zealots.
Of course, but who is going to criticize Linus? I have gently chided him when an
untested patch of his was inserted just before the final release, and broke my
laptop. At least the bisection was pretty quick. :)
Larry
^ permalink raw reply
* Re: [PATCH 1/2] rtl8xxxu: Fix for authentication failure
From: Larry Finger @ 2016-11-03 15:39 UTC (permalink / raw)
To: John Heenan
Cc: Jes Sorensen, Kalle Valo, linux-wireless, netdev, linux-kernel
In-Reply-To: <CAAye0QNZYjg1NDmXmjMXNJqa7nsbvfgoX8et1g1+HT2S2O=L1w@mail.gmail.com>
On 11/03/2016 02:10 AM, John Heenan wrote:
> On 3 November 2016 at 11:00, Larry Finger <Larry.Finger@lwfinger.net> wrote:
>> On 10/30/2016 05:20 AM, John Heenan wrote:
>>>
>>> This fix enables the same sequence of init behaviour as the alternative
>>> working driver for the wireless rtl8723bu IC at
>>> https://github.com/lwfinger/rtl8723bu
>>>
>>> For exampe rtl8xxxu_init_device is now called each time
>>> userspace wpa_supplicant is executed instead of just once when
>>> modprobe is executed.
>>
>>
>> After all the trouble you have had with your patches, I would expect you to
>> use more care when composing the commit message. Note the typo in the
>> paragraph above.
>>
>
> OK, the nasty games continue and the message is not getting through.
>
> An appropriate response by a maintainer would have been to request I
> revise the code according to the way it has currently and elegantly
> revised in.
I am NOT a maintainer for this driver. I do have an interest in it, but not in
any official capacity.
If you cannot accept constructive criticism, you are in the wrong activity.
Please grow up!
Larry
^ permalink raw reply
* [PATCH] Revert "mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE"
From: Felix Fietkau @ 2016-11-03 11:12 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, emmanuel.grumbach
This reverts commit c68df2e7be0c1238ea3c281fd744a204ef3b15a0.
__sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not
set. This prevents the beacon TIM bit from being set for all drivers
that do not implement this op (almost all of them), thus thoroughly
essential AP mode powersave functionality.
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/sta_info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 236d47e..1711bae 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
}
/* No need to do anything if the driver does all */
- if (!local->ops->set_tim)
+ if (ieee80211_hw_check(&local->hw, AP_LINK_PS))
return;
if (sta->dead)
--
2.10.1
^ permalink raw reply related
* Re: [PATCH] mac80211: fix broken AP mode handling of powersave clients
From: Emmanuel Grumbach @ 2016-11-03 11:10 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, Johannes Berg, Emmanuel Grumbach
In-Reply-To: <29865def-991d-9e0c-131b-430a9c0a694f@nbd.name>
On Thu, Nov 3, 2016 at 1:08 PM, Felix Fietkau <nbd@nbd.name> wrote:
> On 2016-11-03 11:51, Emmanuel Grumbach wrote:
>> On Thu, Nov 3, 2016 at 12:51 PM, Emmanuel Grumbach <egrumbach@gmail.com> wrote:
>>> On Thu, Nov 3, 2016 at 11:59 AM, Felix Fietkau <nbd@nbd.name> wrote:
>>>> Commit c68df2e7be0c ("mac80211: allow using AP_LINK_PS with
>>>> mac80211-generated TIM IE") introduced a logic error, where
>>>> __sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not
>>>> set. This prevents the beacon TIM bit from being set for all drivers
>>>> that do not implement this op (almost all of them), thus thoroughly
>>>> essential AP mode powersave functionality.
>>>>
>>>> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>>>> Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
>>>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>>>> ---
>>>> net/mac80211/sta_info.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
>>>> index 236d47e..621734e 100644
>>>> --- a/net/mac80211/sta_info.c
>>>> +++ b/net/mac80211/sta_info.c
>>>> @@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
>>>> }
>>>>
>>>> /* No need to do anything if the driver does all */
>>>> - if (!local->ops->set_tim)
>>>> + if (local->ops->set_tim)
>>>> return;
>>>
>>> but ... then, you'll need call to drv_set_tim below...
>>
>> s/need/never/
>>
>>> Apparently, we can't rely on the ops pointer to enter or not enter this flow.
> Are you going to submit a fix, or should I just send a revert of your
> commit?
>
Go ahead and send a revert. I won't be fast enough :)
^ permalink raw reply
* Re: [PATCH] mac80211: fix broken AP mode handling of powersave clients
From: Felix Fietkau @ 2016-11-03 11:08 UTC (permalink / raw)
To: Emmanuel Grumbach; +Cc: linux-wireless, Johannes Berg, Emmanuel Grumbach
In-Reply-To: <CANUX_P1vktccTAQZOFRdVS9ndg4XEZNw0Ec=0sFL+n7SL2g+dQ@mail.gmail.com>
On 2016-11-03 11:51, Emmanuel Grumbach wrote:
> On Thu, Nov 3, 2016 at 12:51 PM, Emmanuel Grumbach <egrumbach@gmail.com> wrote:
>> On Thu, Nov 3, 2016 at 11:59 AM, Felix Fietkau <nbd@nbd.name> wrote:
>>> Commit c68df2e7be0c ("mac80211: allow using AP_LINK_PS with
>>> mac80211-generated TIM IE") introduced a logic error, where
>>> __sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not
>>> set. This prevents the beacon TIM bit from being set for all drivers
>>> that do not implement this op (almost all of them), thus thoroughly
>>> essential AP mode powersave functionality.
>>>
>>> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>>> Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
>>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>>> ---
>>> net/mac80211/sta_info.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
>>> index 236d47e..621734e 100644
>>> --- a/net/mac80211/sta_info.c
>>> +++ b/net/mac80211/sta_info.c
>>> @@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
>>> }
>>>
>>> /* No need to do anything if the driver does all */
>>> - if (!local->ops->set_tim)
>>> + if (local->ops->set_tim)
>>> return;
>>
>> but ... then, you'll need call to drv_set_tim below...
>
> s/need/never/
>
>> Apparently, we can't rely on the ops pointer to enter or not enter this flow.
Are you going to submit a fix, or should I just send a revert of your
commit?
- Felix
^ permalink raw reply
* Re: [PATCH] mac80211: fix broken AP mode handling of powersave clients
From: Emmanuel Grumbach @ 2016-11-03 10:51 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, Johannes Berg, Emmanuel Grumbach
In-Reply-To: <CANUX_P0xv4a1O7tqBYABsXbRvRQm_3Va888EopKDz433cwjXew@mail.gmail.com>
On Thu, Nov 3, 2016 at 12:51 PM, Emmanuel Grumbach <egrumbach@gmail.com> wrote:
> On Thu, Nov 3, 2016 at 11:59 AM, Felix Fietkau <nbd@nbd.name> wrote:
>> Commit c68df2e7be0c ("mac80211: allow using AP_LINK_PS with
>> mac80211-generated TIM IE") introduced a logic error, where
>> __sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not
>> set. This prevents the beacon TIM bit from being set for all drivers
>> that do not implement this op (almost all of them), thus thoroughly
>> essential AP mode powersave functionality.
>>
>> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>> Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>> net/mac80211/sta_info.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
>> index 236d47e..621734e 100644
>> --- a/net/mac80211/sta_info.c
>> +++ b/net/mac80211/sta_info.c
>> @@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
>> }
>>
>> /* No need to do anything if the driver does all */
>> - if (!local->ops->set_tim)
>> + if (local->ops->set_tim)
>> return;
>
> but ... then, you'll need call to drv_set_tim below...
s/need/never/
> Apparently, we can't rely on the ops pointer to enter or not enter this flow.
^ permalink raw reply
* Re: [PATCH] mac80211: fix broken AP mode handling of powersave clients
From: Emmanuel Grumbach @ 2016-11-03 10:51 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, Johannes Berg, Emmanuel Grumbach
In-Reply-To: <20161103095938.84054-1-nbd@nbd.name>
On Thu, Nov 3, 2016 at 11:59 AM, Felix Fietkau <nbd@nbd.name> wrote:
> Commit c68df2e7be0c ("mac80211: allow using AP_LINK_PS with
> mac80211-generated TIM IE") introduced a logic error, where
> __sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not
> set. This prevents the beacon TIM bit from being set for all drivers
> that do not implement this op (almost all of them), thus thoroughly
> essential AP mode powersave functionality.
>
> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
> net/mac80211/sta_info.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index 236d47e..621734e 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
> }
>
> /* No need to do anything if the driver does all */
> - if (!local->ops->set_tim)
> + if (local->ops->set_tim)
> return;
but ... then, you'll need call to drv_set_tim below...
Apparently, we can't rely on the ops pointer to enter or not enter this flow.
^ permalink raw reply
* [PATCH] mac80211: fix broken AP mode handling of powersave clients
From: Felix Fietkau @ 2016-11-03 9:59 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, emmanuel.grumbach
Commit c68df2e7be0c ("mac80211: allow using AP_LINK_PS with
mac80211-generated TIM IE") introduced a logic error, where
__sta_info_recalc_tim turns into a no-op if local->ops->set_tim is not
set. This prevents the beacon TIM bit from being set for all drivers
that do not implement this op (almost all of them), thus thoroughly
essential AP mode powersave functionality.
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Fixes: c68df2e7be0c ("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/sta_info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 236d47e..621734e 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
}
/* No need to do anything if the driver does all */
- if (!local->ops->set_tim)
+ if (local->ops->set_tim)
return;
if (sta->dead)
--
2.10.1
^ permalink raw reply related
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