Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp298802lqb; Tue, 4 Jun 2024 11:39:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJS7Swclwc7ZnCYa9NXojIktHkaMBGgVbcqaC8JaYJhpEiDiyPIXzAeK43w5YFPZYRpJ3apQxki5DDxSfFUkMgMUGDh5f5UjrxDa9XxA== X-Google-Smtp-Source: AGHT+IHmF62ZErzKbbIMlRAuESiH6i3LUCwnP78tkn4pvCQ64i5KJebzjoPlLwme0nC0F+uam+FH X-Received: by 2002:a05:6871:3a29:b0:250:6f2b:18f2 with SMTP id 586e51a60fabf-25121c77feamr478327fac.2.1717526351151; Tue, 04 Jun 2024 11:39:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717526350; cv=pass; d=google.com; s=arc-20160816; b=PaTlhfvlnAXRMykJaX8YsqJ4NOzFVo94/9zglnzxQiBizaF/qReiYPBeWZ+bffvMjQ LZBfAUvStb1MEO/uhP3p0RDU0+p06PNZv+VkDqCRz+AYUY7srKJ4JwwPXav4DKYhCrtu ctpSFtkSe1n9UIQI7EB90FpVnGC4eKY/eqoGhbW2Lpja91eHngHbN5o3McHi6+kDJ8Fy Pt6UQZKVsW1UKpH606nPabl2NNtnn7AuVMr/5KgkcH3p34YBNcGIVBuP+lJlGWdetJTH vO7IhHVU+V14XAAP/rTtKFA8bngSynEGTvYFrq2uDr/e5F/IuIWrkpi5WfSb7B4J8mto AQWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding: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=T3B17cx33MBWlYmSQhWTDzanbFBe45y4bOdeRe909bU=; fh=5AeKgIExL6VjGx6vNs+Iuvj8CAlP8OYPj9FfBQvPp5Y=; b=vpUYrWrLfvg5neEjV0vumUtPY5iI3E8jn1gbJv6L9MSEvnYXlHbGgXTVzW1YlMfFrR ZF+p/twIJf9KeZhajOs0uBNlrhxTc4jLKNXCgdMK6KCZ2tW9QpnOxjtndx/4conPNmnz pPOLDPNgwFHH/SHlloaHDP+pv2gyH+boSswUuVN88ihVwucyjLj2Ta+HSOn6vcHmCu1T Q1za9wwTOy/i04S0NY+jwR04SmpqMQpp4Em/MyHAFYbu1NA4ocwU+aAX162+Ec0Hn1b+ lLk6/mGp1B9w+X3xSFOSYST2v4Inq/0jGgF74RKyDhn5/dSLMHWBv+nW6y499+Sa9jlP ffMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b="k/ryAEwm"; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-201247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43ff257d578si118006681cf.394.2024.06.04.11.39.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 11:39:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201247-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=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b="k/ryAEwm"; arc=pass (i=1 spf=pass spfdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-201247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de 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 E3B811C25055 for ; Tue, 4 Jun 2024 18:38:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6C991474D8; Tue, 4 Jun 2024 18:38:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="k/ryAEwm" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (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 61C04A5F; Tue, 4 Jun 2024 18:38:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717526324; cv=none; b=j2qjE+WKCMV9CRyeatDsAfFotTrS3LYM1PCXpZeTt2scpDjUStWMt+4NL72y5wWok2D2gD5D9DEyaTRPtegdnzC0gMakQt0DG4LI2uvwOfIVeO/W0iXyfE7F3bXqsrjGpBpd8QRJNHNiGFpncqnVsmf6YmAsXB8kQbx1PUEBp4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717526324; c=relaxed/simple; bh=qKilePeUYl4N0owePs1i85TmPQCrdSEykDz+72qVKzA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Zg0r84A4PyrZ/2clZ2hD+pJM3c+OWuTWqnqFIJbAmUskiY+HtUv+Bb6tIYte61tKc/kOsqSoA0sZXAuaDbr4J1Jq4lGjVE6WwyxraO+IPeOwOv3ujJAKXIz9UCK4XuUczuic//6VvYHib2UJvpOz/B0Ff2Ez4nt/2bxedHDWObI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=fail (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=k/ryAEwm reason="signature verification failed"; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id EEF4040E016A; Tue, 4 Jun 2024 18:38:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=fail (4096-bit key) reason="fail (body has been altered)" header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CWzbnTfk6O2c; Tue, 4 Jun 2024 18:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1717526316; bh=Hkxfp90gizC3m2qlcIHQ6IKrCEoG2r2lC0hRXpfclZw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k/ryAEwmWyR2iwGsf6tb3FMc46HvAsyOYU1sgQw7pe+jU8tP8sLvef3Ne4QJkZxuY Q8g2NsOoooDMheR7WP3KSfiAIpu2/8A01e3wH47Wch00PCEZhU4BZAO0vOjeknW45A moIMJaDsO4MkGUPVNg/jF3llFWOBaXXB3xYqAY8kgIt/1CV6aYt1mvZrCSt42eo4Gv /XbUO6rzZVeMXwMSMgxD1+xuJ1z4NYTCfJM+u+Qj9jU64vPe8A5/L1mIFkgRpFK5ep PcFVHTm9Vle1BRhPSgR/hzRSbllzRFpTu+qhIgH4DEM0yuG+XaNfPMQDxEUz6aLXj+ R8LheoixFY1KI1SjK8MGPNg4aF7FDjR6UZbn4k9tvpymajk7XlC9HJpbnxAo58buKd WXgh+d/uf5FLkQsbrmAAQ7SdSLVtfpAu/NwzxVEEsrKLKwj2paGvNc9P4zRA6rK2+F 39qrdaeS7pHBRgd5bSGapp+7Y7DWrIIIFP0eN2HIXtlNSHveO8PSidG/4E7FmrPQSM MowXRkejuNtg1zBEqMbmRoL3LoXjJxd98aIeOVF8daZi5u6mgOxZ4IGr1dMhoN86PR Dp2r/32O28x/0zQWcLIoyM7qG5IaUgzHWRgke1VY+tLu/oT1h2nNtFCE7+ZptG7I5w NadrARPLyRxb/Y0CCto0/FK0= Received: from zn.tnic (p5de8ee85.dip0.t-ipconnect.de [93.232.238.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 03BA640E0081; Tue, 4 Jun 2024 18:38:20 +0000 (UTC) Date: Tue, 4 Jun 2024 20:38:15 +0200 From: Borislav Petkov To: Serge Semin Cc: Michal Simek , Alexander Stein , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Manish Narani , Punnaiah Choudary Kalluri , Dinh Nguyen , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 02/20] EDAC/synopsys: Fix generic device type detection procedure Message-ID: <20240604183803.GJZl9fC9R5M2NSQ01O@fat_crate.local> References: <20240222181324.28242-1-fancer.lancer@gmail.com> <20240222181324.28242-3-fancer.lancer@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=utf-8 Content-Disposition: inline In-Reply-To: <20240222181324.28242-3-fancer.lancer@gmail.com> Content-Transfer-Encoding: quoted-printable On Thu, Feb 22, 2024 at 09:12:47PM +0300, Serge Semin wrote: > First of all the enum dev_type constants describe the memory DRAM chips > used at the stick, not the entire DQ-bus width (see the enumeration kdo= c Which kdoc? The kernel doc above enum dev_type in include/linux/edac.h? In any case, you need to be precise pls. > for details). So what is returned from the zynqmp_get_dtype() function = and > then specified to the dimm_info->dtype field is definitely incorrect. Whoops, you lost me here. Why is it incorrect? You want "zynqmp_get_dtype - Return the controller memory width." to return the memory width supported by the controller? dimm->dtype =3D p_data->get_dtype(priv->baseaddr); enum dev_type dtype; /* memory device type */ Yeah, no, that function returns the DIMM device type. /me looks at the code. Aha, so you mean the device width should be determined from that DDRC_MSTR_CFG* thing. > Secondly the DRAM chips type has nothing to do with the data bus width > specified in the MSTR.data_bus_width CSR field. That CSR field just > determines the part of the whole DQ-bus currently used to access the da= ta > from the all DRAM memory chips. So it doesn't indicate the individual > chips type. Thirdly the DRAM chips type can be determined only in case = of > the DDR4 protocol by means of the MSTR.device_config field state (it is Hold on, this driver runs on all kinds of hardware I presume. Are you thinking about older ones which don't do DDR4? Or does that thing do DDR4 only? > supposed to be set by the system firmware). Finally the DW uMCTL2 DDRC = ECC > capability doesn't depend on the memory chips type. Moreover it doesn't > depend on the utilized data bus width in runtime either. The IP-core > reference manual says in [1,2] that the ECC support can't be enabled > during the IP-core synthesizes for the DRAM data bus widths other than = 16, This sentence is missing something. > 32 or 64. At the same time the bus width mode (MSTR.data_bus_width) > doesn't change the ECC feature availability. Thus it was wrong to > determine the ECC state with respect to the DQ-bus width mode. You need to split your paragraphs with newlines to help readability. Right now it is a blob of hard to parse text. For example, when you have to write "Secondly, " that's your split right there. "Thirdly," is your next newline. And so on. > Fix all of the mistakes described above in the zynqmp_get_dtype() and > zynqmp_get_ecc_state() methods: specify actual DRAM chips data width on= ly > for the DDR4 protocol and return that it's UNKNOWN in the rest of the > cases; What are the rest of the cases and why is it ok to return UNKNOWN all of a sudden? IOW, how was the old code even tested?! > determine ECC availability by the ECCCFG0.ecc_mode field state > only (that field can't be modified anyway if the IP-core was synthesize= d > with no ECC support). >=20 > [1] DesignWare=C2=AE Cores Enhanced Universal DDR Memory Controller (uM= CTL2) > Databook, Version 3.91a, October 2020, p. 421. > [2] DesignWare=C2=AE Cores Enhanced Universal DDR Memory Controller (uM= CTL2) > Databook, Version 3.91a, October 2020, p. 633. Can those be freely accessed? If not, you should say so. > Fixes: b500b4a029d5 ("EDAC, synopsys: Add ECC support for ZynqMP DDR co= ntroller") So this commit is in 4.20. Does that mean that this fix needs to get backported to all stable kernels? Have you tested this on all hw this driver supports and made sure no regressions are introduced? Thx. --=20 Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette