From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F012FC636D6 for ; Thu, 9 Feb 2023 16:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+1zH8FqG3JnQ5YXhQBPrYIAYVqNlWwAvvJREj6GJfWQ=; b=eV3QrYVkhyRbUR Fm7Zvs0KfoimSEyfLd2tf0QgYdvU2u94yU2ychboyOuc08LXiAC5lyTKx0KD6xxHsl+EX96hnN0ux H8kOLemxV73sZBRJSWS754H115++/aQg682juLMU6ajVQCGxd8GIBm/i3b+pISggo/DMNatTktZFm S2WpUcqGLmGuyC+arYDvsIpiMnqVbxoNUSNY+TtXwhBNBoAXpX9u+Vrhg91ZVCGLl6xuAUD/7M5P2 dJdhSS7TB3+81DIQhEEJJf/J3uHlNJ9LO1yCptK4rULaKKFqDwym/sVX0r/TtLm65ldqF+VFdnU9j fV4q8ztJvoGM+YKMveFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ9UF-002MhV-Sh; Thu, 09 Feb 2023 16:09:27 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ9UC-002Mel-Gy for ath10k@lists.infradead.org; Thu, 09 Feb 2023 16:09:26 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9534461B1F for ; Thu, 9 Feb 2023 16:09:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A0C4C433EF for ; Thu, 9 Feb 2023 16:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675958961; bh=0M/80MVd16v9rBzSC03ir0k/yTUZTebVxlTZPrgIvNo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=d/NQIopcyTOmfXh0Oe5f9loEh9fWJBEN7zdyfNum9bv9Cn/azjJTEqIeTlI/RfBt5 3rrN6Md9mErpOWka1J7AXprUCkfEQq9e7Vv7lm3enNfTPaS9rsQPlgzv7qyHqhUiF5 KMVVZG4aAN2/TDkSI278bd34zuEoa9YWb1rkp6m2IVyPAhDHNAnMGRfh3h361mLMGk WcW6NnSEbVAydeL/NKId2E5zFPjv5EwufXJaxphGdg+jtO1tV8PVttElQzPGK2w0pD aXX8tsXyRdhsF3/DQTaEaEKJSBjlMfJdmMtER1xe0LKxr6JqhHM/fmLrwJjq/WNNzn NmW5u1O3YwuJA== Received: by mail-vk1-f180.google.com with SMTP id n13so1177365vkl.8 for ; Thu, 09 Feb 2023 08:09:20 -0800 (PST) X-Gm-Message-State: AO0yUKXzctA9y5/KNjVmh0eVmJ2oupgVWY5tGak5VQ3fdBnx6mCn91bn n85ccPVfgI+0OPl7jhbgECo0ftKpw7V01sJudw== X-Google-Smtp-Source: AK7set9aPL1yHxtKO96ECAzw2gdVVnMz0shz/0LHQsodjryYcX0FU9j1ko12Gj4Tl1fgXZ7dNENAWxvgLOC/dD7HRvA= X-Received: by 2002:a05:6122:1461:b0:3d5:d30f:81c2 with SMTP id r1-20020a056122146100b003d5d30f81c2mr2315587vkp.14.1675958959955; Thu, 09 Feb 2023 08:09:19 -0800 (PST) MIME-Version: 1.0 References: <20230209045026.1806587-4-equu@openmail.cc> In-Reply-To: <20230209045026.1806587-4-equu@openmail.cc> From: Rob Herring Date: Thu, 9 Feb 2023 10:09:08 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 3/3] wifi: ath10k: only load compatible DT cal data To: equu@openmail.cc Cc: lpieralisi@kernel.org, toke@toke.dk, kvalo@kernel.org, linux-pci@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, kernel test robot X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230209_080924_719986_6AE7E671 X-CRM114-Status: GOOD ( 29.62 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+ath10k=archiver.kernel.org@lists.infradead.org On Wed, Feb 8, 2023 at 10:51 PM wrote: > > From: Edward Chow > > ath10k might also be sensitive to the issue reported on > https://github.com/openwrt/openwrt/pull/11345 , loading calibration > data from a device tree node declared incompatible. > > ath10k will first check whether the device tree node is compatible > with it, using the functionality introduced with the first patch of > this series, ("PCI: of: Match pci devices or drivers against OF DT > nodes") and only proceed loading calibration data from compatible node. > > Signed-off-by: Edward Chow > Reported-by: kernel test robot This is for fixes created as a result of kernel test robot report. Reports on your broken patches should not have this. > --- > drivers/net/wireless/ath/ath10k/core.c | 31 ++++++++++++++++++++++++++ > drivers/net/wireless/ath/ath10k/hw.h | 4 ++++ > drivers/net/wireless/ath/ath10k/pci.c | 18 ++++++++++++++- > drivers/net/wireless/ath/ath10k/pci.h | 2 ++ > 4 files changed, 54 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c > index 5eb131ab916f..4c9e8140aeff 100644 > --- a/drivers/net/wireless/ath/ath10k/core.c > +++ b/drivers/net/wireless/ath/ath10k/core.c > @@ -13,6 +13,8 @@ > #include > #include > #include > +#include > +#include > #include > > #include "core.h" > @@ -26,6 +28,7 @@ > #include "testmode.h" > #include "wmi-ops.h" > #include "coredump.h" > +#include "pci.h" > > unsigned int ath10k_debug_mask; > EXPORT_SYMBOL(ath10k_debug_mask); > @@ -1958,6 +1961,34 @@ static int ath10k_download_cal_nvmem(struct ath10k *ar, const char *cell_name) > size_t len; > int ret; > > + /* devm_nvmem_cell_get() will get a cell first from the OF > + * DT node representing the given device with nvmem-cell-name > + * "calibration", and from the global lookup table as a fallback, > + * and an ath10k device could be either a pci one or a platform one. > + * > + * If the OF DT node is not compatible with the real device, the > + * calibration data got from the node should not be applied. > + * > + * dev_is_pci(ar->dev) && ( no OF node || caldata not from node > + * || not compatible ) -> do not use caldata . > + * > + * !dev_is_pci(ar->dev) -> always use caldata . > + * > + * The judgement for compatibility differs with ath9k for many > + * DT using "qcom,ath10k" as compatibility string. > + */ > + if (dev_is_pci(ar->dev) && > + (!ar->dev->of_node || > + (of_property_match_string(ar->dev->of_node, > + "nvmem-cell-names", > + cell_name) < 0) || > + !of_device_get_match_data(ar->dev) || > + !(((const struct ath10k_hw_misc_flags *) > + of_device_get_match_data(ar->dev))->need_calibration) || > + !of_pci_node_match_driver(ar->dev->of_node, > + &ath10k_pci_driver))) That is just plain ugly and not understandable. Why do you still need of_pci_node_match_driver()? If compatible using VID/PID doesn't match the actual VID/PID, then you should never probe. The prior explanations didn't really clear things up either. I'm really at a loss as to what are the scenarios you need to work. Please enumerate what are the different scenarios of what's in the DTs and how you need the kernel/driver to respond. Rob _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k