Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp347884lqj; Sun, 2 Jun 2024 00:56:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWSo3kD/3ilaHwAjKMMvARdg2GlYAU6QdiPlDe8jwJ3kliBdhgtaAfz4PzDQ3ud/DjU5JgWaBw0XCfqwgPxObmnYX1HOsEODamApdksnw== X-Google-Smtp-Source: AGHT+IFWv6Q0XcbQotJedb+xxZn9PFflySe+4e3dRxcVHfWHWYkaRXBztgiI/1ePcIxFxwdsEeDM X-Received: by 2002:a50:a694:0:b0:579:c2fe:886 with SMTP id 4fb4d7f45d1cf-57a43c36782mr2725439a12.14.1717314967971; Sun, 02 Jun 2024 00:56:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717314967; cv=pass; d=google.com; s=arc-20160816; b=PmjULY+UftcH/vOJIfe665M+SVZY2u1A2gm8WgMs8AvfGc/EqiUSuG6z9BeSySl6Zy ZxKwUVWWC75SvjBMp7pO5Omfuv77uTbpbuDXA9SgxGkSwYnDCunvP4DlZ5sj70X05L/o 3IcIHWq0rsys95DQvEUhot21BDZz3GYI7+eLZKAS/PxktGG+Ns9XCa71Xoibi4S9jbAT FVXNkBoR4Hlfbs2E62ZcT0lPD7qB+kU+ohkME2rDOWtUhNyWHBPYLcUKId6j1H6QNSXx jgXRokh46DI1jLkFCBaufycVb16chNJLD4VbFo64wQ3MBC2i89Bfd+ihsi97u1kgpVkg 7L+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QXzFQUXlEvQ+b4fv3fen3207b1tD9uMg1lSKtYgnQ9o=; fh=yOcRiSVYGuX8AkBDQVXmenZ4BfXwdbWcjIABZp84Rgo=; b=ucDY+6UGMrD3TeFbh1djxGWLX7xgz+XOkpCL+HJFgqBmc+df9sicYhFRBOCy+YaKtR RWbXTWZhtjjwAjQw0P8tJPGKctJoaCWq+dRS7PJSVoU3ZAZ0Nhg/bLNSM3K8aufMTj5S 3LMK8sKNmvp6LzOntdEaZ9z0tfML+u82asJc5qqQ77HZyJxvtEIV4flXAFfSvhCHCkFP bAlDaiU5932T8kx9mgqmDyv144Yfp3Q8eOkcZzwaMLWWSTw3m1HTDtwpJyAO4rP//adQ hGRp6SwT3oEbMFrQt7NHHTuEbM6NLKA87nNBeHveVJtaWb5ePEMDpnr9Xi17e1kOSEHZ BJxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fssQoigk; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-198157-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198157-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31b80fb8si2894611a12.2.2024.06.02.00.56.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 00:56:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198157-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fssQoigk; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-198157-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198157-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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 am.mirrors.kernel.org (Postfix) with ESMTPS id AC3DD1F21600 for ; Sun, 2 Jun 2024 07:56:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1675B208AF; Sun, 2 Jun 2024 07:55:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="fssQoigk" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 763BE171D8; Sun, 2 Jun 2024 07:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717314956; cv=none; b=HPqRIfYllzeK4UtXsw4TiH241giAAI+X0LZ/AXiXZgc3/kQZrErn0seBE1Hv9mGJGa47w8mvJjf6R/4dKeiskCJeKHksgECeCtQ1aRHJDPYNZaGgKePSTySMCBCbhRF0RJyKcD9dAi6kwrFKkR2cKUZ12+HCtdm03Wena/cA5+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717314956; c=relaxed/simple; bh=IEhOxkzhslY+vd8fhusSxnVVLFBJ94oEh/JdlsM+GZ8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D6qp4zEp9iH/XHr10+plYJizjf8akLGQi/EyqocGAzNWXR85JInE0MzQe7pBTy7hol16U2Ydn0HajWRtmiP/VifVqY7vI1rt4YIz4LkqjLfyobeA1kL4euRAyvoD8QfVqvt6FqeD+0iiz4K7EIMeBLnmUcH1jHqKqdaB6ISRP/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=fssQoigk; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1717314949; bh=IEhOxkzhslY+vd8fhusSxnVVLFBJ94oEh/JdlsM+GZ8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fssQoigkKwjV0LLXf1MJ8g7wIBOattCTwEFx5/iZqlSBrF0WfJZkLtiP6kt2XUN+3 X+dC0EDKXtHITVkuImH6d83cJEJxbGrmyEq8DYzq9PvzQhc1ous6+c37l49Zt6kqLb moNbTczo1mjIrtgIoQwtH+HcH18oz+jHhUE6WuEU= Date: Sun, 2 Jun 2024 09:55:48 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Armin Wolf Cc: Guenter Roeck , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, =?utf-8?B?UmVuw6k=?= Rebe , Wolfram Sang Subject: Re: [PATCH RFT v3 4/4] hwmon: (spd5118) Add support for reading SPD data Message-ID: <04d55009-c4a7-49e6-b098-545f20719f83@t-8ch.de> References: <20240531230556.1409532-1-linux@roeck-us.net> <20240531230556.1409532-5-linux@roeck-us.net> <4cc979c3-3ce0-4f31-b5d0-508e1af5fdf4@roeck-us.net> <4e4341e4-2165-40d4-909c-9d5164e97942@t-8ch.de> 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 Content-Transfer-Encoding: 8bit In-Reply-To: On 2024-06-01 21:23:24+0000, Armin Wolf wrote: > Am 01.06.24 um 16:08 schrieb Thomas Weißschuh: > > > On 2024-06-01 06:48:29+0000, Guenter Roeck wrote: > > > > > > > > > Makes sense. Another question: > > > > > > This: > > > > > > + struct nvmem_config nvmem_config = { > > > + .type = NVMEM_TYPE_EEPROM, > > > + .name = dev_name(dev), > > > + .id = NVMEM_DEVID_AUTO, > > > > > > results in: > > > > > > $ ls /sys/bus/nvmem/devices > > > 0-00501 0-00512 0-00523 0-00534 cmos_nvram0 > > > ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ > > > > > > which really doesn't look good. My current plan is to go with NVMEM_DEVID_NONE, > > > which results in > > > > > > $ ls /sys/bus/nvmem/devices > > > 0-0050 0-0051 0-0052 0-0053 cmos_nvram0 > > > > > > We could also used fixed strings, but "spd" results in "spd[1-4]" which > > > I think would be a bit misleading since the DDR3/4 SPD data format is > > > different, and "spd5118" would result in "spd5118[1-4]" which again would > > > look odd. Any suggestions ? > > In order of descending, personal preference: > > > > * spd-ddr5-[0-3] (.id = client->address - 0x50) > > Hi, > > this will break as soon as more than 8 DDR5 DIMMs are installed. i2c_register_spd() only handles 8 DIMMs, too. JESD 300-5B.01 (section 2.6.5) also defines i2c addresses for 8 DIMMS only. Outside of that range we could fall back to something else. > > * spd-ddr5-[0-3] (NVMEM_DEVID_AUTO) > > * Same with only "ddr5-" > > * spd5118-[0-3] > > * Your proposal from above > > * nvmem[0-3] (default handling) > > * 0-0050-[0-3] > > > > Also can't a user of the eeprom already figure out which kind of module > > it is by looking at the eeprom contents? > > The first few bytes used for that seem to be compatible between at least > > DDR4 and DDR5. > > > > So using plain spd[1-4] could be enough. > > This could cause problems when DDR6 arrives. > Personally i would prefer the spd5118-X (NVMEM_DEVID_AUTO) format. I have the impression that the eeprom layouts are designed to be forward and backward compatible. If a non-DDR5-aware parser reads the contents of a DDR5 eeprom it will fail the CRC check, so there can be no accidental misinterpretation. (Because the CRC'ed area is larger and the CRC is at another location) On the other hand the first bytes of DDR4 and DDR5 are compatible, so even an unaware parser can recognize that a SPD eeprom is being read and which DIMM type and specification revision it is. This seems intentional and therefore should also hold true for DDR5 to DDR6. Thomas