From nobody Sat Apr 4 00:05:51 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 BDF3E34CFC5 for ; Sun, 22 Mar 2026 19:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774206438; cv=none; b=qtW7A74YY6Slozzovk1ovUs52Y/qdzPKBl1QOfXZGLNsjk714o/f1K5v/+owsVHMcjnnlIUQZaZOsDw2zXD/qOw31n0ou9x1eRvX2HxmtkGBoRhvjXogWjv1e/qIjEQakbzJGDhw2pZvq/tTPSd+Bf4Xc0WDN+f9axyqYYO8ifg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774206438; c=relaxed/simple; bh=oLKGlkhw2FIIbPnQj7+BVbg/ng9EcldtKCH1eAUAjOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o6/C0dkop+1t/f0ZYByURKwqChJNC/SZ6Es3+twX3UEfgmN/2W51nVlws4JokwqWhhffMpGE69Z1AUsSqwvqbbGH111MwM/GHyJp8hMRUnWg7XnL9GaO64GlNaLaM9BnLyqHWXTSAmDvw62mrapMaAWiT0tzbt6YhUtIkIGz+OY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=V12enzfM; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V12enzfM" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-486fc3ac9fdso4285665e9.1 for ; Sun, 22 Mar 2026 12:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774206435; x=1774811235; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yHNkiyRvuF9AQ8guLO6hV3hpVtlWV/mWDZ+jV3RDgbg=; b=V12enzfMJeUCA8PbnLb/J04GReoi223CpNFVd8PYSp827w4r3XYVqOPcb+drrGAhbY 15fBceS/prwIkCdM8O+m+bWGlN0IcJBf1AfT79FBOY96EgylEZ9TaGWVmlgneIVTqYhe ksG6+VsxuNpY0i/S1R9LyK6pewoo7aeWRL6lX9YnDuYB+UEr9WeAMXpjNZGjli3N5r0r 2XMXPHUXCg55YDWnc9jO4kl592IO+iaztMFP1clHqogkY60rfHoVpNTVndsQ14JMqp4I M2MWEDufquzB5zz7+hWsiXvWk6mZiknHUQ5m0GEUxNZyOhuVvvklMTegH/vHxtmCYCJF eAoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774206435; x=1774811235; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yHNkiyRvuF9AQ8guLO6hV3hpVtlWV/mWDZ+jV3RDgbg=; b=KPIp0ojW5SQRKjz69F6MXJDj81NcO4BKdcjVIAxX5f4gDbX1UTo/aM2YjlKq8Tl+s6 zhDihK4p4IrC9BZnL64KVFjemZgOSCvo4SRuuDtyPA90AgdcWUX0WZ1aKwJYGThFi34I DqlbmVqhM1KtQMEMNNHmcbh5l3ayKzmzJm0x++NlR45C3bq5vOZweeWrajAhNbb3UHTS imotNklWZmG9e2IjOYXYhDPXWs8RMpOx67LfBHDVY6ulWzfLdt4E1aL4qCFrBS+Tc68F STRDxs4eHvPZzHZcZ1JxmqBDizBgAFKrfRj8jjam/gHCKcQBRAXul+c5zDecpzbPPvUM 2gQw== X-Forwarded-Encrypted: i=1; AJvYcCWln9lvUXPliW5t8o9Hd6CP+4airjJ4uzgqU1gH2xd1OIadhypBxMhqPHkgb0iUu0dPLK8fEU2SvJEA+7I=@vger.kernel.org X-Gm-Message-State: AOJu0Ywj4775zLcE2FyGTDsN1NFsXWhwFVuWzjSI874ayf1sI1o3SCVQ 2GDeFxAB5sHOYlrh/D7xm6z/0qbGdabcK/Gbu1ubG6WJ7Lm9p6bvbFLf X-Gm-Gg: ATEYQzxdYvd1a2rzxmCBinEkBL9zffjSh/2YZs/RisWAUGFkkF9n9nJ9RVTwS6ft+HX OGVeMQZHpp48WSm+TlbFeY5KXGK77VyPeS8y2LHQSR51eeqA2ekDyp4Y00HO04wOBAlY0gG8nEs O7lauNwZ1XEWNpuhBuF5fZcfrFeAmyLi7JZDbiKfaARK4I55mhXTW4YdzOZvXC4NrtcyBdmvrcA d0I4XEv0HoEXZzvdaU/E6ZGhk/9j0qT6q2Z4w0eB2gTPUPlxk/ZQTCah81OuHan3E1GSXa1zqx8 tBt3G/n0/i5NWPjA3i5Ym9l20Q3q7gj7icp7aH79czssa0d4m7uZHJaJKLapois4oouV6+BZUHx 6viHIkvMUyrHnVu4iB6QYMCRwIrmHR0E6L5S+J/BxGRdGW+S1X/zIW5kHFwJNgevD5aQqONrFnZ sHmR9oy3hS5djWSufcmdOa+m5BRn24FJS3Us+EZn6ssoT7fc/v8oIIxm3HKLwe1hwpJ+G1LwU= X-Received: by 2002:a05:600c:138a:b0:485:3177:d805 with SMTP id 5b1f17b1804b1-486fee29279mr81465475e9.7.1774206435068; Sun, 22 Mar 2026 12:07:15 -0700 (PDT) Received: from localhost.localdomain ([46.155.1.197]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe868cb1sm63340595e9.5.2026.03.22.12.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 12:07:14 -0700 (PDT) From: Emre Cecanpunar To: platform-driver-x86@vger.kernel.org Cc: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, krishna.chomal108@gmail.com, Emre Cecanpunar Subject: [PATCH v2 3/5] platform/x86: hp-wmi: use mod_delayed_work to reset keep-alive timer Date: Sun, 22 Mar 2026 22:06:22 +0300 Message-ID: <20260322190624.35162-4-emreleno@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260322190624.35162-1-emreleno@gmail.com> References: <20260322190624.35162-1-emreleno@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The keep-alive mechanism re-applies fan settings every 90 seconds to prevent the firmware from reverting to automatic mode after its 120 s timeout. Fan settings are also applied immediately when the user writes to the hwmon sysfs interface. schedule_delayed_work() is a no-op when the work item is already pending. If the user updates fan settings at T=3D85s, the keep-alive still fires at T=3D90s (5 s after the update) instead of 90 s later. This shortens the effective keep-alive window and may allow the firmware timeout to expire between cycles. Replace schedule_delayed_work() with mod_delayed_work() in both the PWM_MODE_MAX and PWM_MODE_MANUAL cases. mod_delayed_work() resets the delay to KEEP_ALIVE_DELAY_SECS from the time of each call, whether or not the work is already pending, ensuring each user action and each keep-alive expiry restarts the full 90 s window. Signed-off-by: Emre Cecanpunar --- drivers/platform/x86/hp/hp-wmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-= wmi.c index 41769c0861e5..a29f34588055 100644 --- a/drivers/platform/x86/hp/hp-wmi.c +++ b/drivers/platform/x86/hp/hp-wmi.c @@ -2342,8 +2342,8 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hw= mon_priv *priv) ret =3D hp_wmi_fan_speed_max_set(1); if (ret < 0) return ret; - schedule_delayed_work(&priv->keep_alive_dwork, - secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); + mod_delayed_work(system_wq, &priv->keep_alive_dwork, + secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); return 0; case PWM_MODE_MANUAL: if (!is_victus_s_thermal_profile()) @@ -2351,8 +2351,8 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hw= mon_priv *priv) ret =3D hp_wmi_fan_speed_set(priv, pwm_to_rpm(priv->pwm, priv)); if (ret < 0) return ret; - schedule_delayed_work(&priv->keep_alive_dwork, - secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); + mod_delayed_work(system_wq, &priv->keep_alive_dwork, + secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); return 0; case PWM_MODE_AUTO: if (is_victus_s_thermal_profile()) { --=20 2.53.0