Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1774070rdb; Thu, 25 Jan 2024 05:58:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc2O0bYYM1d+fuwjH53gfSvAA7ou1oMrtub1AvCd1VN2cjHN469dvPXkhVkWLpqooaxbsz X-Received: by 2002:a05:6a21:3a47:b0:19b:6da4:4cf7 with SMTP id zu7-20020a056a213a4700b0019b6da44cf7mr1699399pzb.11.1706191138279; Thu, 25 Jan 2024 05:58:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706191138; cv=pass; d=google.com; s=arc-20160816; b=vwkMry63TeqDcPqOG8cA8DjTIWeu1rzQlkk+8MTqOkvs1hqn2yZato5RqnsFPASea0 fsPioc0XjM7/THskyo76Za8cJtzcpviVNn4iTz1UgiJuwEVKhMKCR9s2LTJ4fzDeNnGd or9JuAKvxpSiI95EyBSWubAXfSEjZcjTeBr8bEXiO3K2JclsOcN+LlE/MxewYu2Poc8E SA3L/U8K72yeKJLamh/HFSyZcgb/zvHGvzShr7sf227YIDWmi+d0TEQMUgzAvt1lX47T lbk+O/Q/xU5MdQG7eahS/d3bQo3Sy13EB2cZJCyEe1++WDGXLFTzuVJi8BgfssO5ID3b MnrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/C2tExOyKm07kGJJDKhOXfKEbEgJDFItKOdJX+74LMA=; fh=777fnGPFCklgku7miEvMi+H6COSNgqVCQUL/O3yYryM=; b=I5CBGz7ex8XiKNH11l2cuVxIowCvAagQg2+TJTKuWgoWB4S9g/b+TuR4U82meSxt9I miM7vSYIutZa3GcfodqCb+gh6MfidA0RdJ+eF1z4zbg5MB8QOeT00M8yMDkIShWEq1uP d1TPWZlpgDVfBm/ca7zXn+18jj9RdjFiA95pX2sou+sbue4CoafOnF8LQ5i4UOQLLwrR rXJrMWREfbAqIDloHJbS6B3Zv3JUCS0C7WQk7FxCLCb+4bI3YhFZHHCcgTI6XmJN8P1K ivYs9tTdRev1RlH7WU1/WzxRhNgrAVkP/V4/wTN574aZh+01d7lbQhbV1R387RZECwNE p/ZQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Kzjw6Rev; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38683-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g8-20020a635208000000b005cf1fc7a5bcsi13745845pgb.99.2024.01.25.05.58.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 05:58:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Kzjw6Rev; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38683-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 22598296B06 for ; Thu, 25 Jan 2024 13:48:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DE755B5B1; Thu, 25 Jan 2024 13:48:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Kzjw6Rev" Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E33F95A7B0; Thu, 25 Jan 2024 13:48:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706190511; cv=none; b=KBmDY5rOOiDG8INW5kKXB3LczAAMRSOM+WPBGuCHIphdazrQY2t6VkbtWj7JU6SdkzqqE6rOP7X/z5PDNn9lKRLBJvW/coAp5wCJkfBnwSOtuOlYDr0T/bwf8Mb1Y31NlzdXqBQ8NQtk0SwC/mGoRDpIOOrejPf5LVBpQzLMlxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706190511; c=relaxed/simple; bh=fgmTorFLFaU0VMBi44NDyz2rYmY8pepueD0f5QnMAyg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UYvCHpPWEB8obN5SceLIAnL64xiQJ+t1oF3IJDVuEMw/31OVHqPKNSqcwvr/5sOcZaW12UnQzYjGtCSJtdpJckqmfB4oNcvKtf3ow7JUsE1CaMDW+KrTkTCi59S38AHW2XifRqaRS450wwGwsmHmy0afdU4O6UXFm5R2OBXurRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Kzjw6Rev; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2cdfa8e69b5so73567381fa.0; Thu, 25 Jan 2024 05:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706190508; x=1706795308; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/C2tExOyKm07kGJJDKhOXfKEbEgJDFItKOdJX+74LMA=; b=Kzjw6RevN5dUcYclWX1VyiBLMu3IldWtdTTteYinMzl6mZfofoAZtKoqciz5+w1nUE TPBCb38m8gxkqkoxKlfsVFpXpQMs4+w/9AO6VlYyQvv3Eiig9JeOC9MAAr7RN351CcsD x03X0zJx3194JcAL5LwbA9VoRHUxVasiT3UjEkyv/AFRSn3aa87DIYM73ykzcZSoosT/ 94/n9/6SyYPYRUZRxIW3EtPt8SULKDCepZH27NKHblZzTUpQDFEXdmXTRf0dAKZKpXah 3AYbq/Dv9h4khH565cOvKwqj1wnKecEp1vmDHRqkYutTU0S0iyyezHX1nAkFxcbd8AZ1 MFrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706190508; x=1706795308; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/C2tExOyKm07kGJJDKhOXfKEbEgJDFItKOdJX+74LMA=; b=ird9LpNqUA8GnkMwNabuLr3J6DCQMzbp67QKJO5dG4WBaqofpIzSgPzGcbAZzYYibT /dNi5822K4v7j2HjFcs1dBX/UT1Dmft5bLcJYnCXjXPe9gRDIemmSHrsy2jIMZkT9cr3 0QjN1+LiwyXKLs5ue+Z2Bm/PQ5ifNfcAbqgGbvF2DY0UEwaS9lsXaFzLCcIqXAnNCR1E No2B0JCJqv1gEyVOLedK6IwXPN58OxRuQndR1JdVUxbMbvaI9GuvLpnoCVQD+pbRFaNj LOCnbelpTwAiSrpFkAqJIAfbSpu4SjMJSVCUb0bB45K6YE8N1ZMPMtCWLoRqwrqIb2fX Nwxg== X-Gm-Message-State: AOJu0YwfdmD55qMCX/fLPupNb+pocXAKJW/agxK3eM9uUlDy4sFdLKSH 9vAXonYSroMap4jWGgOWOAqlpB5kYdIDtdqZHJG3xBpDkOoR477E X-Received: by 2002:a19:5f58:0:b0:510:ec4:4ee4 with SMTP id a24-20020a195f58000000b005100ec44ee4mr314091lfj.152.1706190507526; Thu, 25 Jan 2024 05:48:27 -0800 (PST) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id b5-20020ac247e5000000b005100cfedda5sm571015lfp.61.2024.01.25.05.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 05:48:27 -0800 (PST) Date: Thu, 25 Jan 2024 16:48:23 +0300 From: Serge Semin To: Furong Xu <0x1207@gmail.com> Cc: "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto , Simon Horman , 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 Subject: Re: [PATCH net] net: stmmac: xgmac: fix safety error descriptions Message-ID: <4coefc2fqtc2eoereds3rf7vudci5l7ahme2wydocjepk2wrwy@ncgwl3j3koyu> References: <20240123085037.939471-1-0x1207@gmail.com> <20240125103454.0000312a@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240125103454.0000312a@gmail.com> On Thu, Jan 25, 2024 at 10:34:54AM +0800, Furong Xu wrote: > On Wed, 24 Jan 2024 17:25:27 +0300 > Serge Semin wrote: > > > On Tue, Jan 23, 2024 at 04:50:37PM +0800, Furong Xu wrote: > > > Commit 56e58d6c8a56 ("net: stmmac: Implement Safety Features in > > > XGMAC core") prints safety error descriptions when safety error assert, > > > but missed some special errors, and mixed correctable errors and > > > uncorrectable errors together. > > > This patch complete the error code list and print the type of errors. > > > > The XGMAC ECC Safety code has likely been just copied from the DW GMAC > > v5 (DW QoS Eth) part. So this change is partly relevant to that code too. I > > can't confirm that the special errors support is relevant to the DW > > QoS Eth too (it likely is though), so what about splitting this patch > > up into two: > > 1. Elaborate the errors description for DW GMAC v5 and DW XGMAC. > > 2. Add new ECC safety errors support. > > ? > > > > On the other hand if we were sure that both DW QoS Eth and XGMAC > > safety features implementation match the ideal solution would be to > > refactor out the common code into a dedicated module. > > > > -Serge(y) > > > > Checked XGMAC Version 3.20a and DW QoS Eth Version 5.20a, the safety error > code definitions are not identical at all, they do have some differences, > about more than 20 bits of status register are different. > I think we should just leave them in individual implementations. For some reason you answered to the last part of my comment and completely ignored the first part which was the main point of my message. Regarding the Safety Feature support implemented in QoS Eth and XGMAC STMMAC modules. You were wrong in using the statement "at all". Except the optional events enable/disable procedure introduced in the commit 5ac712dcdfef ("net: stmmac: enable platform specific safety features"), there aren't many differences: at least the errors handling and report are identical, MTL and DMA error flags match, even MTL and DMA ECC/Safety IRQ flags match. The only difference is in the MTL/MAC DPP (Data Parity Protection) part which can be easily factored out based on the device ID should we attempt to refactor the safety feature code. See the attached html-diff for more details of what match and what is different. Anyway I am not insisting on the refactoring. That was just a proposal, a more preferred alternative to simultaneously patching two parts of the drivers looking very much alike. Such refactoring would improve the code maintainability. The main point of my comment was to extend your patch for DW QoS Eth safety feature implementation too since some of the changes you introduced were useful for it too, and in splitting the patch up since your patch added new flags support which was unrelated change. Thus your patch would turned into the two-patches patchset like this: [Patch 1] would provide an elaborated errors description for both DW QOS Eth (GMAC v5.x) and DW XGMAC. [Patch 2] would introduce the new ECC safety errors support. See my further comments about the respective changes. > > > > > > > Fixes: 56e58d6c8a56 ("net: stmmac: Implement Safety Features in XGMAC core") > > > Signed-off-by: Furong Xu <0x1207@gmail.com> > > > --- > > > .../ethernet/stmicro/stmmac/dwxgmac2_core.c | 36 +++++++++---------- > > > 1 file changed, 18 insertions(+), 18 deletions(-) > > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > > index eb48211d9b0e..ad812484059e 100644 > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > > @@ -748,29 +748,29 @@ static void dwxgmac3_handle_mac_err(struct net_device *ndev, > > > } > > > > > > static const struct dwxgmac3_error_desc dwxgmac3_mtl_errors[32]= { > > > - { true, "TXCES", "MTL TX Memory Error" }, > > > + { true, "TXCES", "MTL TX Memory Correctable Error" }, Applicable for both IP-cores [Patch 1] +QoS, +XGMAC please apply this change to dwmac5.c too. > > > { true, "TXAMS", "MTL TX Memory Address Mismatch Error" }, > > > - { true, "TXUES", "MTL TX Memory Error" }, > > > + { true, "TXUES", "MTL TX Memory Uncorrectable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { false, "UNKNOWN", "Unknown Error" }, /* 3 */ > > > - { true, "RXCES", "MTL RX Memory Error" }, > > > + { true, "RXCES", "MTL RX Memory Correctable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { true, "RXAMS", "MTL RX Memory Address Mismatch Error" }, > > > - { true, "RXUES", "MTL RX Memory Error" }, > > > + { true, "RXUES", "MTL RX Memory Uncorrectable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { false, "UNKNOWN", "Unknown Error" }, /* 7 */ > > > - { true, "ECES", "MTL EST Memory Error" }, > > > + { true, "ECES", "MTL EST Memory Correctable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { true, "EAMS", "MTL EST Memory Address Mismatch Error" }, > > > - { true, "EUES", "MTL EST Memory Error" }, > > > + { true, "EUES", "MTL EST Memory Uncorrectable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { false, "UNKNOWN", "Unknown Error" }, /* 11 */ > > > - { true, "RPCES", "MTL RX Parser Memory Error" }, > > > + { true, "RPCES", "MTL RX Parser Memory Correctable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { true, "RPAMS", "MTL RX Parser Memory Address Mismatch Error" }, > > > - { true, "RPUES", "MTL RX Parser Memory Error" }, > > > + { true, "RPUES", "MTL RX Parser Memory Uncorrectable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { false, "UNKNOWN", "Unknown Error" }, /* 15 */ > > > - { false, "UNKNOWN", "Unknown Error" }, /* 16 */ > > > - { false, "UNKNOWN", "Unknown Error" }, /* 17 */ > > > - { false, "UNKNOWN", "Unknown Error" }, /* 18 */ > > > + { true, "SCES", "MTL SGF GCL Memory Correctable Error" }, > > > + { true, "SAMS", "MTL SGF GCL Memory Address Mismatch Error" }, > > > + { true, "SUES", "MTL SGF GCL Memory Uncorrectable Error" }, > > > { false, "UNKNOWN", "Unknown Error" }, /* 19 */ > > > - { false, "UNKNOWN", "Unknown Error" }, /* 20 */ > > > - { false, "UNKNOWN", "Unknown Error" }, /* 21 */ > > > - { false, "UNKNOWN", "Unknown Error" }, /* 22 */ > > > + { true, "RXFCES", "MTL RXF Memory Correctable Error" }, > > > + { true, "RXFAMS", "MTL RXF Memory Address Mismatch Error" }, > > > + { true, "RXFUES", "MTL RXF Memory Uncorrectable Error" }, This introduces the new flags support. Please move this change into a separate patch (Patch 2): [Patch 2] +XGMAC only. My DW QoS Eth v5.10a databook doesn't have these flags defined. If your 5.20a HW-manual have them described then please add them for DW QoS Eth too. > > > { false, "UNKNOWN", "Unknown Error" }, /* 23 */ > > > { false, "UNKNOWN", "Unknown Error" }, /* 24 */ > > > { false, "UNKNOWN", "Unknown Error" }, /* 25 */ > > > @@ -796,13 +796,13 @@ static void dwxgmac3_handle_mtl_err(struct net_device *ndev, > > > } > > > > > > static const struct dwxgmac3_error_desc dwxgmac3_dma_errors[32]= { > > > - { true, "TCES", "DMA TSO Memory Error" }, > > > + { true, "TCES", "DMA TSO Memory Correctable Error" }, Applicable for both IP-cores [Patch 1] +QoS, +XGMAC please apply this change to dwmac5.c too. > > > { true, "TAMS", "DMA TSO Memory Address Mismatch Error" }, > > > - { true, "TUES", "DMA TSO Memory Error" }, > > > + { true, "TUES", "DMA TSO Memory Uncorrectable Error" }, [Patch 1] +QoS, +XGMAC ditto > > > { false, "UNKNOWN", "Unknown Error" }, /* 3 */ > > > - { true, "DCES", "DMA DCACHE Memory Error" }, > > > + { true, "DCES", "DMA DCACHE Memory Correctable Error" }, > > > { true, "DAMS", "DMA DCACHE Address Mismatch Error" }, > > > - { true, "DUES", "DMA DCACHE Memory Error" }, > > > + { true, "DUES", "DMA DCACHE Memory Uncorrectable Error" }, AFAICS applicable for XGMAC only [Patch 1] +XGMAC only. Once again, My DW QoS Eth v5.10a databook doesn't have these flags defined. So if your DW QoS Eth 5.20a HW-manual do have them described please add them for DW QoS Eth with the elaborated description in the framework of the Patch 2. -Serge(y) > > > { false, "UNKNOWN", "Unknown Error" }, /* 7 */ > > > { false, "UNKNOWN", "Unknown Error" }, /* 8 */ > > > { false, "UNKNOWN", "Unknown Error" }, /* 9 */ > > > -- > > > 2.34.1 > > > > > > >