From nobody Mon Apr 6 17:05:21 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D934ECAAD5 for ; Mon, 5 Sep 2022 10:58:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237874AbiIEK6C (ORCPT ); Mon, 5 Sep 2022 06:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237726AbiIEK5y (ORCPT ); Mon, 5 Sep 2022 06:57:54 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 220BD57E20; Mon, 5 Sep 2022 03:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eVjst3jLJmYbDWIHCX81j9c/1pVhdvCwstNG9IoIbugBR4mgWWgpn2wACzOYIrYbygjlVw/70Mq5WUmGBXb9TH5LeALoF6bZ0bH+KkpsGlp2rQgRcbhEJnr5N12C3ijTPKRJ/dOu+VaO3qhD4n+azF6RYw9iTT6cAohhUKj2jvas3r3k6shJ6DFpSnH8s8HV2IWS9zR82yWThPiUSRTBPGIuxk0tqdx7Di/HYdIWpCkYsnAGBl3qzRpRgSUU8NivBVBrpNcFEEZCItiNWgB1PXYB1gdhb8lkLP8IM1HA4J4mhJTCxHOQwYSBhGzZOociPNgAO+X2535GxhYqjAS3pg== 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=AQ7RSs1vG3HEU2pJhRoI8ZZxUxCzQJEfOlnyxwyoPMM=; b=gKMudERNbhEwrVTsZpPA6QcszxgRC7pxVt+WCOkxVh6BRhXlnQdZtY/h4b+WUbBO26zw8K+mF8PpcItV+VcZKeKRFsW7K2mE78hp5Acd1qNM1lUeMK9zzXO7eaIfch/Y5HM33V6NIp0vdo+XRXhEWF2sK0QIsaqydffO1P/5b3cBWeo7/8qF7Yz3FdDAQ+8tGP32l7uGuxAB+bNgxXc8FQKpD3kMaCGELDxZcfjVxmXn0CNFhYdAj10AnY0kqyXhe5Dg6Tpsw2AjJDn+GLsYyyTUK7shIpYhtjpEfKLrS3EsGgrt05tOJ75SyGexh2ckLg7xokJJOqE4IvRYtxk4HA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=AQ7RSs1vG3HEU2pJhRoI8ZZxUxCzQJEfOlnyxwyoPMM=; b=lo9HbVPtGBDF2oiW99uZUKCo4o6CdwCYmyrQ2gdsTW/eaejkXOTELC0wBsXZo0vEbChqaWaifZO8u258rgVF/HQ0Bch+43N0mzSOdU4ZqFf7kVR8T9JBnrNNrTCgpVVRZucGvVaVNqnrIFnyD1SJwAhNnQUNzGX1ru8pmxo0BA4= Received: from DM6PR12CA0012.namprd12.prod.outlook.com (2603:10b6:5:1c0::25) by SA0PR12MB7076.namprd12.prod.outlook.com (2603:10b6:806:2d5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Mon, 5 Sep 2022 10:57:50 +0000 Received: from DM6NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1c0:cafe::2c) by DM6PR12CA0012.outlook.office365.com (2603:10b6:5:1c0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Mon, 5 Sep 2022 10:57:50 +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 DM6NAM11FT016.mail.protection.outlook.com (10.13.173.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5588.10 via Frontend Transport; Mon, 5 Sep 2022 10:57:50 +0000 Received: from amd.amd.com (10.180.168.240) 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.28; Mon, 5 Sep 2022 05:57:46 -0500 From: Arvind Yadav To: , , , , , , , , , , , , CC: Arvind Yadav Subject: [PATCH 1/4] dma-buf: Check status of enable-signaling bit on debug Date: Mon, 5 Sep 2022 16:26:50 +0530 Message-ID: <20220905105653.13670-2-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905105653.13670-1-Arvind.Yadav@amd.com> References: <20220905105653.13670-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c046595-47d6-451c-835c-08da8f2d79ac X-MS-TrafficTypeDiagnostic: SA0PR12MB7076:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TqzFX8Ol9s8i/kbnPhiY6uA3SqvIX+TKxa8AOLoV3yEgIu6sOCdH21p5ZUZdCsw4c/BzcnwOBNCXjBcF26jbVs5d6O/fgU2vJPEZxCy6hPDDOLRfCk3tyjXjPbtF2oF/2do8e3fxPEMtdpxiqO6eqbR5mSnS27NGlrBgyzPrnyGjGOH5cn4bRZeWyTx8myOBfc6FWl1hkQmQwc4UkynBuFGdlVlvaxKyenyILSZ1Eee/WpjrG5BIkRhA7prZ4xrin6y3wejrR0A0pWpTo1SaSiRnc1GtqNntDyjFK/z0rwCiuxoW0AcD4FBEue07fSrnT+bp/Gvhk6ijw/wmJJDn2er8xTiLQLSs5zc/vNUtuDCqtz4dMjRHpqCSCCilx7iM8vjuMWSaTHZlOHajWA/BZJUlXSNiKjRTQK5WRGbS81MbQcjeZqQNBO/I8rLWQsikD4yxJj1RlsGzGN6LLhBsum9Fm7xrCysHvh/2ONFAtPURe4ZmZ4CSRUDjrfE2RItrfzXUk5RjYF2UAgxrlxipz+pnt4oU+RN+u4qP5aHyfVg606PF3F8uhfbAf1XTY7CWg87Gd/n9hUuIbmI7jtcd8FfjRqC91n8nSlPF/lu9BgHm+1JwE5QNK5h6KUiDZb5KhLkf/54NuoW9mAl5gc6QyJWBDMUnYYaijWlEvWdtbA6YOmLgke1BW6BRJAt1N4Yk3Zo1mK0J9O4RpIHWfr93jnsTOZsxdPzZqoEWLimF5TS1k/L2I/oQdhDiIAFVauih2FJjKttqY0CWdkmZ7EWyF7rASLfqNVG9bsdaiZLaglIqYQ1UReUl3gZaNWpRDDVzmYe7ufjdKl25+uwIezbsZYKIy9RpplziuFWfZoWXMgW5pwUqkwVuyFNtGF5wq+TG 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:(13230016)(4636009)(396003)(136003)(376002)(346002)(39860400002)(46966006)(40470700004)(36840700001)(70586007)(83380400001)(8676002)(47076005)(16526019)(336012)(70206006)(8936002)(426003)(4744005)(36860700001)(5660300002)(7696005)(6666004)(478600001)(26005)(41300700001)(1076003)(2616005)(186003)(4326008)(40480700001)(40460700003)(316002)(86362001)(110136005)(36756003)(82310400005)(921005)(356005)(81166007)(2906002)(82740400003)(2101003)(83996005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 10:57:50.2902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c046595-47d6-451c-835c-08da8f2d79ac 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: DM6NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7076 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The core DMA-buf framework needs to enable signaling before the fence is signaled. The core DMA-buf framework can forget to enable signaling before the fence is signaled. To avoid this scenario on the debug kernel, check the DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT status bit before checking the signaling bit status to confirm that enable_signaling is enabled. Signed-off-by: Arvind Yadav --- include/linux/dma-fence.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h index 775cdc0b4f24..60c0e935c0b5 100644 --- a/include/linux/dma-fence.h +++ b/include/linux/dma-fence.h @@ -428,6 +428,11 @@ dma_fence_is_signaled_locked(struct dma_fence *fence) static inline bool dma_fence_is_signaled(struct dma_fence *fence) { +#ifdef CONFIG_DEBUG_FS + if (!test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &fence->flags)) + return false; +#endif + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) return true; =20 --=20 2.25.1 From nobody Mon Apr 6 17:05:21 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 232CDC6FA83 for ; Mon, 5 Sep 2022 10:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237963AbiIEK6V (ORCPT ); Mon, 5 Sep 2022 06:58:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237819AbiIEK6J (ORCPT ); Mon, 5 Sep 2022 06:58:09 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2044.outbound.protection.outlook.com [40.107.244.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BE0B5809E; Mon, 5 Sep 2022 03:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPt8vqfqgI9pzuGHs5rdVX/uyzSxP3hoUIDFTabb65KrhCHgZNGEPMDPU8MbwvluinnkCFCZosmR9Lt4HSoMRfGdvocge6V9WilsNGSvKM5cwghvde6I/IxoafpEZFaOz0K7Yt1cWrI+X+2SSNxMzUO4h9hsdZHcq+dV/SMZfFaX7brIWZdKuonu8vRC5ZZ929Lz5SShW81FrPfUH9JbwA29ozz/NvW99DOcIlRvPnR6mOJy1bWGYA9mWYsZqAEJ/VoJRUHGf9XxC+3HHDnMZjZCW/fkBZYXZTS0nAXpI2eKSlUTGF05fjFNzn85EtzkHv96209zOf1gPuDBE2NexA== 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=pd3YKTi1QnWIwrhIbThqG/jNGpb7GfrRp9aQt7mObKA=; b=KNJc6Y2+iFua/oJHLEbGQMPg2R8dplMILFcUtxNaGKwY4FPP4uHINSJ4HRJY1bG2RlydX1RLMgq7yrwmvOdzfG3SwvdmzcKP6ZTr8sneQYgrcRWaFez0xafLYdROV94vHi8OmMeMHeqG7QZwDiBCSh+HB4UpMgA23U9ZU0NPoAMNvzKkGZZCF61QHQVlXfP6m0xOPq5TXZW524/lmdQ1P4bG85LWH1QE6iUvZE7hpIdvK4anzzmGX4xhlsWgqnIfV2C6tEr8qKaI+8l3OMWO8Lcp7y2DQYVv7y91ViAcuvaoI53uns+C3o9gSb7eV4O9oEmPDaFj2P/9F3Hzcva3UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=pd3YKTi1QnWIwrhIbThqG/jNGpb7GfrRp9aQt7mObKA=; b=xBG0e++Mb5bGjdjcKoiCaaIPR4URJ01BuIcqt5/bXe//Xwl6UZlEt1iBoaOabe940y04xI42ks29PBJA4+1DEIY6H0tPSq2YELy7Wibu3u/9ntKtva61IZEU131Bb0m+Dp//BhkNhy3KpluS0evGB8/PC5e6kyZADEkX5jQy0kg= Received: from DS7PR06CA0027.namprd06.prod.outlook.com (2603:10b6:8:54::6) by PH7PR12MB5853.namprd12.prod.outlook.com (2603:10b6:510:1d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.15; Mon, 5 Sep 2022 10:58:01 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:8:54:cafe::e5) by DS7PR06CA0027.outlook.office365.com (2603:10b6:8:54::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.11 via Frontend Transport; Mon, 5 Sep 2022 10:58: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5588.10 via Frontend Transport; Mon, 5 Sep 2022 10:58:00 +0000 Received: from amd.amd.com (10.180.168.240) 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.28; Mon, 5 Sep 2022 05:57:56 -0500 From: Arvind Yadav To: , , , , , , , , , , , , CC: Arvind Yadav Subject: [PATCH 2/4] drm/sched: Add callback and enable signaling on debug Date: Mon, 5 Sep 2022 16:26:51 +0530 Message-ID: <20220905105653.13670-3-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905105653.13670-1-Arvind.Yadav@amd.com> References: <20220905105653.13670-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 996ba616-27e5-49a9-f042-08da8f2d7fe1 X-MS-TrafficTypeDiagnostic: PH7PR12MB5853:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uFBS+y0KKnmUl0IKhXzRpiZAipXgej0FtWuqxHBP2yMGTkkNDGwmaMUI9Lp7JBrUNHYlEqT2ctnhR9U/bOPymsfN/O+fioYAOptsJ6qAGinnV9l8vZ+DmT49Y0l2io2iZNIWfRjq0qFJKaWWaj1icLQQ4J/lo6vuMaBFb8mF/foeGBQJN37Go3puQGtHQkD/tznAH6hdj7FrI1cj7DfU/uguzxmQ5mBDef0xWXpuNda07Yh9J99eIEg5AQsJry5cnu70LyEHsj2Gzyl8tFG6BNc9QrIUMCN+RrKIlxvp+xoD3/KfAbnE12lTEwV9Ov0TsIgQbyxZxuIkVRX5pdT9NkR8lb5gPQSIr5Z7jO1ExZMyESFAbt2uSlT8mK33tEePsz1PoF9AuSwlHi4/ov3AlYun5cg/EJtXtC/2Vv35Frhef+LTMA4O70KLiv0pixw2cZp/QBomCWcDvlTXQbyKAoKe9Fd4uswoIBpX4lJTcUWSFz26dKCihXgI6itztP6pVJy1RTZc7ShVwWVJbwZeDqj1rmhyX6Wu/nPpotJRifg+bCPQPNoYPzDtRx960387j1yv1G4W0v3Na1Yf63NxJIRDF2jDFW5ZS/FLmdUJvo3WCn3i5uoCvFXP1COqlPmDqu4sgZ99gvV2W7J9pJklASfpPy0mW1/X2PYdsDZzKiRlMjaliYfpqJz40+/m6tIoJAgUMm0uABFahZt9uDsD4Sa1akzeudU2+fBtShMslPOr+wW13iYo2WCTvtj5vaQHKt8JDGOQahHom5EIRrH0vFF8U/Ra5kdXlSMI6ecve0x6KDkZFr7dY4ntwklpq+cKs8XOWSGJwII0SnM8rMl2aN4M5GD+6di5LkAn5lyWFNhsSDNWa4qKS25AIMfIMEIg 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:(13230016)(4636009)(376002)(396003)(346002)(39860400002)(136003)(40470700004)(36840700001)(46966006)(40460700003)(82740400003)(356005)(81166007)(921005)(70586007)(36860700001)(83380400001)(82310400005)(316002)(8676002)(70206006)(110136005)(4326008)(2616005)(336012)(2906002)(40480700001)(47076005)(426003)(8936002)(186003)(5660300002)(1076003)(16526019)(478600001)(6666004)(41300700001)(26005)(7696005)(36756003)(86362001)(2101003)(83996005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 10:58:00.7222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 996ba616-27e5-49a9-f042-08da8f2d7fe1 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: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5853 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Here's on debug adding an enable_signaling callback for finished fences and enabling software signaling for finished fence. Signed-off-by: Arvind Yadav --- drivers/gpu/drm/scheduler/sched_fence.c | 12 ++++++++++++ drivers/gpu/drm/scheduler/sched_main.c | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/scheduler/sched_fence.c b/drivers/gpu/drm/sche= duler/sched_fence.c index 7fd869520ef2..ebd26cdb79a0 100644 --- a/drivers/gpu/drm/scheduler/sched_fence.c +++ b/drivers/gpu/drm/scheduler/sched_fence.c @@ -122,16 +122,28 @@ static void drm_sched_fence_release_finished(struct d= ma_fence *f) =20 dma_fence_put(&fence->scheduled); } +#ifdef CONFIG_DEBUG_FS +static bool drm_sched_enable_signaling(struct dma_fence *f) +{ + return true; +} +#endif =20 static const struct dma_fence_ops drm_sched_fence_ops_scheduled =3D { .get_driver_name =3D drm_sched_fence_get_driver_name, .get_timeline_name =3D drm_sched_fence_get_timeline_name, +#ifdef CONFIG_DEBUG_FS + .enable_signaling =3D drm_sched_enable_signaling, +#endif .release =3D drm_sched_fence_release_scheduled, }; =20 static const struct dma_fence_ops drm_sched_fence_ops_finished =3D { .get_driver_name =3D drm_sched_fence_get_driver_name, .get_timeline_name =3D drm_sched_fence_get_timeline_name, +#ifdef CONFIG_DEBUG_FS + .enable_signaling =3D drm_sched_enable_signaling, +#endif .release =3D drm_sched_fence_release_finished, }; =20 diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/sched= uler/sched_main.c index e0ab14e0fb6b..140e3d8646e2 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -961,7 +961,9 @@ static int drm_sched_main(void *param) s_fence->parent =3D dma_fence_get(fence); /* Drop for original kref_init of the fence */ dma_fence_put(fence); - +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(&s_fence->finished); +#endif r =3D dma_fence_add_callback(fence, &sched_job->cb, drm_sched_job_done_cb); if (r =3D=3D -ENOENT) --=20 2.25.1 From nobody Mon Apr 6 17:05:21 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DEC7C6FA8B for ; Mon, 5 Sep 2022 10:58:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238029AbiIEK6d (ORCPT ); Mon, 5 Sep 2022 06:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237961AbiIEK6V (ORCPT ); Mon, 5 Sep 2022 06:58:21 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F9885A174; Mon, 5 Sep 2022 03:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PL8PNnZiEfFjbKFVsmtRICe8XZRawGSgkmeTPZq9jXCXwqVjezD+6oWAlafzD4DlR+L//UGrFC67GeqYRQ/IVkKqnLxny3A6VCDG7Op4IwQqP4Ij818LAZvhLQiLHhTaQD11ECeFNFg3IMeZiQXUiomTlhz90asSca8NqBq7kRovkxtd9wZQFQ6lf2MKxEKdjwvjdt3kKmzG5k675xUO8F9fIZ9MzNA4viRxO5q+Hgjn9hIoGp0nu56Ka9tNQxpoJ1IjJC1NXbO4EYdHj3FV3Vu6lkoaPR3nS7D66+S1D1BLz7vdQVRMh9Awg4C2N8UpvIy3Zkm6jT4fYwbjHTwfDA== 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=/DA4gpyajKi438nRVy5K6og8muBYEVokmVF5yl+LL2g=; b=dCqH/PVDHFAuozusncVXMAvuQhVAT4BadBRmn2xQVQ0j5SESYpP+gxW1R2WwOlTblACb19WwVY9iL5yHmRzXKDLpyHwvLQZhyJKKHWPISUjPOp/YwiSqfO+DKDSBv+wIoe9dnBJxhL5fHCgGFZtVhLtxMsU5IcJapMQymEKCvRcu6Ni2enp/M9LL2AvlxTtMnqYO+vPL59IHSTxXM4e68yKkG0qzCmuDw1Nkc33AwWxjXiY63F+nNbj2e/rx2KjxJ68QWmOpiv6Fib/a50MV3jIat2CRd/XrfvdS5k9lBTEGZ65DlXwvwxk9Pa03c2lAqEGROb6vuMLEqpv/366I/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=/DA4gpyajKi438nRVy5K6og8muBYEVokmVF5yl+LL2g=; b=B1X9dJBN4ocC2r2j01z1Ou7otVSf2ygdhQgSpZen4kY3/EcDyzsG/ojvB68M7D+hMWIXvdboEHqnR2K7DSJ4Rd8aBYinvDjgdus0C+G513bp4SjUUKLTDFz/8Qly0rItAMb3jVw7lLD5THgQ8aAc0GP5MR9So/fR+If+b7BMqE8= Received: from DS7PR06CA0031.namprd06.prod.outlook.com (2603:10b6:8:54::11) by BN9PR12MB5146.namprd12.prod.outlook.com (2603:10b6:408:137::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Mon, 5 Sep 2022 10:58:14 +0000 Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:8:54:cafe::f2) by DS7PR06CA0031.outlook.office365.com (2603:10b6:8:54::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Mon, 5 Sep 2022 10:58:14 +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 DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5588.10 via Frontend Transport; Mon, 5 Sep 2022 10:58:14 +0000 Received: from amd.amd.com (10.180.168.240) 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.28; Mon, 5 Sep 2022 05:58:04 -0500 From: Arvind Yadav To: , , , , , , , , , , , , CC: Arvind Yadav Subject: [PATCH 3/4] dma-buf: Add callback and enable signaling on debug Date: Mon, 5 Sep 2022 16:26:52 +0530 Message-ID: <20220905105653.13670-4-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905105653.13670-1-Arvind.Yadav@amd.com> References: <20220905105653.13670-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f630320-0f12-420b-da1b-08da8f2d8837 X-MS-TrafficTypeDiagnostic: BN9PR12MB5146:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w3ciG/+Skcr8dYC8OcMo7L9TPtHZnIhgUwL6WoQ6Dum+flZSM9lxcBOROhuzUNjt+7ARnKNP3NhMhnT545tsSqKxK0zEVwDSYT2SfVXiN4rEEJ56CIN2KoVD14eTdR+Xt7Jf5bJwUI4IdPEgA9KtaH9VWauiYNfpOgrGFOQQ0n9+UfJS1DuYu7DOwBDVge9UnUIzDtvCRvcHmCGnF4qry9mhmTQ92UGmvU36RdMD0Bh2IdgpTmzziAJzp23og3DE/e8btwAGYfXhtPWzmum/n16eAAwCMWUn/hqqtXxaNyEKWMCqCqrlAd3W8dMOt/1eYPlSgnRHIqc/tXRoON7E3W09mL+/PDUjhGQdVmt4j/TOItQZlkL+Ju3R42fvyi5aseT1r6id+CRV8BSakz+jVSDkOvsZl8fdpovqbJI3nFuz8ZAEdT5VJF85jpkUsgzvpstqmMZ5gZfrrKj77I5Uw2VJP6mToDaUSTZ1dAuU60P4jxNTErDNczS1NzFMTnMXgT1TaO+9A+P9OD3AvezC76STvoe8NoGb/nrwobDAjpp+0bz4MMWLjiLOlPBzcxhch6e9jYfB3M7Mqwsq09l0EVLl/IxBYnNaddaO4w3UdJAsIV+6IroZHepPIOzH3U4QMUyGdSIr5+UskwyxvcfmQAF/9tFoWZa+5i/Xkv8tOeFTr4YeG7B4NKPzWhx/wFJLMXNguzj1otjbUVNA6yURchZ7H9qhGkWWuLM4w+WleSwC+dzlFRsBMIaIC8K36g6IAg9SZngmkXAPyr9kwsISN6I2GaL5bOUmJERq/SRMEO+JdCoTHFQtbbsaqHUnCW/UxBPCokW7QePbmLUGz+SHJp8xWI6GnVC/TTo+Ofc6qREJQEoba7usY2oD1ScGI5W8 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:(13230016)(4636009)(346002)(396003)(136003)(376002)(39860400002)(46966006)(36840700001)(40470700004)(16526019)(82740400003)(47076005)(426003)(186003)(1076003)(336012)(921005)(110136005)(356005)(36860700001)(82310400005)(40480700001)(2616005)(83380400001)(316002)(8936002)(40460700003)(26005)(2906002)(5660300002)(36756003)(41300700001)(4326008)(8676002)(81166007)(7696005)(478600001)(70206006)(86362001)(70586007)(6666004)(36900700001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 10:58:14.6914 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f630320-0f12-420b-da1b-08da8f2d8837 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: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5146 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Here's on debug adding an enable_signaling callback for the stub fences and enabling software signaling for the stub fence which is always signaled. This fence should enable software signaling otherwise the AMD GPU scheduler will cause a GPU reset due to a GPU scheduler cleanup activity timeout. Signed-off-by: Arvind Yadav --- drivers/dma-buf/dma-fence.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 066400ed8841..0a67af945ef8 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -27,6 +27,10 @@ EXPORT_TRACEPOINT_SYMBOL(dma_fence_signaled); static DEFINE_SPINLOCK(dma_fence_stub_lock); static struct dma_fence dma_fence_stub; =20 +#ifdef CONFIG_DEBUG_FS +static bool __dma_fence_enable_signaling(struct dma_fence *fence); +#endif + /* * fence context counter: each execution context should have its own * fence context, this allows checking if fences belong to the same @@ -116,9 +120,19 @@ static const char *dma_fence_stub_get_name(struct dma_= fence *fence) return "stub"; } =20 +#ifdef CONFIG_DEBUG_FS +static bool dma_fence_stub_enable_signaling(struct dma_fence *f) +{ + return true; +} +#endif + static const struct dma_fence_ops dma_fence_stub_ops =3D { .get_driver_name =3D dma_fence_stub_get_name, .get_timeline_name =3D dma_fence_stub_get_name, +#ifdef CONFIG_DEBUG_FS + .enable_signaling =3D dma_fence_stub_enable_signaling, +#endif }; =20 /** @@ -136,6 +150,9 @@ struct dma_fence *dma_fence_get_stub(void) &dma_fence_stub_ops, &dma_fence_stub_lock, 0, 0); +#ifdef CONFIG_DEBUG_FS + __dma_fence_enable_signaling(&dma_fence_stub); +#endif dma_fence_signal_locked(&dma_fence_stub); } spin_unlock(&dma_fence_stub_lock); --=20 2.25.1 From nobody Mon Apr 6 17:05:21 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68883C6FA89 for ; Mon, 5 Sep 2022 10:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237998AbiIEK6s (ORCPT ); Mon, 5 Sep 2022 06:58:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238023AbiIEK6d (ORCPT ); Mon, 5 Sep 2022 06:58:33 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2055.outbound.protection.outlook.com [40.107.92.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DD6A5A3D6; Mon, 5 Sep 2022 03:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hL7SuwZUs5GYrIAb21YW/7rwpuByi0MoRuU0jQsoYIDV4PzEAH+Sf8TF1CIx+6Sq0ufB3NPDxYeVF1Cq5hB6xQJc/Z2ofoiR3MeTpHis3JDvItycEvcBaBsleLGojTXYBrqprqqhiOAkLkpRV35ncUBFh8BzwklkPczVudEqNwk4S19XSNxERfSvj1zgsGrqiWYJHqsjB01PP5bURvWPIvQWZ9EsrZxx4Txnw6Leo3I1xfY3bJJHgr4j2OOsH/qx6AYWHmiYJMNY/C5ttRsgR1yYIUSB7fRzrTYPcZUN5M/avTqnLQ/5/Y1Y9OWrblk1oLpUxgDls67GBH56IuK19Q== 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=W+86d+YE+hPaWE8HohimmzLAeT0xeEM82WImJePul4U=; b=FZC83QGtB33FCA+lFO9Mp5mfx8ZRhDhCAhyvNM/Hgp/sWtssC9MkcbdCOkYYJXelv/tS5WNQjAhDsKhrkew4prGPkmu3Av+M+rmPWeVTg0M9gC9DEEzSzQy8Qwq2twpYWAwyr5wjKOwuGOOx0v1kq/oYqtRiyGzJTDdqrhDO8w33wHJH+HsmgYNj2N4OJ808CBy3lX6e03VCSsKtI8tii1Eewp1KmqCwFvvUBCZmFObXeDNrb5HFi48Qi78ywYUZvopivL2PTE24DPxAdVwyQfbrNRzRq/Nu8dJHNM2h8U2zeGtf3FIRAyiMaLR8ygx/FBjg/WxIxd4+linfQVWLrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.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=W+86d+YE+hPaWE8HohimmzLAeT0xeEM82WImJePul4U=; b=QP9wcIVdl718V4sJWfjIGzKQWYnll1jRM/OFTwPfV9BsZ8qGAnjeau0yGrVsK0iCS1febY2oH1I7aJ7n7cCnYcd+Ls8KPpWxfGMH+m0yWG2sTsAKH/3cKVyA8F9PD9v5TnFm584fMIB1RuivgkeuDz1ypRpFeQ0LdzBDDGdO86w= Received: from DM6PR07CA0038.namprd07.prod.outlook.com (2603:10b6:5:74::15) by BL1PR12MB5320.namprd12.prod.outlook.com (2603:10b6:208:314::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Mon, 5 Sep 2022 10:58:21 +0000 Received: from DM6NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:5:74:cafe::97) by DM6PR07CA0038.outlook.office365.com (2603:10b6:5:74::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.13 via Frontend Transport; Mon, 5 Sep 2022 10:58:21 +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 DM6NAM11FT023.mail.protection.outlook.com (10.13.173.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5588.10 via Frontend Transport; Mon, 5 Sep 2022 10:58:21 +0000 Received: from amd.amd.com (10.180.168.240) 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.28; Mon, 5 Sep 2022 05:58:16 -0500 From: Arvind Yadav To: , , , , , , , , , , , , CC: Arvind Yadav Subject: [PATCH 4/4] dma-buf: Add callback and enable signaling on debug Date: Mon, 5 Sep 2022 16:26:53 +0530 Message-ID: <20220905105653.13670-5-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905105653.13670-1-Arvind.Yadav@amd.com> References: <20220905105653.13670-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fa7a37eb-d71a-45d8-b9ba-08da8f2d8c3a X-MS-TrafficTypeDiagnostic: BL1PR12MB5320:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6pZdIabnuyzg/tjkdT50fSdP2h7S2l11xYbiKJ5fqaQEkPpTFyMNYq6ce8hULcDb7ahugIHgbJsMKbTAillsIpzlDZM31OzEOJN9+jlwgC/bESDLByWTTRxJKLKhVIi/CsyZ81S4EumwRFFvSuj05CUTZn3oRcb9IMl0Xfo0Hgx7HN/P+LELU5ZnAbq+whdvWl3CcUgMm5M2t+/SEorEzELC0OYSt0RKYaAyvqgEECslagbb8eevAbdmZ5aLk14P+U69srWyEKvZcIItG1cLBKYEsfPKhfBDcoAG9tZLEAYO6SxEU9pTjen0RuAM3yR3RA9IHTH/8ishldAgQ7rE+cWUukRRAO9qYLLU9IejdvnoOOjTirp662pOLemPtWghqfjDVyBldqsJCma0o7yM9+JDdlcFLN2WUvWgVCq1nWlBL1DXMykf/S178+DDREyujQpiTGVEkIfffjDA4wwxG/L+0vM91Z3q/XQJ14qOCEo3SJMs922nbWmTz/a2Ot3AWtiTUK8Ml20pEb3EW4rSRHed8czgIhCnaZ7c7I87SrAqDEvDwt6oIz7JXUNRQ1Hq/qM0I8ghX3nsdFt7C25VA/S5SUM1eDS/QFNd0gOETTsn/gB6Gth6r15kn6Ix/EVnxpMpfohGGBnn/Nf8SGe9VB7mHoYBC8h0LiIVxFhIOyZy+YhMMF+bJCfOPi9BQnW5jElvCNZePS28W8rJGFqLDWEK0YJ5F/A4a2r27vc0CF8D/rlWRumPX2Iqiyl0Cj5u/MGVmVvR5dVAHS0c+QlfU2Vx7F9NNxAIGpipC9lHlc8XaoynlEb+Pha+Oy+MOyZhMZQBVGYY4psn+78QDxjeHWQuPQX6dlKVtO/oBlrwoSGjX2fFB1bEcb4IDGVKX4az 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:(13230016)(4636009)(376002)(396003)(346002)(136003)(39860400002)(40470700004)(36840700001)(46966006)(2906002)(36756003)(81166007)(47076005)(426003)(356005)(921005)(1076003)(83380400001)(16526019)(336012)(186003)(2616005)(8676002)(70206006)(70586007)(40480700001)(5660300002)(8936002)(4326008)(110136005)(316002)(82310400005)(26005)(41300700001)(7696005)(478600001)(6666004)(36860700001)(40460700003)(86362001)(82740400003)(83996005)(36900700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 10:58:21.4368 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa7a37eb-d71a-45d8-b9ba-08da8f2d8c3a 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: DM6NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5320 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Here's on debug adding an enable_signaling callback for fences and enabling software signaling for selftest. Signed-off-by: Arvind Yadav --- drivers/dma-buf/st-dma-fence-chain.c | 17 +++++++++ drivers/dma-buf/st-dma-fence-unwrap.c | 54 +++++++++++++++++++++++++++ drivers/dma-buf/st-dma-fence.c | 34 ++++++++++++++++- drivers/dma-buf/st-dma-resv.c | 30 +++++++++++++++ 4 files changed, 134 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf/st-dma-fence-chain.c b/drivers/dma-buf/st-dma-= fence-chain.c index 8ce1ea59d31b..ffbb24d6a890 100644 --- a/drivers/dma-buf/st-dma-fence-chain.c +++ b/drivers/dma-buf/st-dma-fence-chain.c @@ -32,6 +32,12 @@ static const char *mock_name(struct dma_fence *f) { return "mock"; } +#ifdef CONFIG_DEBUG_FS +static bool mock_fence_enable_signaling(struct dma_fence *f) +{ + return true; +} +#endif =20 static void mock_fence_release(struct dma_fence *f) { @@ -41,6 +47,9 @@ static void mock_fence_release(struct dma_fence *f) static const struct dma_fence_ops mock_ops =3D { .get_driver_name =3D mock_name, .get_timeline_name =3D mock_name, +#ifdef CONFIG_DEBUG_FS + .enable_signaling =3D mock_fence_enable_signaling, +#endif .release =3D mock_fence_release, }; =20 @@ -87,6 +96,10 @@ static int sanitycheck(void *arg) if (!chain) err =3D -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(chain); +#endif + dma_fence_signal(f); dma_fence_put(f); =20 @@ -143,6 +156,10 @@ static int fence_chains_init(struct fence_chains *fc, = unsigned int count, } =20 fc->tail =3D fc->chains[i]; + +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(fc->chains[i]); +#endif } =20 fc->chain_length =3D i; diff --git a/drivers/dma-buf/st-dma-fence-unwrap.c b/drivers/dma-buf/st-dma= -fence-unwrap.c index 4105d5ea8dde..b43c57559ead 100644 --- a/drivers/dma-buf/st-dma-fence-unwrap.c +++ b/drivers/dma-buf/st-dma-fence-unwrap.c @@ -23,9 +23,19 @@ static const char *mock_name(struct dma_fence *f) return "mock"; } =20 +#ifdef CONFIG_DEBUG_FS +static bool mock_fence_enable_signaling(struct dma_fence *f) +{ + return true; +} +#endif + static const struct dma_fence_ops mock_ops =3D { .get_driver_name =3D mock_name, .get_timeline_name =3D mock_name, +#ifdef CONFIG_DEBUG_FS + .enable_signaling =3D mock_fence_enable_signaling, +#endif }; =20 static struct dma_fence *mock_fence(void) @@ -102,6 +112,10 @@ static int sanitycheck(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif + array =3D mock_array(1, f); if (!array) return -ENOMEM; @@ -124,12 +138,20 @@ static int unwrap_array(void *arg) if (!f1) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f1); +#endif + f2 =3D mock_fence(); if (!f2) { dma_fence_put(f1); return -ENOMEM; } =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f2); +#endif + array =3D mock_array(2, f1, f2); if (!array) return -ENOMEM; @@ -164,12 +186,20 @@ static int unwrap_chain(void *arg) if (!f1) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f1); +#endif + f2 =3D mock_fence(); if (!f2) { dma_fence_put(f1); return -ENOMEM; } =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f2); +#endif + chain =3D mock_chain(f1, f2); if (!chain) return -ENOMEM; @@ -204,12 +234,20 @@ static int unwrap_chain_array(void *arg) if (!f1) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f1); +#endif + f2 =3D mock_fence(); if (!f2) { dma_fence_put(f1); return -ENOMEM; } =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f2); +#endif + array =3D mock_array(2, f1, f2); if (!array) return -ENOMEM; @@ -248,12 +286,20 @@ static int unwrap_merge(void *arg) if (!f1) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f1); +#endif + f2 =3D mock_fence(); if (!f2) { err =3D -ENOMEM; goto error_put_f1; } =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f2); +#endif + f3 =3D dma_fence_unwrap_merge(f1, f2); if (!f3) { err =3D -ENOMEM; @@ -296,10 +342,18 @@ static int unwrap_merge_complex(void *arg) if (!f1) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f1); +#endif + f2 =3D mock_fence(); if (!f2) goto error_put_f1; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f2); +#endif + f3 =3D dma_fence_unwrap_merge(f1, f2); if (!f3) goto error_put_f2; diff --git a/drivers/dma-buf/st-dma-fence.c b/drivers/dma-buf/st-dma-fence.c index c8a12d7ad71a..4adb763f4509 100644 --- a/drivers/dma-buf/st-dma-fence.c +++ b/drivers/dma-buf/st-dma-fence.c @@ -27,6 +27,12 @@ static const char *mock_name(struct dma_fence *f) { return "mock"; } +#ifdef CONFIG_DEBUG_FS +static bool mock_fence_enable_signaling(struct dma_fence *f) +{ + return true; +} +#endif =20 static void mock_fence_release(struct dma_fence *f) { @@ -77,6 +83,9 @@ static const struct dma_fence_ops mock_ops =3D { .get_driver_name =3D mock_name, .get_timeline_name =3D mock_name, .wait =3D mock_wait, +#ifdef CONFIG_DEBUG_FS + .enable_signaling =3D mock_fence_enable_signaling, +#endif .release =3D mock_fence_release, }; =20 @@ -101,7 +110,9 @@ static int sanitycheck(void *arg) f =3D mock_fence(); if (!f) return -ENOMEM; - +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif dma_fence_signal(f); dma_fence_put(f); =20 @@ -117,6 +128,9 @@ static int test_signaling(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif if (dma_fence_is_signaled(f)) { pr_err("Fence unexpectedly signaled on creation\n"); goto err_free; @@ -190,6 +204,9 @@ static int test_late_add_callback(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif dma_fence_signal(f); =20 if (!dma_fence_add_callback(f, &cb.cb, simple_callback)) { @@ -282,6 +299,9 @@ static int test_status(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif if (dma_fence_get_status(f)) { pr_err("Fence unexpectedly has signaled status on creation\n"); goto err_free; @@ -308,6 +328,9 @@ static int test_error(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif dma_fence_set_error(f, -EIO); =20 if (dma_fence_get_status(f)) { @@ -337,6 +360,9 @@ static int test_wait(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif if (dma_fence_wait_timeout(f, false, 0) !=3D -ETIME) { pr_err("Wait reported complete before being signaled\n"); goto err_free; @@ -379,6 +405,9 @@ static int test_wait_timeout(void *arg) if (!wt.f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(wt.f); +#endif if (dma_fence_wait_timeout(wt.f, false, 1) !=3D -ETIME) { pr_err("Wait reported complete before being signaled\n"); goto err_free; @@ -458,6 +487,9 @@ static int thread_signal_callback(void *arg) break; } =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f1); +#endif rcu_assign_pointer(t->fences[t->id], f1); smp_wmb(); =20 diff --git a/drivers/dma-buf/st-dma-resv.c b/drivers/dma-buf/st-dma-resv.c index 813779e3c9be..fa4e7b09d54c 100644 --- a/drivers/dma-buf/st-dma-resv.c +++ b/drivers/dma-buf/st-dma-resv.c @@ -18,9 +18,19 @@ static const char *fence_name(struct dma_fence *f) return "selftest"; } =20 +#ifdef CONFIG_DEBUG_FS +static bool fence_enable_signaling(struct dma_fence *f) +{ + return true; +} +#endif + static const struct dma_fence_ops fence_ops =3D { .get_driver_name =3D fence_name, .get_timeline_name =3D fence_name, +#ifdef CONFIG_DEBUG_FS + .enable_signaling =3D fence_enable_signaling, +#endif }; =20 static struct dma_fence *alloc_fence(void) @@ -45,6 +55,10 @@ static int sanitycheck(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif + dma_fence_signal(f); dma_fence_put(f); =20 @@ -69,6 +83,10 @@ static int test_signaling(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif + dma_resv_init(&resv); r =3D dma_resv_lock(&resv, NULL); if (r) { @@ -114,6 +132,10 @@ static int test_for_each(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif + dma_resv_init(&resv); r =3D dma_resv_lock(&resv, NULL); if (r) { @@ -173,6 +195,10 @@ static int test_for_each_unlocked(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif + dma_resv_init(&resv); r =3D dma_resv_lock(&resv, NULL); if (r) { @@ -244,6 +270,10 @@ static int test_get_fences(void *arg) if (!f) return -ENOMEM; =20 +#ifdef CONFIG_DEBUG_FS + dma_fence_enable_sw_signaling(f); +#endif + dma_resv_init(&resv); r =3D dma_resv_lock(&resv, NULL); if (r) { --=20 2.25.1