Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp126643lqb; Tue, 4 Jun 2024 07:04:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPX/BauGLnpcBqSDkq5WS1bL4MkjQX2OqbEjx/8sEb/UXSyeEVME37o90wyznnCEwVZ25PnHY1m77rAgAOaGELFcxVc/wz5FSMCIiwbw== X-Google-Smtp-Source: AGHT+IFtwQJkfkTZnKpjIxJ6U030mBnrdcM6q4HbpNLI/ZWs4PbQARybH05C9DbhC9V8/1lIg6oJ X-Received: by 2002:ac8:57cf:0:b0:43f:e7c7:a4eb with SMTP id d75a77b69052e-43ff52b6a98mr139097931cf.47.1717509864026; Tue, 04 Jun 2024 07:04:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717509864; cv=pass; d=google.com; s=arc-20160816; b=eOqidHE+djpYdl2ZiFITw2ZE4ugmawGUV7hJl9xfSw/UQ6m2TfiFkmRhOS9QhWSWpk gbcoAKDqObJABFbQaQ2tz3TwtSh+kDaPBJVzOhzCcZsOcr0HfJWKDhaKow/VTJpf/SYP 9Qhluzmf1eN46juRlbEKUpiysmAn56yFUGHbaxvI81AW0g3oU9bYXShXrMGTrihY7I6p OQgWPAzYVCaETs8nkLrU2M3A4Y/ziTb+yAWOEWhDb2WoBZ5HMEFoYsfriCvcHrhIPT1q myBlhb1CRm1j8311Fs7Xul4EgXx4ZGFT3snLdoAmIAN9cHyBr6RBNjNyhEtgKhqAfj7k pUHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=enPaUgUcC9yOTfYy7j3r26WSWSOC6BIEXxvXIakH3m0=; fh=zaMKi4SNHlUPvq46ehwWbSsNCGdzHYc6rr+JfG3cFE8=; b=V8rajHF4SvIK9BPVNqWpOA0giJAg345alQYy/l3eM7mksLH3LIlsL/I3/9bT5ZWWTO ScJtkwqUrriur1+dKqoo3g08uGs4Ix0pbkrFJR0camBeZNx6v911RKVnRysueWsgnT83 KfjX+DrRWUwri8A5yx5rlT+dxA7LL75ZeSOSHoiW2M7Gkr6+ppYz02gZn1g0A5STaevD rYzKQNIwQmbqVgzCb6DQhwqmWQLS05bcYFpH1yebXZNQyk3S+J4IXK8idiL6HvFfUqPm 7w+TvCxnoDNa0Y8/5LN4RsKAL+WDvis4F4t1jF0ui8W60zBiONAkM58qTxPX9+wy1ILL bSAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SflAVlWR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200774-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b401ee1si20362716d6.229.2024.06.04.07.04.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 07:04:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SflAVlWR; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200774-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200774-linux.lists.archive=gmail.com@vger.kernel.org" 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 BE03D1C208E8 for ; Tue, 4 Jun 2024 14:04:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 821DB175A1; Tue, 4 Jun 2024 14:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SflAVlWR" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 B5AB8EAD0; Tue, 4 Jun 2024 14:04:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717509854; cv=none; b=GLgcw8qU5qJWgi4/cm4KpT8Gd3mB1cnITfBrFAl/i/AZXvuKE1Ty7lYewEry9Zlg0wNhCKRKXO0uM0ksf+dII26cxhzGl6Q6JJbKYPJsIE43us2Mz49aTwW0dY2JEPiixfcOiaM+4KlEvvCeGu1kKJ47VIzrZy+DHjEQ7JegIvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717509854; c=relaxed/simple; bh=Bg9cYDKfqeyVraGOEmALsA6FDhsosdOhScbKmJPxU/E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XCUp1cPSQAvzE/qoJV+CxdVAUmU/VyVFQ2plTFPXYqkzucMUr8YnUFFrht6lMKFRTDvg0mFsL0T8Hy87+qGSE5za7Fn8DFHmQPISfkMtuodUFwS0DfdW3cLZEGEz0xyP8Fgnl8gB6csdsFUoaDIRvpFL+4QKML/0jJ0Lwfxrcf4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SflAVlWR; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1f63642ab8aso33295065ad.3; Tue, 04 Jun 2024 07:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717509852; x=1718114652; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=enPaUgUcC9yOTfYy7j3r26WSWSOC6BIEXxvXIakH3m0=; b=SflAVlWRtVd6e+k1RHCG70qUuOrC1M3QVV+9q49RfDlIpGX7TnRyA4PwS5FS3T2eGn axY5ogN/hsNoLjRurKd28r3bDajZ89RSxdxvegh9Xmw5/+1VO0yDkX3/kLA6tGtU4lmA h/PAS40Yg16yQptb92PCyxMaa4c0Csd8CZYloBIOvcqUgYRZsv+2btODKShTQ0b9pCfo AyMNDVF/6Bv6EzJQIUVv4616vX3M3hsLjNRmnkwRiZfD/257Y4RFyCADemmwOsXWXc0d PAumyo0AjsyiBgnjF1/mWxLR5ZbMJbwkXDUHyfqfZht7OIGiL+IdrmIDeXCcSaBfYPTn 3oJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717509852; x=1718114652; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=enPaUgUcC9yOTfYy7j3r26WSWSOC6BIEXxvXIakH3m0=; b=Y2czIa1r8X94ZQ0zA0trmk5p6yGyzytQgnItz+dWqYYdrXAQhHQi7KIfEdGn0AGz72 xfuquzTJywH84uUO2o4rKzVE675BQuEjoXEo8o2gB0ZfhxKrZESlAqsCVN1RyiyLHQ6r EkbeO6cBK7MUtEz8xDmqeY8yhQPlvqbGepz0tCQXkG1OW28tKQ3HWtF6sV5ZeplI2uUC qQSBFdVAziC+xAMkzyfojtgbRt3urKwhDXWs2aQZtT1IsuKLsubgb5J0l6bgch0tSs+u hHxyBg9b8WzHDQ6YBNp5dswPZfy05o8516NetefUYDMJ3YY3XpNmGs6VdmZDAxaLil3M jftA== X-Forwarded-Encrypted: i=1; AJvYcCUfHJvenzLFv60REKiDz8XrCv9LyHAJYAnfmXNcjHxmsrxki/Drf8YgKY27Gt6DHETFqmT1kPN93FyYGu3Eycy2rpynOF97QSc73o+33Td7FUyMEU/W3AJ8LBHcTZE4PKt7jl/S2HA1uwLOqKfRw3fKQUxhiBwlgkbc/bSaIBwL3JYjDw== X-Gm-Message-State: AOJu0Yw4xwUVeUNeA0dOabVBNzu9I/VWo7u10j/9EpbA3nUr1eeAbA9U K6dtkEOZdHQt4z+KH+WMTohm0e/DZHF6yclXm2JOIgmzV8g3KOxs X-Received: by 2002:a17:903:1c8:b0:1f4:9ce1:6e78 with SMTP id d9443c01a7336-1f63701a46fmr140371635ad.19.1717509851781; Tue, 04 Jun 2024 07:04:11 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f63236d26dsm83563705ad.103.2024.06.04.07.04.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jun 2024 07:04:10 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Tue, 4 Jun 2024 07:04:09 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 6/6] hwmon: (spd5118) Add configuration option for auto-detection To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Cc: linux-hwmon@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Krzysztof Kozlowski , Wolfram Sang , =?UTF-8?Q?Ren=C3=A9_Rebe?= , Armin Wolf , Stephen Horvath References: <20240604040237.1064024-1-linux@roeck-us.net> <20240604040237.1064024-7-linux@roeck-us.net> <452386bd-8238-4fac-ad6d-6a8f096ecc35@t-8ch.de> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOP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trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <452386bd-8238-4fac-ad6d-6a8f096ecc35@t-8ch.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/3/24 21:37, Thomas Weißschuh wrote: > On 2024-06-03 21:02:37+0000, Guenter Roeck wrote: >> With SPD5118 chip detection for the most part handled by the i2c-smbus >> core using DMI information, the spd5118 driver no longer needs to >> auto-detect spd5118 compliant chips. >> >> Auto-detection by the driver is still needed on systems with no DMI support >> or on systems with more than eight DIMMs and can not be removed entirely. >> However, it affects boot time and introduces the risk of mis-identifying >> chips. Add configuration option to be able to disable it on systems where >> chip detection is handled outside the driver. >> >> Cc: Wolfram Sang >> Signed-off-by: Guenter Roeck >> --- >> v4: New patch >> >> drivers/hwmon/Kconfig | 18 ++++++++++++++++++ >> drivers/hwmon/spd5118.c | 4 +++- >> 2 files changed, 21 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig >> index 7a84e7637b51..0bb1bdee3e43 100644 >> --- a/drivers/hwmon/Kconfig >> +++ b/drivers/hwmon/Kconfig >> @@ -2185,6 +2185,7 @@ config SENSORS_SPD5118 >> tristate "SPD5118 Compliant Temperature Sensors" >> depends on I2C >> select REGMAP_I2C >> + select SENSORS_SPD5118_DETECT if !DMI >> help >> If you say yes here you get support for SPD5118 (JEDEC JESD300) >> compliant temperature sensors. Such sensors are found on DDR5 memory >> @@ -2193,6 +2194,23 @@ config SENSORS_SPD5118 >> This driver can also be built as a module. If so, the module >> will be called spd5118. >> >> +config SENSORS_SPD5118_DETECT >> + bool "Enable detect function" >> + depends on SENSORS_SPD5118 >> + default y >> + help >> + If enabled, the driver auto-detects if a chip in the SPD address >> + range is compliant to the SPD51888 standard and auto-instantiates >> + if that is the case. If disabled, SPD5118 compliant devices have >> + to be instantiated by other means. On systems with DMI support >> + this will typically be done from DMI DDR detection code in the >> + I2C SMBus subsystem. >> + Disabling the detect function will speed up boot time and reduce >> + the risk of mis-detecting SPD5118 compliant devices. In general >> + it should only be enabled if necessary. >> + >> + If unsure, say Y. > > The combination of > > "In general it should only be enabled if necessary." > > and > > "default y" / "If unsure, say Y." > > looks weird. > Yes, I know. I just couldn't find a better wording. > > Also right now it is not possible to disable detection on non-DMI > configurations. But when using OF, custom kernel code or userspace > instantiation then neither DMI nor CONFIG_DETECT are necessary. > That is a good point. > The following would support those usecases, too: > > config SENSORS_SPD5118_DETECT > bool "Enable detect function" > depends on SENSORS_SPD5118 > default !DMI > > (And no "select SENSORS_SPD5118_DETECT if !DMI") > I don't think "default !DMI" would be a good idea because DMI is supported by multiple architectures, but only two X86 specific controllers call i2c_register_spd(). "default !DMI || !X86" might work, though. I think I'll use that. I'll rephrase the text and drop the "select". Thanks, Guenter