Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1916134lqp; Tue, 16 Apr 2024 01:24:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8JDEd276QCxBya1PDeKCf1VSsOI0OqoIts0omQKcFO01aJhoGGUuh72bXbFGydSJNqul9cTtYFIqSgj10m2bPXzGwEfSquObxue6Giw== X-Google-Smtp-Source: AGHT+IHDpBz9YbMZpxjHVdhugbstzJEzXuLm45vFTi98w2kWjmBfbRHV/6x7CDdrR9d40BVuWtQd X-Received: by 2002:a05:6102:3e8f:b0:47b:7f47:b985 with SMTP id m15-20020a0561023e8f00b0047b7f47b985mr5526061vsv.7.1713255840646; Tue, 16 Apr 2024 01:24:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713255840; cv=pass; d=google.com; s=arc-20160816; b=tJ9GDREXNZxGU9BWvgiCQNieIw8nJqnQ1TM+QA3rtyvBHqhs6CFGDxf05S+90TRiWX +hXvqRRp7wonaoWy6bCAvwqLY2EtttCse4WHfoL3848Jd1R6ZqGIeobJl5xDePALKZsm aLCutsQFzttnQcGefRHklSksRxE4bAeiPxKAciIPazUx8/im4Li0K9OzihXIK5cac5Xf A5ixR0oBuLkO/6Hyyko69ZGSkF4TwREt1chv6ZaKiuk4QIkAn5ufOQ7WBW/V56Eu+2PN yBb5Ud9tI2JVUyCjOtIF0gg1fvRpqyWZw5smwfyYMYWx74vOlWnfqoPmrEf6FvdpQzaA 6rWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=/VyoMxOp0tW/NwNVczKS098fiaFyK3/sT1s9b3x3XYI=; fh=/DmmwJHrFtqQuIc7HDz2J67fUOEBrGhpdHB7tU04Ozc=; b=j9WASyScuVhCSJg8g6NUm1bbPRfKCEqoyAV7HesFqM7/vV/X/PxB/qB5/1WqJipyyA 8BeOrxDONm6wnS9D7FuWrPHMdB4fbCzNl+i95mCXVXBbZcFSulWMqxjPUYUFgy8h0qqz lhohNvQc58X5oB28Pd5a01cHFOTwUZSSh1XjGtdJFU+OkIVyc2MobxrtsmCF4/DTIz/9 Vd/5FwK+U4sDrJSahPG4a1KoCk2lLuhrMJhZshuGrXaZ9SzUDrasWkr82ERXUvSIpCw+ z8UEvxxJm/Ri6J4xTLjLLROkxlpR+EZHsfPxxjuAodTaMSegttXu52e3O3WHwPhMNozs R5tg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=r4letyF+; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-kernel+bounces-146493-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h8-20020ac85e08000000b00432eb958232si12230676qtx.771.2024.04.16.01.24.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 01:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146493-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=r4letyF+; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-kernel+bounces-146493-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4DFCA1C220C4 for ; Tue, 16 Apr 2024 08:24:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6A28156873; Tue, 16 Apr 2024 08:23:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="r4letyF+" Received: from nbd.name (nbd.name [46.4.11.11]) (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 DAD6A136E28; Tue, 16 Apr 2024 08:23:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713255830; cv=none; b=dRgWUSRg5n0RDsKQuFQ11PIZ6Ns0tCGSPBvzV4nDWghTYf2j38LbZwLrbPJ8qLwu8Ez/KIeiDpHC1ZAypnpfoUYm/AL4euh62TQ7U8yMZ1MNmZLrneRUquPzPyc8vqCU0fH5X/EOVZr/QXsgD+2x3S1j0A+EZawW23RL78sdH60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713255830; c=relaxed/simple; bh=mA03cO4LovaIc9VAo9uUmVXN8roU720mR2vgTU68njk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=us+ossXAhl2ADdKRBuy7nga4PHoVceKyOHJWtVyXi1zqncUgDzWwOPXAqDXNbwNxxnmsuWVzTS+9dHd7e35rYycqh9NKoG4DU5icvn1E3ktvMrDzEO+1UzV/SgRpd0X/gP6+ZToxBng/LSIITylNAeb1DPJSM8CAlT39kBFqxu0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=r4letyF+; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/VyoMxOp0tW/NwNVczKS098fiaFyK3/sT1s9b3x3XYI=; b=r4letyF+3ZYFtek1hQzgsvF+Q1 TZPJwWvDX4IWFreyQeiWVVfAAuLqXHAEKxzdzbXzDSwN/vys6h/EiWXZY3ICQpv+Z6Y4UYMvzxm/5 byKiVtR9YhXAgPR5YO4HKIvW6HqX45HlL8pvsMY1pS3RD3wuiEu8Y8kf3/4D878UnBak=; Received: from p54ae9c93.dip0.t-ipconnect.de ([84.174.156.147] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.96) (envelope-from ) id 1rwe6F-001ifE-0A; Tue, 16 Apr 2024 10:23:31 +0200 From: Felix Fietkau To: netdev@vger.kernel.org, Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sujuan Chen Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net] net: ethernet: mtk_eth_soc: fix WED + wifi reset Date: Tue, 16 Apr 2024 10:23:29 +0200 Message-ID: <20240416082330.82564-1-nbd@nbd.name> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The WLAN + WED reset sequence relies on being able to receive interrupts from the card, in order to synchronize individual steps with the firmware. When WED is stopped, leave interrupts running and rely on the driver turning off unwanted ones. WED DMA also needs to be disabled before resetting. Fixes: f78cd9c783e0 ("net: ethernet: mtk_wed: update mtk_wed_stop") Signed-off-by: Felix Fietkau --- drivers/net/ethernet/mediatek/mtk_wed.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c index c895e265ae0e..61334a71058c 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed.c +++ b/drivers/net/ethernet/mediatek/mtk_wed.c @@ -1074,13 +1074,13 @@ mtk_wed_dma_disable(struct mtk_wed_device *dev) static void mtk_wed_stop(struct mtk_wed_device *dev) { + mtk_wed_dma_disable(dev); mtk_wed_set_ext_int(dev, false); wed_w32(dev, MTK_WED_WPDMA_INT_TRIGGER, 0); wed_w32(dev, MTK_WED_WDMA_INT_TRIGGER, 0); wdma_w32(dev, MTK_WDMA_INT_MASK, 0); wdma_w32(dev, MTK_WDMA_INT_GRP2, 0); - wed_w32(dev, MTK_WED_WPDMA_INT_MASK, 0); if (!mtk_wed_get_rx_capa(dev)) return; @@ -1093,7 +1093,6 @@ static void mtk_wed_deinit(struct mtk_wed_device *dev) { mtk_wed_stop(dev); - mtk_wed_dma_disable(dev); wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WDMA_INT_AGENT_EN | @@ -2605,9 +2604,6 @@ mtk_wed_irq_get(struct mtk_wed_device *dev, u32 mask) static void mtk_wed_irq_set_mask(struct mtk_wed_device *dev, u32 mask) { - if (!dev->running) - return; - mtk_wed_set_ext_int(dev, !!mask); wed_w32(dev, MTK_WED_INT_MASK, mask); } -- 2.44.0