From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385452; b=B6R2yvCtUphkkldpl96yklTwtM33kfr+pfKVJr1ld8iCDXaaYc/YGXpP6iAl6UbtXvGS RaNxvYH7XPtYpM+3w8hAwJd7ybvvopQZIOK9p2D4kSuasVPFeccUIUewFqm0jaFvBpYS2 L7vrom8hj4ghxJtgoHxvozxxs+FwkPBtuv25peSGmDpb9AhnpYHdY0gISLGl4R3b3hL+V 219wEanEaMkX4wVRVoAcsYqwZVFMHFPMawtxH0aX5BX7d0mirvtpvzHP8CqhskIkSdH94 u2w8DUD87f4zKsa9nDq+J2kI2+pDDgrnV8/USZ69uGaS5Xt7BrJkhDgaF0iudg9M9/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385452; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=ncgFljVdbmi8CHlgwLbkrF6a/u17fDfoM3BKy2xFMfg=; b=abaPv6n25jAIL0cUEjWSVpxioHN2fYlfu/rCDP76wBr4vuuTQNACNtWsWKf1FvCsqiM3 61ENIevDTHaX/iTpTw/Bzc7TR9fXP3x3qUz4p9DJhBfEGUAubk8IPBDs+wCiEjH3Yu0T8 k0E8l664+ZtPnnjizexcvCV6fmyVVl83CmB5GhAfxDJftA/ug47oLniucQQEzEBU/wgsx A/a8gzOx4G0qSZ2XXAboKvjXPAgiI3YEsrjF9l7RHO4RJTQO5u6D8Z8W5f74+/zGOoAuh /zDM7x+OvVHTmDYysqrbiHpO4oxfqp54SISNxxHRXoTVsY+LiHAoKBKPvkD9Q9d/R8w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=q1lcMVzd; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7444606A322; Fri, 4 Dec 2026 11:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=q1lcMVzd Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2171D1F00934; Fri, 4 Dec 2026 11:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385452; bh=ncgFljVdbmi8CHlgwLbkrF6a/u17fDfoM3BKy2xFMfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=q1lcMVzdNY5t3ZnztPnrHTd+rJ51vcA7YQfSBWjXf982dXDzZPTSHmbAAYlGy48eu RgtK9a0ehJjxs0QoFRan9yGixP+VgmnhYW1ZpRZ+re99pfOG8Y5m/vyBG10BtbkNqE Cj/kMinbhFluWPoqgTTut7rAdQxxcji4bnKCpT6w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Stanislav Aleksandrov , Guenter Roeck Subject: [PATCH 6.6 0562/1167] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Date: Fri, 4 Dec 2026 18:59:49 +0900 Message-ID: <20261204100716.688111613@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stanislav Aleksandrov commit 33d58cbf2ab26bda81bc3052158d8b9867d5b9a6 upstream. The tachometer count registers initialize to 0 until the first measurement cycle completes after power-on. To prevent division by zero, tach_to_rpm() clamped tach == 0 to 1, causing it to compute and report 3,000,000 RPM (60 * 100000 / 1 / 2). Return 0 RPM when tach == 0 instead. Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver") Cc: stable@vger.kernel.org Signed-off-by: Stanislav Aleksandrov Link: https://patch.msgid.link/20261108-max31760-fixes-v1-3-a61450463059@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/max31760.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/hwmon/max31760.c +++ b/drivers/hwmon/max31760.c @@ -68,8 +68,9 @@ static const int max31760_pwm_freq[] = { static int tach_to_rpm(u16 tach) { + /* The count is 0 until the first measurement */ if (tach == 0) - tach = 1; + return 0; return 60 * 100000 / tach / 2; }