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 39F7747CC86 for ; Tue, 28 Apr 2026 18:33:54 +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=1777401234; cv=none; b=SxzKtaY8/VVL/bD1atGYtDdXbWtf71WZVp0PzFQkpmRN/4dpDnGGka8XExJDNFvcNAZBICJFviejF69TbNb5etYxVu5nvCFDALnBDPKABYBo+CrFyQJ7Ns1H3eeAvft3GsH9J1dMrlEoEpQ2EREDmeiS4w+rhD1wrg76+zxCQ3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777401234; c=relaxed/simple; bh=yp/1hi9l3obsmLs0Y34XOImio+CPysYrpb/kn/OcNr4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qiD6cD6EIkhMPPGq5zGpfbeY82gn8idSfF2vKiuPVTWlE4lP0XkXEE2NPjR4caVa5ltrZL+nCYZTidgXZha1uXRDiTklsC/WvjQBa1edEcMaa/sZk69pwPIuNTyUFbq7n5UbQ/IyNUrH+KDZsViR7JQZWtwzNNN7mFfmdKYpINQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NHzm6RMZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NHzm6RMZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65F0BC2BCAF; Tue, 28 Apr 2026 18:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777401234; bh=yp/1hi9l3obsmLs0Y34XOImio+CPysYrpb/kn/OcNr4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NHzm6RMZuKHquVMwjNHGyeqjIACwQ9hQlVzTTudRUidmD0zGBx3B+98IZMhI0qRQN iUmcO+TRLDbQ1WPeNuWOJJ6w22K9IBQ64f9Fcq/jFZAO2GWoLk8yRp7mipXNLT8Htp jYX6iPIxaDMIFobas4eoWZKqN989QDIpTVm08k81slJVEK3hLA8kfZioBTzrSK65uo 9GSHlopQplq28uJyzi6vaKBkcyJ11Obn0LeJhXENXWcVn4P+VQGr8XwbWOHabUz1tx LTIFFofILknuQCvRYe3Cb4wAHUHrnFPn2rzsTTzazBdtmCOT4wj4aC1m++BXfBfXss XhZNkLc0lpLtg== From: Sudeep Holla Date: Tue, 28 Apr 2026 19:33:28 +0100 Subject: [PATCH v2 04/11] firmware: arm_ffa: Fix per-vcpu self notifications handling in workqueue Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260428-ffa_fixes-v2-4-8595ae450034@kernel.org> References: <20260428-ffa_fixes-v2-0-8595ae450034@kernel.org> In-Reply-To: <20260428-ffa_fixes-v2-0-8595ae450034@kernel.org> To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Jens Wiklander , Sudeep Holla X-Mailer: b4 0.15.2 Per-vcpu notification handling already runs from a per-cpu work item on the target cpu. Routing that path back through smp_call_function_single() re-enters the call-function IPI path and executes the notification handler with interrupts disabled. That makes the framework path unsafe, since it takes a mutex, allocates memory with GFP_KERNEL, and invokes client callbacks. Handle per-vcpu self notifications directly from the existing per-cpu work item instead. This keeps the per-vcpu path in task context and avoids the extra IPI hop entirely. Fixes: 3a3e2b83e805 ("firmware: arm_ffa: Avoid queuing work when running on the worker queue") Signed-off-by: Sudeep Holla --- drivers/firmware/arm_ffa/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c index 4e66c7325a4e..2241e851f7ae 100644 --- a/drivers/firmware/arm_ffa/driver.c +++ b/drivers/firmware/arm_ffa/driver.c @@ -1543,7 +1543,7 @@ static void notif_pcpu_irq_work_fn(struct work_struct *work) notif_pcpu_work); struct ffa_drv_info *info = pcpu->info; - ffa_self_notif_handle(smp_processor_id(), true, info); + notif_get_and_handle(info); } static const struct ffa_info_ops ffa_drv_info_ops = { -- 2.43.0