Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1621700pxp; Thu, 17 Mar 2022 12:56:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdZEyoVfasye866zwYj+aBYdmUHFYmP8eG+3+cK0fUaFUjHHSVlqAZ0kS8LTfnjHzlJ/6B X-Received: by 2002:a62:8f83:0:b0:4f1:68e4:c561 with SMTP id n125-20020a628f83000000b004f168e4c561mr6526314pfd.67.1647546986561; Thu, 17 Mar 2022 12:56:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647546986; cv=pass; d=google.com; s=arc-20160816; b=0kOmdiytNby8foTEFqDBBpo5hqeuXNUPendWq9gNWSzLQHiBemkMSASCLgELNvr80r YTJEP4yzWiS5/fq03AysZEq+OO+f/uWFo3tuCP0tKhfVYjaMZjJ6vzafRRqHxTaBNNBz RkN1YsL8A+ebVlfwgRsihQJu1zH3zi99fVQuFpFdsJPjgjKQBpk5ylbyMKVOIAIjrXzm 5AFi/4SlxzKJRaL54BvYeoRxTPPFNOYEiCJniHKpzTEia7hn0j21RJY3irSXJCLn5Xd5 3YDn5HrGGm4RfHgGfDbGTUxNQVEdqWP/+7L37meSRC+9cKTevjqq5kdfE5giGTpN3p8r Q3wg== 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:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=3nmcPUWwUrmMuVWrEX+kmp9aIiHuNs0vZz0RfM36qeQ=; b=kUFNZcJqktfLE1TsLAm92z072z4k91HpGNEeLZ17zzb3vc/H/DU39x86uISUPlcimR 3gK11exMpf00NcdJCAwykUFaDMosNOe9Wdr4QTuUi+h++VhImaVJM+rZ0MPLzVhhW2UC b+ZSgKjP/yBtPwMWq6hUhYQYr0VfsambIsc9p4PA+FqavEq33ao8TgVSEDnWjg0lNcVX zzDhrnrBtLaHCBbcyf+/sY813kCSMez2j1jDyGU1ABBmwdJPjuJcPYR1TNNT0G2GGy0b gBkKyOILuOA4Yp3euryaq9qPkDtI7DWiOaywPiObRUvxzP3hsN3s+zI2/Fu3OzTTZ+CJ yquQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=etuZuG5m; 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l4-20020a170902d34400b00153b2d16499si5527plk.161.2022.03.17.12.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 12:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=etuZuG5m; 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 72D7A26E56F; Thu, 17 Mar 2022 12:50:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236608AbiCQQq0 (ORCPT + 99 others); Thu, 17 Mar 2022 12:46:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234572AbiCQQqY (ORCPT ); Thu, 17 Mar 2022 12:46:24 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B814C1817BB; Thu, 17 Mar 2022 09:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gDEBx6stqSqcN2FBFfEwwLinMz3XiWveaFQxGaF/tBEn7/4qeP9aPuz6bEyQNLcso4ewNBjw9vz7JTh5xmep1VrGvO20cbtm/zEWRFbFrWmiy8PkzVIW4oGHqNUptevKubIvURKLyRtJcioK1+/G3lRcuVoKxAAejMxLsk9Ibu9ogGLhhaKO8H9aa8spvInCeDyJR6MSVoFlznR816voGBVOjQkk8/x1NhbCm88pMNXUmYCSg2UeNFkOxFd1Ai9PHT6WZx/PYUYMi4Cv5IYtujG8coWZ03nchVLGQIWvDE/Aa5ooUH+rTUO/BsyFgyoVkHBn9LKFrUF/X092fX6WwQ== 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=3nmcPUWwUrmMuVWrEX+kmp9aIiHuNs0vZz0RfM36qeQ=; b=j/B0/4J6b5LLkEGPhXtM364U9Jfgteo0M+gssA7ZIBk0N916vjcZMY4M9aO5BlfDtTbIGnEXubpUhBkeKvyKScI3laKUB3copKtaF1LRg9SzceewYvbwyje0Di89mdT0AgEEiVCR70NhrS6adBOnhf25uDwZs2r3zVyIkXZENihT+XM8smjw3lkdlFrAKpC5hFRiHiJsFDO3yFNEIa5r1aV64DKs96EZXTGmnYsPxpWE9DR87aAOwp60sbijBTwu0sw3SqatBmf86ppygKBZ3jqI1ivvD9ve9iYc5n7P8EJp5pQM0JV0DChO4Pe4Z2/GhaeHoKeHkU4v3PGHSNNtDw== 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=3nmcPUWwUrmMuVWrEX+kmp9aIiHuNs0vZz0RfM36qeQ=; b=etuZuG5mQo1Z/dqyFCOIvMe0Zn0r5zqS8UN1ISOBPpf59akas9MURFceZcbLGBNke9EfjqDVj1c9Ixk3WpLi7o79ARcsdEvyeDg+5DVwpTOLliFoFz4/QHg1CcqeK/6uLIvpZHJS9GwLbCUStd2DfPS9LRc+hmLpeWix6vIp3Bw= 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 BL1PR12MB5969.namprd12.prod.outlook.com (2603:10b6:208:398::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.15; Thu, 17 Mar 2022 16:45:05 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::404f:1fc8:9f4c:f185]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::404f:1fc8:9f4c:f185%6]) with mapi id 15.20.5081.015; Thu, 17 Mar 2022 16:45:05 +0000 Message-ID: <915537e2-ac5b-ab0e-3697-2b16a9ec8f91@amd.com> Date: Thu, 17 Mar 2022 17:44:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 2/3] drm/msm/gpu: Park scheduler threads for system suspend Content-Language: en-US To: Rob Clark Cc: Andrey Grodzovsky , dri-devel , freedreno , linux-arm-msm , Rob Clark , Sean Paul , Abhinav Kumar , David Airlie , Akhil P Oommen , Jonathan Marek , AngeloGioacchino Del Regno , Bjorn Andersson , Vladimir Lypak , open list References: <20220310234611.424743-1-robdclark@gmail.com> <20220310234611.424743-3-robdclark@gmail.com> <3945551d-47d2-1974-f637-1dbc61e14702@amd.com> <865abcff-9f52-dca4-df38-b11189c739ff@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AS8PR04CA0025.eurprd04.prod.outlook.com (2603:10a6:20b:310::30) 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: 633c378c-9145-43b9-88a4-08da08357d23 X-MS-TrafficTypeDiagnostic: BL1PR12MB5969:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6vBQlNSUwXksJlYEcPb2Rgzz0dU+MvbV7m6EcDWJh6Ls+/v6XUDUPG1mvz2ELazCgGF1DEInnLUHkMQPaYxfrK7h0RYS7c2Vp9TzarR6DNBynxcCVF4yU2S3cuWjsFj8T1DKEvJfQyFcBVU4EvfDIb6dZRcjM5NIqOvc/GQISRtZHUWPWDxnCdLm21Hom/TWfJSXjr14nBZ+WeGSUpNNh6Ib18u4vvU/wJk9B80bq7FsZyoXH46kJyOEmuKgEcOcsOOXnQb5zVBFLw56UJJokXAlRQIwygyrQbyCRSET6OxDz/cHVOjTRIfLR+sz8Ihs1DrR7KggSLTwQFUgVoMhW+b5PJCpxWRJT7wcQ54IU8JNQWOsQo2jK2o/KYL4drAGsZsQoaupdn4AsX8pP6wlCLmxBSYGdKE0J5pWYQQrgu4twOvqfFiBZgRUAy8UUfTjZqOK1n2iA/8TuxjWlJAZZFpRftyK4YCKLc7WPF9GbdVmtD1EMz/cOhAeRoojeTBXAk/QspGwPmBhckK86eVupi1y+gGkPyjaxcCjqelZe2/jXy4KtfN0v1kDSp09U4b/K5XsHBpyrD/kl4pk9ZH3Uy9MTk8N2jboCi+mvz+00p4dTsvTfL0ooF/RdN/XK7wA4QqT9Qbdmtyegj9Kt4LsC5sxo9WaJdaEHkIlPa6MDK+Ai08FSicq0Kt445R01rl97h6RimCVp7dA5bbEQzhvWXdSftZF7BLW3+6Bll3Gr4EOawuOfAOdPCLyHs5ogel9 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:(13230001)(4636009)(366004)(2906002)(86362001)(31696002)(38100700002)(6916009)(316002)(53546011)(6506007)(6512007)(6666004)(2616005)(186003)(4326008)(6486002)(508600001)(54906003)(66574015)(5660300002)(8676002)(8936002)(15650500001)(66476007)(7416002)(66946007)(66556008)(83380400001)(31686004)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SUZTMzQ4NDhtRVREUmNSVmVCUVVza2o5UWVVeW1vQmhXdE9jQnpNV05wYVph?= =?utf-8?B?ejQvNSs3RkJtR0NmUitQb0ZYWitjQ0FFNlFQVFhOemVCQ1RzVm01QUJxWnlm?= =?utf-8?B?UkhsYy92RjNwY29DNmRjR2RpOHdkalhyWCsxeGlabnJ3dEZxWlV4M0dZNGhh?= =?utf-8?B?Z29ITTVwYmtLNkN3NE1QL2J6OC8vR09XN0I2cmlPOXZlVFp5SzUzeTZsZkhm?= =?utf-8?B?SGNQcmQ0QW5Bd0ZxMHo0L2xU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f-8?Q?Fxi9c2?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 633c378c-9145-43b9-88a4-08da08357d23 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2022 16:45:05.3834 (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: +iac8RW+dFk+RDiRpBz4MkAKSmv+OIHGywVruxoH0W00SIV1kl9/CaSi9mNdEXg/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5969 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 17.03.22 um 17:18 schrieb Rob Clark: > On Thu, Mar 17, 2022 at 9:04 AM Christian König > wrote: >> Am 17.03.22 um 16:10 schrieb Rob Clark: >>> [SNIP] >>> userspace frozen != kthread frozen .. that is what this patch is >>> trying to address, so we aren't racing between shutting down the hw >>> and the scheduler shoveling more jobs at us. >> Well exactly that's the problem. The scheduler is supposed to shoveling >> more jobs at us until it is empty. >> >> Thinking more about it we will then keep some dma_fence instance >> unsignaled and that is and extremely bad idea since it can lead to >> deadlocks during suspend. > Hmm, perhaps that is true if you need to migrate things out of vram? > It is at least not a problem when vram is not involved. No, it's much wider than that. See what can happen is that the memory management shrinkers want to wait for a dma_fence during suspend. And if you stop the scheduler they will just wait forever. What you need to do instead is to drain the scheduler, e.g. call drm_sched_entity_flush() with a proper timeout for each entity you have created. Regards, Christian. > >> So this patch here is an absolute clear NAK from my side. If amdgpu is >> doing something similar that is a severe bug and needs to be addressed >> somehow. > I think amdgpu's use of kthread_park is not related to suspend, but > didn't look too closely. > > And perhaps the solution for this problem is more complex in the case > of amdgpu, I'm not super familiar with the constraints there. But I > think it is a fine solution for integrated GPUs. > > BR, > -R > >> Regards, >> Christian. >> >>> BR, >>> -R >>>