From nobody Sat Apr 4 03:27:32 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 C080D3612D5 for ; Fri, 20 Mar 2026 23:56:11 +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=1774050986; cv=none; b=nuYqQPdM6hail27SyudqAqTwim0E2kCWZiKYJAfw3olfjv7n3y6G2W+nO2xug7Fm8wTdBcImP3H2wKW4P0YHThD9aWc8sSynrW+JQ4QBKEuSsrF3u6IjI9lqxl+eLhsbjtFlQW6ntgPLJZIWWfpqJSQJzO+7xV8GMzIUCZGYMYM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774050986; c=relaxed/simple; bh=cUQdFgJp+vRzURST+mEj40buJgJjr19u5nHUQ/zSxsE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t/ZHrMNqsqbdp61tpab4Xr5lksEnglSSRP0bYA5z+2ELdiiyT4Mc/1qXRftHPDxFBrt47cBkjG5VxwG+EIFj7d7x1fIIoz/Q2YItns/A8BAU59hUwYeigcxNDECxdMicpudx8XGjX/li/Rt2S+/FmdDgnETU3VJlsANjwpl5gW0= 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=gfIszpX1; 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="gfIszpX1" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-485358f43e7so3009485e9.2 for ; Fri, 20 Mar 2026 16:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774050970; x=1774655770; 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=SMegNoYPQ15g9bb1XM2RAfuMgiTFEwFZRaFEUS/laHQ=; b=gfIszpX1THsfW7/L0pT8qtX/636+zxwq7Ne6oduRu2N9F5YlmG0Rztk7O77kowwoiv NG1i6eA5aCJJkFtRWXJFKr/SZO0YbknBtnYO4uRzVF5TpZkdBeu/SOOXpi4ps0wiTwW6 A+qbkYoLd0HjCTxiCljaMFB/hdo9PCubY6JKtViL80Df2TQprq4VguxF4Mn/8KScfWLf XA0vA9NAydB6U6LZcVoQzDGTVfJ9UMNiBYPtm93SfwcyvIYovhjGjzNUNA2Pw1swf8fX Z5ZT5x+hgy0reJQQMfSdesK1Ouy3sE72ULNzqPFtf4nUHQgKlskLOmjsHdE8p0qrOCBU zY4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774050970; x=1774655770; 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=SMegNoYPQ15g9bb1XM2RAfuMgiTFEwFZRaFEUS/laHQ=; b=bcY/LhHn9++mwavJYvqtX4kcKMZNq7EpnUzgz7R/LgVx5bIXN6qiQhgkfHZNsIogYp 8mRhOqoUB0o546bS6Kxcb3uUkzQA1ly36EUDepzn1WebAipvFSEhrYJv0RV+Sp7UIf9a rEs9som4OeVvB8F56n9Fgde7wFKtEJaCigIHhynLWVJiOD092RuDUpDzC1A1usoUIAKB 3d9t4KeR4M6FpNdgb71WHYiD2dgm8huDVqlLgQW7kcFOVPm5cY2uZCyGKP6jIpU0hMSc X8lJXwWKJN24Re/cNf+S2OT8knXRVN0uEFdTqGvxln6YqkYtGR5TfjVntX46BEWc8dGf 67cQ== X-Forwarded-Encrypted: i=1; AJvYcCV7K2/x9tQ/MaGZesAJqXOoYB0K4bgcHvkAv8ilC827e2OaZ2wSEvbVDMMGrELUfqs48iIGMeAyx8laI1I=@vger.kernel.org X-Gm-Message-State: AOJu0YzI9XNx0XII8dCNqRpjzfdq/ahQ1ZnNazt6CE5g1miXx3TkNDZv muEpIbgJdW3NGmpYzj/Lcl2julAT9IwiagTe5Btznw5T/iR54vgkHMGi X-Gm-Gg: ATEYQzwhaluLDVHA0I+7TlolOzaX7GtQSA7oeWAWtsA02aSMLLowIoya9tWqw7cXFpi o/dYJtKHqum3v+rptXX+XXiQqZ8Z8mByHiEMbsJGiikg/EM8NqO/R92SG0XDP+mC4Kp+see7Olb H17g0eW+4Zqq/2fOzGi0vO3lgXut4Bwjn8WubGD83Mf+LFx+3JK7ErKnN/l0Mh7dPZkyVsA8XWV VkK7Xdm9zqfP0exPOajS/VY/DloNFZ+XXwHXHRfqVKaY7X2ijNyQgq2Rw4k8zmf35sIiHKT6EIj Auv+Q5zQnav9UEUQZorBCiA+v+fSMRzpwORC2XY4wnlrQtc8dqRIC5OAtL/+lMWw8ylMa3JEVE7 PleeoIYAdgXpasUSNZ8Z54zUG0fBt8+wCHNfilAIf3hxwtGffWG0N2Sn2TZwl42X/WUlPKFKHjU YB/JKHPoTWjIS2/efSnBWstEgUdgL0+0SVuWTnhtRFbFjuWA== X-Received: by 2002:a05:600c:138a:b0:485:3177:d805 with SMTP id 5b1f17b1804b1-486fee29279mr39897345e9.7.1774050969662; Fri, 20 Mar 2026 16:56:09 -0700 (PDT) Received: from fridge ([195.174.58.89]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b6470c239sm9663418f8f.27.2026.03.20.16.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2026 16:56:09 -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 2/5] platform/x86: hp-wmi: avoid cancel_delayed_work_sync from work handler Date: Sat, 21 Mar 2026 02:55:54 +0300 Message-ID: <20260320235557.56298-3-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" hp_wmi_apply_fan_settings() calls cancel_delayed_work_sync() in the PWM_MODE_AUTO case to stop the keep-alive timer. This function is also called from hp_wmi_hwmon_keep_alive_handler(), which is itself a delayed work handler. If the keep-alive work is executing and the fan mode happens to be AUTO (e.g. a concurrent sysfs write changed it just before the handler read priv->mode), cancel_delayed_work_sync() tries to flush the work item it is already running inside, causing a deadlock. The workqueue documentation explicitly requires callers to ensure this self-flush situation does not arise. Replace cancel_delayed_work_sync() with cancel_delayed_work() in hp_wmi_apply_fan_settings(). The non-synchronous variant cancels pending work without waiting for a running instance to complete, avoiding the deadlock. The synchronous cancel in hp_wmi_bios_remove() is unaffected and still provides the final cleanup guarantee at driver removal time. Signed-off-by: Emre Cecanpunar --- drivers/platform/x86/hp/hp-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-= wmi.c index 0cb2a2b31998..41769c0861e5 100644 --- a/drivers/platform/x86/hp/hp-wmi.c +++ b/drivers/platform/x86/hp/hp-wmi.c @@ -2365,7 +2365,7 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hw= mon_priv *priv) } if (ret < 0) return ret; - cancel_delayed_work_sync(&priv->keep_alive_dwork); + cancel_delayed_work(&priv->keep_alive_dwork); return 0; default: /* shouldn't happen */ --=20 2.53.0