From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8406C43458 for ; Tue, 30 Jun 2026 09:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HX1nHvlk3c1+dgVJ4v3uKemvU735Z6kr6zZ67avlLqY=; b=plye5TUTGVx7W9E4BOlMRcPO7z CmqsPj5Iav9KB3pzIVhA1eMdQlk+h0bIylZVRj/L5nVGuMCFIdOwCnBIy/CVfHchDmEvSNtIfvF4X b7L9kUJ2nNIRNoc7mRYtrtpH5P/4UFtwaFO4LTq2o+YQIfVlLwZLWl9WMFAhl743KpIppXJEaemGq C9RyHGjpuie17cp914Fxz8Rk5YjqCTJzotUIVy01o7dIBKlay9dqIDrvNZJnSFswjoR69VU5RW6q+ Q93yfrW5q/DRWcqecTIcq5F7Wu28kmXje3Gwww0oGlr9Wec4t9nqsbNooylFF1VAJ1n62gYvgGWPM tSl9DItg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1weUQb-0000000GLGg-3Ijo; Tue, 30 Jun 2026 09:06:50 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1weUQW-0000000GLDk-4B6t for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2026 09:06:45 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 722F160008; Tue, 30 Jun 2026 09:06:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DC1D1F00A3A; Tue, 30 Jun 2026 09:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782810404; bh=HX1nHvlk3c1+dgVJ4v3uKemvU735Z6kr6zZ67avlLqY=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=I6ENtvzL6mKerxs3s0GmPXar3Dvn5z6Y/6x8tizjniMcko7B3RTaSTqMzebpGDsEQ IhiK+7z6/cIwWBd+aztR19TwneFo6n/TR8dNft2IT8wVu0U+cGHup/jKbFd50244mV Pvj+Sd85unMObaL0QcnGgZ2aJWFjwrpljdKdQZsapmXbwaJ+kDYddyIi6chYZAmMUV 1Vv466DCGjMlFq29E6ZqD/ZHLi5yPelNJcy3AeUm6UAzGw5DX9LcCRzB6XpUVrd6Cu DKXK7f/a/XB+i46CAVKbWuwutzVa6hfOBQ1AYYFmYEksmoyrgnFikCg/rOTxQElcLw btsikdOiMpu6Q== From: Sudeep Holla Date: Tue, 30 Jun 2026 10:06:02 +0100 Subject: [PATCH 6/9] firmware: arm_scmi: Unregister device notifier before IDR teardown MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260630-scmi_core_fixes-v1-6-f932c1e51992@kernel.org> References: <20260630-scmi_core_fixes-v1-0-f932c1e51992@kernel.org> In-Reply-To: <20260630-scmi_core_fixes-v1-0-f932c1e51992@kernel.org> To: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Cristian Marussi , Sudeep Holla , Sashiko , Sudeep Holla X-Mailer: b4 0.15.2 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The requested-devices notifier looks up protocol fwnodes from the active_protocols IDR. During remove, unregister the notifier before releasing and destroying active_protocols so no notifier callback can race with the IDR teardown. Keep the bus notifier registered until after the protocol state is torn down, matching the existing remove ordering for SCMI bus users. Fixes: 53b8c25df708 ("firmware: arm_scmi: Add common notifier helpers") Reported-by: Sashiko Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 4b369b003003..6df0fe055d64 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -3402,6 +3402,9 @@ static void scmi_remove(struct platform_device *pdev) scmi_notification_exit(&info->handle); + blocking_notifier_chain_unregister(&scmi_requested_devices_nh, + &info->dev_req_nb); + mutex_lock(&info->protocols_mtx); idr_destroy(&info->protocols); mutex_unlock(&info->protocols_mtx); @@ -3410,8 +3413,6 @@ static void scmi_remove(struct platform_device *pdev) of_node_put(child); idr_destroy(&info->active_protocols); - blocking_notifier_chain_unregister(&scmi_requested_devices_nh, - &info->dev_req_nb); bus_unregister_notifier(&scmi_bus_type, &info->bus_nb); /* Safe to free channels since no more users */ -- 2.43.0