Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3842118pxu; Mon, 30 Nov 2020 11:21:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1caSqVyw5kjuodIsOdCepJk1eBAtLvolQqMdtP+ACCydZ+HypTSqFsmUQR8XVONn1tMWG X-Received: by 2002:a50:d745:: with SMTP id i5mr23900760edj.166.1606764119710; Mon, 30 Nov 2020 11:21:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606764119; cv=none; d=google.com; s=arc-20160816; b=ofk3V46JOgcG877xJ38S/KsrlXzVDTssXHBZpfmIqr0YQXYLPADL/y7ALita0bCssX MyFpigkA56g8yMjH8H3aOPd162qCFEuqQWG66tG12SfKMu80wF3NgrOMbb22wL+nWBLL r7HOFxoL5H8F/tKt6/jqKOWVHVorCFQIn4skCmnEdpuhvEhmpZkaGGIwCNVtiw1u7Jrt UcCDH+FsJFJiNo+W7moI1r7XNYFdRshM+7skmdJzmJkDztNjDEk9Ie/+hemPMXOFQNQ6 /Kxm8GZeumGNsdFHa7OJwYQh+6TwktS5ib+8wKMEF3SiealQ0iVQFjh3yQwiNW8qsgtr A/4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iMGjnal/Aq/KlLIqIqqw22222Z1xI0jO/CQiNQfVjOU=; b=k9Y7Lcop8jO9H5atKBd7WjnlUlDXDVWSihJY2FqkKLKF+i+1SYh6OoWpRE2bupMYv6 2gt+w7HF5dQgb0GUXCVn93zaoNlRv1yfiCHME2E+GPTXC6J139cwYrpHM2kL4+Ynw7n/ 72vl66sO5pEfXHn8P7xj/wJP/6ZkA7w/e9prBcIy7Evsjr9xprCRGVxCEfa5FjfO/khe Wjs4J/A1RpUgWz5H+0Xxp5cRNK3XSyzQj/d8nQeARLW9kUcLSDseAGOO0dWfv5XQ5i8k axjaNdJ/AB5GXOGIgwy/+gonOpjHKnfEcFMTM4UDFIacvByLf+Idf5Vy9JPlKXgpTnfm 2Mvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MVIWvWU2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn20si12456528ejc.748.2020.11.30.11.21.25; Mon, 30 Nov 2020 11:21:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@chromium.org header.s=google header.b=MVIWvWU2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729895AbgK3TUB (ORCPT + 99 others); Mon, 30 Nov 2020 14:20:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729886AbgK3TTy (ORCPT ); Mon, 30 Nov 2020 14:19:54 -0500 Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08367C061A47 for ; Mon, 30 Nov 2020 11:19:10 -0800 (PST) Received: by mail-vs1-xe2f.google.com with SMTP id k17so6925839vsp.13 for ; Mon, 30 Nov 2020 11:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iMGjnal/Aq/KlLIqIqqw22222Z1xI0jO/CQiNQfVjOU=; b=MVIWvWU2KEd1oVwr7wCYKt5eVbkImM44ifQyNFO6UawNRcaNv57nGaTuem9Gs4L023 gRwl98CmuhNEQJZ/VVF829iCXS4mFnBKkfgTh9GIkFtIvHJSta4dlEQ6HY7R6dga94ZF hKJ1pvxqlbsVz4qW1W+Ml2DlmFeRaYGGfmvGM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iMGjnal/Aq/KlLIqIqqw22222Z1xI0jO/CQiNQfVjOU=; b=Ll5Wwg3tSTP5WjW79jWVbEuYj28xqmYAAetiYTGixh8S4AnsnHKGr60G72kNwI3vNt f7QvgW9CtSSsAKA9YB4EbIMEghBjQN3mcDAo09i5MsvpB7ZZWjkdLjhlp8ZPW3CcCYvs EQEwmAYOlqWV0wCUUyIYpG2fSAoEORrShG7NmKBLEjjKeGIi43yrv/9TJj2BIE6UtjiD Zc8lmlIDYP9UR50GwspXnyNXj7urwa23/kAam6t65050YVqbSnP4cieXciKwy0aVWeA7 jd/urdAQMNgi9qkaPafuHpkX3nkVEZEl1l+w4lchbonJLI4tTKzZR8C3169oyTu+p2FA zRug== X-Gm-Message-State: AOAM530llVR1WwLF6pIiZ3aMg0wIszPi40+b9Q/FsBvKS7SePGDqLUDA m/fgK+qhVKo5qp276j7lWDlJYTrfuHGaaA== X-Received: by 2002:a67:2d58:: with SMTP id t85mr15653238vst.33.1606763940057; Mon, 30 Nov 2020 11:19:00 -0800 (PST) Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com. [209.85.222.50]) by smtp.gmail.com with ESMTPSA id s20sm5400373vsn.14.2020.11.30.11.18.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 11:18:59 -0800 (PST) Received: by mail-ua1-f50.google.com with SMTP id x4so2856297uac.11 for ; Mon, 30 Nov 2020 11:18:59 -0800 (PST) X-Received: by 2002:a9f:3dcc:: with SMTP id e12mr19070983uaj.121.1606763937949; Mon, 30 Nov 2020 11:18:57 -0800 (PST) MIME-Version: 1.0 References: <20201112200906.991086-1-kuabhs@chromium.org> <20201112200856.v2.1.Ia526132a366886e3b5cf72433d0d58bb7bb1be0f@changeid> <002401d6c242$d78f2140$86ad63c0$@codeaurora.org> <002d01d6c2dd$4386d880$ca948980$@codeaurora.org> In-Reply-To: <002d01d6c2dd$4386d880$ca948980$@codeaurora.org> From: Doug Anderson Date: Mon, 30 Nov 2020 11:18:46 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/1] ath10k: add option for chip-id based BDF selection To: Rakesh Pillai Cc: Abhishek Kumar , Kalle Valo , LKML , ath10k , Brian Norris , linux-wireless , "David S. Miller" , Jakub Kicinski , netdev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, On Tue, Nov 24, 2020 at 7:44 PM Rakesh Pillai wrote: > > > > I missed on reviewing this change. Also I agree with Doug that this is not > > the change I was looking for. > > > > > > The argument "with_variant" can be renamed to "with_extra_params". > > There is no need for any new argument to this function. > > > Case 1: with_extra_params=0, ar->id.bdf_ext[0] = 0 -> The default > > name will be used (bus=snoc,qmi_board_id=0xab) > > > Case 2: with_extra_params=1, ar->id.bdf_ext[0] = 0 -> > > bus=snoc,qmi_board_id=0xab,qmi_chip_id=0xcd > > > Case 3: with_extra_params=1, ar->id.bdf_ext[0] = "xyz" -> > > bus=snoc,qmi_board_id=0xab,qmi_chip_id=0xcd,variant=xyz > > > > > > ar->id.bdf_ext[0] depends on the DT entry for variant field. > > > > I'm confused about your suggestion. Maybe you can help clarify. Are > > you suggesting: > > > > a) Only two calls to ath10k_core_create_board_name() > > > > I'm pretty sure this will fail in some cases. Specifically consider > > the case where the device tree has a "variant" defined but the BRD > > file only has one entry for (board-id) and one for (board-id + > > chip-id) but no entry for (board-id + chip-id + variant). If you are > > only making two calls then I don't think you'll pick the right one. > > > > Said another way... > > > > If the device tree has a variant: > > 1. We should prefer a BRD entry that has board-id + chip-id + variant > > 2. If #1 isn't there, we should prefer a BRD entry that has board-id + chip-id > > 3. If #1 and #2 aren't there we fall back to a BRD entry that has board-id. > > > > ...without 3 calls to ath10k_core_create_board_name() we can't handle > > all 3 cases. > > This can be handled by two calls to ath10k_core_create_board_name > 1) ath10k_core_create_board_name(ar, boardname, sizeof(boardname), true) : As per my suggestions, this can result in two possible board names > a) If DT have the "variant" node, it outputs the #1 from your suggestion (1. We should prefer a BRD entry that has board-id + chip-id + variant) > b) If DT does not have the "variant" node, it outputs the #2 from your suggestion (2. If #1 isn't there, we should prefer a BRD entry that has board-id + chip-id) > > 2) ath10k_core_create_board_name(ar, boardname, sizeof(boardname), false) : This is the second call to this function and outputs the #3 from your suggestion (3. If #1 and #2 aren't there we fall back to a BRD entry that has board-id) What I'm trying to say is this. Imagine that: a) the device tree has the "variant" property. b) the BRD file has two entries, one for "board-id" (1) and one for "board-id + chip-id" (2). It doesn't have one for "board-id + chip-id + variant" (3). With your suggestion we'll see the "variant" property in the device tree. That means we'll search for (1) and (3). (3) isn't there, so we'll pick (1). ...but we really should have picked (2), right? -Doug