Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 16673455181; Sat, 12 Sep 2026 10:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789210697; cv=none; b=PLwYvIjepsCzEHH6lUcu8hh1eIWvPKFnhO5xEViV4Ig0+FxAGLKQyn3mba9+FKqOCpOYUlTAtaF2oz2peGND517jO1+8LlVKKrKk5nb37twl8+IRJb0tCEP8tnaYtJk/dqW3E2x92OYdjtxnzNc88a1sis94eJ8SyfQ2R54NeBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789210697; c=relaxed/simple; bh=CPUl/NkGd3WZhO3xjkN2gg5XPxP5bLDu7hiJsRVMVPM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fmTVR5wMsLqPU6YQnqAOep1vnDmxWj9UfnYIDQkIGHaw2g43rAoHoidR21vpS7Z1AqM/epj3UDnujK1WUhLg97AHA3vrcJ+gGvY1IS1nHsiF0k9QIkzxof5FoR7WHNsz66tYfaeMh+WSYgPkckQgHY2lVhZ+pxC9/Jw4cUHFfEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JgbsgLnJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JgbsgLnJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4E1C1F00893; Sat, 12 Sep 2026 10:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789210696; bh=Exx+RfEOXqoXcWQ1N+YIL8w7ENpxijia4QUQ9mFjtqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JgbsgLnJFDiyWSLkw1taB2DsSBOYGNUYnOvbzpATUfUECtMrcXkrlRNpr2DkzsNOB 6eao1pBsDEF1+ER7OskW5QbErWM58z6WkzSBfoEXbZQSLpjfvw8BqCjtMKisPq62Qi PwEFs2d2XtP21qCRrG0V3Kp8G4KqNkS8Y1wNEYuA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Guenter Roeck , Sasha Levin Subject: [PATCH 6.18 1079/1518] hwmon: (cros_ec) Register the thermal devices after the hwmon ones Date: Sat, 12 Sep 2026 08:54:08 +0200 Message-ID: <20260912065647.858364856@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Weißschuh [ Upstream commit 9f1012119f2a4cb5a7f589dc77d5e15dbab49d00 ] To guarantee consistency for the read-modify-write access in cros_ec_hwmon_cooling_set_cur_state(), locking is necessary. The locking will use standard hwmon device locks, which requires the hwmon device to be ready before the fan devices are set up. Reorder the initialization so this works. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20260711-cros_ec-hwmon-locking-v1-1-cb6d0fdbb2d3@weissschuh.net Signed-off-by: Guenter Roeck Stable-dep-of: 26db27364088 ("hwmon: (cros_ec) Synchronize EC access from the thermal device callbacks") Signed-off-by: Sasha Levin --- drivers/hwmon/cros_ec_hwmon.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/cros_ec_hwmon.c b/drivers/hwmon/cros_ec_hwmon.c index 7e0fd5bbe2d75..8065072b0988c 100644 --- a/drivers/hwmon/cros_ec_hwmon.c +++ b/drivers/hwmon/cros_ec_hwmon.c @@ -547,13 +547,17 @@ static int cros_ec_hwmon_probe(struct platform_device *pdev) priv->fan_control_supported = cros_ec_hwmon_probe_fan_control_supported(priv->cros_ec); priv->temp_threshold_supported = is_cros_ec_cmd_available(priv->cros_ec, EC_CMD_THERMAL_GET_THRESHOLD, 1); - cros_ec_hwmon_register_fan_cooling_devices(dev, priv); hwmon_dev = devm_hwmon_device_register_with_info(dev, "cros_ec", priv, &cros_ec_hwmon_chip_info, NULL); + if (IS_ERR(hwmon_dev)) + return PTR_ERR(hwmon_dev); + + cros_ec_hwmon_register_fan_cooling_devices(dev, priv); + platform_set_drvdata(pdev, priv); - return PTR_ERR_OR_ZERO(hwmon_dev); + return 0; } static int cros_ec_hwmon_suspend(struct platform_device *pdev, pm_message_t state) -- 2.53.0