[Performance regression] BCM4359/9 on S905X2

Martin Blumenstingl martin.blumenstingl at googlemail.com
Tue Apr 4 14:06:04 PDT 2023


Hi Marc,

On Tue, Apr 4, 2023 at 6:09 PM Marc Gonzalez <marc.w.gonzalez at free.fr> wrote:
[...]
> For vendor, common/arch/arm64/boot/dts/amlogic/mesong12a_sei.dtsi
>
>                 bus-width = <4>;
>                 cap-sd-highspeed;
>                 cap-mmc-highspeed;
>                 max-frequency = <100000000>;
I would start by comparing the bus mode. You can get it from
/sys/kernel/debug/mmc2/ios
On the vendor kernel it should be in /sys/kernel/debug/sdio/ios (or
similar, I'm typing this from the top of my head).
It will give you insights on the clock and timing that has been
negotiated between the host and card.

>From this information you can get the maximum bus speed, e.g. from [0]
Please note that any card will add overhead for communication, so bus
speed will not be equal to wifi throughput.

> vendor DTS has the following child node:
>
>                 sdio {
>                         pinname = "sdio";
>                         ocr_avail = <0x200080>; /**VDD voltage 3.3 ~ 3.4 */
>                         /* max_req_size = <0x20000>; */ /**128KB*/
>                         max_req_size = <0x400>;
>                         card_type = <3>;
>                         /* 3:sdio device(ie:sdio-wifi),
>                          * 4:SD combo (IO+mem) card
>                          */
>                         dmode = "pio";
>                 };
>
> Maybe the vendor kernel uses the above information to "boost"
> the performance of the SDIO-based WiFi adapter?
PIO is also what we support upstream with the
amlogic,dram-access-quirk; (which is enabled for &sd_emmc_a).
This suggests that the pinctrl trick that Neil mentioned is not used here.

I assume that the wifi driver on the vendor kernel is the brcmdhd (out
of tree) driver, while mainline uses brcmfmac.
One idea that comes to my mind is to enable the
amlogic,dram-access-quirk; (and use pio mode on the vendor kernel) for
eMMC or SD card and then compare read/write speeds. If they are
similar-ish then the wifi performance difference is likely caused by
the wifi driver (or in the opposite case: if read/write speeds on
mainline with amlogic,dram-access-quirk; perform worse than the vendor
kernel with pio mode then it's likely that it's a meson-gx-mmc driver
limitation).

>From my work on the rtw88 SDIO wifi driver I can say that the
meson-gx-mmc driver can push (TX direction) at least 120Mbit/s.
I understand that this is half of what you get with the vendor kernel
- and that this is the wrong direction (you're testing RX while I'm
testing TX).
The point that I want to get across is: I think nobody has the one
answer why wifi performance is lower (personally I'm happy with having
it work at all, performance is second).
So it'll be a process to find the reason, and I think it requires
being creative due to the large amounts of different code (MMC driver,
wifi driver, additional patches...) between mainline and the vendor
kernel.


Best regards,
Martin


[0] https://en.wikipedia.org/wiki/SD_card#Power_consumption



More information about the linux-amlogic mailing list