Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4499282pxb; Thu, 14 Oct 2021 06:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoRy6OZPewGBKpJkWX7WLBqk19gCFgf/tP26wYaFjmcE5IbIv3Wo1PQNLEpTWKHkmu36H1 X-Received: by 2002:a17:90b:368a:: with SMTP id mj10mr6311088pjb.201.1634218120717; Thu, 14 Oct 2021 06:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634218120; cv=none; d=google.com; s=arc-20160816; b=Ifc0pJg17FxF49ScwVq8FGoenSI/hJ1vVOB+izE2Z1JYddptc9lDNSf8rWgmNAHqQA 2Hmhnh9NLv1IptDl8FRFm8OajNJRgsIetuwBqDr8o7sOUk90LJLmuVkAFjslLKepRb68 g5Wq2eN9BxYCQBKnYagTEesuXIYKXByZnZDpxnUf2KhHLGm6yfjdCx48d5DOblR4Js72 01zB9YYlDtlQgiclxz26pmAQl0vEOnwcwnwldxz5MeyCKOj0W288mDop9Xph3psRSPQH x1Tiq3gjmfAcqKlcHxivtJSvFVFQkxBSiGP84y2MNQffDb/KdGD5kk1X5B1PuRiL4+rq bqwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Dn8qntTXephimx3LoXkKaClxMq8rV7tTytuW+aAxGys=; b=pmepx940WEMJ+lmhiR6hFRjG607aMyriuY5Vl4jaIn8gq9iPcnLGQXtfXL666b4qdc +LLIOeO3JHsEFiGPOAsixcBfOqWXhQv2N6ecGWmoUQL4Y9ky8bbeHwtl/K2+hG7U2qfX nHqHeEb0J4VKiU9gUfAHALJ3cpRqwkufM3gMVzGF3s59ff/Tk0aHoKC6IJqMj7rvcTqB e/e5Visk+IlLmujT8lbV02he/ikVfCtlexyRHopAR+ZWSAE8MD+ExksgBtQrMTuCSlYd VNiZ87Xs2IGwRyiGAvekZYFTHKEztcHul4GpPWIN7YcmePhdJLPO6ceAZbTRMC9YKvBK RNrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TG4gKWLE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si3266537plh.445.2021.10.14.06.28.27; Thu, 14 Oct 2021 06:28:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TG4gKWLE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231284AbhJNN0A (ORCPT + 99 others); Thu, 14 Oct 2021 09:26:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231268AbhJNNZ4 (ORCPT ); Thu, 14 Oct 2021 09:25:56 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83275C06174E; Thu, 14 Oct 2021 06:23:51 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id i12so19447544wrb.7; Thu, 14 Oct 2021 06:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Dn8qntTXephimx3LoXkKaClxMq8rV7tTytuW+aAxGys=; b=TG4gKWLEl1HWM00/cvFeOgDj8WQYP1KCzXTGjFb7rZem/+WkoOb/xrGrkjvQRt7diq zd8viGl3L5J9hmO2rGfQHR1gaQlNNR6UTGuKzPZLn8Xs5/JuRGRrK0ZWgPiDSpWLdPHv DFfuIRHxQyvIHvztCAbcge5bZnpVDD1Lftk2hgMHufVFAFu3yOYsLA8ylcyzbkxTjEPV XObLkUZnCoisWw1iprA8xD93a1QCc/ClQ0rqa/f/+wAVOssgskUwMkvT3YdnPlViC02L gDuC6t1ugWwTWQNrILpaLsLBd9Eu0phGP8FW0E0kdaySSPMPPrCdltzLOlh+sqzFadVf /iyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Dn8qntTXephimx3LoXkKaClxMq8rV7tTytuW+aAxGys=; b=KQ1JJeejln5y16AuGmJqk1l9QmQEk1Xs2LNBtuZ01WvpPFq8xrPRMD1u5Fjw+NXI2B i35dS81CYeKTT7xo/wPsuPk30YnSaO9z3K6Kt4t1JID3mV8syYuDdkvCbMv8IXWQyUe6 8xTvjajNTMtt+r6I0yCaVFS3bpapvlRkduZf8v0eVpPwABN3SOjD9qAnioaAhXwqKnch UWDNBMoPdPIRH/W87/PyH/XW8kOrASAID4+AKOrhrhwc6MCBQ00hnL528Rd2WQw1C7kI wpESH5e/QjqiK4Bv6zVrk2WcLYt5gU4jsusfjoNPJK936fIW0LZjAAQRuihvoSiWnPzu 7piQ== X-Gm-Message-State: AOAM530pxnQNORO4BbDUE8chc+8oxJ6EO5BpTpM9DD/1zOGk2NwxdnKp D6VzygugXimulbf3ruyXUuIba6//3IU= X-Received: by 2002:a05:600c:1c88:: with SMTP id k8mr5782455wms.169.1634217830036; Thu, 14 Oct 2021 06:23:50 -0700 (PDT) Received: from debian64.daheim (p200300d5ff0f7400d63d7efffebde96e.dip0.t-ipconnect.de. [2003:d5:ff0f:7400:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id f186sm7823662wma.46.2021.10.14.06.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 06:23:49 -0700 (PDT) Received: from localhost.daheim ([127.0.0.1]) by debian64.daheim with esmtp (Exim 4.95) (envelope-from ) id 1mb0i5-0009Kt-2o; Thu, 14 Oct 2021 15:23:49 +0200 Subject: Re: [PATCH] ath10k: support bus and device specific API 1 BDF selection To: Robert Marko Cc: kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, open list References: <20211009221711.2315352-1-robimarko@gmail.com> From: Christian Lamparter Message-ID: <0180909b-1c62-208d-3dce-7ac34dbd584c@gmail.com> Date: Thu, 14 Oct 2021 15:23:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/10/2021 14:01, Robert Marko wrote: > On Thu, 14 Oct 2021 at 13:54, Christian Lamparter wrote: >> >> On 10/10/2021 00:17, Robert Marko wrote: >>> Some ath10k IPQ40xx devices like the MikroTik hAP ac2 and ac3 require the >>> BDF-s to be extracted from the device storage instead of shipping packaged >>> API 2 BDF-s. >>> >>> This is required as MikroTik has started shipping boards that require BDF-s >>> to be updated, as otherwise their WLAN performance really suffers. >>> This is however impossible as the devices that require this are release >>> under the same revision and its not possible to differentiate them from >>> devices using the older BDF-s. >>> >>> In OpenWrt we are extracting the calibration data during runtime and we are >>> able to extract the BDF-s in the same manner, however we cannot package the >>> BDF-s to API 2 format on the fly and can only use API 1 to provide BDF-s on >>> the fly. >>> This is an issue as the ath10k driver explicitly looks only for the >>> board.bin file and not for something like board-bus-device.bin like it does >>> for pre-cal data. >>> Due to this we have no way of providing correct BDF-s on the fly, so lets >>> extend the ath10k driver to first look for BDF-s in the >>> board-bus-device.bin format, for example: board-ahb-a800000.wifi.bin >>> If that fails, look for the default board file name as defined previously. >>> >>> Signed-off-by: Robert Marko >>> --- >> >> As mentioned in Robert's OpenWrt Pull request: >> https://github.com/openwrt/openwrt/pull/4679 >> >> It looks like the data comes from an mtd-partition parser. >> So the board data takes an extra detour through userspace >> for this. >> >> Maybe it would be great, if that BDF (and likewise pre-cal) >> files could be fetched via an nvmem-consumer there? >> (Kalle: like the ath9k-nvmem patches) > > Christian, in this case, NVMEM wont work as this is not just read from > an MTD device, it first needs to be parsed from the MikroTik TLV, and > then decompressed as they use LZO with RLE to compress the caldata > and BDF-s. For more context here (it's unrelated to the patch): There is more custom code than just the mtd splitter. I do fear that this could be turning into a dreaded "separation between mechanism vs policy"-proxy discussion with that in-kernel LZOR decompressor/extractor and the way that the board-data then has be rerouted through user-space back to ath10k. --- As for the proposed feature: Yeah, back in 2017/2018-ish, I would have really loved to have this "load separate board-1 based on device-location". Instead the QCA4019's board-2.bin is now bigger than the device's firmware itself. From what I can see, there are also more outstanding board-2.bin merge requests too, though some those are updates. Cheers, Christian