From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE1AB3A71A1 for ; Tue, 12 May 2026 14:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778596047; cv=none; b=egb3zI9DdxfA6rzEdK6bZk0Zpj1fE7yJ5QjnFIdVUCtTfIQ9qWUkEn69EIvkgtFad1I1ZDVyCU+qPo7lvfRcYPD9v3O2ya1EWTtSNbM9rWsTTknm5zoUvSrvTGyMAIqBF3e/SJCkSaGhD4c19LJtfNbnKl+ys622y2gN20MyzQM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778596047; c=relaxed/simple; bh=6BF9x/ECSdm1yeK3i92blU3/+tR11ll8ZjZf8jmg21I=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=vGlN+kP5m1wWf+lJ6uYbqyPdcpgZFaIKvLnnnuotLQmCfebT3+6qHdfvoo+Wfc6FJ9dyRzgXbYwitaEw9+nTUU8Yh5IPZi5VvNUcL3W20MSd78YvaHhkxgltXvdDj+u43Kkdxf7mld+1jJUSFSdXlOwjpW13bE3iPooEfGSyZqI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mQ+qxCR6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="mQ+qxCR6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 630D3C2BCB0; Tue, 12 May 2026 14:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778596047; bh=6BF9x/ECSdm1yeK3i92blU3/+tR11ll8ZjZf8jmg21I=; h=Subject:To:Cc:From:Date:From; b=mQ+qxCR6Zb6BpAPj69jsws+JtIyQB9Yq+tn7VY1rwRqKyzgsBvTosZ1ENwa/oA8yy kfNCCq5/JQVDF8c5vV/+RmzwrDq+UrM7Dq+aDKb2Cf+4hifdNWmHoSUOYyzn08Kx+t CVXpZ+g+YGIW/UbQ2vUsBOrlERoiLdOH/jr454MM= Subject: FAILED: patch "[PATCH] power: supply: cw2015: Free allocated workqueue" failed to apply to 6.18-stable tree To: krzysztof.kozlowski@oss.qualcomm.com,andriy.shevchenko@linux.intel.com,sebastian.reichel@collabora.com Cc: From: Date: Tue, 12 May 2026 16:27:24 +0200 Message-ID: <2026051224-giver-game-dcf2@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x db254b0b232358ab1aeadebe8d147c99a3569559 # git commit -s git send-email --to '' --in-reply-to '2026051224-giver-game-dcf2@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From db254b0b232358ab1aeadebe8d147c99a3569559 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Thu, 5 Mar 2026 22:45:41 +0100 Subject: [PATCH] power: supply: cw2015: Free allocated workqueue Use devm interface so allocated workqueue will be freed during device removal and error paths, thus fixing a memory leak. Change is not equivalent in the workqueue itself: use non-legacy API which does not set (__WQ_LEGACY | WQ_MEM_RECLAIM). The workqueue is used to read updated data from the battery, thus there is no point to run it for memory reclaim. Cc: stable@vger.kernel.org Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/20260305-workqueue-devm-v2-2-66a38741c652@oss.qualcomm.com Signed-off-by: Sebastian Reichel diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c index a05dcc4a48f2..286524d2318c 100644 --- a/drivers/power/supply/cw2015_battery.c +++ b/drivers/power/supply/cw2015_battery.c @@ -694,7 +694,8 @@ static int cw_bat_probe(struct i2c_client *client) "No monitored battery, some properties will be missing\n"); } - cw_bat->battery_workqueue = create_singlethread_workqueue("rk_battery"); + cw_bat->battery_workqueue = devm_alloc_ordered_workqueue(&client->dev, + "rk_battery", 0); if (!cw_bat->battery_workqueue) return -ENOMEM;