sdm660-mainline / linux

Linux kernel source tree
Other
27 stars 17 forks source link

Upstream the wlan hack #24

Open minlexx opened 5 months ago

minlexx commented 5 months ago

I've found interesting thing

$ ath10k-fwencoder --dump-cmdline firmware-5.bin
ath10k-fwencoder --create \
--features=wowlan,no-nwifi-decap-4addr-padding,allows-mesh-bcast,mgmt-tx-by-ref,non-bmi,single-chan-info-per-channel \
--set-wmi-op-version=tlv \
--set-htt-op-version=tlv \

Seems like we don't have to even package firmware-5.bin, it's not a real firmware, but more like "firmware flags" file which can encode some board-specific fw features or quirks (see https://groups.google.com/a/chromium.org/g/chromium-os-reviews/c/7YVeGZrVhtY ). And we can just run ath10k-fwencoder --create ... with those set of flags to get the file. I've been looking how to upstream our msm8998/660 hack https://github.com/sdm660-mainline/linux/commit/3d1b2759a2b11310c66e9daa8432518940c645f0 and I think this should be encoded in firmware-5.bin as firmware quirk. It needs enum value added to struct ath10k_fw_features and also to array ath10k_core_fw_feature_str and same value in ath10k-fwencoder https://github.com/qca/qca-swiss-army-knife/blob/master/tools/scripts/ath10k/ath10k-fwencoder#L45 and new firmware-5.bin generated with this quirk.

call flag like ATH10K_FW_FEATURE_NO_MSA_READY_IND and do smth like

$ ath10k-fwencoder --create --features=wowlan,no-nwifi-decap-4addr-padding,allows-mesh-bcast,mgmt-tx-by-ref,non-bmi,single-chan-info-per-channel,no-msa-ready-ind  \
    --set-wmi-op-version=tlv --set-htt-op-version=tlv --set-fw-api=5

test for pesence of this flag in the ath10k_qmi_driver_event_work() func like

struct ath10k *ar = qmi->ar;
if (test_bit(ATH10K_FW_FEATURE_NO_MSA_READY_IND, ar->running_fw->fw_file.fw_features)) ...
minlexx commented 5 months ago

Ah, someone is already doing that http://lists.infradead.org/pipermail/ath10k/2024-March/015316.html

minlexx commented 5 months ago

Looks like this was already tried and it didn't work => https://lore.kernel.org/ath10k/243a97b7-c298-4307-9f06-8b3a7c3e24fd@freebox.fr/

reason being

QMI stuff happens much EARLIER than firmware-5.bin handling. (ar->running_fw is still NULL)

minlexx commented 4 months ago

Maybe we can try/pick [PATCH v3 0/3] Work around missing MSA_READY indicator for msm8998 devices

It is almost adccepted already, and final solution is to use separate DT property qcom,no-msa-ready-indicator in wlan wcn3990 node.

minlexx commented 1 week ago

in 6.11 we now can drop hack commit and do like this https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=737abcabe97bb37e38be2504acd28ad779dbaf3d