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: 770590 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=spasswolf@web.de header.b="vY7Kp/TQ" 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-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:53YJFb+J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ioa2fp9rAVXR17l4O0GMHtNw A64R0HM0crBISWaZROuWI3POjqbdDdPaFimVkIeHsNFhk= 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,