From patchwork Wed Feb 7 00:01:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bert Karwatzki X-Patchwork-Id: 197677 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1898913dyb; Tue, 6 Feb 2024 16:04:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3EE4ejw4dpGUVqmgKHr31dYrsrHcjnIn+NLcZxKk+6Lefb/zHMZEFPTJ7bPKNEbFhFoo4 X-Received: by 2002:a17:903:2583:b0:1d9:8b6c:2175 with SMTP id jb3-20020a170903258300b001d98b6c2175mr2992434plb.7.1707264157434; Tue, 06 Feb 2024 16:02:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707264157; cv=pass; d=google.com; s=arc-20160816; b=PRcbZEfN01INNtZVMZKFxcJE7b22gKNPb+KZCcRl+eV3RJ87FrwGas9ljdU7hKBY0b VqoBLYYZB1o8xg05Ys6GS6eyqBwXwH17fAbnct9S3OPB49t/6qSbXH1s9HNurT8FXrM1 nu9FUf95vCz4MGOQMITrZsh3KhlQEPdj4xvIE9IP0L0TtW0g/yUkdlV0DW/JL0zW61QG Wc/3toJeR9ZlBCobtXR/QuEdcOm/JteuH2MhEauE528bGBkO8XRNISn9AYgpwPgoMhdK 0cqKCOLsBCbzbV4aESI5Ds4MlMFIbOlbK8VbfqP9hUyMeAW01O4NcA16wtZ+UV2qlWuL csgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=L+UNto8gSCBkVdBxY7LVWNdjinfs5Pk1Hlvx8P2IOGc=; fh=w/YGl/baAaCTrkCxTWcX8Cvs1v0a3vu1PSMQu/SUYNw=; b=Q/P412pWkvillICQzgeHl6w6aPkt6Zjjs04nZjpM87/IJJdHuyO5DzScAf95iDUmvg lkEcJP5EpxFjeyAQY6Ems/muZGk2/+nU10npBd9x2lFuT0u13ie/Xt7GtbEQQT+No7+5 rVE+0V1AwoWnEXynr+LLfXUGq3jEgw+3fCPDHaaKFquplltzUra8GMjb2bnCQBazpC8a MgX2jl+yS1IuIRyb6TgkHmi1yTh8iVixmCpZwE3u+kruJKqrKtPma1WCnZoDtUA+0s52 ItWoGEY3ArjcSCBqVk0yIUMBjp8e6yG7D54ctRaSxEe1cRUvsIQOqegxp9wSsZd/m1km Yacg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b="vY7Kp/TQ"; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-55747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de X-Forwarded-Encrypted: i=2; AJvYcCXgTVd0jAqJPTN4xEmRjie9I8A940cPOvdK0gdo0jdVF+L3MHEDBxWddWp97ZQ/qfHATS+5zpA5zlWGfb5W7VEsO/TaCQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id mg20-20020a17090b371400b00296673e52fbsi1931377pjb.3.2024.02.06.16.02.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 16:02:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b="vY7Kp/TQ"; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-55747-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55747-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6EE04B22B1D for ; Wed, 7 Feb 2024 00:02:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2C17D2EE; Wed, 7 Feb 2024 00:02:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=spasswolf@web.de header.b="vY7Kp/TQ" Received: from mout.web.de (mout.web.de [212.227.15.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9851D9441; Wed, 7 Feb 2024 00:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707264131; cv=none; b=D3an0ZpbFgPjHvKi9DHxYFs7NPe0r7qVtSmd3IoXixEOavW66eRNVThdFSUPwmB7fk9C/4UXSCZKhws5jrmgCdIXL3kLw+LNHUrecbWoLdcaJF9IKHORC5Htb8xRqNnj992raXcNAqAOd0KPRG+p9j5JiAQrFsYsNOeKdCU5eJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707264131; c=relaxed/simple; bh=Eoz4bnLhBsJqtAzSuuDGPpIjD9K8OcY/81Kg6Ud6VYU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TCLKh34uqvbGItAN6pD+yIR9SVjW0gcH+LwYEIzDgF8ovAEJRsr2eoYh488yGkkxlnlpkoxXcGIyO9fUjW2o2roRyLIwBScvUkQ4VANPZ8X41K4WmyS/Kpiumar3q7YdA2Q7Trs9/PPVDMqtR3XfXFR9toSnjVflhumxqtW6dfE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=spasswolf@web.de header.b=vY7Kp/TQ; arc=none smtp.client-ip=212.227.15.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1707264113; x=1707868913; i=spasswolf@web.de; bh=Eoz4bnLhBsJqtAzSuuDGPpIjD9K8OcY/81Kg6Ud6VYU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=vY7Kp/TQTfI3NSahNziD9FxxR6gAIBV3MbkAs+I9WdHu6RnFqaZF0eFI1aWjjDKE U39BCoqgN0BiH7vEtsH7+3OlI/zpcZH7DfVi7a3GiSO4HNno9lvn8sAU11FN8Hydj fPLZNqUGR1BMJCkNphUAOeVYzOhqDwYpLecMg+MKJ+UNwDJia+rWadxQAWsuZlV67 pK+YmKbKccm7VyHh97VWkMFdx6dH323gYpvH/Q3xaDbjpg0fDxOUbzH4POPrTf5sk UPqqtB4prCas4maVt4AF/As6AfOtPj+6xgXD6ZajpfH9RPmQbXCGzgdP1185zvUo3 kOuXzdmrGL9oDzPU1Q== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from lisa.home ([84.119.92.193]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MTfon-1rSF6S13ID-00ToG3; Wed, 07 Feb 2024 01:01:53 +0100 From: Bert Karwatzki To: Lorenzo Bianconi , Felix Fietkau , Ryder Lee Cc: Bert Karwatzki , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH] wifi: mt76: inititalize sband.band to correct value Date: Wed, 7 Feb 2024 01:01:30 +0100 Message-Id: <20240207000130.4040-1-spasswolf@web.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:53YJFb+JQxJ/gyqokVAlhpaiqPGLT50QFyVGIjFzYX/XLQjqOIa R3hx2O3ZlDIJOG0Qy7DGrAWMKvJvGOXXH/g0/PbpxlukPM7/YBO29B/4042l2DbITSAx3fw etwcoBKOAU9wVpcBOFO1+3XHZBihC2X298d97HmbiUmohpsUUQ43ZQURvCSSIdjIYdGfBDY SSqqae6CgZeYy8OanW/OQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:6ElYAlAAUuk=;FFpjRFTVxztmRZWw1r6KcCyzFK+ D6mHheJZKM71NSYWqH03ba/XiKPWISfLNpFPCizFDQboYgMbRQm9xJHFdnI3+39fI3meHFGhG llQVYCUbml3GdpJqo+kGMx9tTfHiw2pi7OzowS7ShSEthc18loT1KD8/Cf0ZI0zErl1q/dcjf OAZPx7ag+fIq/wFkRaRjrbwmmACbqw2+/rpHS/EcqJTfYjuOaqJ/hXaa7BkT/5cb0DT2Egqic S/C3TZ+Um5XSWLj1C9DAvvDak3VRJbe75wz/o6PXcKtrP3ZKUp13W856s8Z43dhhsV/97Q4p7 6sd5tqcHoUs9+dU8xeZKZSsfCuz3KxtD1FgFrAgdLCMs8PaFJ4s93Z6c8MJwrHBsZMqCM5fwc zMxPQeXnACVtipBW57wZqHSEWSGRGpNsGnMTUU4V6A0ohyYMOUb68moT5Xkc6r4PZ+RwBwsDB I61KcFpC7qsDZCo9qDSPRg53mODMpY7XoqKRdLDrZd+WRx6ZiCwRWVYNvcl0hHG/GAq8XEpM/ Mt0dPc7uELJ8k5SgKuJD7ph0Cuhi+l+d+ixfU14jKtfQ7cfdhshsmUvjCE2SHccclH0S0yNVo a9nnorsJlRCZG2QCqV8NEEeItst06a84buHGdpa3apCHL6QXr1k55Cfs/d8Zhd8FJOrOFnom9 Sx/8Ociryuzjka+9Yzd6TUF9v/Y7IaLL3mUk/Sb3XEDvrMiJWoRtDbi2WAyC63va7vXL97Uwg hVaKC7a/x/RGBsoR61dWcTiPGpNgwXDVZ/8N2Hv4OY8PorQJhioa2fp9rAVXR17l4O0GMHtNw A64R0HM0crBISWaZROuWI3POjqbdDdPaFimVkIeHsNFhk= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790196220967982713 X-GMAIL-MSGID: 1790196220967982713 Set phy->sband_{2,5,6}g.sband.band to the correct enum value, otherwise the ieee80211_register_hw() will fail to register the device. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=218466 Signed-off-by: Bert Karwatzki --- drivers/net/wireless/mediatek/mt76/mac80211.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.39.2 When using linux-next-20240205 my mediatek wifi device failed to start. A bisection led to commit f04d2c247e0407 as the problem: https://bugzilla.kernel.org/show_bug.cgi?id=218466 After closer examination of the mt76 code it the problem was to to be the incomplete initialization of phy->sband_{2,5,6}g. The band field has to be set to not confuse the new mac80211 code. (the sband_2g structure was correctly initialized accidendly as NL80211_BAND_2GHZ is 0). Bert Karwatzki diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 8a3a90d1bfac..6cf08446f445 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -363,6 +363,7 @@ mt76_init_sband_2g(struct mt76_phy *phy, struct ieee80211_rate *rates, int n_rates) { phy->hw->wiphy->bands[NL80211_BAND_2GHZ] = &phy->sband_2g.sband; + phy->sband_2g.sband.band = NL80211_BAND_2GHZ; return mt76_init_sband(phy, &phy->sband_2g, mt76_channels_2ghz, ARRAY_SIZE(mt76_channels_2ghz), rates, @@ -374,6 +375,7 @@ mt76_init_sband_5g(struct mt76_phy *phy, struct ieee80211_rate *rates, int n_rates, bool vht) { phy->hw->wiphy->bands[NL80211_BAND_5GHZ] = &phy->sband_5g.sband; + phy->sband_5g.sband.band = NL80211_BAND_5GHZ; return mt76_init_sband(phy, &phy->sband_5g, mt76_channels_5ghz, ARRAY_SIZE(mt76_channels_5ghz), rates, @@ -385,6 +387,7 @@ mt76_init_sband_6g(struct mt76_phy *phy, struct ieee80211_rate *rates, int n_rates) { phy->hw->wiphy->bands[NL80211_BAND_6GHZ] = &phy->sband_6g.sband; + phy->sband_6g.sband.band = NL80211_BAND_6GHZ; return mt76_init_sband(phy, &phy->sband_6g, mt76_channels_6ghz, ARRAY_SIZE(mt76_channels_6ghz), rates,