Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1226784ybb; Wed, 25 Mar 2020 18:48:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtUisulM1imA7iJwb/DsLH+2h4q2gp9selT4onHWbkOt8Py/IGZU5fEZ27skc0iGJmMe6Vi X-Received: by 2002:a05:6830:2318:: with SMTP id u24mr4447477ote.106.1585187294400; Wed, 25 Mar 2020 18:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585187294; cv=none; d=google.com; s=arc-20160816; b=l2OTmdLsh36hgjydVYbIAocb2AkfrbEYfCvVqKYM4BVtCRCsVevnQlU7o+BsLTiU+Q flfs0oSGNq7QBHBUOdAjnyfgLqR13gseLAWtS8itWFv47RbCBRJD4hPMigRN66ANMRZO aE7OhdG01GQgCvoAj3TX/klzvmJuMl2V2nK5AMxYjM4f77XMxylx5bLaLrgXu8JRq/BB lFwdGxWwgaTwexu3v5foxJhvmVB0nJuSiA8LLg8IqJNmYDyxVnUiykL6b5RUB4afNFYX 6KX7Hc6XXyw26Ghu87H5xo1bErNMxp9bKXodXuoQ8RINl/DTZtBROXEWPTDbKJgD8sEj J+Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DVbIGUZzmVzjAjzBPYKxAday7rRrd8gW10hEb8uhH6A=; b=MS6NXsK1VN594zRRjdIOXWFd0ODjLxlLiJDsuFHAZpP6mh3p8cqT6CqVUNwRj/gfoF TcNlo2eyHqHJXK3ksxUPKgoOP8N6Wmiho5HnLrYeh9uCOs3dsmAPkXdHXa+lTdt9G0ZS nI78GfnP+ACaHpeeV0ICdoppMKn8mOq4Cbs1VZO274VXg/yU+bw3vtXcgPQdDi6RzG5f OeQh2KxsSP4kDd5aiLcuPleVx96cUFr3BhriPebaRa0TJv5WNz5251XFmRBptsJSi8fX 3eJTN7ZlFTyX7UIuHBUKcoSXpfIZ1FrEteEQc/TPUXiIOnBeDEye9oSI67nJhdFdyZok Xo2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iInKPqb+; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w8si433467otp.266.2020.03.25.18.47.47; Wed, 25 Mar 2020 18:48:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iInKPqb+; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 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 S1727598AbgCZBpf (ORCPT + 99 others); Wed, 25 Mar 2020 21:45:35 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33099 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727561AbgCZBpf (ORCPT ); Wed, 25 Mar 2020 21:45:35 -0400 Received: by mail-lf1-f68.google.com with SMTP id c20so3506242lfb.0 for ; Wed, 25 Mar 2020 18:45:32 -0700 (PDT) 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=DVbIGUZzmVzjAjzBPYKxAday7rRrd8gW10hEb8uhH6A=; b=iInKPqb+jCE9iBp+FzkJKX23ycUfM+n/4DJSZn3jJ1nRr/JCDdnEAM4mYohQrNVW5I lf7KF5+GfY1o0ATKLFORsCk0SJqmg4tChgm24sHFuJLzShl+X5h5Ksvi1H6uM6kLg5jF CJU020u9izZJiXK40Bxz76UNbC8uNdCpS9yIo= 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=DVbIGUZzmVzjAjzBPYKxAday7rRrd8gW10hEb8uhH6A=; b=UFaew+owP5kB86EGZ504ay33it/mQSaFZFQdFzTfG1IFcBBqihscOW82+zzqP9t9oQ +oEUgI6YWT0ph4GOScMom8Dgdx6RxfxSUXUsvvTge4pVhfgMU9B8tXa1Y6SO2ZVmRrxK WheFjn9ILPSOim9i43Iv8GV0utTbG6291PoK/4kyp8YsoGB+IoWcqHdG7SsulhtiS/Ho HrBToeXi8+GG2GTR8c1ywa6gikQ9++GqEeUSoivSTUToI7PGNmyYhKmlz7rSITTYxomq KyjKz35tiM8NlP2wNb38HL5P/KrdqajTOPNq1/60UJfKEjGzqslRSM/l5BpswT6TqBY+ Wo8Q== X-Gm-Message-State: AGi0PuZVVvve3+4SEFQwM7poSwVCOYLx7+Dr52j51x+sVchXxRnjkvS1 vqBtqr0AiM1sgZfjHjGw4k/dki8CjG8= X-Received: by 2002:ac2:50cf:: with SMTP id h15mr429723lfm.127.1585187131677; Wed, 25 Mar 2020 18:45:31 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id s10sm493185ljp.87.2020.03.25.18.45.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Mar 2020 18:45:30 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id v16so4670099ljk.13 for ; Wed, 25 Mar 2020 18:45:30 -0700 (PDT) X-Received: by 2002:a2e:b559:: with SMTP id a25mr3465429ljn.280.1585187130419; Wed, 25 Mar 2020 18:45:30 -0700 (PDT) MIME-Version: 1.0 References: <20200324075216.22553-1-yhchuang@realtek.com> <20200324075216.22553-2-yhchuang@realtek.com> <20200324165105.GA99185@google.com> In-Reply-To: From: Brian Norris Date: Wed, 25 Mar 2020 18:45:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/2] rtw88: add regulatory process strategy for different chipset To: Andy Huang Cc: Tony Chuang , "kvalo@codeaurora.org" , "linux-wireless@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org [ I'll preface this by saying that the more I look at the regulatory core, the more I realize I'm confused or wrong at times. So forgive me if I've made errors along the way, and please do correct me. ] On Tue, Mar 24, 2020 at 8:11 PM Andy Huang wrote: > > On Tue, Mar 24, 2020 at 03:52:15PM +0800, yhchuang@realtek.com wrote: > > > --- a/drivers/net/wireless/realtek/rtw88/Kconfig > > > +++ b/drivers/net/wireless/realtek/rtw88/Kconfig > > I'm still not sure why rtw88 needs this, and nobody else does. I read > > I think in Atheros driver, ATH_REG_DYNAMIC_USER_REG_HINTS config serves > the same purpose. Ah, I forgot about that one, sorry. > > your commit message, but that doesn't sound like something that belongs > > in a single driver still. > > > > As our previous commit message claims, it is due to FCC [...] Yes, I saw that: my point was that effectively all drivers are subject to this FCC rule, and so this could be a common CONFIG_*. But if we already have the ATH_* one (I missed that, above), I guess we can have an rtw88 one too. It might be less confusing (and more straightforwardly-implemented) if we moved this stuff to the core someday, though. > > > + ret = regulatory_hint(hw->wiphy, rtwdev->efuse.country_code); > > > + if (ret) > > > + rtw_warn(rtwdev, "failed to hint regulatory: %d\n", ret); > > > > I don't think this is what you want; you had it right in previous > > revisions: > > > > if (!rtwdev->efuse.country_worldwide) { > > if (regulatory_hint(hw->wiphy, rtwdev->efuse.country_code)) > > rtw_err( ... ); > > } > > > > Without the 'country_worlwide' check, you start "hinting" (even on > > worldwide chips) that you really wanted "country" 00 only, and so we > > *never* adapt to more strict country settings. That's not how world-wide > > settings are supposed to work. > > It doesn't mean that we want country 00 only, we will get country notifies > from stack, and we will apply it if we accept it. We don't want stack to change > the channel plan for us. I noted this to you privately, but I don't believe it's expected to call regulatory_hint() with "00". See the kerneldoc: * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain * should be in. If @rd is set this should be NULL. Note that if you * set this to NULL you should still set rd->alpha2 to some accepted * alpha2. Note that "00" is *not* actually an ISO 3166 alpha2 code. The key problem I'm seeing: once you do this, you establish a wiphy-specific regd, and this regd never updates its country code or DFS region according to IE updates. So attributes like NL80211_ATTR_DFS_REGION and NL80211_ATTR_REG_ALPHA2 remain unset. Your previous revision -- which for WW settings used wiphy_apply_custom_regulatory() and *not* regulatory_hint() -- did not have that problem. > > Why are you ignoring SET_BY_DRIVER? > > Since the notification with NL80211_REGDOM_SET_BY_DRIVER flag might > comes from an another chipset's regulatory_hint(). Ack. Brian