Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5143077rwb; Mon, 8 Aug 2022 13:01:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR4wnf3aGkwUAfZk8F7m+UYCAgKWQRq+bVAQHqzyLXreSQCox9gHl4lxUJrHrsXuF2Jwtvhq X-Received: by 2002:a17:902:ce05:b0:16c:2a1:c335 with SMTP id k5-20020a170902ce0500b0016c02a1c335mr20444858plg.5.1659988879856; Mon, 08 Aug 2022 13:01:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659988879; cv=pass; d=google.com; s=arc-20160816; b=medlSAuYFHvIEdf73XzSmjD6mcrg0q2Z49Ufk2slQl43sOPZJuL5xfu+sh3gEcgTwZ EPKxKreAkoPythpWpJRQw6My1S+W70c/Q7gwKLxy4JVgODwUY2FMsvfM+T4McJLROlsV damNCHWTAZ8HxEXRKEhkCSdZ2iWFQD826wlHKSaRtquOP7LSkK8NYDM2B8ui3wCtYItZ n45b+wJRurB8zzIw+lUZ4p405Usz0cA6OncXp2UefkO+LJoFT+EgTcvRrrFoJBR0iSx6 p5I3eJ9pqmdCK4C8edyf7jUOhzG9MAJE/tzogDSxB1AqrwCg9OCusdp3FqWrocLvOOyP u8XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:to:content-language:subject:user-agent :date:message-id:dkim-signature; bh=MBhuH0jGyk9jpeT2o/SU7pVqC2oVdcU7EVIEAJB2PxU=; b=jnOd3H/4fy9qpvhgpWaHZzGkzGfhKuaeiia0C1Ankxlr3mkw6OLC+189q6M4qbFt/J vf3qQLYhFpAWEPb715WTM364JknkdS5Zt4GPFQ9Yu8BvFUUuv35dNVK0GRXeZ/k3GIY9 +YXmQQCrzwjrwaFS3uLI4ECCpMHwWaIuKzfsYbHzLgbYj8jW25yO/LxmlyVW+wsuhl0F rEI5G26Ytz71CWQ5Hx0Z+vsKdB1FwYDhlL6ItyE/+W0qLi3kd7u/NY7V1qnntoHchmNq i+4TPMIfDM9jhms0d1p1pfRCDVaqxne5MFwbFXTgIdTGx75lwjINX1l9hKeK5Vv1BWAb d23Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=MuwMOWjt; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j64-20020a638043000000b004068c3147fbsi10541010pgd.543.2022.08.08.13.01.03; Mon, 08 Aug 2022 13:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=MuwMOWjt; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243283AbiHHToV (ORCPT + 99 others); Mon, 8 Aug 2022 15:44:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbiHHToT (ORCPT ); Mon, 8 Aug 2022 15:44:19 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2059.outbound.protection.outlook.com [40.107.93.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B31FB17ABE; Mon, 8 Aug 2022 12:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzKQAEzTAjqJ2DOueHflz0hami9E/n+hd5pX3QSsedW8aFKRddYPpB4I59sdp0wvJrD42K+OwiJd3UzMT0XtbZMb2vjXxICK2zwf/XRo6JLya9V/lJiApEf4q9zTo5HjF3qxPEZZNBgcUiyMxYaHXuuqXIaA+awGRhIgpdXzFA73V+K9HjxFDAigFnC5o1pXopKV2ZzzbVMe3oCMsh4+ODWLXL5Mhi/w73uqGvSq/Pz0eQ/dw7/dpEZuP/Amg8d9loxeJaY79X6Jre1Q6e1fPwF1LoUDEivSG6tPf+ZP/c+GwHSmPqTNwL2UYr8vjI5cHpUicSHdY9759pjX+qZ+6w== 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=MBhuH0jGyk9jpeT2o/SU7pVqC2oVdcU7EVIEAJB2PxU=; b=NR0MUoZjUVYUTcWqm+LUrkdlHfEDDAQqMkAJbOFRMDsjxtCCyrai7tvLXHidXX4eDRQAykVyMumbBqn0gaiY5jmmUHoM7rmKBpfff0Ftqc9oLa0YTOGipx9LkUdtYIB6E8Sh/1rvKeYTjBrw4jeDO+hNdLFwo0JlyhR7WhX9iqjCpxxGYe4d1ZgTzRtiiK1XSxLTc5tNUOcLfSrAJQsNO7NGCge3lNn29Kon2RElAkZHAZWUHYIpLnPOh+fFnnQeFT6Nz6Kpoay6qUdh5uO4whhe1U/K09DehSEE52EAA1v1WvLACMkH+tSUGLjGjlbOGuxDEjsF62j5xFto5auMrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=MBhuH0jGyk9jpeT2o/SU7pVqC2oVdcU7EVIEAJB2PxU=; b=MuwMOWjtbRevv89R0EttV7xunkkxZcfluBJ1GOlo+2ObJmY5L8api4B9pJK9e2N1EZaEN3OsbYa+XnkxooOQYzrKIm2AIjQc6MD4JQZCBt+FoVBM5YUL2XcfNDfSvtlWRN5VNNMkq50fir1qYY6J4nWgs1UCikKh7Uyk8LUkSYM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by PH0PR12MB5499.namprd12.prod.outlook.com (2603:10b6:510:d5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Mon, 8 Aug 2022 19:44:16 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::905:1701:3b51:7e39]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::905:1701:3b51:7e39%2]) with mapi id 15.20.5504.020; Mon, 8 Aug 2022 19:44:16 +0000 Message-ID: <1b917e43-a2a8-15c6-3c91-17a445f22a66@amd.com> Date: Mon, 8 Aug 2022 21:44:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH RFC] dma-buf: To check DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT status on debug Content-Language: en-US To: Arvind Yadav , andrey.grodzovsky@amd.com, shashank.sharma@amd.com, amaranath.somalapuram@amd.com, Luben.Tuikov@amd.com, Alexander.Deucher@amd.com, sumit.semwal@linaro.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org References: <20220804121938.622630-1-Arvind.Yadav@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20220804121938.622630-1-Arvind.Yadav@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0156.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::17) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aeaabec3-bd69-4823-dfe5-08da79766080 X-MS-TrafficTypeDiagnostic: PH0PR12MB5499:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oeQMR/MsZ82cqVoM2EOd6BaEVMfX3WATO8pm5wYjsx9X7RxvfoPfgQbGAmegbF5nGuGfSAOsva7M6idVCbYN+8AcDentgjDxoQ8qbJZ+DMAkjNs/pnS6b6uSp1U7/kJkJydNxGyei6XdtZsKjPAkMugiGUEtwzK5lzqJ1bct+KI/8JZlSn2MV3Nqm6yNNDbq/w9ZnGC9739UZsrFj6GrXgVSEsoH3kA36xKSqCbtSyrdwO13jdgTSrzaWowjHT11tr/M+vJdTFke2fw3ujbYc9t6VuIYS08dmbw8y6HuW3dUqdfij6zpHPBwgmgj8z7HO7Ew/CkyJBz7LG1LZL+kjAsxMrTyROTIWnDTComhuOBBf7k2b51Ss2ZQTUUZWKsrefYODnuZPaiLfUs12daItxPthu38gpoDgujIZsZTqbRCA2vU/C8ISGEB5oDDxs6a6r5/gl0flfFqmyg3aKLXJ0kGvxccrTn18KnE+NB8r0h3nXhUGrcGd3kZL3KIHCb95Jmwc1FrEIqbw7CmuG53LN3J5k2Gnh+TQ2PdJ9EtNEhowAX2dRTqF5veIXNsmhMQ/3jrqy4rS3i/7YpF0AJiM6HMf+t7X2ng0GOb7nQq5lcEjZAGs8+dk/DdCgtpiCDCVsy9Vfd7g4nv7X8cRl/wheeZPvB/W5GoPe2QcY5XX1irkER/8y7dkly6qDueJiIhhyQC3gsAdwn8yIMf4BKaJzcVmvMLUJkYBX+EyDEz2Wva9AlJAiUutObWkutgEu/ncKMw9Ju46p3ginYWXkhaKGbGuHPcYWYvg7zc15D5qeIkmgcN3ReSq1gWRdt//ouldbmyj33Clmra9f41x10MM4h8YtGC9gFfPvUFH18wPnw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(376002)(396003)(39860400002)(366004)(346002)(31686004)(66556008)(66476007)(36756003)(8676002)(66946007)(6486002)(186003)(316002)(86362001)(8936002)(31696002)(478600001)(5660300002)(2906002)(83380400001)(6506007)(921005)(6512007)(41300700001)(6666004)(38100700002)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SjRrSHRudUx5QU9HVzFxTytjaWI5cEhYVUlZSVZVdVNEeUc0U0srTmo4VFhw?= =?utf-8?B?bE05NzBBTVkwZWU1bjZjditCSTNqUTNBTDJEdjlSR01IQzZyQVRwZW5JUW1T?= =?utf-8?B?SURWeUtzL3F0MHN2dXZvR2ZHK2RvNml5Qk5aSG9sU1FRVGM1NUt2NDFNT3hD?= =?utf-8?B?MWZvRGFmeldnNmtudXR0M1lkbE9VZjZMbVJuZWJpNXNiWEFXSDJmaUlISDZs?= =?utf-8?B?dEViOTRvVG9Fd005aXNaTnF6bDh5L2d5a3VTdjBra2hMbTM4cjJ3d1QxMzRJ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ZPRDZlSWdFV21PclN6ZmlWNzJLMzN4RnNSTE5YZG1sSEVrU1FW?= =?utf-8?B?VjdHa2xnSm1WUjVCRDBvQTJUSmRVaC8rUDhSZi83QTNYNUFZSGUyVnZab09R?= =?utf-8?Q?egYV66YfrHZI6jH9bMOZTWA+NV9BcwffW1rpk9hX7wFS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: aeaabec3-bd69-4823-dfe5-08da79766080 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2022 19:44:16.1475 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M3sHxepC5W2X3HilLbz2neTKl3drihwVuHZBz26JSbl/ncCXawDO7/fJy9qNchMo X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5499 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 04.08.22 um 14:19 schrieb Arvind Yadav: > If core DMA-buf framework forgets to call dma_fence_enable_signaling() > before calling the dma_fence_is_signaled(). To handle this scenario on > debug kernel the DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT needs to be checked > before checking the actual signaling status. > > Signed-off-by: Arvind Yadav > --- > include/linux/dma-fence.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h > index 775cdc0b4f24..7c95c8d5e5f5 100644 > --- a/include/linux/dma-fence.h > +++ b/include/linux/dma-fence.h > @@ -428,6 +428,10 @@ 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 true; The logic is just inverted. The test should be !test_bit(...) return false; And please give that some testing as well. Regards, Christian. > +#endif > if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) > return true; >