From nobody Sun Feb 8 07:14:56 2026 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011058.outbound.protection.outlook.com [52.101.52.58]) (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 2660C8BEC; Tue, 7 Oct 2025 15:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.52.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850348; cv=fail; b=uTAZClV4qmADYZPYClc/85lQY6pR8Ib4vCJJ5LBpKMiHe6TfmMY0IPjQOKZNpeMWM/OeMjUciPIigjm8Ab52Vq2d2vOQARsolZFmM5bmucJBGiNNGFlF+QQmW7jHrQB0MkMu89u9LwDicHwm5SF8Eu1cPO1Oyq5Zuq/7C/dAx+s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850348; c=relaxed/simple; bh=bFFjl9hAtmkQn5+3L2FgOQrWVYo4Guj10jx6uAMj3Qg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n2p5HBIMOYmA99+6xp8aHa2tnOSDu0UcLi24ptTBXknt2QT7MuLjLemmOpYGqYslxjwTAtXa/N8LV0DBx22K6I5Dtw58WUEItJiO1C4cZFgMj+LNuXCVu8MfPOSDf83ut9E3L6yehfGWedXWNaV7RwGQCuVXFQ/LA5KuZf+jj1U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=EJZzlg8a; arc=fail smtp.client-ip=52.101.52.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="EJZzlg8a" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TH76tcNK4pH5Yx1U2XZ6RPa5sqkJaeJYSeDu4QCR8LG7y9zE2EtMDSCBAivDDqsDDp0nHpJ//PHJE6V4Hug8FRjasNpUxaQa8WkxTyOv5qJrDuqsAIDujf3NieA1nRrw4ONuTw1Wt+N559HXlyUieopbausxyZWy4eyHhvadcADtNApsTXt7VjH+BSzNIV9UwKLhvFyV7guRi/7/OXS746KRPae3JB+C0kJ50B3fyub6O//v7fhrx7I4/uyNxHmHLMpULHUV1P5dhSL4zGDWVYVOoogO8Lpaqm/A9+gUuDAAc3ImQbeJPEgsVTfVu/DRfUCMO+Yl9StpjRUMaEMlnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oWV/KRRs4L719LemVNN1eLPmdwlyiDsedJHSf4vyD7Y=; b=Qla4J4cOE+ivh6JSv4iGnj3Xrac9kGjSNRnLsnvnEcFLmmDuumX6pslCO5pAEpYPap3HXyRRFXf7b7depNNoHiNGcuSyka8szh/WUAIRuylHV5V1CKz3l8owuNQPcLO6bEpe85lKCFonGubEaJ7ImQTzRxvcBOczoPPK0JgK4IkA2rfJIkjHTgndDdGr8POMDcC4miosBHkFVF2FMwoObe6KRchFQMidV2+1n2CCk12GsoUfWr0XILJlRhMF1grmRvv/rWs18SXE8ka4Ht0Ikp5WOIvgOgsOXSpefLtzlhq6qdBWhNLnrnTpR1sskKjJ2zSZ9fQOyekhCSFmTHmQZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oWV/KRRs4L719LemVNN1eLPmdwlyiDsedJHSf4vyD7Y=; b=EJZzlg8adjKFKHTc7VR4c0mJEkbOin1kIqqaoVbduXRY9qNiJYOQUgbTSA0l2VdoQIW5ujAMr+agiX4r6AQMWW2BB+HQ+MdaCXKr+W15Hm7Wo1uODonbCn1OgGh4ldVHzwhgdfIVaOWVBJ4hbCIyLAmw29LQJn2JWrsChGQ1h/g= Received: from BYAPR08CA0015.namprd08.prod.outlook.com (2603:10b6:a03:100::28) by DM6PR12MB4300.namprd12.prod.outlook.com (2603:10b6:5:21a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9182.20; Tue, 7 Oct 2025 15:18:59 +0000 Received: from BY1PEPF0001AE1A.namprd04.prod.outlook.com (2603:10b6:a03:100:cafe::56) by BYAPR08CA0015.outlook.office365.com (2603:10b6:a03:100::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9203.9 via Frontend Transport; Tue, 7 Oct 2025 15:18:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BY1PEPF0001AE1A.mail.protection.outlook.com (10.167.242.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9203.9 via Frontend Transport; Tue, 7 Oct 2025 15:18:59 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.17; Tue, 7 Oct 2025 08:18:58 -0700 Received: from satlexmb07.amd.com (10.181.42.216) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 7 Oct 2025 10:18:58 -0500 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Tue, 7 Oct 2025 08:18:57 -0700 From: Tanmay Shah To: , , CC: , , Tanmay Shah Subject: [PATCH v2 1/2] mailbox: check mailbox queue is full or not Date: Tue, 7 Oct 2025 08:18:27 -0700 Message-ID: <20251007151828.1527105-2-tanmay.shah@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251007151828.1527105-1-tanmay.shah@amd.com> References: <20251007151828.1527105-1-tanmay.shah@amd.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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE1A:EE_|DM6PR12MB4300:EE_ X-MS-Office365-Filtering-Correlation-Id: c64933ab-456d-46a7-a44a-08de05b4d706 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EKcIHWOSOTALXQC5GBBpNqoYYeUFtRtFGzpQ8XDuSP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WCMvUvBxIpmsdHsDycwo+b0uGywB+zDOR1X/f8wudw+SE+K8I7?= =?us-ascii?Q?E2LMnZ8UKJMFXZCr2+MyZdT7RqonHiTK3f77UfomKVt/QchiWQ0C8S+4u48y?= =?us-ascii?Q?uk1SVp0syKLMPLw8GTepxE7RL/QeL0SM4cZjJ8CA2r7JNMXAzidKwJjMderz?= =?us-ascii?Q?RdJcMrZ3Cf3UMpEGNBR9/chFqPKqjLuzMfm28D5YhsVHWrdH4ycU0XHxMR5m?= =?us-ascii?Q?nHC7FRINQNpqPIFFEvB9GhmUzvDyyW9RYP2ov22q/HkyQ46p8lfKq2RCyKCp?= =?us-ascii?Q?8l4i/kIaEdNf2l88zj2NoJ8m7m2Z2lvs9ozYKUr3Bf1GNvm8wi8uv03gPex4?= =?us-ascii?Q?eFDsAB2Rr/HH4HagGg5C23lHqxB3YRvKSEhO0EvIncYdz4Y+o4kwB8Q0VaHv?= =?us-ascii?Q?5tcPK7AR8PdfrZ+X+0F9YUCQMnFRgB0oM+uJG2VsJ2GN6RfGxLTV6psxvwNW?= =?us-ascii?Q?S4D10EHvL91YwmK+Rp3pq27Dnx+a2aOHyNYtrWoGIbtFLImc/oZC2zk4SWnq?= =?us-ascii?Q?NvODy4UftHrvPIWawuDARbM69tuzEmFemoCIdu/M0vAVXTd/EMzatAJOm2vI?= =?us-ascii?Q?ugUJT4/kihKT6SX1GVR8BXu9PWwOjVyyLNZJeE6FCbnKvhHGCV+DuY7jiLtH?= =?us-ascii?Q?sJMaecXxfoHlQDunp8Q=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2025 15:18:59.1632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c64933ab-456d-46a7-a44a-08de05b4d706 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF0001AE1A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4300 Content-Type: text/plain; charset="utf-8" Sometimes clients need to know if mailbox queue is full or not before posting new message via mailbox. If mailbox queue is full clients can choose not to post new message. This doesn't mean current queue length should be increased, but clients may want to wait till previous Tx is done. Introduce variable per channel to track available msg slots. Clients can check this variable and decide not to send new message if it is 0. This can help avoid false positive warning from mailbox framework "Try increasing MBOX_TX_QUEUE_LEN". Signed-off-by: Tanmay Shah --- v2: - Separate patch for remoteproc subsystem. - Change design and introduce msg_slot_ro field for each channel instead of API. Clients can use this variable directly. - Remove mbox_queue_full API drivers/mailbox/mailbox.c | 3 +++ include/linux/mailbox_controller.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 5cd8ae222073..c2e187aa5d22 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -35,6 +35,7 @@ static int add_to_rbuf(struct mbox_chan *chan, void *mssg) idx =3D chan->msg_free; chan->msg_data[idx] =3D mssg; chan->msg_count++; + chan->msg_slot_ro =3D (MBOX_TX_QUEUE_LEN - chan->msg_count); =20 if (idx =3D=3D MBOX_TX_QUEUE_LEN - 1) chan->msg_free =3D 0; @@ -70,6 +71,7 @@ static void msg_submit(struct mbox_chan *chan) if (!err) { chan->active_req =3D data; chan->msg_count--; + chan->msg_slot_ro =3D (MBOX_TX_QUEUE_LEN - chan->msg_count); } } =20 @@ -318,6 +320,7 @@ static int __mbox_bind_client(struct mbox_chan *chan, s= truct mbox_client *cl) scoped_guard(spinlock_irqsave, &chan->lock) { chan->msg_free =3D 0; chan->msg_count =3D 0; + chan->msg_slot_ro =3D MBOX_TX_QUEUE_LEN; chan->active_req =3D NULL; chan->cl =3D cl; init_completion(&chan->tx_complete); diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_con= troller.h index ad01c4082358..514f10fbcd42 100644 --- a/include/linux/mailbox_controller.h +++ b/include/linux/mailbox_controller.h @@ -112,6 +112,7 @@ struct mbox_controller { * @msg_count: No. of mssg currently queued * @msg_free: Index of next available mssg slot * @msg_data: Hook for data packet + * @msg_slot_ro: remaining message slots in the queue. * @lock: Serialise access to the channel * @con_priv: Hook for controller driver to attach private data */ @@ -123,6 +124,7 @@ struct mbox_chan { void *active_req; unsigned msg_count, msg_free; void *msg_data[MBOX_TX_QUEUE_LEN]; + unsigned int msg_slot_ro; spinlock_t lock; /* Serialise access to the channel */ void *con_priv; }; --=20 2.34.1 From nobody Sun Feb 8 07:14:56 2026 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11010000.outbound.protection.outlook.com [52.101.46.0]) (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 13D382D73A1; Tue, 7 Oct 2025 15:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.46.0 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850349; cv=fail; b=DdwsGTvAuwvLjOgcJG86V8+0lwE2zx7BUkRZhmMcmB1nWl40oDT+ujLoAS0RYxgLJg/hrbZY2DBqEm41J+R8i4PbKD1syv8U0dp3Kafmhh+cBdl2tts+O6BCEgZc57/MBaCZhUsZo5U+ksUgCiZMnBIuaeAgYXCpie7lJovo1xI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850349; c=relaxed/simple; bh=4VK+6f/+RdO0eR4JCElKzBTYbc3kOZh1x6FtXSJ2Ic4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VWGe+6iSafMs3UCZPhKaAiyagoeo9rzi4g5VXHPSbKd5peDZhQAoEHsljGanZfMf/gvqn0FArrrk1VEIIhaus6boT6vh9g88/IJy8Bl4TJ16ewOSWc2i+HJLBdP28p4YBqxlwaM8G5616RaMYmkAx3nrLE/jW6tR2fWAGAwp7OE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=oa5rpOgd; arc=fail smtp.client-ip=52.101.46.0 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="oa5rpOgd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VWxUGeL8KSEUMlLAgghnLDqL5vtf8hxUGooSeARIRHV3u4JF4rZBc2pyLKsUy1Met6JFw1iH6uyxnrRmXMflfLJ00rib8CzQ08y5k+FSCXVIsGfuTQPelJmrmc86c2atqXZmnaR6mQKWXW/a01+aBSIr/eQGoChD/kqTdbKSuyYRWej641EE7JMTcuSYgiqArSm8LMyfaHmp7X8/ZfjlhZyLY/F5WBY9FPowyKGslxt+un7e6khK/TdLuFbe+BnLptI1glyoPMO0+g9c9oC33qSQ7lyhsIhi/B6+/ghIV2eYiP9ZgRMfWzlEJNVq+Y3gEqC5oh0MmT1K2h7ki3qT2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h9bpMbOt2QZcivwxpQnb60o00Bb2wf/YgvINMX2AXwo=; b=uknfPt9ss1LsT0NCQtx3QwQd3u+FTL3OPQxo8DOS3Rdm3LN+oYdhAAD5SOMHLcof+0PpXjONzITU25BnDdaYqryqzRCNSdyswDoAXafpCZ15VFMKWaeDSttEt+Aq6oGZ4ejrQkSxd3Ei/h8RY8OZ0ACPevNggVAf+0m2ZYDDa/FiDgqq0VM2fv/KqLZFQwiPUZeLGk76oNZjqPzhGFS/DR/i92cCzisojFPgPj7BmS9JrvVbt03irNhQmLMunvKZ34UsGjJ2N77AcHA/OSmttHaTPVUzRf/I7Tz/arw9ji+sBFPlgt/p6b+Yd67q50/Mw9xcCV5w0WYC4I9EVgWR5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h9bpMbOt2QZcivwxpQnb60o00Bb2wf/YgvINMX2AXwo=; b=oa5rpOgdzSVs3D3Nco/GIx4eaevTA5GigTDhkBAglhwcCSh1cUwuDeRZA/aGrNRWOrEUmDDw/dGJMI/d11TBamvTGMV8T/TaYNPrDdFcGQz3p5a4tI/KS0+2qoKJvcne8fs09X9L1ZWhKinTMh4irgLo70a7sxvztsf6ujyix7Q= Received: from BYAPR08CA0026.namprd08.prod.outlook.com (2603:10b6:a03:100::39) by CY8PR12MB7266.namprd12.prod.outlook.com (2603:10b6:930:56::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9182.20; Tue, 7 Oct 2025 15:19:00 +0000 Received: from BY1PEPF0001AE1A.namprd04.prod.outlook.com (2603:10b6:a03:100:cafe::c4) by BYAPR08CA0026.outlook.office365.com (2603:10b6:a03:100::39) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9182.20 via Frontend Transport; Tue, 7 Oct 2025 15:19:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BY1PEPF0001AE1A.mail.protection.outlook.com (10.167.242.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9203.9 via Frontend Transport; Tue, 7 Oct 2025 15:19:00 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 7 Oct 2025 08:18:59 -0700 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 7 Oct 2025 08:18:58 -0700 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Tue, 7 Oct 2025 08:18:58 -0700 From: Tanmay Shah To: , , CC: , , Tanmay Shah Subject: [PATCH v2 2/2] remoteproc: xlnx: do not kick if mbox queue is full Date: Tue, 7 Oct 2025 08:18:28 -0700 Message-ID: <20251007151828.1527105-3-tanmay.shah@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251007151828.1527105-1-tanmay.shah@amd.com> References: <20251007151828.1527105-1-tanmay.shah@amd.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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE1A:EE_|CY8PR12MB7266:EE_ X-MS-Office365-Filtering-Correlation-Id: 23ab3cd5-a1ab-433b-ed01-08de05b4d7a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?oErimFbyEfjSWH1LqBPgZDQxmDa9tjAjyhCKXDOYcuwDb4DAohLGBYyu/IbT?= =?us-ascii?Q?PxLstq2z4DJpi5uHlzPrXmjQsKfXxrONSb0CiZGz6aLOStoJ4e+gjLM+vLR7?= =?us-ascii?Q?m4kezRCuOPwU10KXJLrMN41iCPJSQOJ081aHwppL8ty56ZvhhsqeBTl5lzZ6?= =?us-ascii?Q?Grm+QD+rFjwE/NDsI08ce689MuWhyFOLOPxrTCqlycBbHJi8i6xAzunyTkKX?= =?us-ascii?Q?zM3wkYfVFQJ35KbDNU+ApNYckPRUPYTN/v+yyFwSix2N/3YqF8O6ibSj94T4?= =?us-ascii?Q?av2fuRyP8PPMs2rU5sjrz+mLptK9WczCDBlAPR8ZxJzVoZe6N3Nn8L1u1oIH?= =?us-ascii?Q?e1p6ROAhgrZWuXwcvnPKNebqm/HTF6nR78Qu5qofHQAIImKhBibMY3zdArqL?= =?us-ascii?Q?xS1QT8MwAp7j7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hC/WQPmW?= =?us-ascii?Q?AE65Y1pdLf5Nf2Olr/bO5UL5a3iMQchRNfFUqujg2ns09Z9G3tI7HI6fvrKW?= =?us-ascii?Q?EeBXDO64Z2S6A9+j8gC6ZgZMojO4Xdy7oiM1OVsioagsDMdgxCF+TFa1Ceqk?= =?us-ascii?Q?yHwAG+OIYBJC5hl4jlChPpC1931abID8wLYaXAxI02r3tYspd/0l91f9jFPv?= =?us-ascii?Q?5FvfHxGO/dhsVQB93b/u1jT+hw9olo8Oml87SwASissfzYWtQ7eSD9DhAJ4T?= =?us-ascii?Q?o9/vMxmTlIm+MHAbe/8=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2025 15:19:00.2334 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23ab3cd5-a1ab-433b-ed01-08de05b4d7a9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF0001AE1A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7266 Content-Type: text/plain; charset="utf-8" If MBOX_TX_QUEUE_LEN number of kicks are pending, then no need to keep doing more kicks because it will fail anyway. Preventing further kicks is needed because it avoids printing false positive warning messages from mailbox framework. Functionally nothing changes from RPMsg or remoteproc point of view. Signed-off-by: Tanmay Shah --- v2: - Use msg_slot_ro to know if single slot is available in msg queue or not. drivers/remoteproc/xlnx_r5_remoteproc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/x= lnx_r5_remoteproc.c index 0b7b173d0d26..d589f31f45b9 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -335,6 +336,10 @@ static void zynqmp_r5_rproc_kick(struct rproc *rproc, = int vqid) if (!ipi) return; =20 + /* Do not need new kick as already many kicks are pending. */ + if (ipi->tx_chan->msg_slot_ro =3D=3D 0) + return; + mb_msg =3D (struct zynqmp_ipi_message *)ipi->tx_mc_buf; memcpy(mb_msg->data, &vqid, sizeof(vqid)); mb_msg->len =3D sizeof(vqid); --=20 2.34.1