From patchwork Tue Sep 27 17:24:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 611271 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 9E551C54EE9 for ; Tue, 27 Sep 2022 17:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232459AbiI0RZA (ORCPT ); Tue, 27 Sep 2022 13:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232399AbiI0RYt (ORCPT ); Tue, 27 Sep 2022 13:24:49 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2075.outbound.protection.outlook.com [40.107.95.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBC1437FB5; Tue, 27 Sep 2022 10:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKiGz5rXap0DPTGh1Ev7T3Zxn/YMt/YfPi8BU/rSYgoqOe1MyHrPk8DRmyuHysux1QuVVpKY4XCxFtg9kfS6W9NU8IhzRVZzgPUspVioo800Hcew9TI3hFRPDBbjBBwOX3GxcZqfc0U0mro+GvR/C9oI1/uBcNujCV0loPnUa1RhbeM6jRkg5rnphqdQidl/rF9AMBKGzuznCFFBeuvRGY0SCFJX7z1AiRJbzB/FSneeIaNg0nz8TaMIOvnJzNRFbGKFB8jVvkc/wIlyPe1r5bSyFTwQB3G1LYPijbsPDjEhMe+iPzviwn0keXykqXqdQTMXku+zim0/MhtzLVXtPQ== 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=vzpAP7aCoaET4RHIGUlsyf3t9mv1CqQCdFqwMr60Gfs=; b=bs6eDB0kTFKHgGMGQWo5soT+3q9YyacoIyE2uSvBoL7f853vEJUEwf1lltv38pGC7jMMQzkomyvDIVIuX6aYh8TzH0zKTjRij6wnYJOkaT68DX8UnuP9x8noe9alJ7I0GBZ70QvQC6aPXp8SH62R6d7edx/RZ4RDl9HN/5SSDqMqNdKKMh7nsOfygiapfLzXr7VtMaxSi5O6zJZkryVE3gmYd6wL905aX0YkwQSTwKNlq/9VcEhjUnon/tQnTBixzMpKnaTyx0nC2XWbBkXZUCIGA9vOjZyROrLkZ1iUVclxTMaxBBDdaPxVjkShgLw/mcdfesUO5zzf739UXBj4Ow== 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=vzpAP7aCoaET4RHIGUlsyf3t9mv1CqQCdFqwMr60Gfs=; b=UCqZvusClfUEMn2pqAhM4lSjT0NOEyF0d4fhP6JWaryHdRi10LXN44TAGC8WN6CLRnaIOONU3/WAnwH5l5TTjFa2WeU14wwKV6P06bD3KSXqPcSBzkSUeDKA1Gq/AMqIbmq3IPNtCivjD2erDBGAAuQJ3qHc8ob5fJaH6ClRvj4= Received: from MW4PR03CA0224.namprd03.prod.outlook.com (2603:10b6:303:b9::19) by CH2PR12MB4038.namprd12.prod.outlook.com (2603:10b6:610:7b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Tue, 27 Sep 2022 17:24:45 +0000 Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b9:cafe::a8) by MW4PR03CA0224.outlook.office365.com (2603:10b6:303:b9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Tue, 27 Sep 2022 17:24:44 +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 CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Tue, 27 Sep 2022 17:24:44 +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; Tue, 27 Sep 2022 12:24:39 -0500 From: Arvind Yadav To: , , , , , , , , , , , , CC: Arvind Yadav Subject: [PATCH 1/3] dma-buf: Remove the signaled bit status check Date: Tue, 27 Sep 2022 22:54:07 +0530 Message-ID: <20220927172409.484061-2-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220927172409.484061-1-Arvind.Yadav@amd.com> References: <20220927172409.484061-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT042:EE_|CH2PR12MB4038:EE_ X-MS-Office365-Filtering-Correlation-Id: b8459f1e-f091-4377-0dbd-08daa0ad2b9e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ByAt3uFis77yFoc7MO+Zh5+QaWb4kZz7GnTjw9CvrXNX5KJGD9+UygBroEylctxO6z1uS90xvk7tWr/FYeK9+4H+oAlAfEioUJ0CS+/O/GJMd+vgnJVoZbhmA8lxmGa4+mxfyO06CoB+xqXoauT+kqdp/HBcqarRpOhB/IgU+I6dc5CZ3sAH0qAVSJA8JOBdmdRL6GAvbCuNLV9XzJA26yfmoRgyPzPS4lkWgSJ6emyZeJ6V8NtucfMGHQR/lUHjh8myUenpIyRfcHwUWMgOlgM86VJ7q0kWlz1qADylcycoGf2863m+BUJRft2unptpS8rseYb24trFmr8p55DwoY09nGRfQZ22+BA6RcEUO5fn0QVm4oeOMQfJ0Z8O8LmW9AuLVHRUeAQJ6yn7K21+C30k+5jnBQEQeM6wZJqpJsyAlZtlnx4nFfX3vgRaGhsX41XTLLgcDno/PBySLaSHMdqVGdIegPIVmUwOXRdWWXsraydjPVotlQgSrYypCd81UFVnIgHVFsD1cgYJdLrXCncypdYpLhWgXM2JgjkLBlNT9YA4f3AupSODG95+av66HzP9e7i1k3mZbIULYJlmEtH75il5QMTi8eO2TKwnLU/BbPNajemt9SFP4KyliT5Rn1AJwNWDJdJNgMSjrJDI5wEE2F91VqnKOexSEJdho/SlvQbn/WP51/u/2c1SY8IY3PNZvCGVm5SJaUuVxbkQA+G+zksHYqBv7tiCWwGeWln5PUdcky7OhGKMK4WBlpsFAj7Pp6zXh7UQwZYZhZ75ELxOphjpT5N4kqi/KJgBYd6SeVQ626zAEP8r9w1y2/5gGCNvliaVkmkvjBz9NbvgZtIrjtQ0XQ7Mt92ow/GkA24= 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:(13230022)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(36756003)(7696005)(316002)(336012)(82740400003)(110136005)(16526019)(1076003)(186003)(8936002)(26005)(2616005)(36860700001)(86362001)(70586007)(2906002)(41300700001)(83380400001)(40480700001)(426003)(47076005)(8676002)(4326008)(70206006)(81166007)(4744005)(478600001)(40460700003)(82310400005)(5660300002)(356005)(6666004)(921005)(36900700001)(2101003)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2022 17:24:44.6036 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8459f1e-f091-4377-0dbd-08daa0ad2b9e 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: CO1NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4038 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Remove the extra signaled bit status check because it is returning early when the fence is already signaled and __dma_fence_enable_signaling is checking the status of signaled bit again. Signed-off-by: Arvind Yadav --- drivers/dma-buf/dma-fence.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 406b4e26f538..11ef20f70ee0 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -648,11 +648,6 @@ int dma_fence_add_callback(struct dma_fence *fence, struct dma_fence_cb *cb, if (WARN_ON(!fence || !func)) return -EINVAL; - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { - INIT_LIST_HEAD(&cb->node); - return -ENOENT; - } - spin_lock_irqsave(fence->lock, flags); if (__dma_fence_enable_signaling(fence)) { From patchwork Tue Sep 27 17:24:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 609918 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 4F3B4C6FA92 for ; Tue, 27 Sep 2022 17:25:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbiI0RZC (ORCPT ); Tue, 27 Sep 2022 13:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232354AbiI0RY6 (ORCPT ); Tue, 27 Sep 2022 13:24:58 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD105727C; Tue, 27 Sep 2022 10:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hxr9IbDJQHaoLV3TDk88fJ9imxDEQepA7SaNtoUMUTRGJ4kZ63RqIU8n8G6cVSSu//62oSeeRNpzqmn9xLg3afa/RWTm84BdXmj8B5xvdUzf6Ro7ccyeQZCGOWrBmauKLhoprKDIkIUuEVyLF1nMvukB8peXxgD8WZvT7fK4Rx0dFGHQzdYB4SIDV/97nyhc1d10TeRnrrd0+JwWcR3GvdhPHYPJzw+oNEthh7E5n7kUZfDH4/6gmdYFmp560Sh8iasgpdhRRp5U+hj2Ax4Rb/JxtKR/LjRUwhRIAGR+Bve5Fa4rqTvfwUXXP+saUCFWzd0O1ipe+MIHOSlIuNYESQ== 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=Hh/re6H4qm1SfGhVgvtaUd2q5kotF2nVKNU02OX4tfY=; b=iHRqCt29XVW5yZ9glPBpGMzN5VVTFajAaPviyBUsxbggLJt1NphxeE58XJ6dYghh8q+xStT9TV0chnxL9O4mgMyxHbaRloPo+r48ZRtecvhEBxXwn1NvVV3wVpzkGEHep2XTMsAW/IGj4UFjtAHQFe7JUg3Dx1hhI8EQUI65SYshusxJSVo0Q+fWD79A4YLaNwtpbRpy02BLUrX21iNnglVOiIEyyERJJko/iNU7/TilqdiO6Zfy6HHcBmZ3HoSEgs3FgFmI7dk9InQJdflTmcbtvNORSC5GYv0k/cKVekUyYjTMHMjyS6ZA21NkVwX/7o/jWwReYMi5L1FDIeJ9Ug== 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=Hh/re6H4qm1SfGhVgvtaUd2q5kotF2nVKNU02OX4tfY=; b=xbFnrNn8/Te97U9lqga/45FGcdR+MoIlfMTNzY38FH3At6FPNNFCkZoV33hxTvE+4GkzioKZ/FF9/5lapYrAlN/wcQieln8RxgD2+O6oCdXN4feVbe5aIzHfqjmaFQUk6M09gDZf9UvXOfmDsLB/eHmzWQjlPBaXllI+EB/4C8M= Received: from MW4PR03CA0181.namprd03.prod.outlook.com (2603:10b6:303:b8::6) by DM6PR12MB4156.namprd12.prod.outlook.com (2603:10b6:5:218::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Tue, 27 Sep 2022 17:24:50 +0000 Received: from CO1NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b8:cafe::42) by MW4PR03CA0181.outlook.office365.com (2603:10b6:303:b8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Tue, 27 Sep 2022 17:24: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 CO1NAM11FT082.mail.protection.outlook.com (10.13.175.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Tue, 27 Sep 2022 17:24: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; Tue, 27 Sep 2022 12:24:45 -0500 From: Arvind Yadav To: , , , , , , , , , , , , CC: Arvind Yadav Subject: [PATCH 2/3] dma-buf: Enable signaling on fence for sw_sync Date: Tue, 27 Sep 2022 22:54:08 +0530 Message-ID: <20220927172409.484061-3-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220927172409.484061-1-Arvind.Yadav@amd.com> References: <20220927172409.484061-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT082:EE_|DM6PR12MB4156:EE_ X-MS-Office365-Filtering-Correlation-Id: 81454cc2-772e-4915-e1c8-08daa0ad2ef8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FhhksBhOXcnTXFy00pLGNnM0eW4sSb7lLOP4UM7mT7lkJcZebHsOoA0z1qcyQhk7KdK6N1llhPg8RMRT0aiJVBBK0r1buKWMKWsjccOmW0bzNi4JD40ZRBNnu5AFVWSX3cs0BJwOhTykIxRSgBfwMJMA/Eqe2bKb3f+Jlxgz+FObxOQPP+x9aew4T8EokpW156lD978GnLovH0rj5xu4od4NELFAaLofSKDnwJZWYUjG/pWKZ81sbKKzQjgfFe2CfEQuiJf/4kVeorOiacC58ILb914JdN2SMXh0zQ+m86p1yaC53d0RyyZWOQls05uk6emw6haXZn11ZoOZt8LZYnVXMy47ttMeHyQ51zMjGSL7ZhhukII/sR482ZCXQofWMtTzDELqIlYsoLt5KptMEYkdaaq6mjgGCEa6dixBVfzp4Y0WwSwpUTSaO16BAj3f24jENVWavQfzpAH0hGlUri93f7G3JDg+jjns8jY7UxFx6ZHCqbzVhT6ekcVZsCFcvsFWySDMZPym3DBC0+QX6bOlXBZYbAV81wtvQa5eb4SVE5xA/jC7OSDm8U0t/XHlNDRjOak25CRbvoCWGqojzkrDcjlnXkFEV1u+qwXIANStZ82HhqSMlTnjrsyW4mujm9/wSEm9bst6/1ovxaH76m1h1seimFY8tupZKHaUsPkCw1KqYYId6pYpPir1Ky5OHcaIfQRo+rLsbcyVhaFW4BX3Z1IDb06Cxd9LA2SF4uMSdUEyCsPBmcWoIsrvYz0DR/ti2MHZQBP115F6667DY6MYz/4G72juDc6Ra39kr0enTTtIvojIGtFNn2QXxJe0JkufgzbK97tLcZl/5whDIPHo+kazZQWO82JeqCpXUxQ= 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:(13230022)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199015)(40470700004)(36840700001)(46966006)(82310400005)(4744005)(40460700003)(478600001)(921005)(6666004)(356005)(5660300002)(2616005)(36860700001)(26005)(86362001)(8936002)(316002)(336012)(36756003)(7696005)(16526019)(110136005)(186003)(1076003)(82740400003)(70206006)(70586007)(4326008)(81166007)(41300700001)(40480700001)(2906002)(8676002)(47076005)(426003)(83380400001)(2101003)(83996005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2022 17:24:50.2164 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81454cc2-772e-4915-e1c8-08daa0ad2ef8 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: CO1NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4156 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Here's enabling software signaling on fence for sw_sync. Signed-off-by: Arvind Yadav Reviewed-by: Christian König --- drivers/dma-buf/sw_sync.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c index 348b3a9170fa..d2a52ceac14e 100644 --- a/drivers/dma-buf/sw_sync.c +++ b/drivers/dma-buf/sw_sync.c @@ -244,6 +244,8 @@ static struct sync_pt *sync_pt_create(struct sync_timeline *obj, obj->context, value); INIT_LIST_HEAD(&pt->link); + dma_fence_enable_sw_signaling(&pt->base); + spin_lock_irq(&obj->lock); if (!dma_fence_is_signaled_locked(&pt->base)) { struct rb_node **p = &obj->pt_tree.rb_node; From patchwork Tue Sep 27 17:24:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 611270 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 D2F04C6FA82 for ; Tue, 27 Sep 2022 17:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbiI0RZF (ORCPT ); Tue, 27 Sep 2022 13:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232465AbiI0RZB (ORCPT ); Tue, 27 Sep 2022 13:25:01 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9832672854; Tue, 27 Sep 2022 10:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=guho5G/NH6Uu9NUxWGjhkF77HE9kSSuZnRLp6eRk7MxRSjvqQl0Yhw0ci7kmX1BZcS62AG+oWMxR4h78EU9Fdz0W9AGfgVQomT4RtteryyRYE/iPK78K/3to7iRtQvgT4loIxuyUS2FdX7ZU2o9XMxRlkhme7hGE6q8eWq/cogFRuWfupjV23gWCb8dwQg10gpA8ozKbnmqW/8BWX8yopFcgZdRnrIx6n16j2NuaTDY95Tifa7yZvCiPQIzfnCuxUYiOkJGzmAwJkgJFcP7O7KzvYIe+dZYIevYYGh8tcG/3e2Y5wOVmgf1oLzMYjNfvaTzNkLOaaHZEV0tIZcZHmQ== 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=ZxjL6udLV/T1l2yE4VhuGlIkYVYM5IUzlKBuY7TuvR0=; b=ci7l0hkU8RRgQ+lX1l3zWKlAZixQSJn2Xzy3b7Y5wHbXQu8TaYIzEDGCmqh1yNWQjd1pbyU5M8KzmR89uiQ8vpk0xI2KGrCZlumPtUsXa6lCDGu+OkfQ7M0+nHkx0AULa2tY5yXn0MM6aZvhtAQJIUJ5FXdjuONgEAw2uoUQIGYPm8QZOq/U7lD358Gcc8bVi0/5rNG0jY0ayzBY0Yl1eDEqffRROHsxpAEMnHGz61m8SuF6ldlPiKMD8l6hJdCsyhKg3MB/e9v1HH5+agaB6jhAY/u84Bx1mFbuSsckKb1v8ecsM2ZW6KnyTry1ek+Uuu3WHEMyvl7/Xp463Y4+3g== 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=ZxjL6udLV/T1l2yE4VhuGlIkYVYM5IUzlKBuY7TuvR0=; b=5KpjGn737RF8cH5DLQLUBGS9Ii9dHKm4vO5JQ7gMHom+9bYOisSpuQMjqJcbWFwpXPZt/W23z3gU+C3WKId+fw2u+1JLcUjDL0SwaYbmJplWt903rNwjsk+N9G8v+GEEa/pL+K13XhOzBQT7Exb4Z+RGTWJ0BhWrpsQtIRUIceU= Received: from MW4P223CA0029.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::34) by PH0PR12MB5450.namprd12.prod.outlook.com (2603:10b6:510:e8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Tue, 27 Sep 2022 17:24:56 +0000 Received: from CO1NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::61) by MW4P223CA0029.outlook.office365.com (2603:10b6:303:80::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.19 via Frontend Transport; Tue, 27 Sep 2022 17:24:56 +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 CO1NAM11FT039.mail.protection.outlook.com (10.13.174.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Tue, 27 Sep 2022 17:24:56 +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; Tue, 27 Sep 2022 12:24:51 -0500 From: Arvind Yadav To: , , , , , , , , , , , , CC: Arvind Yadav Subject: [PATCH 3/3] dma-buf: Check status of enable-signaling bit on debug Date: Tue, 27 Sep 2022 22:54:09 +0530 Message-ID: <20220927172409.484061-4-Arvind.Yadav@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220927172409.484061-1-Arvind.Yadav@amd.com> References: <20220927172409.484061-1-Arvind.Yadav@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT039:EE_|PH0PR12MB5450:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bf6b998-fc9d-4ad3-f00d-08daa0ad3272 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y50vJD8GGXWyhmE+X+CQ/XcTz3zF4YmHs1Imndn0Z3CiRyuRiQ/UUx78fZvi6HinR2exwG3H8EAQmCLH3RNI5q9e5swuTMXx1qGwYjO+Y1kxHrcbkQ/Gx7Kpis7WeH4yBNDMaZT3iREvdK7BgcMuc+xjiy9CAo/9L13Ps26UKJTq88oJpB4x4q5zniqfO6N8UO7EkQxnzbVgc+ZT8YYqnBxjcaySCa+zVC3enCQWXGlXeFRezrKsWZAPPG+A4vh2kZlKm/cysgUQbXwyD8/Fd16QqiwoBGxta+cC1/i2K1GCop4Q1O1iM1csC+xF1vnhGgrJWO97V0o2REmSmqSkHSMafs9GUWAWSQisFO4vMrgY20svql2lmSNPqL+FsTZN8GCvtXZWE0Kio5SM7aZNPDBy5p71ZDQCe9xH7KdT2vlPL94vb7n/9qqHcpNlCCdtazFarvQ+RqsYG8+ybhWTh/v7SXalfC3Pk2Hhjb6KHeEKAdmCk5t6m3hhZaE1BwKaxyWks0Mw5btnyyNVJBWb9u5OxmWh8e79yRf2moZA2oxIxWbfsECKZMK81hmwMgQfjwWhwTbOLiP5yeLY59+czrWBGogzs91wYOAY4i37OazSUqnFaDw1qoh3Z2QIAxlEv9EeaEFEnubyxy/dxvZBzNFFRq+YHEYsmClC2ZFfzvIfGClPi1ZzyQgVk+/HNJQw1R71JKJ2j/LSPAH1S8iz8GOUe2xy2YfjdBHUPhz5rs5lfsUXqrA6iILSeqWujQpaB55IXrUy7ZK1zCWGw7vYAhu5UdAo4y18rGs78sAal4uq2IZcxQmxh6TkztrQvKqDxOmTHBmoyy2+dMDRrbHfEIh7GEF+X03cOcrFOiWantAbJQKLdlN5Am32P1e89/cO 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:(13230022)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199015)(36840700001)(40470700004)(46966006)(2906002)(16526019)(186003)(1076003)(47076005)(83380400001)(356005)(86362001)(81166007)(82310400005)(2616005)(36756003)(40480700001)(921005)(82740400003)(4326008)(426003)(36860700001)(336012)(40460700003)(110136005)(478600001)(70586007)(8676002)(70206006)(316002)(26005)(5660300002)(41300700001)(6666004)(7696005)(8936002)(36900700001)(2101003)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2022 17:24:56.0651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4bf6b998-fc9d-4ad3-f00d-08daa0ad3272 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: CO1NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5450 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fence signaling must be enabled to make sure that the dma_fence_is_signaled_locked() function ever returns true. Since drivers and implementations sometimes mess this up, this ensures correct behaviour when DMABUF_DEBUG_ENABLE_SIGNALING is used during debugging. This should make any implementation bugs resulting in not signaled fences much more obvious. 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..5156dc6be0a6 100644 --- a/include/linux/dma-fence.h +++ b/include/linux/dma-fence.h @@ -398,6 +398,11 @@ void dma_fence_enable_sw_signaling(struct dma_fence *fence); static inline bool dma_fence_is_signaled_locked(struct dma_fence *fence) { +#ifdef CONFIG_DMABUF_DEBUG_ENABLE_SIGNALING + 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;