From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 BBE2D3D1CCA; Tue, 21 Jul 2026 18:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657411; cv=none; b=KSjHNAVy7CCYxF46m9tO7Z79OeuJfuFRs3rnUzF9jwyu7ji5VyHI3QN1+2QJc/ZtiO/N4QOnw4go5Q+HjKkv6mQa5ysn2muwvcjCxTszhUIsMDLOUjcYe3lx0kdTb6NbPuzwVxIAjSu+e7taXQphgDgUO9E1ql8UqmHoiCPopdA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784657411; c=relaxed/simple; bh=O/j7RD1CZterFxmdgk74lSx6KBQxEqIZLnUzz6p1uqY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HSKW8Ey2Mk+i4yHJSLvuksoQLtLC2hAzXA8dK44yDo4+5ekxNhR2+df1Qw9urTFEvxTeNr7Gsn3WiIXgd5tUqy4O22QaYe230FhYslvNBdvGW9qIz5GoYQufLDWftizoLEhLt2bdhUK7o/JTSl4fPrVn2Yzu1HM7F74I4u/J8nQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ST/zTgq+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ST/zTgq+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A9BA1F000E9; Tue, 21 Jul 2026 18:10:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784657409; bh=u+0ruFoxUgzwfXc+fPahwok0wgvQot/SWJflLxPkQ9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ST/zTgq+kk4JMnRxDkR3NE/6CxmepT99QebSid7HvEw38HqMURqWhBip9QxZcsoZy mUoHEbRM7IOqP1T9eNgHFNMNeup8IKIy2MNkx9Hv3vIukbh3rnL/CGM0ei8Nhac1zN yv4RaShdDc55Df9qLj5laVSb7SkGtrQrKYEcmgTs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Adrian Hunter , Frank Li , Alexandre Belloni , Sasha Levin Subject: [PATCH 6.18 0755/1611] i3c: master: Make hot-join workqueue freezable to block hot-join during suspend Date: Tue, 21 Jul 2026 17:14:31 +0200 Message-ID: <20260721152532.357532603@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Adrian Hunter [ Upstream commit 527756cb9ebb277dca12fff00af9fbb3b9ec8cc8 ] The I3C master workqueue (master->wq) is used to defer work that needs thread context and the bus maintenance lock, most notably Hot Join processing (which calls i3c_master_do_daa() to assign dynamic addresses to newly joined devices). Currently the workqueue keeps running across system suspend, which can race with the suspend path: - do_daa() may execute after the controller has been suspended, issuing bus transactions on a powered-down or otherwise unusable controller. - New I3C devices can be enumerated and added to the bus mid-suspend, registering driver model objects at a point where the I3C subsystem and its consumers are not prepared to handle them. Mark the workqueue WQ_FREEZABLE so its workers are frozen for the duration of system suspend/hibernate and resumed afterwards. This naturally defers any pending or newly queued Hot Join work until the system (and the controller) is fully resumed, closing both races without adding explicit suspend/resume synchronization in the master drivers. Update the kerneldoc for struct i3c_master_controller::wq to reflect that the workqueue is freezable. Fixes: 3a379bbcea0af ("i3c: Add core I3C infrastructure") Signed-off-by: Adrian Hunter Reviewed-by: Frank Li Link: https://patch.msgid.link/20260608054312.10604-2-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/i3c/master.c | 2 +- include/linux/i3c/master.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index a0cb4b3d33b92b..776b0ec3abe2c1 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2927,7 +2927,7 @@ int i3c_master_register(struct i3c_master_controller *master, if (ret) goto err_put_dev; - master->wq = alloc_workqueue("%s", WQ_PERCPU, 0, dev_name(parent)); + master->wq = alloc_workqueue("%s", WQ_PERCPU | WQ_FREEZABLE, 0, dev_name(parent)); if (!master->wq) { ret = -ENOMEM; goto err_put_dev; diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index c52a82dd79a634..cfe0285a5c381d 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -509,7 +509,7 @@ struct i3c_master_controller_ops { * @boardinfo.i2c: list of I2C boardinfo objects * @boardinfo: board-level information attached to devices connected on the bus * @bus: I3C bus exposed by this master - * @wq: workqueue which can be used by master + * @wq: freezable workqueue which can be used by master * drivers if they need to postpone operations that need to take place * in a thread context. Typical examples are Hot Join processing which * requires taking the bus lock in maintenance, which in turn, can only -- 2.53.0