9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] Unwanted power-saving behaviour in etheriwl
@ 2025-03-01  2:30 Jamie McClymont
  2025-03-01 18:43 ` kemal
  0 siblings, 1 reply; 10+ messages in thread
From: Jamie McClymont @ 2025-03-01  2:30 UTC (permalink / raw)
  To: 9front

Hello,

etheriwl on my Intel 8265/8275 card behaves in an odd way:

After receiving a beacon frame, the card sends all queued packets, and receives all queued packets from the AP. Once that’s done, it immediately goes back to sleep (sending a Null Function frame with the `PWR MGT: STA will go to sleep flag), until the next beacon frame. 

This means that packets (in both directions!) are only sent during a brief window every 102.4ms.

I don’t see from the code why the card would behave this way – MAC power saving seems to be turned off correctly. 

I’m curious how widespread this behaviour is. If you use etheriwl, and ping a machine on the local network, do you get consistently low ping, or are ping times randomly distributed between 0 and 102.4ms (and which card do you use)?

Hacky fixes I have tried which have not helped:
* Changing the power management timeout flag in tx cmds from 0 to 3, which should allegedly tell the firmware to not sleep for the next 10 seconds (line 3943)
* Changing 1<<0 to 0<<0 in updatedevicepower, to disable PM there

My next steps will be to try updating the firmware blob to the latest available, in case there have been fixes there. Failing that, I guess I’ll see if the behaviour is reproducible under openbsd, and diff the commands we send to the card if not.

- Jamie

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-01  2:30 [9front] Unwanted power-saving behaviour in etheriwl Jamie McClymont
@ 2025-03-01 18:43 ` kemal
  2025-03-01 18:48   ` Jamie McClymont
  0 siblings, 1 reply; 10+ messages in thread
From: kemal @ 2025-03-01 18:43 UTC (permalink / raw)
  To: 9front

try doing 1<<13|1<<0 and 1<<13|0<<0 in updatedevicepower
openbsd seems to do 0<<13|1<<0 though

/**
 * Masks for device power command flags
 * @IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK:
 * '1' Allow to save power by turning off receiver and transmitter.
 * '0' Do not allow. This flag should be always set to '1' unless
 * one needs to disable actual power down for debug purposes.
 * @IWM_DEVICE_POWER_FLAGS_CAM_MSK:
 * '1' CAM (Continuous Active Mode) is set, power management is 
disabled.
 * '0' Power management is enabled, one of the power schemes is applied.
 */
#define IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK (1 << 0)
#define IWM_DEVICE_POWER_FLAGS_CAM_MSK (1 << 13)

here's the openbsd source btw
https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/dev/pci/if_iwmreg.h
https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/dev/pci/if_iwm.c




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-01 18:43 ` kemal
@ 2025-03-01 18:48   ` Jamie McClymont
  2025-03-01 18:48     ` Jamie McClymont
  0 siblings, 1 reply; 10+ messages in thread
From: Jamie McClymont @ 2025-03-01 18:48 UTC (permalink / raw)
  To: 9front



> On 2 Mar 2025, at 5:43 AM, kemal <kmal@cock.li> wrote:
> 
> try doing 1<<13|1<<0 and 1<<13|0<<0 in updatedevicepower
> openbsd seems to do 0<<13|1<<0 though

Yeah that’s the second bullet point in my email of things I already tried :(

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-01 18:48   ` Jamie McClymont
@ 2025-03-01 18:48     ` Jamie McClymont
  2025-03-01 19:08       ` Jamie McClymont
  0 siblings, 1 reply; 10+ messages in thread
From: Jamie McClymont @ 2025-03-01 18:48 UTC (permalink / raw)
  To: 9front

Oh sorry, I misread! Will try.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-01 18:48     ` Jamie McClymont
@ 2025-03-01 19:08       ` Jamie McClymont
  2025-03-01 22:27         ` kemal
  0 siblings, 1 reply; 10+ messages in thread
From: Jamie McClymont @ 2025-03-01 19:08 UTC (permalink / raw)
  To: 9front

That bit triggers a fatal firmware error :(

The register definitions in the linux driver don’t define bit 13, so I suspect it may not exist.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-01 19:08       ` Jamie McClymont
@ 2025-03-01 22:27         ` kemal
  2025-03-02  0:21           ` cinap_lenrek
  0 siblings, 1 reply; 10+ messages in thread
From: kemal @ 2025-03-01 22:27 UTC (permalink / raw)
  To: 9front


i looked into it a bit more
- that bit 13 was removed in a later firmware api, which was the reason 
for the fatal firmware error
- 2 commands seem to be relevant here: updatedevicepower and 
setmacpowermode
- bit 0 should be off (0<<0) to disable power management and have the 
card continuously running, in updatedevicepower and setmacpowermode (it 
already is in setmacpowermode)
- openbsd runs updatedevicepower again right before setmacpowermode, we 
should do so in rxon7000




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-01 22:27         ` kemal
@ 2025-03-02  0:21           ` cinap_lenrek
  2025-03-02  0:31             ` kemal
  0 siblings, 1 reply; 10+ messages in thread
From: cinap_lenrek @ 2025-03-02  0:21 UTC (permalink / raw)
  To: 9front

wow, so with these changes it works?

--
cianp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-02  0:21           ` cinap_lenrek
@ 2025-03-02  0:31             ` kemal
  2025-03-02  1:36               ` cinap_lenrek
  0 siblings, 1 reply; 10+ messages in thread
From: kemal @ 2025-03-02  0:31 UTC (permalink / raw)
  To: 9front

no idea, i dont have a 9front system, just giving suggestions
(if i did i would have tested it and had sent a patch)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-02  0:31             ` kemal
@ 2025-03-02  1:36               ` cinap_lenrek
  2025-03-02 14:46                 ` Jamie McClymont
  0 siblings, 1 reply; 10+ messages in thread
From: cinap_lenrek @ 2025-03-02  1:36 UTC (permalink / raw)
  To: 9front

okay,

thank you anyway for your efforts.
i dont have the setup here right now to test.
maybe i can do something next week.

--
cianp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9front] Unwanted power-saving behaviour in etheriwl
  2025-03-02  1:36               ` cinap_lenrek
@ 2025-03-02 14:46                 ` Jamie McClymont
  0 siblings, 0 replies; 10+ messages in thread
From: Jamie McClymont @ 2025-03-02 14:46 UTC (permalink / raw)
  To: 9front

No change from running updatedevicepower again right before setmacpowermode in rxon7000, even with 0<<0.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-02 14:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-01  2:30 [9front] Unwanted power-saving behaviour in etheriwl Jamie McClymont
2025-03-01 18:43 ` kemal
2025-03-01 18:48   ` Jamie McClymont
2025-03-01 18:48     ` Jamie McClymont
2025-03-01 19:08       ` Jamie McClymont
2025-03-01 22:27         ` kemal
2025-03-02  0:21           ` cinap_lenrek
2025-03-02  0:31             ` kemal
2025-03-02  1:36               ` cinap_lenrek
2025-03-02 14:46                 ` Jamie McClymont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).