From nobody Sat Apr 4 03:27:34 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 052BC3F54BA for ; Fri, 20 Mar 2026 23:56:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774050990; cv=none; b=fmQAEjJEvwvLkD5ogr/G/dbj5aLJtWDXv4/dmyELmIvXAE1OjNWNGx8J2i35ScAZBjLyW7uT3OFanOuVc1wVLo3JmL7Ysx5oCr9wgBfJb6O7hvytYPCdlg7auV1Opl6om/sNt7G+5iVnNRZaVrMgWrPaAaifVk4sQIwfDZShVKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774050990; c=relaxed/simple; bh=oLKGlkhw2FIIbPnQj7+BVbg/ng9EcldtKCH1eAUAjOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QfFzoIW9vMYhTIJ2MBmHg9dYbRFIRb2yJkWRYw0G/lepTSPGy7Gb74vj1AeDfTMaxNWE+ubvM/Mu/ps8+95HPzl/gHHQSPZ5B68sk2urlTT60N4A+fe8WxOjoxTB7o2m+fX3e4toXvEYd4PxP91AUHmqZ/xqp0S083otVvNZMzE= 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=gnqQw7Rl; arc=none smtp.client-ip=209.85.128.45 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="gnqQw7Rl" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4836cd6e0d4so3050365e9.3 for ; Fri, 20 Mar 2026 16:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774050971; x=1774655771; 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=gnqQw7RlCkHfep/q0tlEo4epoADnRob3nUACRDSd7beNuRq78smRzVriWb16Cii7dz hmAkQKoxuIWxUjhMpLsWOiNAZB0kF6wDxbwym1U7y+v2R/I51XNBYfTQG4xnV9BsAqSA 8s5EKWqcAg3oLNE0LNpVKDRnOpqaccg0kERpzBT3WSJ+5uTteUFFzxKxFOmlwt1B5+oy hbUoT3zWxXUeEH4dTaxF/3j1N4J9Gs0KmXzGQZFqM191Mu2RtwVnsC8qYa7639TdQn3Y H5pWCX1Bg5ytvDBvg8deKeAz4451UAU44yycHfx7HUH4GKyP+UhrvCKjkf2/D/yBuKAA 8NuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774050971; x=1774655771; 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=Gm4WG0GNrKsOGrS5qBd3C71l80y1+PV60UWewQtIFvoUP68fmiWQ8gWvTlYPXizGot IRSh5QDjWHWQfHDYe6GPQPU3ALdK3s4dmIq4VfvLWcIB4MlXjzAMXnTpP87p6HMbLYI7 fhsWuHAylh7GQ2Nm9jyFS7pMW4ysDfR1U+/wTZ6A1lCfw0pPgXZaSwjKcrDv8vwHwlhK 0imwD0eQcZdna01IQer0AP3BRf+A/FaNyjhfaAGfYq0U+e/9thL6fobHZXRWPYlf3pwK 0j/cgJCvdqjmIg6kvRfMEXkgYZKREqzdcMOKGNVkCUfmJ64n0vCV+24R1e5j6qwGdG+q s8OQ== X-Forwarded-Encrypted: i=1; AJvYcCV2V1AHL93WDJqrYu1wGF+xYqkH7vENTbEF6YaLWzG4piC7aO+eUN9xzJshwxJ8FJLTQDttDOkyDVSfh9E=@vger.kernel.org X-Gm-Message-State: AOJu0YzyrH+zlSHEzJiTwT398MfltEZKotbhsO3Dh+paj6UuqEZtmsd+ amfFKut0Oc/0JiaYkSBAXMjoXcVFPkIWxK+NivtXfRjvhQSWQzS1FKc++OFGyx+d2cc= X-Gm-Gg: ATEYQzz76z4+cJGdaJ+yzHYOIERE5c2GGNVVxd0XyU2E5I/UDp68fCWXvVbqLsRU/OU 4Gg66TQpQ7zg0ckAJ8kQW+PIv2/tQV0/oqltD3h+x4Nk9j7VH0nLV9VvN9Z+HjYeC/WXGTEpib4 r7k+lJZ72gKctVXUagpihMrCNCoK8CtvCd20xcR/W3OBf26kiY9RbHH7egeu5lvE7MLvjUhmFho 8kSFq4+EwHDngaPhwFD0oKftKHMtg7rdMjvEF9Qz7YulM3521H25WwZi96jHEkyPjN0U++R+uUg jUroEH0cDexNppIIq5NSMdEhHXP3VoZ0dK7E050IAY6MDUjNDZdX9gPtweR3nfaPshjpSHpQxpZ zFOsdVwCjjUuDKEXtPVZ2hZxzhTrWk2NGJ1fCmrwVeavDeHK1Px2w+Qeyk+1SzgEBA8MaY701an ieMNXoifi+UeIv65kPO3ej8nsPdmyWPZuD9C8GBU+y54Y1bQ== X-Received: by 2002:a05:600c:630d:b0:485:385f:674d with SMTP id 5b1f17b1804b1-486ff0230d9mr45474065e9.8.1774050971412; Fri, 20 Mar 2026 16:56:11 -0700 (PDT) Received: from fridge ([195.174.58.89]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b6470c239sm9663418f8f.27.2026.03.20.16.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2026 16:56:11 -0700 (PDT) From: Emre Cecanpunar To: platform-driver-x86@vger.kernel.org Cc: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, krishna.chomal108@gmail.com, linux-kernel@vger.kernel.org, Emre Cecanpunar Subject: [PATCH 3/5] platform/x86: hp-wmi: use mod_delayed_work to reset keep-alive timer Date: Sat, 21 Mar 2026 02:55:55 +0300 Message-ID: <20260320235557.56298-4-emreleno@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320235557.56298-1-emreleno@gmail.com> References: <20260320235557.56298-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