SiliconLabs / wfx-fullMAC-driver

Silicon Laboratories WFx Wi-Fi Full-MAC driver
23 stars 9 forks source link

remove extra 2 cycles from reg16 routines #3

Closed bunnie closed 4 years ago

bunnie commented 4 years ago

the reg16 calls set the size field to 4, which causes an extra two cycles to occur for 16-bit reads/writes.

At least on my system, I am able to reduce this to just the 2 bytes expected of a 16-bit read/write and I have not seen any instability yet.

silabs-JulienT commented 4 years ago

Hi Bunnie,

You are correct, reading the control register with a 2-byte access is the most efficient way to read the control register. Doing so has no impact on stability. The driver uses a 4-byte access for compatibility issues especially with SDIO drivers on various hosts. Some of this drivers require a 32-bit aligned size. It is the case for some MCUs or Linux hosts (https://elixir.bootlin.com/linux/latest/source/drivers/mmc/core/sdio_io.c#L205).

bunnie commented 4 years ago

Makes sense, and thanks for explaining the issue. We'll keep this as a patch in our branch then.