From patchwork Fri Jan 6 13:19:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T. Ivanov" X-Patchwork-Id: 13091366 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 125FBC3DA7A for ; Fri, 6 Jan 2023 13:20:26 +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:MIME-Version:Message-Id:Date:Subject:Cc :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=wBo5vOe1zrF0PZT15EaXTzCgW8/uwQd7p6TBxX3F7Ao=; b=1O36V4qNZ9hlYK 2Pc9YKzyb0Veq90aT00b7EP3/vgttx6vp7ALjyPnVnsi+dfMnkJfpUblqa1qFvS2wQyQitVUvoYXl b/8mxrU8mTg8LpUHsg0MJ7+O3Mp0valx+zr58nMU2t6hq0Gh45yH4jdqMX1mUqn4JqkuMgSvKJ7kp 6VIXFTMmILATXXn3VPu61+kZFnYopmWCHssEzUsP1BkqUIItlRb3m2mx7sm2956UmM5r7FXEeF17Z sFCHssySM+bu8PU8qr1MCjyd3K9TAlSen7XtT22TYfEOZrp8k92wXFQ86eudyaVt43RgUTI965Qj2 4IzcHpiN55yuzszlA1nQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDmdA-008LSc-O4; Fri, 06 Jan 2023 13:19:32 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDmd7-008LPu-0G for linux-arm-kernel@lists.infradead.org; Fri, 06 Jan 2023 13:19:30 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7C6F026B8B; Fri, 6 Jan 2023 13:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1673011163; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kAERvk5nBFa12V2mZMiTZvP60v0XGkRfhjbzVAQuTyw=; b=KoonKBdqVvpkdxegu6pG4IIpAzTIWP1YVsgfTGDmIEyWBLDkV1vUsCGeEuGagMEymkLlQI 1a46Sety7WRP8zuE6rODKmsi/ePQzaMFMnkJGv2FW2OqZAxjMeMWyz4iMIUYHYF+7txIT+ QVKX9hfbGiVk4ETEXzBnUwdR4SkknoE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1673011163; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=kAERvk5nBFa12V2mZMiTZvP60v0XGkRfhjbzVAQuTyw=; b=mVOGvsNkU0K+hZCpdmecHUjBvj1vb+B5uiCNA6nsXp0agsu2GmF9XWw5hpwtBKCJOu/bD/ saclmeVmvMxVQqCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 59D17139D5; Fri, 6 Jan 2023 13:19:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +sfIFdsfuGOBWAAAMHmgww (envelope-from ); Fri, 06 Jan 2023 13:19:23 +0000 From: "Ivan T. Ivanov" To: aspriel@gmail.com, marcan@marcan.st Cc: franky.lin@broadcom.com, hante.meuleman@broadcom.com, rmk+kernel@armlinux.org.uk, stefan.wahren@i2se.com, pbrobinson@gmail.com, jforbes@fedoraproject.org, kvalo@kernel.org, davem@davemloft.net, devicetree@vger.kernel.org, edumazet@google.com, krzysztof.kozlowski+dt@linaro.org, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, "Ivan T. Ivanov" , stable@vger.kernel.org Subject: [PATCH v2] brcmfmac: Prefer DT board type over DMI board type Date: Fri, 6 Jan 2023 15:19:05 +0200 Message-Id: <20230106131905.81854-1-iivanov@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230106_051929_227725_AFFEB380 X-CRM114-Status: GOOD ( 11.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The introduction of support for Apple board types inadvertently changed the precedence order, causing hybrid SMBIOS+DT platforms to look up the firmware using the DMI information instead of the device tree compatible to generate the board type. Revert back to the old behavior, as affected platforms use firmwares named after the DT compatible. Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties") [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1206697#c13 Cc: stable@vger.kernel.org Signed-off-by: Ivan T. Ivanov Reviewed-by: Hector Martin Reviewed-by: Arend van Spriel Tested-by: Peter Robinson --- Changes since v1 Rewrite commit message according feedback. https://lore.kernel.org/all/20230106072746.29516-1-iivanov@suse.de/ drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index a83699de01ec..fdd0c9abc1a1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -79,7 +79,8 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, /* Apple ARM64 platforms have their own idea of board type, passed in * via the device tree. They also have an antenna SKU parameter */ - if (!of_property_read_string(np, "brcm,board-type", &prop)) + err = of_property_read_string(np, "brcm,board-type", &prop); + if (!err) settings->board_type = prop; if (!of_property_read_string(np, "apple,antenna-sku", &prop)) @@ -87,7 +88,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, /* Set board-type to the first string of the machine compatible prop */ root = of_find_node_by_path("/"); - if (root && !settings->board_type) { + if (root && err) { char *board_type; const char *tmp;