Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3024997rwb; Mon, 5 Sep 2022 05:26:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR7l2IRF7Hs+ptsdKsurFpM+XjKmOYeNnCXrW5aL3eOZdjz2pwTSGkzpV8Y3YHOxFb3jwvD7 X-Received: by 2002:a17:907:608b:b0:731:8a9d:5a2d with SMTP id ht11-20020a170907608b00b007318a9d5a2dmr35730666ejc.443.1662380818170; Mon, 05 Sep 2022 05:26:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662380818; cv=pass; d=google.com; s=arc-20160816; b=h2sJvKLK3JXkOJ5PqqII1pVTR/jE2lJAiCBBreTujMwRWpYhDTFlduojic3m3KvWd5 PUYFdl8iYpQ4b/J7Po4JbOdDtsq8jhoIIzy4vA0WjVYzokH8FG8bJz39bYyTZpLGhWJJ TITTb7hBIBbx3bB7cDP2HilaMpI995syh0TU0zpPNIqndPVDds8pCr9cwmN0uhv0pNBC 82c9zKRPac78y4bubVuNjiyohA/qOLE6l6f5v/Nve2+SgA9fKI2BLO/by9/SQkZuKCXS g1Jsvw0JLkHwfulyT/YCQuh6YspVBCKJzTwdhVV3uKAxfNiqtplj3qj+TmJS15B4e9sL l6sg== 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=M62w+sA/4ZgJkn/JIBnuBpwTw8jDUHybcNoEpP8YN1M=; b=rQ7AI0bEKACqRoxhGyfhfCHFO7fl4Y6PFa1o7G+c/E6oT+UX1OoOmH8Ajw5GxFMIj9 CbydZuSIyyc36kPOljOEOmQGMKz8Pf/94VoP6amL0kCmiTs3WHOQG94fW3YmpPulzbWx XIMmytaKsg0I6bpGEBIlUEmCr5vld3w2/qo+eww3lx5/AoeGIwhWNCmyYzm+rOjp8UtX YqL6LRVdoFsCj7lCxl6+30hUaxKC82sAv+bXDA0l0SgqE6YkiWMvXVGhiGtbsP01tZjI GdmAq71WT73ZXn7xefCYE6nz8qET24Aini0NaVRILQgnYcLBvnHfSxXsl/v3VxdyI32r sEyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=AeHP94Rj; 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 dr4-20020a170907720400b00730aa3e3843si8312908ejc.131.2022.09.05.05.26.32; Mon, 05 Sep 2022 05:26:58 -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=AeHP94Rj; 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 S237632AbiIELZ5 (ORCPT + 99 others); Mon, 5 Sep 2022 07:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236506AbiIELZz (ORCPT ); Mon, 5 Sep 2022 07:25:55 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2085.outbound.protection.outlook.com [40.107.223.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2151957246; Mon, 5 Sep 2022 04:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iJHZw1aW3iJ9H8ot87aCJKqOXqomwC6OUFd2TITzCSCMjNe+Zvr0FMVolsRnLAjAtBxfJWdqAbh2moFIcLs5dMYRvyZhHxkYxQj2PMOEva0GOAH3NAqBpsm75IrqS2xZj9hewXnEpfEQrwW0bTevyIkeH5LqeVBWXUiTtc1Vuwbu2UgORl3eod7XL0QGGGXJSifesox7T5cLDYcN/2Si6XnBmGxTuVX10O/opEX4+SNsSDe+J2Dthh/+5nejurw18VqFZra3PDqyNNB/IVR/TmyLEkd56bPu2ed0EdgWQ9Cfa6WjYNJ74IOoaoFRY7QB3PoGdFbf0+RST4oeG/wGMQ== 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=M62w+sA/4ZgJkn/JIBnuBpwTw8jDUHybcNoEpP8YN1M=; b=ZyaLm70g4gD7Dp0RRzuk4ssXB/jVTGlwb7NG0MbQAXZA5U244OzuopuzKRlJX8rt408uWdympa1HJwF5aYvEHjEq0XwwcklC/5zXQkSs/taIME7tYvFnG4EcdLbDmg/QFL8jANZIaUJh3F3nXjVqxBbH61ANxRSNrZ81lHxbkRYUd8V82jA7prsWzsvA8YMXr+SN9B3NbrpBHQkhiYOb99ACzzXZ1VPylU9Q1mKrsf8RLX3Iiqgy1LqzoyTqNZArrKoiKPZZGAhLKX930KHEVY1W5ykseVekQnKQXTuZQ47MzDfQdRiQH0vPPf9VML79H4X809r7+kr0YgAu5z6xnQ== 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=M62w+sA/4ZgJkn/JIBnuBpwTw8jDUHybcNoEpP8YN1M=; b=AeHP94RjRUr9j9YgRfFzKkUXAe/ddOaORzf9KELLSzaYZd2n3Uh7OF1kHOXyscJDRshnJ4iZVUlPiaqzUtyCc8sJH+CFGxySOJB5vQotvx7k8g8K1qE0ewe7oowD7jcwV4NXsLE4un0Mq69uZ1JXyH/KqMcDcVsfB+ZYo0jOtfM= 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 DS7PR12MB6237.namprd12.prod.outlook.com (2603:10b6:8:97::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.12; Mon, 5 Sep 2022 11:25:51 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::4524:eda6:873a:8f94]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::4524:eda6:873a:8f94%7]) with mapi id 15.20.5588.018; Mon, 5 Sep 2022 11:25:51 +0000 Message-ID: <96d14c8a-e3de-fcea-b3b1-434bc6a78ae4@amd.com> Date: Mon, 5 Sep 2022 13:25:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 2/4] drm/sched: Add callback and enable signaling on debug Content-Language: en-US To: Arvind Yadav , andrey.grodzovsky@amd.com, shashank.sharma@amd.com, amaranath.somalapuram@amd.com, Arunpravin.PaneerSelvam@amd.com, sumit.semwal@linaro.org, gustavo@padovan.org, airlied@linux.ie, daniel@ffwll.ch, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org References: <20220905105653.13670-1-Arvind.Yadav@amd.com> <20220905105653.13670-3-Arvind.Yadav@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20220905105653.13670-3-Arvind.Yadav@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0060.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::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: 5adae3eb-7587-4db7-640b-08da8f316358 X-MS-TrafficTypeDiagnostic: DS7PR12MB6237:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yAosFKgPdJTNwt2WIXuUA8TrpjVnD3ZNBYQZIg2cuMfuXFu1bAV57dJctT28Qn78/VOUE0kAs3SK60XIMvyf9HqkPey7cn5H1DkMWoNSjx8mcROULJhUKvoSqrtCKEyC2LKPEziSGpkzQnOoOVSy6swi+7eL7Ij464+S8oeNv62OZzKdGS8lOJd/gbD1KEyb7uFCntwQe0UM1eQLl++5mYPFKHc4WlPpKBsfTy8iZwaWMLAxRmFhT6CInP6yoWkc7UYQxwL1IUgCv+dpgN9gqobETI6YouhJmCjgX6MRenBtAMNWuoLtLrzxY7XDx7owevKtp1aQuJamH2AvLS7S/OR4MfRPYX++f199iS8YMYvo0C9Z+ItQeckR0HvoLqivcOM2l1va1GQHs9sqFQ+3Wtdtzc2PD4EbqVC7+xU7A9qKghOx+LSERMj8yQJoEVgharVoxMMwZmRS3MeRftK36Dbm+IYRlQV0UROc7/5RgHSph/STz90BsrEYT+5Qb/m8LDXCFSyHdQeOJLpCGjm/KEfAIPyXAB2fUhhJrgSMp/GnNsBWYWCZJIUiJr1uNHGdFEvyDt683aNr3WQdhq4y2VLFNP1jJdZSjpddmYKpEEUCf7rlG4Nh3rCuICgAH4aNKMIFqFt9xtFP0KBobSbLUwFfNMEyhwFGhh1iAgQoYxMuExt96gqgIzIFs++v5rhOLzwRtDWmIPKPAfQcyQ8WzLOj8Lx8JSe+mJgamXqqcooqkzMRCA3THAJ0U9LofjbsEkFWAQ8QafrgWSsdj1EQSNKSjvoAcapWqRnuH9EcdUhPtg9GIMnySMJkFVbLQAhM 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)(39860400002)(136003)(396003)(366004)(346002)(376002)(36756003)(6506007)(921005)(6512007)(2906002)(31686004)(38100700002)(478600001)(8936002)(6486002)(6666004)(5660300002)(316002)(41300700001)(31696002)(66476007)(26005)(66556008)(66946007)(86362001)(8676002)(186003)(83380400001)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Ym82SENRQTNRSmNhTlY4Ny9ZbDFkaEg5OHg2MWRENXU4UWV0clU5Z3FxU09v?= =?utf-8?B?dDEzSldLSkxaRWdySVZGZ0hEREtMRE9memZGRTlPcTl5MHBnQ3FkcEhjWU9n?= =?utf-8?B?dEFUSlpZd0tsYjZjcGJHVzlRcVNOck5QOFhFZVF5azUzOVZrb1A0ZkRkeUlV?= =?utf-8?B?R0tSdDdLbGR6Q0JlN2dlUHRTZ1c5am9EVTRqM0wrUjhtYitTOFIxSnpGT1Z0?= =?utf-8?B?V050cE1pQXh4TjJpV2piZU9JenV2eEE1RklURElKQzFYZ3I5bWNEblFYSnpM?= =?utf-8?B?Y2dHRU1WUTdFTlVKb1FndXNOcUM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?utf-8?Q?u+LFrNfF1KKBb8YSOAWYVafEM?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5adae3eb-7587-4db7-640b-08da8f316358 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 11:25:51.1440 (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: xB8/TVc07AZmmnNOFfRGlhXcshH7rsNap/dBNHj6mG6guj8SaqdG39mPoUmzA6ki X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6237 X-Spam-Status: No, score=-3.8 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 05.09.22 um 12:56 schrieb Arvind Yadav: > 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/scheduler/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 dma_fence *f) > > dma_fence_put(&fence->scheduled); > } > +#ifdef CONFIG_DEBUG_FS > +static bool drm_sched_enable_signaling(struct dma_fence *f) > +{ > + return true; > +} > +#endif > > static const struct dma_fence_ops drm_sched_fence_ops_scheduled = { > .get_driver_name = drm_sched_fence_get_driver_name, > .get_timeline_name = drm_sched_fence_get_timeline_name, > +#ifdef CONFIG_DEBUG_FS > + .enable_signaling = drm_sched_enable_signaling, > +#endif > .release = drm_sched_fence_release_scheduled, > }; > > static const struct dma_fence_ops drm_sched_fence_ops_finished = { > .get_driver_name = drm_sched_fence_get_driver_name, > .get_timeline_name = drm_sched_fence_get_timeline_name, > +#ifdef CONFIG_DEBUG_FS > + .enable_signaling = drm_sched_enable_signaling, > +#endif Adding the callback should not be necessary. > .release = drm_sched_fence_release_finished, > }; > > diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/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 = dma_fence_get(fence); > /* Drop for original kref_init of the fence */ > dma_fence_put(fence); Uff, not related to your patch but that looks wrong to me. The reference can only be dropped after the call to dma_fence_add_callback(). > - > +#ifdef CONFIG_DEBUG_FS > + dma_fence_enable_sw_signaling(&s_fence->finished); > +#endif This should always be called, independent of the config options set. Christian. > r = dma_fence_add_callback(fence, &sched_job->cb, > drm_sched_job_done_cb); > if (r == -ENOENT)