Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp695579pxb; Thu, 5 Nov 2020 10:28:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1g8nnU+ZxedYqO89LnVbiKrwnT3BEftbzJx46GpI71XVa6QBnM16oQtl7uYQzqfSOK3tk X-Received: by 2002:a50:b224:: with SMTP id o33mr3862070edd.21.1604600888345; Thu, 05 Nov 2020 10:28:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604600888; cv=none; d=google.com; s=arc-20160816; b=u5EWOGxWEfdtToKOG5Oid1K/FytAwPump2NxF7oW7EDzTOioXrdA1xqZIT0nEEXjIB ToSEiPWZByuyR0XwPkT+rEW0NvUFKWlRCmB40184BSOXuemDa/MABST111+/Low0otbI IUrEWFjHFGTzmsc02aqgerY/4qXT6oC4/38tDABaXSr2ZHt//9D7WmGsFy+jbq5ZRBE9 ZYaEXAZLWAyIy1ZJ7D13ZeANcgCLKZOyWY8GaFKw4bZxdYAnVvUPR4ztbskGI9x1U1cL adKSKj9javiYvFZ++xNY9Z/+nbL3dzf7acQLeNQSphY8T90qzogg5960UI/Rxc47DLJg NkNA== 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=TtdJiddFj/JVmqq84Ng6/IaGiQPTm1boOA18UOSGclA=; b=AdL5tvVG//ra3BrvDLGFoLxa91d9y826I6fcKsT7t392HJRjVWnG93uHGZ7n6KykTJ jJkTlPkSoDHedj5LFioRC1/9w2YSuIaDalasc5HzwHX2vkeypAj1z+YlBUg2kspu4vLd HGU58OjHsgwOMhIZUYP4KLSBSwrZVaYedueA4uKozlYF/3zdPDaRxYY0H5T/yPDl44wt 2b9DirtpuZ7mGKqZL6A/73G/thIWJZDQZqTYIFE6qj1uSStydvmxx188WnkHCld7Oidz o1q2InT1Th/vaXF1xiwgUJGHxlRDI+Zr83IJSU00V40HCBxj4zdvkOhrl+0FjmQL9dpo mkGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bg76QJYH; 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 ef7si1745194ejb.146.2020.11.05.10.27.32; Thu, 05 Nov 2020 10:28:08 -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=bg76QJYH; 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 S1731746AbgKESZX (ORCPT + 99 others); Thu, 5 Nov 2020 13:25:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731722AbgKESZW (ORCPT ); Thu, 5 Nov 2020 13:25:22 -0500 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14E28C0613CF for ; Thu, 5 Nov 2020 10:25:22 -0800 (PST) Received: by mail-lf1-x141.google.com with SMTP id s30so3705757lfc.4 for ; Thu, 05 Nov 2020 10:25:21 -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=TtdJiddFj/JVmqq84Ng6/IaGiQPTm1boOA18UOSGclA=; b=bg76QJYHQJ8Gvg0r3vdI/b36YOfUxywPva/A1XljHA9rBblUYTG55v84ZjqUd07RZ+ r1EJqBgCDa+0EFSQVz7/wUMTYhoJFHhnqvzOnQ9dS5qjcODJdVUl0ns2kMqDDcwY8Huv oWfUles2q81ZFUpiTrMgkM3iDMWS63SCOpDVE= 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=TtdJiddFj/JVmqq84Ng6/IaGiQPTm1boOA18UOSGclA=; b=mR1d2NTt9zUitpPEDF5cnl5y9NfFwVp2jkpjXtoOlyt7n3irmFFHeVzxNsCSRBBP6t gFhed3jn4Q5ZL8G/FfYYnKY5M1kKIB8VboaJu8kkrgX9uS02EnzzPQvmv4urKgbbESXy 7HTIbo15V1f79YytQqR3E224cSiwdIuu+BiBVOWEZfubi1mG33zbo9NHgQD5Ecl3nEKR aIyA7Unk9wrvg4Bge0BEehj9fI29NY7GtTHYx9W7QllMV4oSWUABCNZ8auusyfzar3Jp A01uKWMIONfVi0sKlY3DgPOzj2fNmOUQYxo2Q1pkQR/ww04aPbAqaGh2Gr5sETpFNdws GcjA== X-Gm-Message-State: AOAM532hAq9f6+/sSXYYMFxtcIOzUhn78EtVDYmxW0JOl1z2n3Ca6FhU SZTYTZwq28OdA/nThRTRDUx7wbjUO/yBsw== X-Received: by 2002:a19:7413:: with SMTP id v19mr1466158lfe.300.1604600720179; Thu, 05 Nov 2020 10:25:20 -0800 (PST) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id 17sm257369lft.18.2020.11.05.10.25.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Nov 2020 10:25:19 -0800 (PST) Received: by mail-lf1-f53.google.com with SMTP id v144so3657954lfa.13 for ; Thu, 05 Nov 2020 10:25:18 -0800 (PST) X-Received: by 2002:a19:c703:: with SMTP id x3mr1400737lff.105.1604600718451; Thu, 05 Nov 2020 10:25:18 -0800 (PST) MIME-Version: 1.0 References: <1600753017-4614-1-git-send-email-cjhuang@codeaurora.org> <877dr0nqtv.fsf@codeaurora.org> <728196c17b4e70e18c99798a9945d1e6@codeaurora.org> In-Reply-To: <728196c17b4e70e18c99798a9945d1e6@codeaurora.org> From: Brian Norris Date: Thu, 5 Nov 2020 10:25:05 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations. To: Carl Huang Cc: Kalle Valo , Abhishek Kumar , linux-wireless , ath11k@lists.infradead.org, ath10k , Doug Anderson Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Nov 5, 2020 at 3:10 AM Carl Huang wrote: > On 2020-11-05 16:35, Kalle Valo wrote: > > Brian Norris writes: > >> On Tue, Nov 3, 2020 at 11:32 PM Carl Huang > >> wrote: > >>> On 2020-11-04 10:00, Brian Norris wrote: > >>> > What are the ABI guarantees around a given driver/chip's 'sar_capa'? > >>> > Do we guarantee that if the driver supports N ranges of certain bands, > >>> > that it will always continue to support those bands? To be clear: the answer here is "no." So we have to map out what the user/kernel interaction looks like when they change. > >> ... > >>> For a given chip(at least a QCOM chip), we don't see that the > >>> range will grow or change. > >> > >> That's good to know. But that's not quite the same as an ABI > >> guarantee. > > > > I'm not sure if I understood Brian's question correctly, but I have > > concerns on the assumption that frequency ranges never change. For > > example, in ath10k we have a patch[1] under discussion which adds more > > channels and in ath11k we added 6 GHz band after initial ath11k support > > landed. And I would not be surprised if in some boards/platforms a > > certain band is disabled due to cotting costs (no antenna etc). Right, I certainly was not taking the "never change bands" claim from Carl at face value ;) This is exactly why I was asking. > > My > > preference is to have a robust interface which would be designed to > > handle these kind of changes. Sure. > > [1] [PATCH] ath10k: enable advertising support for channels 32, 68 and > > 98 > > So the trick here is even if more channels are supported, it doesn't > mean > that it can support different SAR setting on these new channels. In this > case, > it likely falls into 5G range. It's safe for driver to extend the 5G > range and > doesn't break userspace. (68 and 98 are already in the 5G range, so > driver just > extends the start edge freq to 32 here.). You can't just wave your hands and say it "doesn't break userspace" -- you have to think about how user space can use this API. Specifically, consider that user space is not going to memorize indeces, as those are per-driver implementation details; it's going to memorize frequency bands. It wants to cross reference those with the results of the GET/DUMP API before it translates those into indeces for SET. As you're describing it, user space will have to have some kind of "fuzziness" to its logic -- today, it thinks the 5G band is [X,Y], but tomorrow it might expand to [X-N, Y+M]. So user space should just ensure that it configures any band that intersects with [X,Y], even though it didn't know about [X-N,X] or [Y,Y+M]? That logic covers splits too, I suppose. There's still the question of ranges that user space has no knowledge of (i.e., no intersection with any known [X,Y]). I think there's two approaches that are roughly equivalent: 1) require SET operations to specify all bands, and designate a NULL or MAX value that user space should use for unknown/unconfigured bands [or, user space uses some kind of "extension" from the nearest known band, just to be safe?] 2) allow SET operations to specify a subset of supported bands [gray area: what happens with the unconfigured band(s)? left as-is? use max?] We're approximately in #1 right now. If we're explicit about how that's supposed to work, then I think we can stay with that. Although it sounds like Carl is moving toward #2 (allow subsets). > But for flexibility, given 6 GHz as example here, let's keep the > explicit > index for SET command. For sar_capa advertisement, the explicit index is > dropped as Johannes suggested. New ranges can only be appended to > existing > ones. Like Brian said, only add or split is allowed. > The complexity to > handle > splitted range Vs whole range is left to WLAN driver itself. Hmm? I thought we're keeping the driver simple. I'm OK with that (and moving a little more complexity into user space) as long as we're clear about it. Brian > Userspace can SET any ranges which are advertised by WLAN driver. It's > not required to set all ranges and userspace can skip any ranges.