From patchwork Tue Feb 28 21:02:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13155210 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 61F99C64EC4 for ; Tue, 28 Feb 2023 21:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DszhHY8KdrENjqHa2pC1ni4eW2hAKQOUtn+F1pUbVTU=; b=APcu/f60oAfzwg mBklby/uPN+7mnREQ0RLMxlMeUgtcG1f63Vz4fxv7nlSQip5QyMcaUETQsNGVSDLlS7t3KRLLgs/m PkJbFzqMYdXxlT4exOkA9BRXnrJ2Kldv3jiv5654+MParSnrkA5oM4BUcnfO+5B1wkS+khIT4Sf05 hE/FodSxMN8oQEA6q6Wjb7sssAnjE+jxgb7w1k1isqT2UPqucHjsYNElJQRvG4Y/J2X61rgKZA0H6 Q3qHWwGKaW5gBKYalZYhL4SWCvhbldfBc9bS8JA3CthykRDW/5UXMOpRuDh42VfUra8z4kbDJkCFp Eh4YynD3IelUIaUwOpyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77b-00EGNu-UJ; Tue, 28 Feb 2023 21:02:52 +0000 Received: from mail-bn8nam11on20601.outbound.protection.outlook.com ([2a01:111:f400:7eae::601] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77H-00EGIH-OX for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 21:02:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gOBY0+v+XbJn5XXDdS84N6J06jj/uCHu9CpF1MYlUye08cPYZtEMu1kjAryFJaCzF+BeM+VSLQIWDs3TryG5/4WKiPrmI182MoTp184PRWCbmV3Y43HdKysd0NYkZ1D0G9krvyvpNoCBbNkPZp4ylU+gt4TPTgUP/phXBri3TyGTwjp/DMiPWi0bFZJ8e6E5AeY7zLMZP4kWdRmzQXwjNXi/q0u/EJ85aJtjzUl8MPy12m0Be2En6noiWQddD69glOWpIvfJZqQTl8APOp6R5jSBnJWXvZfoFTf9e7aXcxGjLCGZj5otNVj29Ewswf7nYQy/ht9m8WcujUI+r5LwTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=FW/g/aYeDD6QlIeLozEex9991fetDVWFOmaEqyxZ55s=; b=oCbUB+aJgxrIuc7JkBsf2OyRwRTecFnI2Yj4pUNJVTkFrP42dSeBbR/UqoGKPAXICxNg+BBJwYK+NO/VdumRZGwdELsXaKuyZykXuMoYs5Pq8frRLG6ImjErTYDSfCA1P9I/j+A6KuObmfkKEwAnTPgXuSrKrCzFhYCY7ddLT79qfV7LXHceWB3H2VGi1g0QDmhgAut7KbEtdPd444QszDdXiBPwUc3/WlOcdZ8VHP+vEjFQWNZLPrecRrmk9qi8moY2XaK7F//pWdvg6je00B5hznRZfurAm/alDzTppoh2BDxvzUeCUoJzmXGYE8ESUIysnUOBqq1YkKH2jer/+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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 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=FW/g/aYeDD6QlIeLozEex9991fetDVWFOmaEqyxZ55s=; b=G0G9Vx6tT7fZJCK+j/NLIF2yBII0SvopPAGcUCxFEkF7CNZEoIE5XIyEQ6Rg65M/ZCTKPWl2ur+0TelByk9oMZHjwsS5VL5Gzv+tm1Jvl5p7Gxw2Ccu0aAsU6inTh4SnlsCOmpp312HZ2Nmd/F5CqKkPB91K6HnqX62yRaSqqr8= Received: from DM5PR07CA0114.namprd07.prod.outlook.com (2603:10b6:4:ae::43) by MW4PR12MB7484.namprd12.prod.outlook.com (2603:10b6:303:212::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 21:02:24 +0000 Received: from DM6NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::b3) by DM5PR07CA0114.outlook.office365.com (2603:10b6:4:ae::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30 via Frontend Transport; Tue, 28 Feb 2023 21:02:24 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT018.mail.protection.outlook.com (10.13.172.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.17 via Frontend Transport; Tue, 28 Feb 2023 21:02:24 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 28 Feb 2023 15:02:21 -0600 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 28 Feb 2023 15:02:20 -0600 From: Tanmay Shah To: , , , , , CC: , , , Tanmay Shah Subject: [PATCH v4 1/5] mailbox: zynqmp: fix counts of child nodes Date: Tue, 28 Feb 2023 13:02:12 -0800 Message-ID: <20230228210216.447373-2-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230228210216.447373-1-tanmay.shah@amd.com> References: <20230228210216.447373-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT018:EE_|MW4PR12MB7484:EE_ X-MS-Office365-Filtering-Correlation-Id: f093526b-6881-4b89-e823-08db19cf1791 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gYPnKj81SKv5WbXWbT2N6/WFGBoFheT7WLp58vLTEUaMsHBQmYdlqPVQXDSJ9I+9R/SIBouRmCNJ3SW4h3L87Hz+CPWUrgaiktic+ZqvupQc9TJyOXzekNPkLnaGyeFps0nTdR4JYlU+CRWhbb6gwGz+348Cm6oCKQr/dAiECjyP9k9++Xag4MiwZVMCyOSEGgxe8FI8pgq9TSNnjbdppiucRlT+kNjg8JqZhiOy+h/2am5MKf/g2N68sRqaHi70Qiza6f1ckmdma0lv+FEwWihAHqJOdQmxYp0S2lRzN6hvYs7jkRkWhzJhjLN2artGxHXRoEDTajfP0AsI/g9hwAUFcf8dbtGBH4a64oxrHuktSp3PTEfFet0E8swwpAuyslS1hI9zahJBzXfziAnguQP+CyAUxEMmDgGEER9kdiApl+Lc5SWuik30Smx2v2SUGKfaGq/5TqX51Ovt7vODQFPM+md8xyQYqqSVIvF0OztrwN4HjJ4ewYI+zwtqkC2VLn/dt3pNIfa81LC4Qx8Rqa261Aj/Cghpir0+PyINOZz2vaZ/TpYPwxvB7X36Eb6ADrK4zZiCMPd0kD6JZF6d4pi2orAUE/9Y7c++fReUCp4nIf7Kryy1PgVFqT7PFKcFnryLhQBGh5jva2s4574BhcT2VwNVjv2Z0uLaC0ie6aRrezJuPaJjVgxondE0c6tF3vlgq0xrOIdL+n+D94ZehkZcPZd5iGhyhMI8PKQCHb8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(376002)(136003)(346002)(396003)(451199018)(36840700001)(46966006)(40470700004)(36756003)(86362001)(70206006)(5660300002)(8676002)(4326008)(15650500001)(41300700001)(8936002)(40480700001)(2906002)(44832011)(4744005)(36860700001)(81166007)(82740400003)(356005)(6666004)(6636002)(478600001)(54906003)(316002)(70586007)(82310400005)(83380400001)(47076005)(110136005)(26005)(186003)(426003)(2616005)(40460700003)(336012)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 21:02:24.6638 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f093526b-6881-4b89-e823-08db19cf1791 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7484 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_130231_818664_E2CDA2EF X-CRM114-Status: GOOD ( 12.37 ) 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 If child mailbox node status is disabled it causes crash in interrupt handler. Fix this by assigning only available child node during driver probe. Signed-off-by: Tanmay Shah --- drivers/mailbox/zynqmp-ipi-mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index 12e004ff1a14..e287ed7a92ce 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -634,7 +634,7 @@ static int zynqmp_ipi_probe(struct platform_device *pdev) struct zynqmp_ipi_mbox *mbox; int num_mboxes, ret = -EINVAL; - num_mboxes = of_get_child_count(np); + num_mboxes = of_get_available_child_count(np); pdata = devm_kzalloc(dev, sizeof(*pdata) + (num_mboxes * sizeof(*mbox)), GFP_KERNEL); if (!pdata) From patchwork Tue Feb 28 21:02:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13155211 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 24AE1C64EC4 for ; Tue, 28 Feb 2023 21:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P+wccR1Yf+VuSQLAopOeyMN+3OqP3/W5P/O6wPS/5b8=; b=TI1xsyQmbUEYbU pImeQF2wA2hBzMspKl+evP6My/dctIPnR7Unayv/m3k7nuzM2m/vxd/CCvrZ1J9jZMugNiDXvOvj4 hIPGe0Ai8Zd4fUWyDs/fwnx/MOvWSCZMF/aqDnwJ5xN2/QtPLHljeTi003EDrNxaKdWjStATDwpxC o7JCvjoVo0OVmcA3hPkR4syMhF/U9D0pY6gC6Uv89bOv4pHLtKg/NQhI6TI4s0HWibYWl1/ZFrNUd kAvzVWbcA/IM7921FQ23z1f/KhmwFutG7dBYESU0PgeJrRWwcbfJ23DH0McGvzerpgJG6kH67RpU6 AVz8R6Vfl/PCGFATjPSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77k-00EGPn-12; Tue, 28 Feb 2023 21:03:00 +0000 Received: from mail-co1nam11on20625.outbound.protection.outlook.com ([2a01:111:f400:7eab::625] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77I-00EGIO-36 for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 21:02:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JonRgnHi5SSpTGgMLRhf8mxg+0NnwMTCbN1yrGPdAhXp1kr0bijbUIrvNCISwFz8vSMQ6xLgSdi+Kq8/W2yPwSf49H02hw9TuWq0kifKzWUoyOjL8MlHighv7JmRuoNj6rzr0CZPtUkK4IO11fQPAQTTE2VTXhyqxFhJDB4LyiCWcUiY4emLjPkaVz8a7VQjVd1sn0QKCLyJd95ZkJ2hDkYVMps4bbccoqftU+MwnwuzfT/Tnt/i0ASJeICgNFOAgDZHOQVfOZlL69UeLBCgegzamMG4hKZIi4X6cDLBKhiaIc6HH76IHRTziLaySPresvq3Xu1a++0k6PEdP2y37g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=8ZZbFSCii/bEzZuwFiGNigWIcDZEsXJksoL1k+8ANIo=; b=bamowe3dv2LWTISJqUxVFrWo9s5MTsjqRMEv9y+aJtPeyirBEzUqn6ripbqGZjApHyuaczh1vhynJ5I/lRY85gLoIeAN37bH8LIQZLrxTqNFlGRnWELpI8tbDapxCu/fj1DnxEbB1rQUUGYJU6Ar4VQDU4pE8uMlThUR6b77Wl3t7G1r4LiiYIYKTM3UieyNmtm1wytc0C5qBYUr0JyoV2QgPeuZVXYgyGZaVCSfI0cpyxrH2pddxKhqa1kuqhnIC5Hl3L5nhWRAaYWPZJl7sWDNYtt8iYQRqd9LE7EXyMzfA72kgs028r/tlmtSpjyT/o5zPJmI7bay6vWyDydd1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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 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=8ZZbFSCii/bEzZuwFiGNigWIcDZEsXJksoL1k+8ANIo=; b=3e5oM2R9oA8t9tculmjXxqDZPVEnzDummCihNupr7760/tes2h4z0YXSTsJOAQlZeGcT9Nbmkc4z+BdGvdFSYJ+pwEy500lf2nIOUaMbPb6wQPyIuH8QX4fMahiywBUyAY6k5pp0R1eeMJJ5CVP1LV+WMd84Krzne1TCmgB5rzU= Received: from DM5PR07CA0087.namprd07.prod.outlook.com (2603:10b6:4:ae::16) by IA0PR12MB8424.namprd12.prod.outlook.com (2603:10b6:208:40c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 21:02:27 +0000 Received: from DM6NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::88) by DM5PR07CA0087.outlook.office365.com (2603:10b6:4:ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30 via Frontend Transport; Tue, 28 Feb 2023 21:02:27 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT018.mail.protection.outlook.com (10.13.172.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.17 via Frontend Transport; Tue, 28 Feb 2023 21:02:27 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 28 Feb 2023 15:02:22 -0600 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 28 Feb 2023 15:02:22 -0600 From: Tanmay Shah To: , , , , , CC: , , , Tanmay Shah Subject: [PATCH v4 2/5] mailbox: zynqmp: fix IPI isr handling Date: Tue, 28 Feb 2023 13:02:13 -0800 Message-ID: <20230228210216.447373-3-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230228210216.447373-1-tanmay.shah@amd.com> References: <20230228210216.447373-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT018:EE_|IA0PR12MB8424:EE_ X-MS-Office365-Filtering-Correlation-Id: 0de68b8c-f6a0-426c-f4b7-08db19cf192b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rkaM2PWXt2rnZuGz2PuApCq3ImCZO+xx2FIQoGedOVhfCT/0diTjbAj5WVllDBgHKYX3eq+3szf8SVZh2GzYr+iCtrkYl44CeVH18C01izIQV2/idE+0Rb+QdMaaTkjvGKfktLJx23GIdB7+ZkSuxpHXJ1ccOq3rcnPM8eK2SPorW0piyQ+LZRC0c8I77m7akgEa63obZiynxVI8FoN23lJV2ciS09dQ9QsggWJooho/B9DVEQIXanOyYIcu6saYcJUOqCgz3ZBbiD2drzElccaHkPbYVuK2WL5TE0Bg9uzu7y5iOE5x9MUrr3+KMT6UWpYjHXaTGYDXfPdVc95UWH1nc9WReU82SgSPrf+/Btj2lXyLPyjQ0lDxSuTMgDjkZ9H8tN7Pw38+EwOXw1H8tpU+IA0vKG0+/ZzOU+JeVgZxYxaUScKMYwHzkGXshduXB+jcFuQIPhCBGL0pCLMD7nJ28iCVdvPXHBeBM3YyebWQYom1LLYw826qLa1XYJBTuswpv4+YEIzSLiTTC0BnZR8yIDL1rvToSyCpaDBeDMKQqzGaamU9pQi5dADMRIDf7PxcdFf+XgENybLzNPduSPaArApze4+lPzsIAnwEuE40G6rT9g3pQdYnND5pPBBSyVxo9E6vVlldxwo9Z9tbgOq0rzy/0kWabc+la5/Ci6KL+kNNK8nSOXjrWykPNjj8Q+JfLekVMzPF2oqcUeq5zSv8a5eci8yUtavfS732Ha4= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199018)(40470700004)(36840700001)(46966006)(356005)(36860700001)(81166007)(82740400003)(86362001)(36756003)(2906002)(44832011)(15650500001)(40480700001)(8676002)(41300700001)(5660300002)(70206006)(8936002)(4326008)(70586007)(82310400005)(40460700003)(1076003)(2616005)(336012)(47076005)(426003)(110136005)(26005)(186003)(83380400001)(6636002)(478600001)(54906003)(316002)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 21:02:27.3511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0de68b8c-f6a0-426c-f4b7-08db19cf192b 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8424 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_130232_150645_E3E4076A X-CRM114-Status: GOOD ( 11.72 ) 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 Multiple IPI channels are mapped to same interrupt handler. Current isr implementation handles only one channel per isr. Fix this behavior by checking isr status bit of all child mailbox nodes. Signed-off-by: Tanmay Shah Acked-by: Michal Simek --- drivers/mailbox/zynqmp-ipi-mailbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index e287ed7a92ce..b1498f6f06e1 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -152,7 +152,7 @@ static irqreturn_t zynqmp_ipi_interrupt(int irq, void *data) struct zynqmp_ipi_message *msg; u64 arg0, arg3; struct arm_smccc_res res; - int ret, i; + int ret, i, status = IRQ_NONE; (void)irq; arg0 = SMC_IPI_MAILBOX_STATUS_ENQUIRY; @@ -170,11 +170,11 @@ static irqreturn_t zynqmp_ipi_interrupt(int irq, void *data) memcpy_fromio(msg->data, mchan->req_buf, msg->len); mbox_chan_received_data(chan, (void *)msg); - return IRQ_HANDLED; + status = IRQ_HANDLED; } } } - return IRQ_NONE; + return status; } /** From patchwork Tue Feb 28 21:02:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13155208 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 9441EC64EC7 for ; Tue, 28 Feb 2023 21:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jacSHaO8uLi9q0GB70HjGiaQlZrCcALd9XtkIQ6Lg+M=; b=aLQyqIOswmgZt+ 2wSPhDYT888tCU5tglbQiPRfcgnb0RS/PMTIlGK4pDZKbc7u4hV91YzxbrUfjS1EDZ4CYm81ChHg+ VTfgjCrbEMANCTYUQHUUfKMu4hYrAlDQ/cI9imTuXFa7jC7bE4M2PJnZ8O1xpA+yFeK8QUzkXGUh+ H4b5HMnVWZVcEWskRV4XcWY3p3zD1kneEFDhsSnv0NEETztCGhMMguo7FO4yLkGztphatIWzF+tC2 laKNoBZ1j0yuIPhVNEmBXV/8xqXcAs3gloly8a16GOadKiwxi3SmrqlF0vZXy5Haf1LXckT0+O76k y2bG/63/TNbcVGY5YqQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77L-00EGK9-R8; Tue, 28 Feb 2023 21:02:36 +0000 Received: from mail-bn8nam11on20601.outbound.protection.outlook.com ([2a01:111:f400:7eae::601] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77H-00EGIP-NG for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 21:02:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itPvrE+lNliuZHsBJCW+UaAe0DlfPXXff68cjTWMIK5syjN0UvIx3nM/rAxTkY9CdPc6eOVcKqoCqJpI8ysjfuKDb1h766euDdn9R3WLr56mkQVIii0nvoEBR5Fiw+svZP9nSKfn7tHCEIEFJduyB4ys8WQw2CIhHDrJ9mbbkaIzJ/z31jnP+lsX9Rm3/aeknkbrmxOEtkl3FpViOD1Gcd7Oyr/1nKgQ8Uhpcd3GZOF3s+LBeyUUkhvtHMdHMzqzFxMS3MGXmLbPNK82dLZbNDTNQjP2+csFu8/KuzudxayM4bKUOmmJodGtz4DVCRn78OI6bSUFq2Kc66TDdYFj8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=C7Wl1JYpP6lqT61SfXqmrBexlILLSeSkm6bACCOLW2c=; b=DuS80NGbC0hr4doLgm8OuwvgbE32nSF9uFbIXP4/JYooZH2McEaV+jsSTPU07km6ZjtcRjYlMtBXALT30eVLeUWBJwcxCHSRzmMDWUFC+4Jicm1LC63Zq1oi95O4jMDktf8nNvAwtsBqjHoxG9MCJhzUXbov6ayvOAFVvd9OhphvZLhIHYNPOPnjbmRUexX9uwyJXbdO7esCRjueQ9spuVkqcN0UOt7a1P3TZXwIBe6wD+Vmx9AQw81AL6hMbIp4iny1ytmfHVNMh3Q5uy/7CNJJ3x8sOHE9RX2v9wXoG283yA86nSAvMM4PdOjbiTYSfMuKmXyg4eFDr0sWtSdI1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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 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=C7Wl1JYpP6lqT61SfXqmrBexlILLSeSkm6bACCOLW2c=; b=0TBZzOY5Bedz5uJuIfAwWNEOcDRECFhN89LyRkQl0FXnAoGDq53wrfeKISD4sMprP6Yd0dCxR/JPeU9EDxDvqhoxv7XZpwUn/tVl/5ApFv3FKog4GdOaREdQPLj24EQ1DQV8VBho1PjoNcF8StK/ouWrnth0fFXszYlIe97wy/w= Received: from DM5PR07CA0109.namprd07.prod.outlook.com (2603:10b6:4:ae::38) by DS0PR12MB7702.namprd12.prod.outlook.com (2603:10b6:8:130::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.25; Tue, 28 Feb 2023 21:02:27 +0000 Received: from DM6NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::4d) by DM5PR07CA0109.outlook.office365.com (2603:10b6:4:ae::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30 via Frontend Transport; Tue, 28 Feb 2023 21:02:27 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT018.mail.protection.outlook.com (10.13.172.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.17 via Frontend Transport; Tue, 28 Feb 2023 21:02:27 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 28 Feb 2023 15:02:24 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 28 Feb 2023 13:02:23 -0800 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 28 Feb 2023 15:02:23 -0600 From: Tanmay Shah To: , , , , , CC: , , , Tanmay Shah Subject: [PATCH v4 3/5] mailbox: zynqmp: fix typo in IPI documentation Date: Tue, 28 Feb 2023 13:02:14 -0800 Message-ID: <20230228210216.447373-4-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230228210216.447373-1-tanmay.shah@amd.com> References: <20230228210216.447373-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT018:EE_|DS0PR12MB7702:EE_ X-MS-Office365-Filtering-Correlation-Id: ce1cbf60-ed00-44b5-3e78-08db19cf1978 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nKgAI4nUn0v9CW3OB5befPynj8BAb+mdHNJ4GdCBI+uWxYeSS5PEG5c7xjRBT7VrK/rN9OCGWHESwKBNeKB3L502jhiUddgJpORnJm9yNoEFnc9C5856fAFi973c8AA+tvXzNhQDz+MT2o5Pntf/eKe8NhIdxpXrlMse5xvOS5ImiK6NJfGdza7lCKewArrujrK81DKs6wAAuQVffW4Yw+4FZFrYZnlVwfqM45CjjHvkxFpc1AQcQ0KB5z3CWygRAOoSo9qnuDJDGFEnDmZ2aQsm1t7fvNx2nLmBbSTIT6Ju4PWEOeNXmmiQNzDSyXuPmFGCOrp/23CNgzvgfRLn9ya9eppGvEgK4ojJR5u6f2O1gSJWiH3LrUOgSeYWO0Hzm3ix1uoH+pYHMTvw/Ffm3aBW6ouKIyX8le9GIddnm0ntEPdHiv77y9Xxcfl8GiJRI2ASeP4x5fuBoCtMqissmzYwn/BUJyFEJH6Wb81/uagUu2/o2Y1+Hkclse7iuIIGa1Oj5Z8djTYjp/ejH7lmP8ah1slAJi12btzuALFhj8JU/9Us2/fHM9EK4GQYxhDNy++/Jp6tr3e7MlfJKuBHd4evUY81N+qGshzg8hHaydHPSgZvoKvzUPi1soq9quIKGH+gvjlBKN1ccMoQDbVBWWnupJzy2jGU9WAx1BUZp3nAARhij9NIXgaHZYdj7qPU7VScRnkpygoafgxXI3hy88e2/kvrxlEqp4U8uM7y/4o= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199018)(40470700004)(46966006)(36840700001)(8676002)(4326008)(70586007)(83380400001)(70206006)(426003)(47076005)(41300700001)(36860700001)(36756003)(316002)(336012)(110136005)(54906003)(8936002)(6636002)(81166007)(82740400003)(5660300002)(2616005)(44832011)(356005)(86362001)(478600001)(26005)(186003)(40460700003)(40480700001)(2906002)(15650500001)(82310400005)(4744005)(1076003)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 21:02:27.8511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce1cbf60-ed00-44b5-3e78-08db19cf1978 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7702 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_130231_785237_517DD8A7 X-CRM114-Status: GOOD ( 12.49 ) 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 Xilinx IPI message buffers allows 32-byte data transfer. Fix documentation that says 12 bytes Signed-off-by: Tanmay Shah Acked-by: Michal Simek --- include/linux/mailbox/zynqmp-ipi-message.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mailbox/zynqmp-ipi-message.h b/include/linux/mailbox/zynqmp-ipi-message.h index 35ce84c8ca02..31d8046d945e 100644 --- a/include/linux/mailbox/zynqmp-ipi-message.h +++ b/include/linux/mailbox/zynqmp-ipi-message.h @@ -9,7 +9,7 @@ * @data: message payload * * This is the structure for data used in mbox_send_message - * the maximum length of data buffer is fixed to 12 bytes. + * the maximum length of data buffer is fixed to 32 bytes. * Client is supposed to be aware of this. */ struct zynqmp_ipi_message { From patchwork Tue Feb 28 21:02:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13155219 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 9A16CC64EC7 for ; Tue, 28 Feb 2023 21:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1R/lC2DYanZjnr76Nvfz+F3hNqedSoERz++wBUnMYFw=; b=3fyYSWWQLGk1or tm0fb/yG69HV2vMSuvmImsQ21DrjqbhkFALJSxsBViBUFW3iPI381jSHaUVwnCYysQx7OT08eJX6f RYbBo3jtb2sogMyPG1vb9gkKm1YdzEmkMFWFenCFRhmiRZRB03Rf15grVXPSAUkExj+XAod3iAo6e LsZ7wsQWm8qVrNM8eKvx9IXJ5N7BfcUb0SRDZ1lRo2KpbCNx006LB/+UbKF0NGGqWCIeRZlAJr6n4 k4GC/hpVEgyGzYgOcBwv78MqmsjK6qmxI2DOEw0zUZkB5BXn/0I7EG7IQhfL8GYnPW1jlNfo0/gBy E14HOdGnNdXd0dtcbVWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX784-00EGVV-Ek; Tue, 28 Feb 2023 21:03:20 +0000 Received: from mail-sn1nam02on2062a.outbound.protection.outlook.com ([2a01:111:f400:7ea9::62a] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77m-00EGPL-AY for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 21:03:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bqHT3vcVQoKYWjumlOQ9lDSbkC0iXbOY3mHRlUrnlRkV2E6GFALy/qKdo7Fef5rWGJxnK28O/Vy9d1NClPF9h91ttSs6hFTCI0RqxK8Pw/uBACM5k8/qEzUcvSGs4lz49Mc/yku5tR/ADHl1ZOYqzjNKpc0wQ2KL0udidRkleCLTj6QpDvKYNVha/GKGekv02WnKcInecC9pc5zEbeHZS/mP4UPKq0kXRcBVvZJJB3BBbXJpZzvHLNL2jpOKUZoh/WaYNmd2fPynxxohMJyygizM0yYsg+S0AXrxMerT6o190eVLGzixIyr2AgsrS8epTwNqIBNgwIMM+QDrpOvahg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=nxwlWXOooBFl8B1lTIGYMMLzVp5Ju0ytT94PSyoReNc=; b=Qwr+gk00pyp5wW19KiQ1rEgXO8XcnR2p92OmB/M5cvf69YhM4k53CwivthOPAqrDHmMxXpFNt+3Y2PCGba/K6Vzt18R0cQUpgxMCpspalXK3pkyge9NGh1nTE/lhpiZmK+fR4Z5ud65N0YMJhHHjcXlFLUnJixaDPc0ZSgrIEQRYGa2bq0nX5tUR+dEQQhcFE9DsWLiGrvH2q2y7VTuAHxZ99YgcUEjgB1+gc3ino1nCZD3BmzKDjj6nsiH9pkm1jTfIUWdg2+wu754R95F2dkRonbpHVsWg9yL0E9AIiYgwFT79TnclL6GUUiKkln6Cu6rfSpLGx9e6tgdqBkEvmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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 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=nxwlWXOooBFl8B1lTIGYMMLzVp5Ju0ytT94PSyoReNc=; b=gV+nIDp0MRXbmv/wFaCbvLeL4yo+pvnYuTWhohCqPPdExZ3zNfss4BeTPPE6BPrYl8qAJ6ZGMzXlS+fQTztV/5fk6hPS1+EFgZCePXpHZJzwqBwiNXfEceH7axnjG2bZWTypOeTRtHpkAvX+fW7GpGV5BBuzggtZhHc4BgOvo6I= Received: from MN2PR14CA0008.namprd14.prod.outlook.com (2603:10b6:208:23e::13) by DS0PR12MB8271.namprd12.prod.outlook.com (2603:10b6:8:fb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 21:02:54 +0000 Received: from BL02EPF000108EA.namprd05.prod.outlook.com (2603:10b6:208:23e:cafe::46) by MN2PR14CA0008.outlook.office365.com (2603:10b6:208:23e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30 via Frontend Transport; Tue, 28 Feb 2023 21:02:54 +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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000108EA.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.12 via Frontend Transport; Tue, 28 Feb 2023 21:02:54 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 28 Feb 2023 15:02:24 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 28 Feb 2023 13:02:24 -0800 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 28 Feb 2023 15:02:24 -0600 From: Tanmay Shah To: , , , , , CC: , , , Tanmay Shah Subject: [PATCH v4 4/5] drivers: remoteproc: xilinx: fix carveout names Date: Tue, 28 Feb 2023 13:02:15 -0800 Message-ID: <20230228210216.447373-5-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230228210216.447373-1-tanmay.shah@amd.com> References: <20230228210216.447373-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108EA:EE_|DS0PR12MB8271:EE_ X-MS-Office365-Filtering-Correlation-Id: 17d2639b-12d4-4880-02fe-08db19cf2987 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lR6BE5+pnGv8JcHlBB6RI+xhCJHPqKLG9GR5ZxQ/HpFocI1wf3spUvf3iTExvKW+gvidifcnvSeK6jhR86ZEqOtqmVP6naVPLtaF0MCcm74+eTpAHG32F37s/4wMPJuf6e1ZdKo1F1dOHiQ1cj2lulQuUyQOHcxIUSGDKWUnqIVbKVlKiQJmZt4ot7WdUp0VfHMIA4vOunFLzRwizEeEPV7IK3dTn0UWZDW8X3ksCdmDv5JJCv194ItUmhvd8NY5n3gYdV3KRrPPyIOOtQOrl/vPSfPJkVXUIJGofd9YOkAsd+D62onrD2XqTw4pY3Fs9zD6zKooyhQs5bs7PUrAhyXC67mpJw7TLeYmThHUTA3eAfYajjVPwygDPQafNV+36lLTNIrRNwMQp9wp458Amyxhr5dkXL2kmxLWyzzUG+JH8HGLJvxLdLzxE3phT1+ZKWvXnN3dHR9uZ9rZfwl9a6fvY2XgoJ7s2oz5yMT5f6rZ9DNC0jm1sq6ZhhjbTyHpvTTu1Smwf5DUrCnz/BF3ByyCHiyx821fLcGjNe6pAnyZ9EM9dxsnex1/TQN2f4+TRiC9EajrWxruK5QQqxAV3l/oZIftKREbKOD7zWZnids1AweQ2AQG6w4uMFoR/j5SD1iFwXL/Q/cOG85hhTI1M3YuVcUPO9nTpSV/Nub1v+keCOmkvTd9oJmHzlmshf6szooVcbXDMQ51ydzn4qWa+u42X85Mkg5vxDtoN4gHoKE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(36756003)(86362001)(70206006)(40480700001)(41300700001)(8936002)(5660300002)(8676002)(44832011)(2906002)(356005)(36860700001)(82740400003)(81166007)(4326008)(6666004)(54906003)(6636002)(478600001)(316002)(70586007)(82310400005)(40460700003)(83380400001)(47076005)(110136005)(186003)(426003)(2616005)(336012)(26005)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 21:02:54.8227 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17d2639b-12d4-4880-02fe-08db19cf2987 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000108EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8271 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_130302_399447_C2BB0D8C X-CRM114-Status: GOOD ( 18.68 ) 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 If the unit address is appended to node name of memory-region, then adding rproc carveouts fails as node name and unit-address both are passed as carveout name (i.e. vdev0vring0@xxxxxxxx). However, only node name is expected by remoteproc framework. This patch moves memory-region node parsing from driver probe to prepare and only passes node-name and not unit-address Fixes: 6b291e8020a8 ("drivers: remoteproc: Add Xilinx r5 remoteproc driver") Signed-off-by: Tanmay Shah --- Changes in v4: - use of_phandle_iterator_next to get memory-region nodes Changes in v3: - split patch and add fixes tag - fix memory-region carveout names drivers/remoteproc/xlnx_r5_remoteproc.c | 90 ++++++------------------- 1 file changed, 20 insertions(+), 70 deletions(-) diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index 2db57d394155..5dd007622603 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -61,8 +61,6 @@ static const struct mem_bank_data zynqmp_tcm_banks[] = { * @np: device node of RPU instance * @tcm_bank_count: number TCM banks accessible to this RPU * @tcm_banks: array of each TCM bank data - * @rmem_count: Number of reserved mem regions - * @rmem: reserved memory region nodes from device tree * @rproc: rproc handle * @pm_domain_id: RPU CPU power domain id */ @@ -71,8 +69,6 @@ struct zynqmp_r5_core { struct device_node *np; int tcm_bank_count; struct mem_bank_data **tcm_banks; - int rmem_count; - struct reserved_mem **rmem; struct rproc *rproc; u32 pm_domain_id; }; @@ -239,21 +235,29 @@ static int add_mem_regions_carveout(struct rproc *rproc) { struct rproc_mem_entry *rproc_mem; struct zynqmp_r5_core *r5_core; + struct of_phandle_iterator it; struct reserved_mem *rmem; - int i, num_mem_regions; + int i = 0; r5_core = (struct zynqmp_r5_core *)rproc->priv; - num_mem_regions = r5_core->rmem_count; - for (i = 0; i < num_mem_regions; i++) { - rmem = r5_core->rmem[i]; + /* Register associated reserved memory regions */ + of_phandle_iterator_init(&it, r5_core->np, "memory-region", NULL, 0); - if (!strncmp(rmem->name, "vdev0buffer", strlen("vdev0buffer"))) { + while (of_phandle_iterator_next(&it) == 0) { + rmem = of_reserved_mem_lookup(it.node); + if (!rmem) { + of_node_put(it.node); + dev_err(&rproc->dev, "unable to acquire memory-region\n"); + return -EINVAL; + } + + if (!strcmp(it.node->name, "vdev0buffer")) { /* Init reserved memory for vdev buffer */ rproc_mem = rproc_of_resm_mem_entry_init(&rproc->dev, i, rmem->size, rmem->base, - rmem->name); + it.node->name); } else { /* Register associated reserved memory regions */ rproc_mem = rproc_mem_entry_init(&rproc->dev, NULL, @@ -261,16 +265,19 @@ static int add_mem_regions_carveout(struct rproc *rproc) rmem->size, rmem->base, zynqmp_r5_mem_region_map, zynqmp_r5_mem_region_unmap, - rmem->name); + it.node->name); } - if (!rproc_mem) + if (!rproc_mem) { + of_node_put(it.node); return -ENOMEM; + } rproc_add_carveout(rproc, rproc_mem); dev_dbg(&rproc->dev, "reserved mem carveout %s addr=%llx, size=0x%llx", - rmem->name, rmem->base, rmem->size); + it.node->name, rmem->base, rmem->size); + i++; } return 0; @@ -726,59 +733,6 @@ static int zynqmp_r5_get_tcm_node(struct zynqmp_r5_cluster *cluster) return 0; } -/** - * zynqmp_r5_get_mem_region_node() - * parse memory-region property and get reserved mem regions - * - * @r5_core: pointer to zynqmp_r5_core type object - * - * Return: 0 for success and error code for failure. - */ -static int zynqmp_r5_get_mem_region_node(struct zynqmp_r5_core *r5_core) -{ - struct device_node *np, *rmem_np; - struct reserved_mem **rmem; - int res_mem_count, i; - struct device *dev; - - dev = r5_core->dev; - np = r5_core->np; - - res_mem_count = of_property_count_elems_of_size(np, "memory-region", - sizeof(phandle)); - if (res_mem_count <= 0) { - dev_warn(dev, "failed to get memory-region property %d\n", - res_mem_count); - return 0; - } - - rmem = devm_kcalloc(dev, res_mem_count, - sizeof(struct reserved_mem *), GFP_KERNEL); - if (!rmem) - return -ENOMEM; - - for (i = 0; i < res_mem_count; i++) { - rmem_np = of_parse_phandle(np, "memory-region", i); - if (!rmem_np) - goto release_rmem; - - rmem[i] = of_reserved_mem_lookup(rmem_np); - if (!rmem[i]) { - of_node_put(rmem_np); - goto release_rmem; - } - - of_node_put(rmem_np); - } - - r5_core->rmem_count = res_mem_count; - r5_core->rmem = rmem; - return 0; - -release_rmem: - return -EINVAL; -} - /* * zynqmp_r5_core_init() * Create and initialize zynqmp_r5_core type object @@ -806,10 +760,6 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster, for (i = 0; i < cluster->core_count; i++) { r5_core = cluster->r5_cores[i]; - ret = zynqmp_r5_get_mem_region_node(r5_core); - if (ret) - dev_warn(dev, "memory-region prop failed %d\n", ret); - /* Initialize r5 cores with power-domains parsed from dts */ ret = of_property_read_u32_index(r5_core->np, "power-domains", 1, &r5_core->pm_domain_id); From patchwork Tue Feb 28 21:02:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13155212 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 7AC82C64EC4 for ; Tue, 28 Feb 2023 21:04:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QnJeR0q3HMme36HyoGkvsXgqTk2uG6XypL2lnzwdvYY=; b=qsBkmdRv0tUabF kZFEAnfDwi3wl+QPN3ELg/zxVIiATcLEqjioegM+ETxtrLa/wTh+l9P13QRPIenWMiV55yiu7DGKb U6jvT4JDT8V9nghKR/H8+xdnfnYlu9p6hZR9Ryq7MDr1geHb5cQEmFAIyxmV1MdLqc66Ty4aojhdU 3DRWVy/6axKxuvaaziEmZb+RZS6BPRwUsFwCZjHsPYlAwSo6WtYQTUmUR7/3bCJ6MbMFRMrmUomii 7elb1/Y6Pa0Fc3MVtIxfQTKTroOdrEzEEl3+Xb/hvwqyfGTjJPSfrpMmOmgt1XUNyJ2LR5U77cuql ZgGBR4Z7Vidkf3Jy1ttA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77s-00EGRt-TB; Tue, 28 Feb 2023 21:03:09 +0000 Received: from mail-dm6nam10on20606.outbound.protection.outlook.com ([2a01:111:f400:7e88::606] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX77J-00EGIS-9g for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 21:02:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q3Yamt/q99Sf7miQInruRvoRz7ICXizCeKpLTX1nKDeHkXJgXLcQovm64W5G4WdVcdMnDcbrS8vY59zShQLHF+oMTAjtah4OwSxxCEsR/jD4zlAT5Y8jO+yxI1u3C38sHI6n+heZGzEsm8Fp/HXApJKePGEQkqC1WJeNwwQs8TGYDGThT6a5Vk5v+EWObw/p8J89Q3L9qtbYZmTI065l1PyML9+7OGKbzOuh24AK7JnSrx93/yba+qpV5oAxXNs2/8YpyDguEaJikBEkQoOUnNGQX1hBa77Klk24HqeY3t5dWR172xSWDQwgub5fQ79bVoCykbp3fBQl6Pp8JCoBcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=jLsKPhzEELL1Wu5N6l491bMrgzda/1+NSpLcQtRj+yk=; b=dsxxTWf95yma/5yF/w2tar7vK7YzY81C2oVSrbXTV2qWM3MNqk1RC3BH3MYGAyMHuBEEmA9Z9QLf1d/goCybiEPlcMGGEElTGoZlWhiOWtcssrnB/TFFKsbktcdnJsnTvZUS4u2wlW4i5ISSp41AGiwvciq/ako7eKP6ymrIqtNrqCcCGUJNPsS1KY6f6J2H1bLP/3heeAczHJGOZImPI4trN9Z++RdOPWWgSF6mNU1lm5YaXcs+3RVgdVHGUtusQBZKEd/3+9DPSIBs85rxmh3NgniDITfVm0JP00KFO9RmL6IfN9S2dw+NzUZ3L7+Qyc4wc1rZnrXCyuTputNw3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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 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=jLsKPhzEELL1Wu5N6l491bMrgzda/1+NSpLcQtRj+yk=; b=J9cHbdAyTCIB+cPS4a3vtHXZEK3eQVZ8GcQdG+8IdPchAw7e1/PIevByC+FkVLDUu3CVBNMmWUN7U67K9rJArfcSLHxRHLGavALoBFiGUnYE50cj2V5yofX22yj03ZZqLqgpS02Q0CWGQQm1da2fCOpaauIq+AY8mM/z3jRQPKU= Received: from DM5PR07CA0091.namprd07.prod.outlook.com (2603:10b6:4:ae::20) by PH7PR12MB5880.namprd12.prod.outlook.com (2603:10b6:510:1d8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 21:02:28 +0000 Received: from DM6NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::40) by DM5PR07CA0091.outlook.office365.com (2603:10b6:4:ae::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.17 via Frontend Transport; Tue, 28 Feb 2023 21:02:28 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT018.mail.protection.outlook.com (10.13.172.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.17 via Frontend Transport; Tue, 28 Feb 2023 21:02:28 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 28 Feb 2023 15:02:25 -0600 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 28 Feb 2023 15:02:25 -0600 From: Tanmay Shah To: , , , , , CC: , , , Tanmay Shah Subject: [PATCH v4 5/5] remoteproc: xilinx: add mailbox channels for rpmsg Date: Tue, 28 Feb 2023 13:02:16 -0800 Message-ID: <20230228210216.447373-6-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230228210216.447373-1-tanmay.shah@amd.com> References: <20230228210216.447373-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT018:EE_|PH7PR12MB5880:EE_ X-MS-Office365-Filtering-Correlation-Id: 03be0935-823c-4976-75d9-08db19cf19b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0WyzWPgwUqixzFlcNazvv7NplHfEF/6ZqUUSbzoMqdYUa7t0rspRdl2VYfKxgVPIp42nHEFRGFSiLJKBM6+HEOvHWXnuuaKn5oqojKF0cCRzYyRLYJQUfaKS01gAxGEnlh+y7sFNxzgJrvjpTUHFGQesNpkuBiXkah4pDnV8irmZ92Kj4ktVxfTeNZN5Ju/JU6RH+c/z4Hqp01J2BvofYFWAiKiKBWKq4egW4YPTdf5k1C13ZHj6zW4kU1k843u4WN5ebFqTsSEm4UgtC5fOAewlQsB0Z4TTNcjvbm91VzP75q3Nz27IjQ/n1at6bVU3P5A8U3PP7ouZQMEOTtiqUzQPfA7lMSUQqCR0IJCLrHLsK9Enc0aRWpfI518K6I5WeoIcoV1wwRP5gHL2XlYmX7qdMPKxe/DuP+lPCWJ2HBjzoCCqbhzOvs1nCg50rIpHcBQMtkzcgfWN/EZV2aaXokdbiarUWLYWM9srVAk+n3YfSuzZKTRmFPJWpFsfcZ/AYPbL/SRlPMkpBqtkUCJgdkWHNbFuBxoa77XCnhrmjwKhNgG7nhG7d0rpxhalOQrdQhiLu7nuj8hdIdiKrzoKkFv8aP1LFhRIeARzmhWBGM5T5TcPJYBtoCYpidGF3aXgWdOI2a3zGY/26TjyNgBlsGCCeYSksaOji3cCBIYWkCszhBFj3s5PrISfx8ddS1FW0peweEBGoc6p7AHJoHktGBONooabKNG3jUIbt4sbhyK9GInHNr38DXgGAnYvsRl1 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(396003)(376002)(39860400002)(451199018)(46966006)(36840700001)(40470700004)(86362001)(8936002)(5660300002)(44832011)(26005)(1076003)(316002)(8676002)(15650500001)(70586007)(70206006)(41300700001)(186003)(4326008)(6636002)(2906002)(36756003)(54906003)(83380400001)(40460700003)(966005)(110136005)(478600001)(40480700001)(6666004)(426003)(336012)(47076005)(356005)(2616005)(82740400003)(81166007)(36860700001)(82310400005)(17423001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 21:02:28.1792 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03be0935-823c-4976-75d9-08db19cf19b1 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5880 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_130233_423828_17903504 X-CRM114-Status: GOOD ( 28.02 ) 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 This patch makes each r5 core mailbox client and uses tx and rx channels to send and receive data to/from remote processor respectively. This is needed for rpmsg communication to remote processor. Signed-off-by: Tanmay Shah --- Changes in v4: - move zynqmp_r5_setup_mbox from zynqmp_r5_add_rproc_core to zynqmp_r5_cluster_init Changes in v3: - fix multi-line comment format - do not mixup mailbox information with memory-regions - fix redundant dev_warn for split mode - setting up mailboxes should return an error code - redesign driver to move mailbox setup during driver probe - add .kick function only if mailbox setup is success v2: https://lore.kernel.org/all/20230126213154.1707300-1-tanmay.shah@amd.com/ drivers/remoteproc/xlnx_r5_remoteproc.c | 227 +++++++++++++++++++++++- 1 file changed, 225 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index 5dd007622603..78c1638ccef0 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -8,16 +8,23 @@ #include #include #include +#include +#include #include #include #include #include #include #include -#include #include "remoteproc_internal.h" +/* IPI buffer MAX length */ +#define IPI_BUF_LEN_MAX 32U + +/* RX mailbox client buffer max length */ +#define MBOX_CLIENT_BUF_MAX (IPI_BUF_LEN_MAX + \ + sizeof(struct zynqmp_ipi_message)) /* * settings for RPU cluster mode which * reflects possible values of xlnx,cluster-mode dt-property @@ -43,6 +50,27 @@ struct mem_bank_data { char *bank_name; }; +/** + * struct mbox_info + * + * @rx_mc_buf: to copy data from mailbox rx channel + * @tx_mc_buf: to copy data to mailbox tx channel + * @r5_core: this mailbox's corresponding r5_core pointer + * @mbox_work: schedule work after receiving data from mailbox + * @mbox_cl: mailbox client + * @tx_chan: mailbox tx channel + * @rx_chan: mailbox rx channel + */ +struct mbox_info { + unsigned char rx_mc_buf[MBOX_CLIENT_BUF_MAX]; + unsigned char tx_mc_buf[MBOX_CLIENT_BUF_MAX]; + struct zynqmp_r5_core *r5_core; + struct work_struct mbox_work; + struct mbox_client mbox_cl; + struct mbox_chan *tx_chan; + struct mbox_chan *rx_chan; +}; + /* * Hardcoded TCM bank values. This will be removed once TCM bindings are * accepted for system-dt specifications and upstreamed in linux kernel @@ -63,6 +91,7 @@ static const struct mem_bank_data zynqmp_tcm_banks[] = { * @tcm_banks: array of each TCM bank data * @rproc: rproc handle * @pm_domain_id: RPU CPU power domain id + * @ipi: pointer to mailbox information */ struct zynqmp_r5_core { struct device *dev; @@ -71,6 +100,7 @@ struct zynqmp_r5_core { struct mem_bank_data **tcm_banks; struct rproc *rproc; u32 pm_domain_id; + struct mbox_info *ipi; }; /** @@ -88,6 +118,178 @@ struct zynqmp_r5_cluster { struct zynqmp_r5_core **r5_cores; }; +/** + * event_notified_idr_cb() - callback for vq_interrupt per notifyid + * @id: rproc->notify id + * @ptr: pointer to idr private data + * @data: data passed to idr_for_each callback + * + * Pass notification to remoteproc virtio + * + * Return: 0. having return is to satisfy the idr_for_each() function + * pointer input argument requirement. + **/ +static int event_notified_idr_cb(int id, void *ptr, void *data) +{ + struct rproc *rproc = data; + + if (rproc_vq_interrupt(rproc, id) == IRQ_NONE) + dev_dbg(&rproc->dev, "data not found for vqid=%d\n", id); + + return 0; +} + +/** + * handle_event_notified() - remoteproc notification work function + * @work: pointer to the work structure + * + * It checks each registered remoteproc notify IDs. + */ +static void handle_event_notified(struct work_struct *work) +{ + struct mbox_info *ipi; + struct rproc *rproc; + + ipi = container_of(work, struct mbox_info, mbox_work); + rproc = ipi->r5_core->rproc; + + /* + * We only use IPI for interrupt. The RPU firmware side may or may + * not write the notifyid when it trigger IPI. + * And thus, we scan through all the registered notifyids and + * find which one is valid to get the message. + * Even if message from firmware is NULL, we attempt to get vqid + */ + idr_for_each(&rproc->notifyids, event_notified_idr_cb, rproc); +} + +/** + * zynqmp_r5_mb_rx_cb() - receive channel mailbox callback + * @cl: mailbox client + * @msg: message pointer + * + * Receive data from ipi buffer, ack interrupt and then + * it will schedule the R5 notification work. + */ +static void zynqmp_r5_mb_rx_cb(struct mbox_client *cl, void *msg) +{ + struct zynqmp_ipi_message *ipi_msg, *buf_msg; + struct mbox_info *ipi; + size_t len; + + ipi = container_of(cl, struct mbox_info, mbox_cl); + + /* copy data from ipi buffer to r5_core */ + ipi_msg = (struct zynqmp_ipi_message *)msg; + buf_msg = (struct zynqmp_ipi_message *)ipi->rx_mc_buf; + len = ipi_msg->len; + if (len > IPI_BUF_LEN_MAX) { + dev_warn(cl->dev, "msg size exceeded than %d\n", + IPI_BUF_LEN_MAX); + len = IPI_BUF_LEN_MAX; + } + buf_msg->len = len; + memcpy(buf_msg->data, ipi_msg->data, len); + + /* received and processed interrupt ack */ + if (mbox_send_message(ipi->rx_chan, NULL) < 0) + dev_err(cl->dev, "ack failed to mbox rx_chan\n"); + + schedule_work(&ipi->mbox_work); +} + +/** + * zynqmp_r5_setup_mbox() - Setup mailboxes related properties + * this is used for each individual R5 core + * + * @cdev: child node device + * + * Function to setup mailboxes related properties + * return : NULL if failed else pointer to mbox_info + */ +static struct mbox_info *zynqmp_r5_setup_mbox(struct device *cdev) +{ + struct mbox_client *mbox_cl; + struct mbox_info *ipi; + + ipi = kzalloc(sizeof(*ipi), GFP_KERNEL); + if (!ipi) + return NULL; + + mbox_cl = &ipi->mbox_cl; + mbox_cl->rx_callback = zynqmp_r5_mb_rx_cb; + mbox_cl->tx_block = false; + mbox_cl->knows_txdone = false; + mbox_cl->tx_done = NULL; + mbox_cl->dev = cdev; + + /* Request TX and RX channels */ + ipi->tx_chan = mbox_request_channel_byname(mbox_cl, "tx"); + if (IS_ERR(ipi->tx_chan)) { + ipi->tx_chan = NULL; + kfree(ipi); + dev_warn(cdev, "mbox tx channel request failed\n"); + return NULL; + } + + ipi->rx_chan = mbox_request_channel_byname(mbox_cl, "rx"); + if (IS_ERR(ipi->rx_chan)) { + mbox_free_channel(ipi->tx_chan); + ipi->rx_chan = NULL; + ipi->tx_chan = NULL; + kfree(ipi); + dev_warn(cdev, "mbox rx channel request failed\n"); + return NULL; + } + + INIT_WORK(&ipi->mbox_work, handle_event_notified); + + return ipi; +} + +static void zynqmp_r5_free_mbox(struct mbox_info *ipi) +{ + if (!ipi) + return; + + if (ipi->tx_chan) { + mbox_free_channel(ipi->tx_chan); + ipi->tx_chan = NULL; + } + + if (ipi->rx_chan) { + mbox_free_channel(ipi->rx_chan); + ipi->rx_chan = NULL; + } + + kfree(ipi); +} + +/* + * zynqmp_r5_core_kick() - kick a firmware if mbox is provided + * @rproc: r5 core's corresponding rproc structure + * @vqid: virtqueue ID + */ +static void zynqmp_r5_rproc_kick(struct rproc *rproc, int vqid) +{ + struct zynqmp_r5_core *r5_core = rproc->priv; + struct device *dev = r5_core->dev; + struct zynqmp_ipi_message *mb_msg; + struct mbox_info *ipi; + int ret; + + ipi = r5_core->ipi; + if (!ipi) + return; + + mb_msg = (struct zynqmp_ipi_message *)ipi->tx_mc_buf; + memcpy(mb_msg->data, &vqid, sizeof(vqid)); + mb_msg->len = sizeof(vqid); + ret = mbox_send_message(ipi->tx_chan, mb_msg); + if (ret < 0) + dev_warn(dev, "failed to send message\n"); +} + /* * zynqmp_r5_set_mode() * @@ -614,7 +816,7 @@ static int zynqmp_r5_rproc_unprepare(struct rproc *rproc) return 0; } -static const struct rproc_ops zynqmp_r5_rproc_ops = { +static struct rproc_ops zynqmp_r5_rproc_ops = { .prepare = zynqmp_r5_rproc_prepare, .unprepare = zynqmp_r5_rproc_unprepare, .start = zynqmp_r5_rproc_start, @@ -673,6 +875,7 @@ static struct zynqmp_r5_core *zynqmp_r5_add_rproc_core(struct device *cdev) } r5_core->rproc = r5_rproc; + return r5_core; free_rproc: @@ -799,6 +1002,7 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) struct device_node *child; enum rpu_tcm_comb tcm_mode; int core_count, ret, i; + struct mbox_info *ipi; ret = of_property_read_u32(dev_node, "xlnx,cluster-mode", &cluster_mode); @@ -869,6 +1073,18 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) child_devs[i] = &child_pdev->dev; + /* + * If mailbox nodes are disabled using "status" property then + * setting up mailbox channels will be failed. In that case we + * don't really need kick() operation. Include .kick() only if + * mbox channels are acquired successfully. + */ + ipi = zynqmp_r5_setup_mbox(&child_pdev->dev); + if (ipi) + zynqmp_r5_rproc_ops.kick = zynqmp_r5_rproc_kick; + else + zynqmp_r5_rproc_ops.kick = NULL; + /* create and add remoteproc instance of type struct rproc */ r5_cores[i] = zynqmp_r5_add_rproc_core(&child_pdev->dev); if (IS_ERR(r5_cores[i])) { @@ -878,6 +1094,11 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) goto release_r5_cores; } + if (ipi) { + r5_cores[i]->ipi = ipi; + ipi->r5_core = r5_cores[i]; + } + /* * If two child nodes are available in dts in lockstep mode, * then ignore second child node. @@ -915,6 +1136,7 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) while (i >= 0) { put_device(child_devs[i]); if (r5_cores[i]) { + zynqmp_r5_free_mbox(r5_cores[i]->ipi); of_reserved_mem_device_release(r5_cores[i]->dev); rproc_del(r5_cores[i]->rproc); rproc_free(r5_cores[i]->rproc); @@ -939,6 +1161,7 @@ static void zynqmp_r5_cluster_exit(void *data) for (i = 0; i < cluster->core_count; i++) { r5_core = cluster->r5_cores[i]; + zynqmp_r5_free_mbox(r5_core->ipi); of_reserved_mem_device_release(r5_core->dev); put_device(r5_core->dev); rproc_del(r5_core->rproc);