From patchwork Thu Jul 20 21:03:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 13321076 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98020EB64DA for ; Thu, 20 Jul 2023 21:04:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 363FC10E1B0; Thu, 20 Jul 2023 21:04:42 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id C706D10E1B0 for ; Thu, 20 Jul 2023 21:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689887079; x=1721423079; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=lCUxLssVaNpbp84lPdhE6U50yP9YzyaQStCVpkM9GcY=; b=muLsOoLfO2xhbyTxXRAlvQx1QsxliCJkr9xgoI5DJzZ8ZSytStmOI3kS gWzmuYHQYA5dhKfu7n++/QohV0eFafv4dAKWZ7hk0VSSYcPCebhdJ0p/f 50i7T6cJAfwtfEoc60qSxBJjdYaVPr5TzJcybeRfEPNVBFdpSZRDl6mFQ dk6hz1IAXE3dUJ7HHDthS446pxyTgnuy08yR5Pk/yPb/AmmgRFtf3Eznx WBoEdbBixVacZ8MHhBNUJ0wQe+7zi39R6qRKDzaW9iOwH/asrrt2KEeqo 10z8h8/TLWc+RaTo4u+DA0BhIINtATW1UH8MKGfSuKdQBm1mWkkY/EAD1 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="364326776" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="364326776" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 14:04:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="789966564" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="789966564" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 20 Jul 2023 14:04:39 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 20 Jul 2023 14:04:38 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 20 Jul 2023 14:04:38 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Thu, 20 Jul 2023 14:04:38 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.102) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 20 Jul 2023 14:04:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gdHzVxPdEjKOKKpG/dcyvzSXku16pZSzNOX+vMxzoSdjHGaFDzPb0EZznlfwuLgupKTc4w7MbVUMpAhN7XgcQ2AU/tTsFzLMtazXVdpUCpv5yGtvzrp0Ed2jo7lqAy5yx/uYbDIdCGPE/0YJpU6lTf3ZoZDpIaZsaeKhbCqTT+Fth0WHxLBAWraCJco5Tg4vVIzY9cAA+0rfm/sUe/7nqaRKSb9NKwO+AtyfdZpAOkqBxBRVeNjPFLI/uAbO8W+VC8AmNABISQd7V4+lYwpvUAPlgn36BJZ8YjyNg7dGD+Bbdm9xB/xXwUf6ksVVgfeqc7fZC2qyjD7jz1TelKqxjQ== 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=oq65BIqcoCzrGiQyGLlL8wAan0BtmdXnnPtnTxthgbI=; b=ABXfq34Y7OYw7i9plPG9PEehCl7zMa5Z92YeTQklwoDEG3T49ROyVGXmchwro9xvGBZ7KXJLUkGEAR9JTD26DhMVXysDkf2eRAaYcWvxJH/UBBiN6YXRd+DoqE5VWqFVKcihlQ95N6uxv7hOvh/LanY9mhzDGDCrnK07C3wWwnVgXebJbC/e1wCO+WhEouTxDWhXRS1SL2XfLEg3qq+kH5t+ddvFDSLyaDzKB/ltaYSPEBX8jd/dNtF2Zlsakvw78yQdDVhx9t4jtD5e4+25A3v08vQ1TSMKA0mXgxX05PZe/8pTtZ0N36uBAB1fG2PRF/v8lShYYUgNHQ4B8rbg0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) by CY8PR11MB6892.namprd11.prod.outlook.com (2603:10b6:930:5b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul 2023 21:04:05 +0000 Received: from MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::7f94:b6c4:1ce2:294]) by MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::7f94:b6c4:1ce2:294%5]) with mapi id 15.20.6609.024; Thu, 20 Jul 2023 21:04:05 +0000 From: Rodrigo Vivi To: Date: Thu, 20 Jul 2023 17:03:52 -0400 Message-ID: <20230720210353.214385-3-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720210353.214385-1-rodrigo.vivi@intel.com> References: <20230720210353.214385-1-rodrigo.vivi@intel.com> X-ClientProxiedBy: BYAPR06CA0050.namprd06.prod.outlook.com (2603:10b6:a03:14b::27) To MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR11MB6059:EE_|CY8PR11MB6892:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e439f66-04c6-4816-25fc-08db8964da59 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b1bvKvw6N9qoL3ASNU92YJn8Prl4/rrtjDwmNwMw9S2tcXeP550fSkQgyPO26gzEhpmsp6MC2Z8EDw7xrYZGewB5MvUI2QviBfXhwYEvrQpYniLoNm2JFZSeX9+rYtjOJ0rZwu8U86no46wTLEbyvPS0dadYNBVxfqGjz9OIF7qxu0+KJy6r3i5krzoLHCSLmjHjvF92BplZZ7LGaWrsunDuA8Tx5nySC9MqCtqcAMt/jdww6O6/oWUMmuQB7fBdTpOBDncKNBOHR85x5UJG4EsXMGPzySewt+xHbHcu0zhDdxPQ4Y1TGRqGwa3ZSsuyQv23+4XDVOa14n2x6QEu19Jb51PO1vC6OCTJs47I/mZRTQUdG9MTkDNv6a8bz8Kiez5MTBUCa0EzzKC6PWS+NeLvT4UqnHMpPrPUkNcvse0BYtju7bIDqisVtqby13CcGSpOTkboc5RqPthjDBYVN9TmHGanxJdfnjkFvZWdbKoqVwltjoiDzqEMLwYEXLck/rmZMBo4Ej8rSzRJRzibjcKqGxrxKmXlZ/qxKTurIxroxNTA9pLl9pyyDDwBoBz1iMtMN94pdgXod8Tz42z9EYT/TAdld68fvrMlMnamMwQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN0PR11MB6059.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(346002)(366004)(39860400002)(396003)(376002)(136003)(451199021)(38100700002)(2616005)(1076003)(26005)(186003)(107886003)(6506007)(8936002)(83380400001)(66946007)(66476007)(316002)(6916009)(4326008)(66556008)(8676002)(5660300002)(41300700001)(6512007)(6486002)(6666004)(478600001)(54906003)(2906002)(82960400001)(36756003)(86362001)(44832011)(32563001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qCApA15TZ8upSf8Nmd/3EECvFf7V/ghPs8iFleh/wrBW9/TdxfsVD0ankJX69nWjgUbPpMY91G2qiK0iHbI2jPKAixYaooYMYZ1wmZ8xE/lIHfJxHUY+pa73SQJf6m0LL3ohNxesaLfZgz5RvUnsz33PXiAsxU60FPXgU4O14vKCbCMD3Oujk4hbaLw59P2rc14Uq3GgN3z5Qvkm3z1VCJfdukWBTlTMZnOYKacbMQ2hjeen+nVkxNCD8jStH40CIBzsCwoQk7QQ6pTVVRWz559+aPnAzeH3zTOa6nYpkzFf5XsbSwJhL0GBLV0bVnTKndwvWUTKnibxl5wmxWqkTzX2oehhFO1N10Or1MuF9YzMmL2MKR0KWijbt/8NJiJDl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R68eEAT6vCksIZaiyz+os90Ycl/qG+Xz6wXQedTAr/2yjUZdQ5HWos+oDg3218sPp+SfHxWSssTn8yvVfq/nAdj5TmHIWUjwiDk/55+6L5JBPvr5Yt+5w7JrDTev+0+R5CtIjPaB9oFfu6cz4MAbg== X-MS-Exchange-CrossTenant-Network-Message-Id: 0e439f66-04c6-4816-25fc-08db8964da59 X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6059.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 21:04:05.8404 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 06IhNu8p1tx1az0dk6ByGHBhBizkYRssg5uZD7X9DMu483ObMqd2Q/yDrIpN01bsRhGQmBLp1FTGTqQDeDEwtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6892 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH 3/4] drm/xe: Fix the runtime_idle call and d3cold.allowed decision. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rodrigo Vivi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" According to Documentation/power/runtime_pm.txt: int pm_runtime_put(struct device *dev); - decrement the device's usage counter; if the result is 0 then run pm_request_idle(dev) and return its result int pm_runtime_put_autosuspend(struct device *dev); - decrement the device's usage counter; if the result is 0 then run pm_request_autosuspend(dev) and return its result We need to ensure that the idle function is called before suspending so we take the right d3cold.allowed decision and respect the values set on vram_d3cold_threshold sysfs. So we need pm_runtime_put() instead of pm_runtime_put_autosuspend(). Cc: Anshuman Gupta Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index a6459df2599e..73bcb76c2d42 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -144,7 +144,7 @@ static void xe_pm_runtime_init(struct xe_device *xe) pm_runtime_set_active(dev); pm_runtime_allow(dev); pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); + pm_runtime_put(dev); } void xe_pm_init(struct xe_device *xe) @@ -273,7 +273,7 @@ int xe_pm_runtime_get(struct xe_device *xe) int xe_pm_runtime_put(struct xe_device *xe) { pm_runtime_mark_last_busy(xe->drm.dev); - return pm_runtime_put_autosuspend(xe->drm.dev); + return pm_runtime_put(xe->drm.dev); } int xe_pm_runtime_get_if_active(struct xe_device *xe)