From nobody Tue Apr 7 12:52:06 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 6C95C2FE075 for ; Sun, 5 Apr 2026 14:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775400322; cv=none; b=K+alVFatHUw/ZuHpY+5yLj+lt8t3yzG1gGQzx4R1vmmm/x8PixoSokN0SSf7RjHVH5Kge1+dFVH6Egktvoj1I4RlifcXu9oTJiNJgRC6oboqLa6E6oLtjpb3HQeCPbhnz6E3KotpCYVvALGxEghol3xUBXFbpggzhGZ0zIzVpAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775400322; c=relaxed/simple; bh=YxZ/d8hWc5Dojxq2+WQ8y//zQ0MV75jV5AaZq1iu/u8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QDQGGDi9X7i6/EDMNc2lVO0PqnyFrsJVOYnWtq3NNG/oM5ovO9x+GguTf9OpZuBCuQ+6Zj1bYGdKFN77qdoWom5fbYhZEN0xRdp6ILvsnWs/pen1XTrAkPQFZitnB6d96W7VeXeHP7je3ZDC3MKFT4VgzblWzIJkXdHS6do8qTs= 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=LcUd8vkn; arc=none smtp.client-ip=209.85.221.43 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="LcUd8vkn" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-43b9974ac31so430158f8f.1 for ; Sun, 05 Apr 2026 07:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775400318; x=1776005118; 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=dxSRimATBcfYurd5oZ/SGQyL2ML4iFG/Nsr5i0TaWFg=; b=LcUd8vkn1h/cW/r43Vu80VhpuS1TwPrHnLcORHnFyyogIJ5iB1CF4zAs3kjXkUAC9G wbT62Yy0v2MMF2OjPnu5/rtedEjsAfWUQxodzlqj0AvluKJpwqpgNUp1E4IrvJbmEDzr 6r91ovLnSR4icYEquVTn8sNqLP92iC+iqq/lD7MqTzArjdWfwIBE7P4DlXGoDryMjEWS 1CmTV9+ro9Xho2dknUUA/oBtt43M7C97zhworUsJOZRp5a5Ig2uw37QcywpWqO7x3rTT GNduL6tOLj/ppZIyyzkxJ/AF0FXOR+1Mhe7xHOx7JXJf23v3rJ0UfgW0dfydv964ASSg U2Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775400318; x=1776005118; 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=dxSRimATBcfYurd5oZ/SGQyL2ML4iFG/Nsr5i0TaWFg=; b=iYHTX55omUI7/K/2jPiceDQ4DbSwcV6jnmfBxKjWS9KdcEgfXi/qTWfBh74SkgdllA //3QdGgXozrmN9O0FYDFfHwC3J8HveKd3GiJSU15JPAzilQWLgdlBSM361J454xS1FJ1 JBLUGo93i/4vYk1JaCwQfny5C0I7IzAyT8iFolE/rrvQqiJt76aykeMlm2C5SNM+yT8A l8qqc/2ZiIDpRSgQ5OL7DipzG6kOE7Znmh5lXCFyhvLaZ2Vf1GBWclVtRxwXba6sCaHG KtQG02owCWo1qiPC0pIfTGK7aJzQrpLgXsu0SWOVF+RdoaS6YrHKipSD0OkNi2aYxx3j 8fjg== X-Forwarded-Encrypted: i=1; AJvYcCXBtGgTcZcJ+9fo6DeCixz7gUk4JofvgzUs1PE6R9i8oeOWumYVSpLCo2YT6gm/dfsI5w0SzUhEmlq5PpU=@vger.kernel.org X-Gm-Message-State: AOJu0YxYxWqvfUm/loCLRcYhHkVFSBSdFEe26uJyoFewR3T0hll09GTM dzEosFEj7Owjjb+QeNjO0x5yi1bDjY2kj8ds9G5h+9VJvo9JVQfTgwzU X-Gm-Gg: AeBDiesmwKMgN66SVat14pQdLl8NjIJaTIYZ1dz38co2WgQXsvsyvolmGLNJVXfJ92M jNbBDk+JuTl6VlLi2Ba9uTwUdBtDEOtw58zSH7pPkeTuYHaN4APVBqZCCs6KPQQfp1RJjr3JEjb ymOqgYMirZn8XKura2oXyqlvjwQBgjxfEsf/0h2yLE3iTgs3+HISYH30xALkwhUlZFSqrAoXZev w7Vo2vTU7+/2b5qznl7cDl5LLnRP2n5897G5XuTiXpBRh4s4dEPjge2ea04xCY89SHE2GOvw404 BfzOYMGALnlDvPy4mWBz5jBnBOIJmRrD9+RPlZwltI+AblZzCuo5YZICUHVIDlEp3GKbyem9+ZK 4XErF8KXDecBXRNoTIWHxxfBdZwY571SO0ysSitOvmqA9LRQFzScFyjHdzjm/otf2/9rtPaBR6f Q0Ge6bNkmSYRpCI8fCPh6laave3E0g5TXGyUbcJDBggLSmGhhXEp5zdbysZtc= X-Received: by 2002:a05:6000:2308:b0:43d:3141:77d8 with SMTP id ffacd0b85a97d-43d31417991mr4516340f8f.2.1775400317649; Sun, 05 Apr 2026 07:45:17 -0700 (PDT) Received: from fridge.local ([2a00:1d35:c836:5700:77d9:f36f:3748:d642]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4f1a99sm35698799f8f.32.2026.04.05.07.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2026 07:45:17 -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, edip@medip.dev, emreleno@gmail.com Subject: [PATCH v3 3/5] platform/x86: hp-wmi: use mod_delayed_work to reset keep-alive timer Date: Sun, 5 Apr 2026 17:44:58 +0300 Message-ID: <20260405144502.24944-4-emreleno@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260405144502.24944-1-emreleno@gmail.com> References: <20260405144502.24944-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" Currently, schedule_delayed_work() is used to queue the 90s keep-alive timer. If a user manually changes the fan speed at T=3D85s, schedule_delayed_work() leaves the existing timer in place as it is a no-op if the work is already pending. This results in the keep-alive timer firing unnecessarily at T=3D90s, just 5 seconds after the user action. Replace schedule_delayed_work() with mod_delayed_work() to reset the 90s timer whenever fan settings are applied. This guarantees a full 90s delay after every user interaction, preventing redundant keep-alive executions and improving efficiency. Fixes: c203c59fb5de ("platform/x86: hp-wmi: implement fan keep-alive") Signed-off-by: Emre Cecanpunar --- Changes in v3: - Reworded commit message to clarify this is an inefficiency fix, not a functional bug. 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 79d6bc3cd223..2932cab9aa78 100644 --- a/drivers/platform/x86/hp/hp-wmi.c +++ b/drivers/platform/x86/hp/hp-wmi.c @@ -2361,8 +2361,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()) @@ -2370,8 +2370,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