From patchwork Thu Jul 30 12:49:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alvin_=C5=A0ipraga?= X-Patchwork-Id: 11693001 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31B9813B1 for ; Thu, 30 Jul 2020 12:50:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 077932082E for ; Thu, 30 Jul 2020 12:50:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LqJylNkh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=bang-olufsen.dk header.i=@bang-olufsen.dk header.b="hCl+QNTW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 077932082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bang-olufsen.dk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=sS/jVlnioNyK65qYSIrZpBv1kFuXyfjYHm2ZsoDzwsw=; b=LqJylNkhldJW2RJGwIh05ZMm+L W0366HBbJk+N6bAW/eYcJuMlvfIgUX7iUWDhIDSOadMhTFJ8sOtwrSreiQ4Js3n+1yTSlrNDVgQMT wSbOGI72IfOZvuP/u1073GJdo/yYb78AtyTnpweNu6S95CjUwNSvH/ftW55P8Q8xTAc4654IYClK1 qU4xKb2GmN/iNZGF3WvBn5/EBB0Dl3sxpTAYiU12HP3JhXWvsKHydJxLaLVEOSDasbHquWOAi/Ihj g0UHXdoR/eQvkF2i49WcbO6fnUTPpIQ/aaHIiRGiswkEXirxFeaEhqYv6l+jZi7KHfO45LWgMgj8e PTXYxp6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k180g-0006OF-ME; Thu, 30 Jul 2020 12:50:10 +0000 Received: from mail-am6eur05on2120.outbound.protection.outlook.com ([40.107.22.120] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k180d-0006NY-EB for ath10k@lists.infradead.org; Thu, 30 Jul 2020 12:50:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nmRuSE/sFI3zSR7woH86LgQCci16W7HjqmIEZSOgg7tptyncIW/fn2sE+kOI/Sthl6sLAMYIsabS0U5a/EEHfeOtBUnIVoNNBC04zkM14s+yomCzqfpLyPRPtcuhDIdGT8+voSsEDA1KbThdH1GeYcCCeLYQxZPBkSx1gyfWOlyYskbR2WGm/We2ME+yfSh5MtnaCFTMW66YjnBtPOzup5b6dNW0Rfa40vqTLN42yqiGb55Y7r7rK/xqsTUTyvY2q5kZSsT3SrJKTLhDiwuJgqBNb5qWNAk/XYyn3W9KOwsoj//4CgG7tZoIAXTWEYLVYFU1DtUnWJtjbRlWYMolug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oz5t78Gv7vpLiS7J9Aia7d4ZQPUvY4UV0mdMCpdW9Kc=; b=C6FtZkkuZem5R7qVgJ37UK3A1uiY8ZOXbJ2LVtPEvNk/FY8EjdwuaWPH7U0XzlCyOY0f6hrJ8hUAjmpaUZLSmQdFXeZfC6C8NMI5JF7ZR4evtHXco4FhqyREmHG8AYBBP93qyjtduCMBNihLvi8SiUpkeVBQXuGkvs6k5hsJ9cHsGShnBuw2ij9/oVGbocBdMDbftA9rmAq6r3T+dcttWkWHlAG6nnItvGPHSeXEjyp43us1L5/Wso6jYNZ1TI94VE8p1bPPgYi/oPPUtKhI2F/tFzn1qjE7OrSj6hPSSRfHoxFnWNM3hWWrOAhyq0M031gt9cUD/GVKp3Nxei7wdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bang-olufsen.dk; dmarc=pass action=none header.from=bang-olufsen.dk; dkim=pass header.d=bang-olufsen.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bang-olufsen.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oz5t78Gv7vpLiS7J9Aia7d4ZQPUvY4UV0mdMCpdW9Kc=; b=hCl+QNTW1dOvZMzoTb06vJaVz5N1DM48TB3kFhbGxH8FnhELxAOKG2m2ztzgCWWV+sM7LVzmfdxdRNNoZMm2DinlseBQPrMa46xJvECJkFWGsaLNKm8AV4XhfpFrCC9CV41hCgTQXbuxjH58wu46eG5gdfb4LZfj/yf1JpyaCdM= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=bang-olufsen.dk; Received: from VI1PR03MB3166.eurprd03.prod.outlook.com (2603:10a6:802:32::30) by VI1PR03MB4912.eurprd03.prod.outlook.com (2603:10a6:803:be::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16; Thu, 30 Jul 2020 12:50:01 +0000 Received: from VI1PR03MB3166.eurprd03.prod.outlook.com ([fe80::4b3:262a:b605:14ba]) by VI1PR03MB3166.eurprd03.prod.outlook.com ([fe80::4b3:262a:b605:14ba%5]) with mapi id 15.20.3239.017; Thu, 30 Jul 2020 12:50:01 +0000 From: =?utf-8?q?Alvin_=C5=A0ipraga?= To: ath10k@lists.infradead.org Subject: [PATCH] Revert "ath: add support for special 0x0 regulatory domain" Date: Thu, 30 Jul 2020 14:49:23 +0200 Message-Id: <20200730124923.271429-1-alsi@bang-olufsen.dk> X-Mailer: git-send-email 2.27.0 X-ClientProxiedBy: AM6P193CA0123.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::28) To VI1PR03MB3166.eurprd03.prod.outlook.com (2603:10a6:802:32::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from capella.home51.bang-olufsen.dk (193.89.194.27) by AM6P193CA0123.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16 via Frontend Transport; Thu, 30 Jul 2020 12:50:01 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [193.89.194.27] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f72f20d2-7dff-484e-afa6-08d8348712de X-MS-TrafficTypeDiagnostic: VI1PR03MB4912: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: orfyT46MQ61Mxb5iPWFd2WpDoe+OrogMXwNbSH58bqPcQSs+AFAEM5nNBEsicahGoYrnMWGfU9w/CwrAjpoHHbcnbejzG6V2tckdFMKzv6PKZ5Ki/HIwS2OKeENLP10t31JNMIRKogDiCBrHUWOUO5QCDQbK68Ct71hIHDMMHGjLlbpbnJPzaYFMvZ2ajbVl058NsikCJqtD/jG++Go/P/NMhFqQnrPInSFOIbfLDmr227Zy0CUWZ8S9O1ea5+ZidSr+4FZzJhed1thDqiW8xsLyt53tt/Yog+yK7FdCncVO2F/hbz1nGPtnae6nQML0YKb4JYywUnCYDj/b7XAAKTAFVtEVHuIelvvlpFq99aNMmdSWO0eIwLncDl6dkbSqzLQ+QSgayJ2NtM0n6+pm7A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR03MB3166.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(136003)(396003)(39850400004)(366004)(376002)(346002)(186003)(26005)(2906002)(16526019)(8976002)(8936002)(15650500001)(8676002)(66574015)(66946007)(52116002)(7696005)(66556008)(66476007)(83380400001)(956004)(2616005)(966005)(478600001)(4326008)(6486002)(6666004)(1076003)(5660300002)(316002)(36756003)(54906003)(6916009)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: sNpkBKPb3YBOESAUnfiu/4JBciyMA0kKXLNdwiolR6OvfQSeXiZzAW7y7k83hy3Bs+Ngcnto/BZAKaP1aoBh4DdHmcTsYf/I6+PrxqCSrusoHHvXBBYhPW/901RiE4cHid0VMpBu6AEog9IAH0+nC9Bj0WJE2biF7VzxF7sSp1HB/KgijX6XWWl1Ie2IfLr09K2jBR1BNrebGD2x0q5helGUj27CmVFs8ngCckNspTAZWVmThLptDfVycoHe7tMyIBWtMEXcmWN1iXC1sag9aYUG9gYta8xjTNCvMdxgJ4Ft6GAdAckn652PGjC+2q3sVIE/w7bJzvaoGjZyKHWFCIayhSF3g19CbH5XPecpbkYi+/7csw1aBlm9dblMR+7R+l0n5YGSlVIR99f0PoWMY8v9xMMzXNSG8wysxDmu8rChiqhXgIZlSNXmFOpVbW7I0XXdkbrgQEY3K5869ll6zmWgRmnj17IfE67DmLCZ0fRkUCcOM5WwBgYK4Aw2O1zT+E3NZtFhu4Sx68x+hMbN174QLPBhdnyOCgW87M3PFZFENsWNU5YO3XDDydK1WMbY75Ee6PCUz3NMv8f2z0isDSsi0NS9W/DvVpK05+LJdEn+nh+bKzaBAICI3mTymwvhfnA6X0bCSoIIlv8o++HjkA== X-OriginatorOrg: bang-olufsen.dk X-MS-Exchange-CrossTenant-Network-Message-Id: f72f20d2-7dff-484e-afa6-08d8348712de X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB3166.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2020 12:50:01.7757 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 210d08b8-83f7-470a-bc96-381193ca14a1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KGlnu4KcPTmoVPJM5zU1e3KtbbBki+c4qKLMxb+i9HoD04LRAGnEllcmz6Js/LIhib0zLZmXD7hztNSXr/9jEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB4912 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200730_085007_614411_6F5FF836 X-CRM114-Status: GOOD ( 16.14 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [40.107.22.120 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.22.120 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Luis R . Rodriguez" , Wen Gong , linux-wireless@vger.kernel.org, =?utf-8?q?Alvin_=C5=A0ipraga?= Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org This reverts commit 2dc016599cfa9672a147528ca26d70c3654a5423. Per Atheros documentation to manufacturers, the EEPROM regulatory domain code 0x0 must always map to "US". In particular, it should not map to a custom world regulatory domain. For references, see [1] and [2] below. Furthermore, __ath_regd_init() has a specific condition to set the country code to "US" in this case, which emits the following log message: [ 7.814307] ath: EEPROM indicates default country code should be used The patch being reverted mistakenly maps 0x0 to the custom world regulatory domain 0x64 - the most restrictive of the world regulatory domains. The premise of the patch is that in the case of EEPROM regulatory domain code 0x0, ath_is_world_regd() should return true. But, as stated above, 0x0 should not map to a world regulatory domain, and so the function should return false. The original behaviour, whereby NL80211_REGDOM_SET_BY_COUNTRY_IE is ignored, was correct according to the manufacturer's intent and should not have been changed. [1] https://wireless.wiki.kernel.org/en/users/drivers/ath#the_0x0_regulatory_domain [2] http://article.gmane.org/gmane.linux.kernel.wireless.general/38410 Fixes: 2dc016599cfa ("ath: add support for special 0x0 regulatory domain") Cc: Wen Gong Cc: Luis R. Rodriguez Cc: linux-wireless@vger.kernel.org Tested-on: QCA9880 hw2.0 PCI 10.2.4-1.0-00047 Signed-off-by: Alvin Šipraga --- drivers/net/wireless/ath/regd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c index bee9110b91f3..20f4f8ea9f89 100644 --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c @@ -666,14 +666,14 @@ ath_regd_init_wiphy(struct ath_regulatory *reg, /* * Some users have reported their EEPROM programmed with - * 0x8000 or 0x0 set, this is not a supported regulatory - * domain but since we have more than one user with it we - * need a solution for them. We default to 0x64, which is - * the default Atheros world regulatory domain. + * 0x8000 set, this is not a supported regulatory domain + * but since we have more than one user with it we need + * a solution for them. We default to 0x64, which is the + * default Atheros world regulatory domain. */ static void ath_regd_sanitize(struct ath_regulatory *reg) { - if (reg->current_rd != COUNTRY_ERD_FLAG && reg->current_rd != 0) + if (reg->current_rd != COUNTRY_ERD_FLAG) return; printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n"); reg->current_rd = 0x64;