From patchwork Tue Jan 23 09:50:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Furong Xu <0x1207@gmail.com> X-Patchwork-Id: 13527089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28954C47258 for ; Tue, 23 Jan 2024 09:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+UjljglrDTUO9QAoIGsl3mfPNfsUx4GSNak+dU1sTrU=; b=0J8zi4TwMvgORq FFt92pbL5lgjWEm8gLODpICv01I0nUpFpgSqqk8igg6bldJHt40XutS9kCCuUgUpm7WPKv+Vmwp3R lwrAPMGxAVh+5YKkhCke31MiVqZ2k22uHViFhwhYVlIapORy8heDjJ0Lf2KKDRogt7rlCHhE+FnwL vV7V5AzvTl1O38MqtROmyZ29/l5MZIgqvoS7FCeUXgzDNZ59edMyAyVgTOK/n/k816KBJzrsJFpLF sOlTW5Bm9GVEzgjr9+G9QcavYe34VXDnltJimjEqPqB0Eh+HQPp1+p95MS37OyKq96SCVCWTxV4/M e0WvULLPIW5fb2mwhYYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSDRG-00FpDH-2h; Tue, 23 Jan 2024 09:51:26 +0000 Received: from mail-oi1-f176.google.com ([209.85.167.176]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSDRE-00FpB0-0x for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 09:51:25 +0000 Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3bda741ad7dso3241545b6e.1 for ; Tue, 23 Jan 2024 01:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706003421; x=1706608221; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PB92u9IW1i3UPi9lwUSJ6To660URrQExv6UFr5Kbu60=; b=khVxro5Aom51L3pGgH+R9daD5EV/eo8f5ht29ZtPW+1irpM2mvJWaIymV6J+velF5l TbmWCDMq4wZUA3LXmw1SFizeG2BFmSPKKoDuOfwTvoY3M/Quq0TpfuXOiOym4z8vGqMn BVvXCMT/a7NyQRDBfSyxdcoNcrClRAwVqvSaOVdZcavKingCBOtJs50Byc3bZ0/Jvpy7 tYjIouBcWrJ7EEeG2QHY0SRQfNct2o6V7+1fTtN+VIs3IoujocN9qv7qrhOPh7D9ckNB TwGR6Cy4CdC7EVp2ODnKwetoSFHxjw5mJb0Hxhpypp6UKWKBa/Qe9Lt0JyiV8IwyUWte CbHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706003421; x=1706608221; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PB92u9IW1i3UPi9lwUSJ6To660URrQExv6UFr5Kbu60=; b=pSLV36gMy2wG+8+wvMvTxxeUBVH1OEuazDdsW/ak4LgS+eVE/6G23CD0W0KzGIp4NB ICbp0GOOeDNA+LDZ5NE9/WE+tY4LF0o6md0gQHXWIztNmThsaZp1OKlDafizpb/UkDfk DT4fjaNsouHDLopehiVPs8QynnTgzpDR6/gbw8zbXuuoh2NBpwb+n9TBlRzH4SUjl0SY /C6LpvbqlvWsP0dEfOTNMNhdWgIXKqX6uC3P9XN1B7TmsMmwbKBDAlqfAiTmpvZRFlRE Pm+ND89DjXyT7yriJ3emgvO2izEcANbo6nEio6dwhNw9LjzFehfo2xP7uL1602GRVUZJ 6ooA== X-Gm-Message-State: AOJu0YzFLZ1PzTTjA+vS11VmOzeZcFYGl/eNj94brxkVjDt0ESL3+5Gf u59tdxV8Z7NSUcadcrxS5UqAaDnC4tmqe4o+0Gv9h6I9EeuYkCsl X-Google-Smtp-Source: AGHT+IFB2J7jlF2o323XuO6+0bPEVEQ5/i7o6OTowMJfhE3eJOKff9Hrtb7aB0/Z8Z/+nyeQkppHqA== X-Received: by 2002:a05:6808:1a17:b0:3bd:c43b:f935 with SMTP id bk23-20020a0568081a1700b003bdc43bf935mr1051159oib.9.1706003420915; Tue, 23 Jan 2024 01:50:20 -0800 (PST) Received: from localhost.localdomain ([112.65.140.130]) by smtp.googlemail.com with ESMTPSA id lp4-20020a056a003d4400b006dce766903dsm1325482pfb.90.2024.01.23.01.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 01:50:20 -0800 (PST) From: Furong Xu <0x1207@gmail.com> To: "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto , Simon Horman Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, xfr@outlook.com, rock.xu@nio.com, Furong Xu <0x1207@gmail.com> Subject: [PATCH net] net: stmmac: xgmac: fix handling of DPP safety error for DMA channels Date: Tue, 23 Jan 2024 17:50:06 +0800 Message-Id: <20240123095006.979437-1-0x1207@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_015124_333281_ABF10A40 X-CRM114-Status: GOOD ( 11.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 56e58d6c8a56 ("net: stmmac: Implement Safety Features in XGMAC core") checks and reports safety errors, but leaves the Data Path Parity Errors for each channel in DMA unhandled at all, lead to a storm of interrupt. Fix it by checking and clearing the DMA_DPP_Interrupt_Status register. Fixes: 56e58d6c8a56 ("net: stmmac: Implement Safety Features in XGMAC core") Signed-off-by: Furong Xu <0x1207@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 1 + drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h index 207ff1799f2c..188e11683136 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h @@ -385,6 +385,7 @@ #define XGMAC_DCEIE BIT(1) #define XGMAC_TCEIE BIT(0) #define XGMAC_DMA_ECC_INT_STATUS 0x0000306c +#define XGMAC_DMA_DPP_INT_STATUS 0x00003074 #define XGMAC_DMA_CH_CONTROL(x) (0x00003100 + (0x80 * (x))) #define XGMAC_SPH BIT(24) #define XGMAC_PBLx8 BIT(16) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index eb48211d9b0e..874e85b499e2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -745,6 +745,12 @@ static void dwxgmac3_handle_mac_err(struct net_device *ndev, dwxgmac3_log_error(ndev, value, correctable, "MAC", dwxgmac3_mac_errors, STAT_OFF(mac_errors), stats); + + value = readl(ioaddr + XGMAC_DMA_DPP_INT_STATUS); + writel(value, ioaddr + XGMAC_DMA_DPP_INT_STATUS); + + if (value) + netdev_err(ndev, "Found DMA_DPP error, status: 0x%x\n", value); } static const struct dwxgmac3_error_desc dwxgmac3_mtl_errors[32]= {