Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4008478rwb; Tue, 6 Sep 2022 00:38:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR6WNRixK323soO8GEkLQncqtJtmdASPM9/VJ3CLIkzfAx3M0VU0C+lJUTAnxNHE2KrER9Ws X-Received: by 2002:a17:907:c05:b0:73d:6e0a:8d22 with SMTP id ga5-20020a1709070c0500b0073d6e0a8d22mr38041307ejc.646.1662449900226; Tue, 06 Sep 2022 00:38:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662449900; cv=pass; d=google.com; s=arc-20160816; b=PN3JDgUjvghc4tpCxHlFx7AK0DeOERY2mGrlRtYGwQBm4VUG7bfE9sJ96m1W2BqSsZ 8d0vF+vUoOXcrAP4+v7B0Oy11L4qIlk+8Pb7qakl/TcdLSYoXEoeD89gp0f9HgG91VCL SZcyTeT+XCQaCVwcyTVX4Hv4ZD2gzKaqLfiVSh5EgWLCjCnoGbT4VtunzpBM1fWvVKha v8O89EVLhgRdNph9Rz4+ylfKoi37fFGWVXlkDk58FkLcBkVU0E/Nu/gg4Fkpk+3WwI2Q Fm7oYpprXX94tpfd5O0PjkRx27JKqUx/IHF3v4DvqmBOxH9Ll5rKpBgmeoQSV3mCilT7 rpAw== 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=CsCTEVmG4yfXkfwpLxWIVMPRpWHtUNkNg0ocfZQvBtk=; b=D+ers7pCL0idjUxEItAGmPrfryA40JpXqV1+nS7n0g6xgeSEJNlHc3pldT1Om54qMM haeCAOtB/Ea2KsUzJvUpqzDx6I3GOXkxWhiIohIKO34QbA1qSb5zgKEhL1m/VfphebiX pPIYZaidlR+mzPzwVpNb/PxtxhrzLqyojqsC1M3wZRN78F0hNfrxgIKnvkabmwnNwenM S5TBtWS5BP34fI7z3Fgq8m++pIGf7nHFAXGH6tQyKlm+y6cioF61CXfJ7vt/rr1kOBfW t+6tFH4/cwSG5ZrjiB48o7Stxk2hfefFgBf3o0Ffq1j1NVJG+ZcUvkkubB8wQ09CLOlS Y8Iw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=jyMuRWit; 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 va8-20020a17090711c800b007318692f59csi7795746ejb.935.2022.09.06.00.37.55; Tue, 06 Sep 2022 00:38:20 -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=jyMuRWit; 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 S238508AbiIFHKa (ORCPT + 99 others); Tue, 6 Sep 2022 03:10:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238834AbiIFHKH (ORCPT ); Tue, 6 Sep 2022 03:10:07 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2072.outbound.protection.outlook.com [40.107.223.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 462E62CDFF; Tue, 6 Sep 2022 00:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JOfmIi2KszgVDn+DgrIsIPlFVuwVqKvVO8mkF9zZdjWeyfpPPctqKqAyZk3OvdbVFd3M06e4TuZDiH0BLau9mE0Kqs3u/eIb7XB/0AXJRbZynNWlfm0ZtkNkktokKc278C8LDtQ8dCoriVNvfobVu1/vmoZZWLEAtyTD2EVt+aid43ELltd3NwAytL7CM2STBfbIU1V+BC8UbmdtPAkFYBDJxJ1QB5B02u5Myp90kg/3Vp+2cEs54XhLzumeORVhaWqiBF+iMIY2yW0KN5FCtR0jJqmzJnQ8UatdVRrh9pCR1zpIjxdBdPWyBWi3J4rOD7P9SLhK1YWAcN7hyHMNJw== 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=CsCTEVmG4yfXkfwpLxWIVMPRpWHtUNkNg0ocfZQvBtk=; b=ZVCdZlW/kua80wQVGi+UoxF1gttbr/MRaqUZw1Pi59k0Cd+Ni1n9dSFNp9w/SZ05415vcdTaF0CMCmx4oINOR5u1eDYAjF613SfULj1gXfInImZlZI4qLL7UMof29jDhCHF60AzQFqIQxmsUKjcHCDeyNno8gOhODGDr1Iw2HGfy4NqaNb+xgDvOUocE6/Y7oF/eO95twre1bBwFbIddSNl5Mg4fBL12m/W4wN5yhkN2ZR13L7Ohj+C9dXsGj4lE1DAqEUkB9SQBaW+W16toejcxuRl8lWDwzw7KqTlAzg+PVzoitm4EKPlgujWeRkVoLCLhhcUvqvinoRbJz1dHfw== 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=CsCTEVmG4yfXkfwpLxWIVMPRpWHtUNkNg0ocfZQvBtk=; b=jyMuRWitF5XEvpY8H3jCTYjxk4ESY3S0nIUvMP7jbVm89L+7nf67JW+FiG6A6o5IaMB+eExlbla1opuo5amwzwJyYz79UG4xARUFE/ryReRbWbYmCU9u3RIpMAgPuoMYNPxM1z2DeUOpTedx0KMRW2AZr0FRM1aOk13RdeahUdM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB3589.namprd12.prod.outlook.com (2603:10b6:a03:df::29) by PH8PR12MB6697.namprd12.prod.outlook.com (2603:10b6:510:1cc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Tue, 6 Sep 2022 07:09:53 +0000 Received: from BYAPR12MB3589.namprd12.prod.outlook.com ([fe80::a997:c7f:aea0:764a]) by BYAPR12MB3589.namprd12.prod.outlook.com ([fe80::a997:c7f:aea0:764a%4]) with mapi id 15.20.5588.018; Tue, 6 Sep 2022 07:09:53 +0000 Message-ID: <37ec6f1d-a3f4-6fa3-6d5c-fe89bb958d87@amd.com> Date: Tue, 6 Sep 2022 09:09:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 2/4] dma-buf: enable signaling for the stub fence 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: <20220905163502.4032-1-Arvind.Yadav@amd.com> <20220905163502.4032-3-Arvind.Yadav@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20220905163502.4032-3-Arvind.Yadav@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0061.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::16) To BYAPR12MB3589.namprd12.prod.outlook.com (2603:10b6:a03:df::29) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 47bf859e-c764-47f4-7dfb-08da8fd6cb91 X-MS-TrafficTypeDiagnostic: PH8PR12MB6697:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TvP1j7ZleFRP/SBs763sF7ThQeLhYaDeleCT/2E/KtDJqrG26n3kkw7/+VdOO0+ZGnddnHZpYt8E1HTEO2eU/t/Tu/NgYR1JuVZIpjc4Qc9uV3Wxztcx+fg3rJ78uuPJPUz+mN3bTpS+/09juqkAJRNrjSUQz95dmxy0a1FoXhtzlQ7sYOJQqNq8za/pz9rK0O0ICfe+Ijfi3bZlnL25jl8CbCrRplpxBTZPJXTeI9x9Ckq5WUTkQ6nB99uaJJvuaGJmJ9ZOUSNvXZJXmKKzACcZbBDgT2zUgpwGPjNyuc7hJKc+7WXJVIzQCImTYC+Re265hUVrlunF+Y3evvcgnNK5LCKcJTn6pBHHUs9imFNukKV47AbEWB20qv8kKwB53rM44a1hJGSO+KavKLwNPjz9QFPeLZ+9vd5hUibZp+/8hSbxyRiEIoFKanNR49JtIXZzn1UxGIFLiLMEgrngKSTAtzULv6HpbSs6L+ZAEhY5LlCk1rdt0JV/Dku5FoWcr/1Q2LAwmUHydJSvelyk7lpLXEXDU0hoLPWJ+Li9FEI+AKDZbXnae8UbVdzfQFXCMbgYg0x/ioTMT4Z41yAS6j4jiPVU3mknv8cF7NGOTkv0wsCilcIQ645GXUfP0iC3byjwKiI6/wsnnXqDNIx9H0PXBTyrLmV06SexaCJCO+78gSfbaOM4/DX5V3ppmeDcWB45vY5bnyQeAHh4BoUzp//XLjmUpzW9IG9cPXi1fSg8adcZE9KfKIHdd0llLL61afh+bGh5njHve8HoRj6jpcH09Byvm7jBxy27hZzI0CredJN4oUCyZ5MptVeLFvIM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3589.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(39860400002)(136003)(396003)(366004)(376002)(66556008)(31686004)(38100700002)(8676002)(316002)(66946007)(66476007)(921005)(2906002)(31696002)(86362001)(36756003)(83380400001)(6666004)(6512007)(6486002)(41300700001)(6506007)(8936002)(5660300002)(2616005)(478600001)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U2dYaVhWWE83TVpvU3lCaURhdkp1WHplc0hXVy84L1MwZjhkdzhFMXB5cDJC?= =?utf-8?B?R3RON241ajU2Ri91aHBjbzAxUk04RVlHeTA2TmRhOGtIUHhnVUxJeUluKzEz?= =?utf-8?B?TUtVMzYvY2k4Qk5oMVQ5SVM4VlhSV2xXWE5LdlJPK1pvQUlNM2xjOGN6QmpP?= =?utf-8?B?SXV6RTczV3RiTkZFU0tTTyt5UjNFYVZPNG43YkpSR0MzTmFSb3RTUXJUK2tW?= =?utf-8?B?cWFuUVpWcTQ2ZmZBRTlqbGhpdVA0OGNEMlRCcWEvaSs5UXVrTkNlcURqcVRj?= =?utf-8?B?MEZGUm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QyYUsvWFd0MWMxaEVSMHpndnpRVXZNWnAv?= =?utf-8?B?SnZQUStYdTIyVEtZWVkyQVk5VHFOaTNpNHpXODQ1TGRlYkQzcStJa0FtNlp2?= =?utf-8?Q?IhMQ7IUHg7dJuKUsByKZg6y4w5rf0ZUUMG9UOwBqY5bq?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47bf859e-c764-47f4-7dfb-08da8fd6cb91 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3589.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2022 07:09:52.9460 (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: g15bfOBMq9zJMCC96zc/bdy9ppdBAEftqzPL78p6ERSj/9qY6AO9C0MlE/2voWOr X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6697 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 18:35 schrieb Arvind Yadav: > Here's on debug 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 > --- > > Changes in v1 : > 1- Addressing Christian's comment to remove unnecessary callback. > 2- Replacing CONFIG_DEBUG_WW_MUTEX_SLOWPATH instead of CONFIG_DEBUG_FS. > 3- The version of this patch is also changed and previously > it was [PATCH 3/4] > > --- > drivers/dma-buf/dma-fence.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c > index 066400ed8841..2378b12538c4 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; > > +#ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH > +static bool __dma_fence_enable_signaling(struct dma_fence *fence); > +#endif > + I would rename the function to something like dma_fence_enable_signaling_locked(). And please don't add any #ifdef if it isn't absolutely necessary. This makes the code pretty fragile. > /* > * fence context counter: each execution context should have its own > * fence context, this allows checking if fences belong to the same > @@ -136,6 +140,9 @@ struct dma_fence *dma_fence_get_stub(void) > &dma_fence_stub_ops, > &dma_fence_stub_lock, > 0, 0); > +#ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH > + __dma_fence_enable_signaling(&dma_fence_stub); > +#endif Alternatively in this particular case you could just set the bit manually here since this is part of the dma_fence code anyway. Christian. > dma_fence_signal_locked(&dma_fence_stub); > } > spin_unlock(&dma_fence_stub_lock);