Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2350803rwl; Fri, 6 Jan 2023 05:25:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXvJ0BfBrPmXaobWcdmPj1o2DLUS/STcKwybAoPUyOR9XnyZGT9Knur+fvAjXjZ23sg7pajJ X-Received: by 2002:a17:902:aa96:b0:18e:8223:6447 with SMTP id d22-20020a170902aa9600b0018e82236447mr54532995plr.22.1673011500294; Fri, 06 Jan 2023 05:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673011500; cv=none; d=google.com; s=arc-20160816; b=v/m2zhI+i4s1Q1Bf1ecHdOlGz9MQKS2BibNBYU9Z/16+FbqZnozHuZTQmwHd8Za3JD tlmI1OqxNoH3ODJu1y8tuQY8ox0Qs9hfp7DSHJGHqW6YsJRCqnp2+nUedr32KDRsPtxA WFCrl34bK+O68jgW1RS7BmV1Da35WTz5WqGcVxI3QAH9z8Alk90/LgRCBZ9OB7A1MFio 1KKmx3+Uvwm5r8RpOza8xJvYXuK5/WRtNgY437uhQSOsBmsdFfhRyiDz5qHFRxDWguC4 pgIpI6nBZCYK623LzEki6m9S8UuakXYxUAEL+J3OQPCANu5QPOZuSRLnUYkT1ILiwapF Hknw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=kAERvk5nBFa12V2mZMiTZvP60v0XGkRfhjbzVAQuTyw=; b=YwvIwNstyylnV25P+Z1uurNcx+MQmmjOgSqfUvwNuhqG/wjMHHRGaOQ9I/d95Nt/vh rPQL/LE33UnpbiHc+30IxoEZSsTYPgGxlo4p55/OUD4BSUxJTGU1PsRdHlfpWxGzNVoo lURwqRlUlKrU8oqXUvmgypv0V1JPeeeFMB2PS4JObKa6dUfEYW9P1LskPCVN/WYDHX3r G74vUPrZ1ePDFBk9d62U56eIbUnZlVfLVLJiOTlowLtVD9DEfRaX3oPkha6hmLbdClbO Mu/f22m+grWjxQjniJeZxmw0D2pIfJ2MLu7XS+tUtHE1jQsHcXVXgKuKtiKLsAAw8yCF um1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KoonKBdq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a65494b000000b00478e7f82dd3si1499389pgs.543.2023.01.06.05.24.48; Fri, 06 Jan 2023 05:25:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KoonKBdq; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233945AbjAFNTe (ORCPT + 66 others); Fri, 6 Jan 2023 08:19:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233050AbjAFNT1 (ORCPT ); Fri, 6 Jan 2023 08:19:27 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1452E7682C; Fri, 6 Jan 2023 05:19:26 -0800 (PST) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 --- 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; -- 2.35.3