Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp407984lqp; Mon, 10 Jun 2024 07:44:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULhRZh8mLM3zt0BqkTrIdZFjo3gg26F/pZUI51BuhZsbir59BXHo88xSee159KRb5YY7W/kwUAQK9Zoy9M85iu+3z+H8aMy9/mt7a0MA== X-Google-Smtp-Source: AGHT+IGBs3xWEEnBc86/Upp6drSJBvZf/Ne126AD50C5d3MIpn/X4Lp9lUoDz6lxHPaAxCjVSYTl X-Received: by 2002:a05:6a21:271f:b0:1aa:6167:b6d6 with SMTP id adf61e73a8af0-1b2f9c72376mr9165672637.42.1718030693912; Mon, 10 Jun 2024 07:44:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718030693; cv=pass; d=google.com; s=arc-20160816; b=dbbg13bzyRHJpzV8D4xGmxRSBF4QiFwXhjKKP/65DonFqtcNbGcTd6CFz2cCuE7Lc5 fJkmWG9GI2CHHch3EOJ91kUj+rSN+MTs2DPLQQdL/aUH13vAO6JvZ0oJpctQ53bfXuOe V/pNVl+iVqJda3rcZ4Q3XYkHy7iy9GEMgSHz91AK9Jq+3Xij8tFwnKrR2SiQGUEiwZt9 1wbu79tBgDP/GB53LOfSn9tpKZERr4ZQ7R/SqTfF3rUi4yU/at4XSFXYaCIslcdEdemM 3FcvoX9lMNMj/taWDTVDeioteYkdMTJ2t80hG/UWVFATNapx3aJcHKY8UxRf1SknMuOH 0nHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=BKkziaSKSr/muOq1HRAFyB+WD5eSBI8YIdJmSO2EbMk=; fh=+carZ6B7WwVLRuIPQHDjuC1RxanKsBQZ2Auxb/jvd5c=; b=Q9dISmyuFPpOyBXLmHrvTs7C48DOPKdgon9PcyCdpE1ne/1nPFYvND1nHhQc3Riz30 /9uwEYysMwBVr6djj/qU++DeK5jXo66rb/3sUwm3jh3GTVypDUIwhmnDsugI3mlIgc08 Cw/l20EdemJJ77VTfJUWhpW7vgr9JU0ZA5488Xz90oWkwDwCcOZGGA2sEQmVMK7mt01Y CGLXp8cmGTZYANV/eMBcYP9QKSuGH2LGNuba8PgJExV3ZdvmiDnZoyzqAlGb8Md7lVz8 5rFFfYSt3/0psTCjzZK9Zr4o+4soZSDF91xUe9ixkZDFB72uTgigANOt2QLLJAPZnA13 plGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YG6FDjzJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208386-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208386-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70420d2354esi3818054b3a.95.2024.06.10.07.44.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:44:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208386-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YG6FDjzJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208386-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208386-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 53501287B62 for ; Mon, 10 Jun 2024 14:43:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A48C143885; Mon, 10 Jun 2024 14:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YG6FDjzJ" Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.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 A587614263B; Mon, 10 Jun 2024 14:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718030482; cv=none; b=ENDDC78mOwTMgheXOd0R95QBKfSaCzf2GepRycBPw6KxVm/YsOxPGT+DJS0F1u22h7+FW11fZJMuSaqJuRmhv+mYwJr341OLYgMwvqFM+OpY9QW+f2BmzR2ukwQjecyBaDxIpbYwD248HbWCE3Txz/FzNL+6HOUH5I+8BJbpxkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718030482; c=relaxed/simple; bh=eqaMSv5Aa4/kBy5g0iKnICdAo6+fypqw8AFbKQnuxkw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a7HNfKF780ENGb8952PGtSGE++x2FCR8pNIM9wn4paeNLmaymY6yiV9IQSZeM7213c8oS63/avpPy66HfO1GFaYCNASlpxqzTq65a+aUoE2vCO4ArnDTlaNrwNT5CoQS/Q4/nhbbeIF9zLjM8jG3MA7ZsV6bogGveWc9xAfB1Xo= 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=YG6FDjzJ; arc=none smtp.client-ip=209.85.210.177 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-pf1-f177.google.com with SMTP id d2e1a72fcca58-7023b6d810bso3545051b3a.3; Mon, 10 Jun 2024 07:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718030479; x=1718635279; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=BKkziaSKSr/muOq1HRAFyB+WD5eSBI8YIdJmSO2EbMk=; b=YG6FDjzJsOxT2GbicoQBxzx2W+NiI0ywx6nSe7kX5n6OB9CS81eDIq3GOioYuipo/C ga2uG8Kn3HWw2ZuIIyzuNFLfYZpLxdOaHh648iL5BWfWsnRrL2IqT8QGXHRA1PYnp4hs Dv6P6TmLybgCfaxJGO/46ZuA1SuFqAAEniPvhJCKrhvPrBb+SLHSzVQ0LYFnBWvJ1vmN X5Zz/yQvi9XmElOuDo6GgWzmr9UBkEdaOvvNQtOrGqVaUIpNQU9cpMOxS1JAeAZiWuKs Y4NsBfwKD+tJGqGMfBUOHSzaXNxPvb6fWKhVYiHysIZ8UtT8kuHXMzJ4rfKf6da/iAOq XomQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718030479; x=1718635279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BKkziaSKSr/muOq1HRAFyB+WD5eSBI8YIdJmSO2EbMk=; b=iRaL39HMk1CgysRHT0IuOCq89yEnAGGhbIuJwLU/lpE/g6H6sZw15eW0666olJfLdO 6GgrqqqV2DFs5ViJlfrGMwLn29/bQCnmN3DDUEWP65qgpqg4mv7mKSAyEorlDdtHW3JZ Rs3cwLPl4ysB/7FfWYB97vTUnNMI4b8niqE0CFP5wUiBmfVDsaE4tcS+yBmdJibCKDNW DQI21lU7jGM/pgxMfPCKwFaWiOGTUy1F5Q7/uwjzSWtQMO2sMI+ytpaCJbXx9lyht803 tBTnE1LQvi0D5eESHGaTUyfQP29NSy229m84MWCx+eu/oQOUYoRGxT6PVcZHKyzmCIC2 pvPw== X-Forwarded-Encrypted: i=1; AJvYcCV8FIgx6OQFwtRZK0Ztcs+yXOfjY8M8H8eJd97RHsBcNfBuAM++Xk9+e3DI5soPYRWe/vdv8he2PzeubDKdFkboKXf8BSc47XbuFWbZZosSzsf+5Qe++SM87I6VNcXweR4ihRNRwtkVDg== X-Gm-Message-State: AOJu0YwY9iUOgyWrjC4jAujCMi/oZKMnYaR2i/IB3BlCc3GtjtPVOXXg gThudZv75m3ogyGvnkHm8R8SLvVD/DgAUaAEy+GyDcBoQjLPa+GuY79ndg== X-Received: by 2002:a05:6a00:4790:b0:704:13d0:a7cb with SMTP id d2e1a72fcca58-70413d0aeccmr6270995b3a.13.1718030479556; Mon, 10 Jun 2024 07:41:19 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705382784b9sm2146318b3a.48.2024.06.10.07.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:41:18 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: linux-hwmon@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Krzysztof Kozlowski , Wolfram Sang , =?UTF-8?q?Ren=C3=A9=20Rebe?= , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Armin Wolf , Stephen Horvath , Paul Menzel , Guenter Roeck Subject: [PATCH v5 6/6] hwmon: (spd5118) Add configuration option for auto-detection Date: Mon, 10 Jun 2024 07:41:03 -0700 Message-Id: <20240610144103.1970359-7-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610144103.1970359-1-linux@roeck-us.net> References: <20240610144103.1970359-1-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Tested-by: Armin Wolf Signed-off-by: Guenter Roeck --- v5: Added Tested-by: tag Replaced #ifdef with IS_ENABLED() and included address_list in conditional code v4a: Do not auto-select SENSORS_SPD5118_DETECT if DMI is disabled Modify help text of SENSORS_SPD5118_DETECT Default SENSORS_SPD5118_DETECT to y if (!DMI || !X86) v4: New patch drivers/hwmon/Kconfig | 19 +++++++++++++++++++ drivers/hwmon/spd5118.c | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 7a84e7637b51..d5eced417fc3 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -2193,6 +2193,25 @@ 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 (!DMI || !X86) + 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 X86 systems with DMI support + this will typically be done from DMI DDR detection code in the + I2C SMBus subsystem. Devicetree based systems will instantiate + attached devices if the DIMMs are listed in the devicetree file. + + Disabling the detect function will speed up boot time and reduce + the risk of mis-detecting SPD5118 compliant devices. However, it + may result in missed DIMMs under some circumstances. + + If unsure, say Y. + config SENSORS_TC74 tristate "Microchip TC74" depends on I2C diff --git a/drivers/hwmon/spd5118.c b/drivers/hwmon/spd5118.c index de6cf07f3007..ac94a6779360 100644 --- a/drivers/hwmon/spd5118.c +++ b/drivers/hwmon/spd5118.c @@ -646,8 +646,8 @@ static struct i2c_driver spd5118_driver = { }, .probe = spd5118_probe, .id_table = spd5118_id, - .detect = spd5118_detect, - .address_list = normal_i2c, + .detect = IS_ENABLED(CONFIG_SENSORS_SPD5118_DETECT) ? spd5118_detect : NULL, + .address_list = IS_ENABLED(CONFIG_SENSORS_SPD5118_DETECT) ? normal_i2c : NULL, }; module_i2c_driver(spd5118_driver); -- 2.39.2