diff mbox

[08/36] iwlwifi: mvm: Change power management dependency on multi MAC

Message ID 1387313079-28123-8-git-send-email-egrumbach@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Emmanuel Grumbach Dec. 17, 2013, 8:44 p.m. UTC
From: Alexander Bondar <alexander.bondar@intel.com>

FW still does not support power management on multiple MAC interfaces.
Currently the driver enforce this limitation by disabling PM if second
interface is added. Change this behavior to allow PM on a single interface
even if other interfaces exist but not bound to any specific PHY.
PM will be enabled if only one single interface is bound.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/mac80211.c |   63 +++++++--------------------
 drivers/net/wireless/iwlwifi/mvm/mvm.h      |   19 +++++---
 drivers/net/wireless/iwlwifi/mvm/power.c    |   36 ++++++++++-----
 3 files changed, 53 insertions(+), 65 deletions(-)

Comments

Karl Beldan Jan. 13, 2014, 11:13 a.m. UTC | #1
On Tue, Dec 17, 2013 at 10:44:11PM +0200, Emmanuel Grumbach wrote:
> From: Alexander Bondar <alexander.bondar@intel.com>
> 
> FW still does not support power management on multiple MAC interfaces.
> Currently the driver enforce this limitation by disabling PM if second
> interface is added. Change this behavior to allow PM on a single interface
> even if other interfaces exist but not bound to any specific PHY.
> PM will be enabled if only one single interface is bound.
> 
> Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
> Reviewed-by: Johannes Berg <johannes.berg@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Hi,

This broke monitor mode:
(unsetting .power_update_binding does not hang)

modprobe iwlmvm
iw dev wlan0 set type monitor
iw dev wlan0 set freq 5180 40 5190  # hangs

Can you reproduce it easily or do you need me to post further dbg info ?

 
Karl
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.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gNDAgNTE5MCAgIyBoYW5ncw0KPiANCj4gQ2FuIHlvdSByZXByb2R1Y2UgaXQgZWFzaWx5
IG9yIGRvIHlvdSBuZWVkIG1lIHRvIHBvc3QgZnVydGhlciBkYmcgaW5mbyA/DQo+IA0KDQpXZSBo
YXZlIGFuIG9wZW4gYnVnIG9uIHRoaXMgaW50ZXJuYWxseSAtIHRoYW5rcyBmb3IgcmVwb3J0aW5n
Lg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Karl Beldan Jan. 13, 2014, 12:41 p.m. UTC | #3
On Mon, Jan 13, 2014 at 11:15:53AM +0000, Grumbach, Emmanuel wrote:
> > >
> > > FW still does not support power management on multiple MAC interfaces.
> > > Currently the driver enforce this limitation by disabling PM if second
> > > interface is added. Change this behavior to allow PM on a single
> > > interface even if other interfaces exist but not bound to any specific PHY.
> > > PM will be enabled if only one single interface is bound.
> > >
> > > Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
> > > Reviewed-by: Johannes Berg <johannes.berg@intel.com>
> > > Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > 
> > Hi,
> > 
> > This broke monitor mode:
> > (unsetting .power_update_binding does not hang)
> > 
> > modprobe iwlmvm
> > iw dev wlan0 set type monitor
> > iw dev wlan0 set freq 5180 40 5190  # hangs
> > 
> > Can you reproduce it easily or do you need me to post further dbg info ?
> > 
> 
> We have an open bug on this internally - thanks for reporting.

OK, BTW I have errors like
- "Microcode SW error detected." upon monitor up
- "iwlwifi 0000:02:00.0: FW error in SYNC CMD TXPATH_FLUSH" sometimes
after the subsequent ieee80211_restart_hw
- "WARNING: ... iwlwifi/mvm/binding.c:201 iwl_mvm_binding_remove_vif"
  when removing a monitor iface

You must have seen those too. I will avoid this tree with iwlwifi then.

 
Karl
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Emmanuel Grumbach Jan. 16, 2014, 8:08 p.m. UTC | #4
>>>
>>> Hi,
>>>
>>> This broke monitor mode:
>>> (unsetting .power_update_binding does not hang)
>>>
>>> modprobe iwlmvm
>>> iw dev wlan0 set type monitor
>>> iw dev wlan0 set freq 5180 40 5190  # hangs
>>>
>>> Can you reproduce it easily or do you need me to post further dbg info ?
>>>
>>
>> We have an open bug on this internally - thanks for reporting.
> 
> OK, BTW I have errors like
> - "Microcode SW error detected." upon monitor up

reading your mail again - is this related to monitor mode or not?

> - "iwlwifi 0000:02:00.0: FW error in SYNC CMD TXPATH_FLUSH" sometimes
> after the subsequent ieee80211_restart_hw
> - "WARNING: ... iwlwifi/mvm/binding.c:201 iwl_mvm_binding_remove_vif"
>   when removing a monitor iface
> 
> You must have seen those too. I will avoid this tree with iwlwifi then.
> 

I probably misunderstood this last sentence?
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Karl Beldan Jan. 16, 2014, 9:43 p.m. UTC | #5
On Thu, Jan 16, 2014 at 10:08:54PM +0200, Emmanuel Grumbach wrote:
> >>>
> >>> Hi,
> >>>
> >>> This broke monitor mode:
> >>> (unsetting .power_update_binding does not hang)
> >>>
> >>> modprobe iwlmvm
> >>> iw dev wlan0 set type monitor
> >>> iw dev wlan0 set freq 5180 40 5190  # hangs
> >>>
> >>> Can you reproduce it easily or do you need me to post further dbg info ?
> >>>
> >>
> >> We have an open bug on this internally - thanks for reporting.
> > 
> > OK, BTW I have errors like
> > - "Microcode SW error detected." upon monitor up
> 
> reading your mail again - is this related to monitor mode or not?
> 
Yes, at least that's part of what I meant by "upon monitor up", it seems
to happen systematically when I bring a monitor iface up.

> > - "iwlwifi 0000:02:00.0: FW error in SYNC CMD TXPATH_FLUSH" sometimes
> > after the subsequent ieee80211_restart_hw
> > - "WARNING: ... iwlwifi/mvm/binding.c:201 iwl_mvm_binding_remove_vif"
> >   when removing a monitor iface
> > 
> > You must have seen those too. I will avoid this tree with iwlwifi then.
> > 
> 
> I probably misunderstood this last sentence?

I ecountered many problems with mvm in this tree, Eyal quickly fixed the
rs unending search cycle, you told me the monitor deadlock was already
filed internally on your side, the ones I mentioned in this thread, also
it seems that with the 7260-8.ucode I don't get anything on a monitor
iface except the mere traffic of another associated iface (when I have
such one).
Except maybe for the latter?, these bugs seem easy enough to trigger
and alarming enough that I suspect you already must be on your way to
fixing what you deem needs to .. and thus I did not feel bad not
dissecting or reporting further and droping this tree with iwlwifi.
I hope this clarifies the meaning and intention of the last sentence.

I have been using the 7260 since last summer and, as I already mentioned
to Johannes, found it very useful, and wouldn't mind giving some
other out-of-tree patches a go.

 
Karl
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Emmanuel Grumbach Feb. 13, 2014, 12:01 p.m. UTC | #6
On Thu, Jan 16, 2014 at 11:43 PM, Karl Beldan <karl.beldan@gmail.com> wrote:
> On Thu, Jan 16, 2014 at 10:08:54PM +0200, Emmanuel Grumbach wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> This broke monitor mode:
>> >>> (unsetting .power_update_binding does not hang)
>> >>>
>> >>> modprobe iwlmvm
>> >>> iw dev wlan0 set type monitor
>> >>> iw dev wlan0 set freq 5180 40 5190  # hangs
>> >>>
>> >>> Can you reproduce it easily or do you need me to post further dbg info ?
>> >>>
>> >>
>> >> We have an open bug on this internally - thanks for reporting.
>> >
>> > OK, BTW I have errors like
>> > - "Microcode SW error detected." upon monitor up
>>
>> reading your mail again - is this related to monitor mode or not?
>>
> Yes, at least that's part of what I meant by "upon monitor up", it seems
> to happen systematically when I bring a monitor iface up.
>
>> > - "iwlwifi 0000:02:00.0: FW error in SYNC CMD TXPATH_FLUSH" sometimes
>> > after the subsequent ieee80211_restart_hw
>> > - "WARNING: ... iwlwifi/mvm/binding.c:201 iwl_mvm_binding_remove_vif"
>> >   when removing a monitor iface
>> >
>> > You must have seen those too. I will avoid this tree with iwlwifi then.
>> >
>>
>> I probably misunderstood this last sentence?
>
> I ecountered many problems with mvm in this tree, Eyal quickly fixed the
> rs unending search cycle, you told me the monitor deadlock was already
> filed internally on your side, the ones I mentioned in this thread, also
> it seems that with the 7260-8.ucode I don't get anything on a monitor
> iface except the mere traffic of another associated iface (when I have
> such one).
> Except maybe for the latter?, these bugs seem easy enough to trigger
> and alarming enough that I suspect you already must be on your way to
> fixing what you deem needs to .. and thus I did not feel bad not
> dissecting or reporting further and droping this tree with iwlwifi.
> I hope this clarifies the meaning and intention of the last sentence.
>
> I have been using the 7260 since last summer and, as I already mentioned
> to Johannes, found it very useful, and wouldn't mind giving some
> other out-of-tree patches a go.
>

Monitor mode should work with latest wireless-testing now.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Karl Beldan March 6, 2014, 10:21 a.m. UTC | #7
On Thu, Feb 13, 2014 at 02:01:43PM +0200, Emmanuel Grumbach wrote:
> Monitor mode should work with latest wireless-testing now.

Hi,

Thanks for the update, indeed monitor is in better shape, however I am
still seeing some issues.
E.g. short-guard or > 20MHz bw frames are not visible when not
aggregated, I still see "Microcode SW error detected." but in a
different scenario (monitoring with main managed iface down, then upping
the main managed iface up), it also seems that we filter out many frames
when the main managed iface is up and/or? associated.
Also, I started working on AMSDUs this week and yesterday my laptop
crashed immediately when monitoring. This morning I see that this
happens when my aggregates start getting above the ~4k limit and
modprobing with amsdu_size_8K=1 seems to 'fix' the issue, I guess some
places need some oflows checks.
All this with wireless-next@704445d9 (i.e. circa the time I got your
email) and fw 22.15.8.0.


 
Karl
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Emmanuel Grumbach March 6, 2014, 10:22 a.m. UTC | #8
> 

> Hi,

> 

> Thanks for the update, indeed monitor is in better shape, however I am

> still seeing some issues.

> E.g. short-guard or > 20MHz bw frames are not visible when not

> aggregated, I still see "Microcode SW error detected." but in a

> different scenario (monitoring with main managed iface down, then upping

> the main managed iface up), it also seems that we filter out many frames

> when the main managed iface is up and/or? associated.

> Also, I started working on AMSDUs this week and yesterday my laptop

> crashed immediately when monitoring. This morning I see that this

> happens when my aggregates start getting above the ~4k limit and

> modprobing with amsdu_size_8K=1 seems to 'fix' the issue, I guess some

> places need some oflows checks.

> All this with wireless-next@704445d9 (i.e. circa the time I got your

> email) and fw 22.15.8.0.

> 


Please paste the data for the firmware assert. Also, take https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=1c37a72c1bd0b83be8b95cff7f1bc9b1f32bd433 into account.
Emmanuel Grumbach March 6, 2014, 10:25 a.m. UTC | #9
> >

> > Hi,

> >

> > Thanks for the update, indeed monitor is in better shape, however I am

> > still seeing some issues.

> > E.g. short-guard or > 20MHz bw frames are not visible when not

> > aggregated, I still see "Microcode SW error detected." but in a

> > different scenario (monitoring with main managed iface down, then

> > upping the main managed iface up), it also seems that we filter out

> > many frames when the main managed iface is up and/or? associated.

> > Also, I started working on AMSDUs this week and yesterday my laptop

> > crashed immediately when monitoring. This morning I see that this

> > happens when my aggregates start getting above the ~4k limit and

> > modprobing with amsdu_size_8K=1 seems to 'fix' the issue, I guess some

> > places need some oflows checks.


Hmm... Thanks for the heads - up. Do you have the crash data?

> > All this with wireless-next@704445d9 (i.e. circa the time I got your

> > email) and fw 22.15.8.0.

> >

> 

> Please paste the data for the firmware assert. Also, take

> https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=

> 1c37a72c1bd0b83be8b95cff7f1bc9b1f32bd433 into account.
Karl Beldan March 6, 2014, 10:49 a.m. UTC | #10
On Thu, Mar 06, 2014 at 10:25:34AM +0000, Grumbach, Emmanuel wrote:
> > >
> > > Hi,
> > >
> > > Thanks for the update, indeed monitor is in better shape, however I am
> > > still seeing some issues.
> > > E.g. short-guard or > 20MHz bw frames are not visible when not
> > > aggregated, I still see "Microcode SW error detected." but in a
> > > different scenario (monitoring with main managed iface down, then
> > > upping the main managed iface up), it also seems that we filter out
> > > many frames when the main managed iface is up and/or? associated.
> > > Also, I started working on AMSDUs this week and yesterday my laptop
> > > crashed immediately when monitoring. This morning I see that this
> > > happens when my aggregates start getting above the ~4k limit and
> > > modprobing with amsdu_size_8K=1 seems to 'fix' the issue, I guess some
> > > places need some oflows checks.
> 
> Hmm... Thanks for the heads - up. Do you have the crash data?
> 
You mean a pcap of the traffic crashing the system or the iwlmvm data ?
The crashes are severe enough that they hang my whole laptop right away.

> > > All this with wireless-next@704445d9 (i.e. circa the time I got your
> > > email) and fw 22.15.8.0.
> > >
> > 
> > Please paste the data for the firmware assert. Also, take
> > https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=
> > 1c37a72c1bd0b83be8b95cff7f1bc9b1f32bd433 into account.
Attached. Looks like this change will help.

 
Karl
Emmanuel Grumbach March 6, 2014, 10:58 a.m. UTC | #11
PiANCj4gT24gVGh1LCBNYXIgMDYsIDIwMTQgYXQgMTA6MjU6MzRBTSArMDAwMCwgR3J1bWJhY2gs
IEVtbWFudWVsIHdyb3RlOg0KPiA+ID4gPg0KPiA+ID4gPiBIaSwNCj4gPiA+ID4NCj4gPiA+ID4g
VGhhbmtzIGZvciB0aGUgdXBkYXRlLCBpbmRlZWQgbW9uaXRvciBpcyBpbiBiZXR0ZXIgc2hhcGUs
IGhvd2V2ZXINCj4gPiA+ID4gSSBhbSBzdGlsbCBzZWVpbmcgc29tZSBpc3N1ZXMuDQo+ID4gPiA+
IEUuZy4gc2hvcnQtZ3VhcmQgb3IgPiAyME1IeiBidyBmcmFtZXMgYXJlIG5vdCB2aXNpYmxlIHdo
ZW4gbm90DQo+ID4gPiA+IGFnZ3JlZ2F0ZWQsIEkgc3RpbGwgc2VlICJNaWNyb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EgPw0KPiBUaGUgY3Jhc2hlcyBhcmUgc2V2ZXJlIGVub3VnaCB0aGF0IHRoZXkgaGFu
ZyBteSB3aG9sZSBsYXB0b3AgcmlnaHQgYXdheS4NCg0KT2ggb2sgLSBJIHdhcyB0YWxraW5nIGFi
b3V0IHRoZSBXQVJOSU5HIC8gQlVHIG1lc3NhZ2Ugd2hhdGV2ZXIuDQoNCj4gDQo+ID4gPiA+IEFs
bCB0aGlzIHdpdGggd2lyZWxlc3MtbmV4dEA3MDQ0NDVkOSAoaS5lLiBjaXJjYSB0aGUgdGltZSBJ
IGdvdA0KPiA+ID4gPiB5b3VyDQo+ID4gPiA+IGVtYWlsKSBhbmQgZncgMjIuMTUuOC4wLg0KPiA+
ID4gPg0KPiA+ID4NCj4gPiA+IFBsZWFzZSBwYXN0ZSB0aGUgZGF0YSBmb3IgdGhlIGZpcm13YXJl
IGFzc2VydC4gQWxzbywgdGFrZQ0KPiA+ID4gaHR0cHM6Ly9naXQua2VybmVsLm9yZy9jZ2l0L2xp
bnV4L2tlcm5lbC9naXQvamJlcmcvbWFjODAyMTEuZ2l0L2NvbW0NCj4gPiA+IGl0Lz9pZD0NCj4g
PiA+IDFjMzdhNzJjMWJkMGI4M2JlOGI5NWNmZjdmMWJjOWIxZjMyYmQ0MzMgaW50byBhY2NvdW50
Lg0KPiBBdHRhY2hlZC4gTG9va3MgbGlrZSB0aGlzIGNoYW5nZSB3aWxsIGhlbHAuDQo+IA0KDQpC
VFcgLSBuZXdlciBGVyBpcyBhdmFpbGFibGU6IDIyLjI0LjguMA0K
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Emmanuel Grumbach March 6, 2014, 11:02 a.m. UTC | #12
> > On Thu, Mar 06, 2014 at 10:25:34AM +0000, Grumbach, Emmanuel wrote:

> > > > >

> > > > > Hi,

> > > > >

> > > > > Thanks for the update, indeed monitor is in better shape,

> > > > > however I am still seeing some issues.

> > > > > E.g. short-guard or > 20MHz bw frames are not visible when not

> > > > > aggregated, I still see "Microcode SW error detected." but in a

> > > > > different scenario (monitoring with main managed iface down,

> > > > > then upping the main managed iface up), it also seems that we

> > > > > filter out many frames when the main managed iface is up and/or?

> > associated.

> > > > > Also, I started working on AMSDUs this week and yesterday my

> > > > > laptop crashed immediately when monitoring. This morning I see

> > > > > that this happens when my aggregates start getting above the ~4k

> > > > > limit and modprobing with amsdu_size_8K=1 seems to 'fix' the

> > > > > issue, I guess some places need some oflows checks.

> > >

> > > Hmm... Thanks for the heads - up. Do you have the crash data?

> > >

> > You mean a pcap of the traffic crashing the system or the iwlmvm data ?

> > The crashes are severe enough that they hang my whole laptop right away.

> 

> Oh ok - I was talking about the WARNING / BUG message whatever.

> 

> >

> > > > > All this with wireless-next@704445d9 (i.e. circa the time I got

> > > > > your

> > > > > email) and fw 22.15.8.0.

> > > > >

> > > >

> > > > Please paste the data for the firmware assert. Also, take

> > > > https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/co

> > > > mm

> > > > it/?id=

> > > > 1c37a72c1bd0b83be8b95cff7f1bc9b1f32bd433 into account.

> > Attached. Looks like this change will help.

> >

> 

> BTW - newer FW is available: 22.24.8.0


Just looked at your log - I'd hope the new FW will fix it.
Can you give it a try?
Karl Beldan March 6, 2014, 11:54 a.m. UTC | #13
On Thu, Mar 06, 2014 at 11:02:48AM +0000, Grumbach, Emmanuel wrote:
> > > On Thu, Mar 06, 2014 at 10:25:34AM +0000, Grumbach, Emmanuel wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Thanks for the update, indeed monitor is in better shape,
> > > > > > however I am still seeing some issues.
> > > > > > E.g. short-guard or > 20MHz bw frames are not visible when not
> > > > > > aggregated, I still see "Microcode SW error detected." but in a
> > > > > > different scenario (monitoring with main managed iface down,
> > > > > > then upping the main managed iface up), it also seems that we
> > > > > > filter out many frames when the main managed iface is up and/or?
> > > associated.
> > > > > > Also, I started working on AMSDUs this week and yesterday my
> > > > > > laptop crashed immediately when monitoring. This morning I see
> > > > > > that this happens when my aggregates start getting above the ~4k
> > > > > > limit and modprobing with amsdu_size_8K=1 seems to 'fix' the
> > > > > > issue, I guess some places need some oflows checks.
> > > >
> > > > Hmm... Thanks for the heads - up. Do you have the crash data?
> > > >
> > > You mean a pcap of the traffic crashing the system or the iwlmvm data ?
> > > The crashes are severe enough that they hang my whole laptop right away.
> > 
> > Oh ok - I was talking about the WARNING / BUG message whatever.
> > 
> > >
> > > > > > All this with wireless-next@704445d9 (i.e. circa the time I got
> > > > > > your
> > > > > > email) and fw 22.15.8.0.
> > > > > >
> > > > >
> > > > > Please paste the data for the firmware assert. Also, take
> > > > > https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/co
> > > > > mm
> > > > > it/?id=
> > > > > 1c37a72c1bd0b83be8b95cff7f1bc9b1f32bd433 into account.
> > > Attached. Looks like this change will help.
> > >
> > 
> > BTW - newer FW is available: 22.24.8.0
> 
> Just looked at your log - I'd hope the new FW will fix it.
> Can you give it a try?
> 
Just did, seems to fix the issue, thanks.

 
Karl
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Karl Beldan March 6, 2014, 11:59 a.m. UTC | #14
On Thu, Mar 06, 2014 at 10:22:49AM +0000, Grumbach, Emmanuel wrote:
> > 
> > Hi,
> > 
> > Thanks for the update, indeed monitor is in better shape, however I am
> > still seeing some issues.
> > E.g. short-guard or > 20MHz bw frames are not visible when not
> > aggregated, I still see "Microcode SW error detected." but in a
> > different scenario (monitoring with main managed iface down, then upping
> > the main managed iface up), it also seems that we filter out many frames
> > when the main managed iface is up and/or? associated.
> > Also, I started working on AMSDUs this week and yesterday my laptop
> > crashed immediately when monitoring. This morning I see that this
> > happens when my aggregates start getting above the ~4k limit and
> > modprobing with amsdu_size_8K=1 seems to 'fix' the issue, I guess some
> > places need some oflows checks.
> > All this with wireless-next@704445d9 (i.e. circa the time I got your
> > email) and fw 22.15.8.0.
> > 
> 
> Please paste the data for the firmware assert. Also, take https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211.git/commit/?id=1c37a72c1bd0b83be8b95cff7f1bc9b1f32bd433 into account.

Just tried it, does not help for >20MHz bw .. I think the fact that I
cannot see them when not aggregated but can when they are might be a
good lead.

 
Karl
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 8d80728..e1c379a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -494,17 +494,6 @@  static void iwl_mvm_mac_stop(struct ieee80211_hw *hw)
 	cancel_work_sync(&mvm->async_handlers_wk);
 }
 
-static void iwl_mvm_pm_disable_iterator(void *data, u8 *mac,
-					struct ieee80211_vif *vif)
-{
-	struct iwl_mvm *mvm = data;
-	int ret;
-
-	ret = iwl_mvm_power_disable(mvm, vif);
-	if (ret)
-		IWL_ERR(mvm, "failed to disable power management\n");
-}
-
 static void iwl_mvm_power_update_iterator(void *data, u8 *mac,
 					  struct ieee80211_vif *vif)
 {
@@ -547,26 +536,9 @@  static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
 	if (ret)
 		goto out_unlock;
 
-	/*
-	 * TODO: remove this temporary code.
-	 * Currently MVM FW supports power management only on single MAC.
-	 * If new interface added, disable PM on existing interface.
-	 * P2P device is a special case, since it is handled by FW similary to
-	 * scan. If P2P deviced is added, PM remains enabled on existing
-	 * interface.
-	 * Note: the method below does not count the new interface being added
-	 * at this moment.
-	 */
+	/* Counting number of interfaces is needed for legacy PM */
 	if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
 		mvm->vif_count++;
-	if (mvm->vif_count > 1) {
-		IWL_DEBUG_MAC80211(mvm,
-				   "Disable power on existing interfaces\n");
-		ieee80211_iterate_active_interfaces_atomic(
-					    mvm->hw,
-					    IEEE80211_IFACE_ITER_NORMAL,
-					    iwl_mvm_pm_disable_iterator, mvm);
-	}
 
 	/*
 	 * The AP binding flow can be done only after the beacon
@@ -597,11 +569,7 @@  static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
 	if (ret)
 		goto out_release;
 
-	/*
-	 * Update power state on the new interface. Admittedly, based on
-	 * mac80211 logics this power update will disable power management
-	 */
-	iwl_mvm_power_update_mode(mvm, vif);
+	iwl_mvm_power_disable(mvm, vif);
 
 	/* beacon filtering */
 	ret = iwl_mvm_disable_beacon_filter(mvm, vif);
@@ -662,9 +630,12 @@  static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
  out_release:
 	if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
 		mvm->vif_count--;
+
+	/* TODO: remove this when legacy PM will be discarded */
 	ieee80211_iterate_active_interfaces(
 		mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
 		iwl_mvm_power_update_iterator, mvm);
+
 	iwl_mvm_mac_ctxt_release(mvm, vif);
  out_unlock:
 	mutex_unlock(&mvm->mutex);
@@ -750,21 +721,13 @@  static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw,
 		mvmvif->phy_ctxt = NULL;
 	}
 
-	/*
-	 * TODO: remove this temporary code.
-	 * Currently MVM FW supports power management only on single MAC.
-	 * Check if only one additional interface remains after removing
-	 * current one. Update power mode on the remaining interface.
-	 */
 	if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE)
 		mvm->vif_count--;
-	IWL_DEBUG_MAC80211(mvm, "Currently %d interfaces active\n",
-			   mvm->vif_count);
-	if (mvm->vif_count == 1) {
-		ieee80211_iterate_active_interfaces(
-					mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
-					iwl_mvm_power_update_iterator, mvm);
-	}
+
+	/* TODO: remove this when legacy PM will be discarded */
+	ieee80211_iterate_active_interfaces(
+		mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
+		iwl_mvm_power_update_iterator, mvm);
 
 	iwl_mvm_mac_ctxt_remove(mvm, vif);
 
@@ -1658,6 +1621,9 @@  static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw,
 			goto out_remove_binding;
 	}
 
+	mvm->bound_vif_cnt++;
+	iwl_mvm_power_update_binding(mvm, vif);
+
 	goto out_unlock;
 
  out_remove_binding:
@@ -1695,6 +1661,9 @@  static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw,
 	iwl_mvm_binding_remove_vif(mvm, vif);
 out_unlock:
 	mvmvif->phy_ctxt = NULL;
+	mvm->bound_vif_cnt--;
+	iwl_mvm_power_update_binding(mvm, vif);
+
 	mutex_unlock(&mvm->mutex);
 }
 
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 5da5e2d..51b0e9a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -163,6 +163,8 @@  struct iwl_mvm_power_ops {
 				 struct ieee80211_vif *vif);
 	int (*power_update_device_mode)(struct iwl_mvm *mvm);
 	int (*power_disable)(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
+	void (*power_update_binding)(struct iwl_mvm *mvm,
+				     struct ieee80211_vif *vif);
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 	int (*power_dbgfs_read)(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 				char *buf, int bufsz);
@@ -336,6 +338,8 @@  struct iwl_mvm_vif {
 
 	/* FW identified misbehaving AP */
 	u8 uapsd_misbehaving_bssid[ETH_ALEN];
+
+	bool pm_prevented;
 };
 
 static inline struct iwl_mvm_vif *
@@ -520,12 +524,6 @@  struct iwl_mvm {
 	 */
 	unsigned long fw_key_table[BITS_TO_LONGS(STA_KEY_MAX_NUM)];
 
-	/*
-	 * This counter of created interfaces is referenced only in conjunction
-	 * with FW limitation related to power management. Currently PM is
-	 * supported only on a single interface.
-	 * IMPORTANT: this variable counts all interfaces except P2P device.
-	 */
 	u8 vif_count;
 
 	/* -1 for always, 0 for never, >0 for that many times */
@@ -568,6 +566,8 @@  struct iwl_mvm {
 	u8 aux_queue;
 	u8 first_agg_queue;
 	u8 last_agg_queue;
+
+	u8 bound_vif_cnt;
 };
 
 /* Extract MVM priv from op_mode and _hw */
@@ -786,6 +786,13 @@  static inline int iwl_mvm_power_update_device_mode(struct iwl_mvm *mvm)
 	return 0;
 }
 
+static inline void iwl_mvm_power_update_binding(struct iwl_mvm *mvm,
+						struct ieee80211_vif *vif)
+{
+	if (mvm->pm_ops->power_update_binding)
+		mvm->pm_ops->power_update_binding(mvm, vif);
+}
+
 void iwl_mvm_power_vif_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
 int iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm,
 					     struct iwl_rx_cmd_buffer *rxb,
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index 1817b2a..d5d4935 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -311,7 +311,7 @@  static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
 	    mvmvif->dbgfs_pm.disable_power_off)
 		cmd->flags &= cpu_to_le16(~POWER_FLAGS_POWER_SAVE_ENA_MSK);
 #endif
-	if (!vif->bss_conf.ps)
+	if (!vif->bss_conf.ps || mvmvif->pm_prevented)
 		return;
 
 	cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK);
@@ -406,17 +406,6 @@  static int iwl_mvm_power_mac_update_mode(struct iwl_mvm *mvm,
 	if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
 		return 0;
 
-	/*
-	 * TODO: The following vif_count verification is temporary condition.
-	 * Avoid power mode update if more than one interface is currently
-	 * active. Remove this condition when FW will support power management
-	 * on multiple MACs.
-	 */
-	IWL_DEBUG_POWER(mvm, "Currently %d interfaces active\n",
-			mvm->vif_count);
-	if (mvm->vif_count > 1)
-		return 0;
-
 	iwl_mvm_power_build_cmd(mvm, vif, &cmd);
 	iwl_mvm_power_log(mvm, &cmd);
 
@@ -522,6 +511,28 @@  int iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm,
 	return 0;
 }
 
+static void iwl_mvm_power_binding_iterator(void *_data, u8 *mac,
+					   struct ieee80211_vif *vif)
+{
+	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+	struct iwl_mvm *mvm = _data;
+	int ret;
+
+	mvmvif->pm_prevented = (mvm->bound_vif_cnt <= 1) ? false : true;
+
+	ret = iwl_mvm_power_mac_update_mode(mvm, vif);
+	WARN_ONCE(ret, "Failed to update power parameters on a specific vif\n");
+}
+
+static void _iwl_mvm_power_update_binding(struct iwl_mvm *mvm,
+					  struct ieee80211_vif *vif)
+{
+	ieee80211_iterate_active_interfaces(mvm->hw,
+					    IEEE80211_IFACE_ITER_NORMAL,
+					    iwl_mvm_power_binding_iterator,
+					    mvm);
+}
+
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 static int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm,
 					struct ieee80211_vif *vif, char *buf,
@@ -692,6 +703,7 @@  const struct iwl_mvm_power_ops pm_mac_ops = {
 	.power_update_mode = iwl_mvm_power_mac_update_mode,
 	.power_update_device_mode = iwl_mvm_power_update_device,
 	.power_disable = iwl_mvm_power_mac_disable,
+	.power_update_binding = _iwl_mvm_power_update_binding,
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 	.power_dbgfs_read = iwl_mvm_power_mac_dbgfs_read,
 #endif