Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5452345rwj; Wed, 21 Dec 2022 02:55:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSlmI41AnIClzdgmcfuZznf3BTvk7sj9TijMrdbsFJlyHwTWN0UP3eTbymZ9jyXGmbd5ub X-Received: by 2002:a17:907:8d16:b0:7c4:fa17:71fe with SMTP id tc22-20020a1709078d1600b007c4fa1771femr986839ejc.45.1671620106733; Wed, 21 Dec 2022 02:55:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671620106; cv=none; d=google.com; s=arc-20160816; b=qwahpSXHgAR6Xyfjg5ETkBltZ844ZmBt+kMT86g/rbyiDy45N5LQTZ3pClubXn/n/G 84IwzNSsrvYSBCWSjjTPZJiKQHmyZrihSCfhMRhdwaVcte5WkBQoQZnkjkQ+cs2MxPHg EGXcZ+SLQhbHQGsCQxVAWXR5zrq+ZrrErdIR0iFJXk/LXpVb8+iKeOI3xD3GG1AcKPM7 xssW37XBx2BloU2Gzq4lYzqLUMw7cjixBruW36Gi5YfN5NBywz8bPseutBKdFuxruAoU 5/Uji31X5O3Crsv/nv/Vs4gDvgbZQ6ad3rCciGChcFKaimH/Vqi9SOfCM7WKhcLrNHc0 MizQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=xsapQokhKn3g01DS/Y1LIgKzuSsQ+5ZMsJck6mWKddQ=; b=s1bynKgBHoiE3ZzNJVGjzg1pOpijNZnKuQhJrDfhg9wfmGyyUjZUWv6lT6pT0ZetDA D7r7tI+ypzSuXPFDaOIHO2gB4SCJT6JP7pun8J2cy4hgVXfe6sKuSoAtrqhy22H6+Rhr i1dYQUtQeAwKnkxufI06SFmJUxPfvydo4ZV6a+lPOnLVDvzptD6UKf6eQbGbzU4cTki7 fvUuDJNYBlmpJwS4zuPdSHEwuZrh0ZTW6HzcjTuk2TZU+2JjKbu5sR+p5EU8TO/8o3KL f7JZo1o8kVyqPA6iMhjt9S9aa77q8k8bSiKw0pLu/hmP4x3jhsVINisNN/zdRHMv+TzX nyJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=h87ETB5h; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a1709060a8900b007aea5ae3956si10188012ejf.820.2022.12.21.02.54.48; Wed, 21 Dec 2022 02:55:06 -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=fail header.i=@nbd.name header.s=20160729 header.b=h87ETB5h; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234455AbiLUKpu (ORCPT + 66 others); Wed, 21 Dec 2022 05:45:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbiLUKpt (ORCPT ); Wed, 21 Dec 2022 05:45:49 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F16B02736; Wed, 21 Dec 2022 02:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xsapQokhKn3g01DS/Y1LIgKzuSsQ+5ZMsJck6mWKddQ=; b=h87ETB5hlJd0/1Riw1TT6BCxuE XkzUMOEu+8h+bFtm0a24kV7+MWp0RdHvE0vV+WrbbIUDr0ncdKNRUJPPwLH815XCivhmWrNHTPPyw zLtq32W51tYVA2nTL4UTR+Fbw7MRGO046pKaHmCFx3TZd+IRztU7NonQOVSJ+OnFrrgs=; Received: from p200300daa720fc02bd853fbc229daa4a.dip0.t-ipconnect.de ([2003:da:a720:fc02:bd85:3fbc:229d:aa4a] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1p7wbT-00AZ5f-4S; Wed, 21 Dec 2022 11:45:39 +0100 Message-ID: <678adc67-9e46-3eef-f274-c951b121570f@nbd.name> Date: Wed, 21 Dec 2022 11:45:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [6.2][regression] after commit cd372b8c99c5a5cf6a464acebb7e4a79af7ec8ae stopping working wifi mt7921e Content-Language: en-US To: Mikhail Gavrilov , lorenzo@kernel.org, sujuan.chen@mediatek.com, Linux List Kernel Mailing , Linux List Kernel Mailing References: From: Felix Fietkau In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE 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 On 21.12.22 02:10, Mikhail Gavrilov wrote: > Hi, > The kernel 6.2 preparation cycle has begun. > And after the kernel was updated on my laptop, the wifi stopped working. > > Bisecting blames this commit: > cd372b8c99c5a5cf6a464acebb7e4a79af7ec8ae is the first bad commit > commit cd372b8c99c5a5cf6a464acebb7e4a79af7ec8ae > Author: Lorenzo Bianconi > Date: Sat Nov 12 16:40:35 2022 +0100 > > wifi: mt76: add WED RX support to mt76_dma_{add,get}_buf > > Introduce the capability to configure RX WED in mt76_dma_{add,get}_buf > utility routines. > > Tested-by: Daniel Golle > Co-developed-by: Sujuan Chen > Signed-off-by: Sujuan Chen > Signed-off-by: Lorenzo Bianconi > Signed-off-by: Felix Fietkau > > drivers/net/wireless/mediatek/mt76/dma.c | 125 ++++++++++++++++++++---------- > drivers/net/wireless/mediatek/mt76/mt76.h | 2 + > 2 files changed, 88 insertions(+), 39 deletions(-) > > Unfortunately, I can't be sure that revert this commit will fix the > problem. Because after the revert, compile of kernel failing with > follow error: > drivers/net/wireless/mediatek/mt76/mt7915/dma.c: In function ‘mt7915_dma_init’: > drivers/net/wireless/mediatek/mt76/mt7915/dma.c:489:33: error: > implicit declaration of function ‘MT_WED_Q_RX’; did you mean > ‘MT_WED_Q_TX’? [-Werror=implicit-function-declaration] > 489 | MT_WED_Q_RX(MT7915_RXQ_BAND0); > | ^~~~~~~~~~~ > | MT_WED_Q_TX > cc1: some warnings being treated as errors > CC [M] drivers/net/ethernet/intel/igb/e1000_phy.o > make[7]: *** [scripts/Makefile.build:252: > drivers/net/wireless/mediatek/mt76/mt7915/dma.o] Error 1 > make[7]: *** Waiting for unfinished jobs.... I'm pretty sure that commit is unrelated to this issue. However, while looking at the code I found a bug that would explain your issue. Please try this patch: --- --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -422,15 +422,15 @@ void mt7921_roc_timer(struct timer_list *timer) static int mt7921_abort_roc(struct mt7921_phy *phy, struct mt7921_vif *vif) { - int err; - - if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) - return 0; + int err = 0; del_timer_sync(&phy->roc_timer); cancel_work_sync(&phy->roc_work); - err = mt7921_mcu_abort_roc(phy, vif, phy->roc_token_id); - clear_bit(MT76_STATE_ROC, &phy->mt76->state); + + mt7921_mutex_acquire(phy->dev); + if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state)) + err = mt7921_mcu_abort_roc(phy, vif, phy->roc_token_id); + mt7921_mutex_release(phy->dev); return err; } @@ -487,13 +487,8 @@ static int mt7921_cancel_remain_on_channel(struct ieee80211_hw *hw, { struct mt7921_vif *mvif = (struct mt7921_vif *)vif->drv_priv; struct mt7921_phy *phy = mt7921_hw_phy(hw); - int err; - mt7921_mutex_acquire(phy->dev); - err = mt7921_abort_roc(phy, mvif); - mt7921_mutex_release(phy->dev); - - return err; + return mt7921_abort_roc(phy, mvif); } static int mt7921_set_channel(struct mt7921_phy *phy) @@ -1778,11 +1773,8 @@ static void mt7921_mgd_complete_tx(struct ieee80211_hw *hw, struct ieee80211_prep_tx_info *info) { struct mt7921_vif *mvif = (struct mt7921_vif *)vif->drv_priv; - struct mt7921_dev *dev = mt7921_hw_dev(hw); - mt7921_mutex_acquire(dev); mt7921_abort_roc(mvif->phy, mvif); - mt7921_mutex_release(dev); } const struct ieee80211_ops mt7921_ops = {