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 ACAD8C6FD1C for ; Tue, 21 Mar 2023 02:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbjCUC4H (ORCPT ); Mon, 20 Mar 2023 22:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjCUC4F (ORCPT ); Mon, 20 Mar 2023 22:56:05 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2059.outbound.protection.outlook.com [40.107.92.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4968517148; Mon, 20 Mar 2023 19:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kRSZshCr2RcDnW9fGnJzp/XQgLrhv8iFT0i334gfbw8KIdjoy6F+nWWLMm/cnnfqsZRhA7wEmMjLWcut0yT/G2ZHV2fRzqyS9+KxL4+WkxhjpuigK+f3a7Owyo+PjDwgbnCXXCP+2zH1maObs8ejHB0fIlGfS+5k6C0+4vtFHlAuDY9833PMX7kT2Wgg7Oj9S4Ty41mnxl+l+PLbBIFqG1PSXA0gIACkLjZObdihj3OnYODgMjvH3jKuOJdGUaBafqTYVKNmm8ty73dbu6O/Q6XaszkUZ71vvlgHHZnaFYskKNN6CE40IL0AYky+qFXvSwkL9s+M8TLnVKaZIqWAPA== 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=aF+HTQ8gds3JND65WXm8Y2ksv6y+4cVCg0/DUiH++sA=; b=XC91R9OgZeIMPuIg31ahEHIm0+oC48NNcKfh3R0ioaj0/PGmkrHIlGLW0eUpoBlWku03ueH90the1yJhxC+ABCx7EPww4V1Olv6kHep7GR6X3K1LgKhjrptx0Yo/kx5UPuTggnsyjmF6J4j73DG7mTjQOv0qwYh2foZjKK8KrnCPofZ1VyK02LoBCbNAdQDSnUkyDRmqSUuvBhBaalJjyH8XFEQDK3Q6dUgII8LbJW2DVATO5h+eldpnvqt2OA30hDjQFrMmDr9VE0/+TphxaLLNA0WSKID7NTOLglF3STbCGwBn8MW5gKQKBGdAIzSnqKG8kiQzKbkV5RMcvyw63Q== 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=aF+HTQ8gds3JND65WXm8Y2ksv6y+4cVCg0/DUiH++sA=; b=jixEA8vKn67Gyg4e0vJxvrOCDz1riJBfsZwtGrepc/GvklrlhwcRNpnOJWc0OZo6QW+GoLynLeo1VOPYXdCPHZkfzn9xSDrQ3DWo8WJoRWzKzjITRefUPap8iR6JjnRdbUW6e3oS5sVMR7GwM4V5zebWtqa0A3q8gTfTAQHYrkI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB3370.namprd12.prod.outlook.com (2603:10b6:5:38::25) by CY8PR12MB7217.namprd12.prod.outlook.com (2603:10b6:930:5b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 02:55:58 +0000 Received: from DM6PR12MB3370.namprd12.prod.outlook.com ([fe80::e43d:5bd2:7a85:d0cf]) by DM6PR12MB3370.namprd12.prod.outlook.com ([fe80::e43d:5bd2:7a85:d0cf%7]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 02:55:58 +0000 Message-ID: <97416541-5051-932d-c364-a7c602d54aae@amd.com> Date: Mon, 20 Mar 2023 22:55:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 23/23] drm/sched: Add (optional) fence signaling annotation Content-Language: en-CA To: Rob Clark , dri-devel@lists.freedesktop.org Cc: Daniel Vetter , freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , open list References: <20230320144356.803762-1-robdclark@gmail.com> <20230320144356.803762-24-robdclark@gmail.com> From: Luben Tuikov In-Reply-To: <20230320144356.803762-24-robdclark@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YT4P288CA0016.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d4::29) To DM6PR12MB3370.namprd12.prod.outlook.com (2603:10b6:5:38::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3370:EE_|CY8PR12MB7217:EE_ X-MS-Office365-Filtering-Correlation-Id: e90e4582-7dfb-4b2c-9ca7-08db29b7cc19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KZTaPI/2EcpdnMBcy7cALnvZMX5x5ho0sv4iAS1cp2EzzjYue+itKMc0EZmgvXxTJuvNqqDfnEoXD6izTIJCBoXULM+uIEBEMr8nJYJC4TqMIRNF4R5J62jhCay5+Y8NSNLgeiIyRCXv8hgFwdX+EWzRQd8pocHpPC05h98jM/gNO1HCOS5QKjICXO574kWhDwGKEy6ZUfOPxMArI2XNmShAAxDR0xd56EBUgJtTc++bMMMv8LxOXvwInow3/Ithi3TFt9mPozsDeFB4G2RoGiqzFwJbAiJtjM9ElpORKaaIVI5PgqK9KX+jKiQhQNEQhDgmreB46FVDGoIn/6eC78d9fnHNyYLjRFSv2vt83nJRh3C1kLBtkUfN0LLX/NCRuV0U/smPCaHULN2EGzK9k74ZTZLISeeJ0EB/rfqtYwhXJ6WpuE1BRIORy7fmfE3SWPWf5qJmXLJ5JWQYhk18nlKQuMAAuyg7MrKgtiCxwbEBgYcWpByXDg01fUV/VmxSodDBEVRiQk1rKcGdLTtVeLBtFduIAnqqcrLj5a/C77t31lF4fc0r8DK/IFEnwZgC6+HgSfwmoE1Y/RmNMJg0AEg++NBIcfs8V/tgUPFHOQUNeUumJaas+8DdQ+4DVkkMd9My+6fN0z3VEjJAa3k6/iruT5IKFwb5ASiCYDQxDf3xyGtfkQ/IwuDH0sgARaJ7grhx+aV0Un0izxgxlCNzcgUp54iLPRjMqh7WsMaA2Xw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3370.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(39860400002)(376002)(366004)(346002)(396003)(451199018)(966005)(6486002)(44832011)(38100700002)(31686004)(478600001)(7416002)(5660300002)(54906003)(316002)(86362001)(31696002)(83380400001)(66556008)(4326008)(66946007)(8676002)(2616005)(6666004)(66476007)(36756003)(8936002)(53546011)(55236004)(41300700001)(186003)(2906002)(26005)(6506007)(6512007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dHlwL1dPNWRsSUVHNVlod3hhUXNZS3ZXVFpIN3VmVTJjVTBrbXA3aG5xMjls?= =?utf-8?B?MEhVKzVCcHg3amI4bHFCRDY0bS9YMXplL0x2RWp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-8?B?K0Eyc2JHV09DM1JLOG5sUEdRKzVpb05kT3AxL2NwVFJweVkzNkd1S1NDTzJa?= =?utf-8?B?djFlRXA3SW81OGVZWkhKaTZkQXZqY1FVN0hDZjh2VGNqc3RHWGgwUnY5M3RG?= =?utf-8?B?elVqSTdQaTZIOGdBQUdTbW8yS21IYVpKdVV2TDN3eGFKU3cwNGtRSWNWV0hH?= =?utf-8?B?Mnllc2VMbUhjcG9JaDVvbkplR3FQNUtBNG1MZnFkczloMm93aDNjbGM1NktP?= =?utf-8?Q?fTRJAdpTcnACZOsTBG03cKJ4a?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e90e4582-7dfb-4b2c-9ca7-08db29b7cc19 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3370.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 02:55:58.5072 (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: Zd9Y+6ZwY3jEgb7rEu8K0MVXfIyrVrFTJROdCVxbxt7MMaftoj52TmJg3uMg2jPH X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7217 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is good. Hopefully it helps us catch lockdep bugs. Reviewed-by: Luben Tuikov Regards, Luben On 2023-03-20 10:43, Rob Clark wrote: > From: Rob Clark > > Based on > https://lore.kernel.org/dri-devel/20200604081224.863494-10-daniel.vetter@ffwll.ch/ > but made to be optional. > > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/msm_ringbuffer.c | 1 + > drivers/gpu/drm/scheduler/sched_main.c | 9 +++++++++ > include/drm/gpu_scheduler.h | 2 ++ > 3 files changed, 12 insertions(+) > > diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c > index b60199184409..7e42baf16cd0 100644 > --- a/drivers/gpu/drm/msm/msm_ringbuffer.c > +++ b/drivers/gpu/drm/msm/msm_ringbuffer.c > @@ -93,6 +93,7 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id, > /* currently managing hangcheck ourselves: */ > sched_timeout = MAX_SCHEDULE_TIMEOUT; > > + ring->sched.fence_signaling = true; > ret = drm_sched_init(&ring->sched, &msm_sched_ops, > num_hw_submissions, 0, sched_timeout, > NULL, NULL, to_msm_bo(ring->bo)->name, gpu->dev->dev); > diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c > index 4e6ad6e122bc..c2ee44d6224b 100644 > --- a/drivers/gpu/drm/scheduler/sched_main.c > +++ b/drivers/gpu/drm/scheduler/sched_main.c > @@ -978,10 +978,15 @@ static bool drm_sched_blocked(struct drm_gpu_scheduler *sched) > static int drm_sched_main(void *param) > { > struct drm_gpu_scheduler *sched = (struct drm_gpu_scheduler *)param; > + const bool fence_signaling = sched->fence_signaling; > + bool fence_cookie; > int r; > > sched_set_fifo_low(current); > > + if (fence_signaling) > + fence_cookie = dma_fence_begin_signalling(); > + > while (!kthread_should_stop()) { > struct drm_sched_entity *entity = NULL; > struct drm_sched_fence *s_fence; > @@ -1039,6 +1044,10 @@ static int drm_sched_main(void *param) > > wake_up(&sched->job_scheduled); > } > + > + if (fence_signaling) > + dma_fence_end_signalling(fence_cookie); > + > return 0; > } > > diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h > index 9db9e5e504ee..8f23ea522e22 100644 > --- a/include/drm/gpu_scheduler.h > +++ b/include/drm/gpu_scheduler.h > @@ -483,6 +483,7 @@ struct drm_sched_backend_ops { > * @ready: marks if the underlying HW is ready to work > * @free_guilty: A hit to time out handler to free the guilty job. > * @dev: system &struct device > + * @fence_signaling: Opt in to fence signaling annotations > * > * One scheduler is implemented for each hardware ring. > */ > @@ -507,6 +508,7 @@ struct drm_gpu_scheduler { > bool ready; > bool free_guilty; > struct device *dev; > + bool fence_signaling; > }; > > int drm_sched_init(struct drm_gpu_scheduler *sched,