From patchwork Thu Jul 20 21:03:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 13321074 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 A90EFEB64DD for ; Thu, 20 Jul 2023 21:04:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3207810E1A6; Thu, 20 Jul 2023 21:04:11 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id C23E510E1A6 for ; Thu, 20 Jul 2023 21:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689887048; x=1721423048; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=wovNgzaLlFJ9KRIPLPP4zkc0eEAFwGfGh4N4y0oHav8=; b=UAcs/stCSoSv3YodOr6Hm4LGf3+VOupoOYqXlQLPoOkqs7cgHGGNGcGA TvoR5VE7mH2PF8fAl3iKT+v8I4HfMbfJQySQtimTvUQY9ufgJpA+8Ofvu EjLI8IE1PXnbTNIjEJUEcTjD+7/enVEAKKmwgQjQhQa+xhWSKDk/p8uVg iFsgJIt24JpPTqFJtwGeJJHuoPbXVfm3nkpnA/DsrTDRWVE9YR+8Y9jKi a9RRLF3XyLVy33LyHnJhgs53wiXkbaqcDAlrC7zhguL1QvPNPLD2k8KAQ 9umVCv4L5kpqtIwyJ+sZFyzQim0Hn8iJUFKU1pnIz0evoJu0mobBRUu9P Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="347166166" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="347166166" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 14:04:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="754177329" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="754177329" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 20 Jul 2023 14:04:07 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:00 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) 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:00 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 via Frontend Transport; Thu, 20 Jul 2023 14:04:00 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (134.134.137.103) 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:03:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h1EhecS/cEazMyE4FzejItpbg3LhvmWHePxibdFN9d1NfihWqAjoaGzdH1bka9UIknBXcBTqpudUJLNEktOCrT3rsl3UgevqtqorkHP3cpR2twC/yoahmNGQAXig4O4vDB9p6UfS3OUDBJj5TGnvsknE2go8nLPiwAMNf2L8hAfvd1JizXDH3CrGqskJ/ejNmSTCDWS3t7btd32IN1hQQjxmQhSKBlHyC1NdEjEYK0tXDLxGRj8vL82Hc5oUzU61vDRZlr6te95YWbRmNxmHohriGFij3CTJce4VCKBt7kFRaEcMdzx4MH+SUiXqt+qDsPVslijfmxxvVigovUcCPA== 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=AMXlDWvz4BwodBCreoAGLArkDt2oVsTkOUMr7C15/yA=; b=IcnbPUp0uBHdk057jMtPWt3P450AAar/otbbOBaOYuVhUlztu2GjKjQ8FGw069Ift/gDxK5lW5GMnWaquQplYSTcybyF1cYiL7i+fAIYz/k1PeKsqUBYbNDSQmnCo86x/1wePBZJTBH3T1ENazojt/4MW8Dy5pNEpggoGnaEGNwRM75JXhC/vA3iimU7t/K5S/JAOlsBrytOrSyq3F+TSZMkUW96ZIEB7W+GVUBK/p/1NgkNnVQNWXH7Pvd5rcb43rtijwqk2FiGe58nrBIeVD0ibguavnCVPF0xnZGywX+k7TR96iHpN6TUkxZ9PtyIG3diXbbJV4iVLIdTrVaLog== 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:03:58 +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:03:57 +0000 From: Rodrigo Vivi To: Date: Thu, 20 Jul 2023 17:03:50 -0400 Message-ID: <20230720210353.214385-1-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: SJ0PR05CA0066.namprd05.prod.outlook.com (2603:10b6:a03:332::11) 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: 1c35a11b-4c22-4b33-0c81-08db8964d597 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o1Bq/HsCfjkNrJF+kdcqzJxBZWkGedM4JhnD/G6Di/9dyfbalADxwqgwKt61I+Cd4nRLa9EJ97NHY1HUW86Szij+ExocPpxRMqRbDgx93QbSo4Q+f2PIIq6U0w9mRdW4/gckrnScphGLy574O9S+lwmEe1OnBnnbjAg2gscgI0BnZQoX1R3ueNcYs52f+urMgaDCYs3dXSr8O0jKzTD+sOgz60yTa7S9K78l3seVSBjXurbOaK9x5MFJ+BRVrkLnS1595QWJLQm1xkAsgtiOCSE4A+LWRJEOOTMDfLu3I3Loq3uC6RBEwIA1IUrVX3oZP8yCRwThw/shV4D4Q52GGxikY/sfG4C8rnzEE+wkdybVCBb91MuSyIzC5lzHBr5cZdXdIscAMlmMr2lRntxNj9a0pe4qjwdlaitY3r9C98/p/3/iOk3HHFfIhZujqcmewb2V+smd/SnBcSxzqH34lOAMn8VW7urO6Ik6xHjA/yKvbEzKgkpD0m8xgG0JRjNNUANGbssstp4B+twZJSwHQsP4zFxwX7+53FMbBIw1Jet0OQ2g9FMmar3iVqHWk5+K 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); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4O5cwLy/kZI8PxbnOlrvAM/QZlwEyPwlN6aiMOZKLLqpCv4UTLgwfG6bx3MtC764wxXiFHoJ8g+vvaA/MCkrftgLkPz6tvsKaET9eUJxYXf1Ou3QmxfxWmZCsgBBUkCSqufSljVWU8JCxoM+m3QQMogODjw/NpL7+gR6oDg5jJZ13VBjf5AgIXOmdm/hPGmpjPphWUf7/1T8MbBRDuZPYDBw2k07lCfhNLgwI4wADrXC60E7Jaqlx504p2MQqzz3EtMfzdb8durN7HO3+hv1TMZA4vZUKHdqdf29VjBBq3bK+t9WbofsKH52SBQDp9Nm4EP0W5TOlNPyOGPvG46uYBABu2yPzZWwFPi+OauaKeTL7RpNnhJ/730X3+VthS7OrxgGWlSH6vdrF7Y2G8IM+EtjAZOcv0SGwfPBl3N2Y5nUyF9Mp/y8JXHH1suwN3HqcXyI+4cuV2hj4aNwQhf6/LIQiV7DoHVcqOZxqNuD7luayoYLG/jnuV72Ju3ujcVMh4X0noXfbvVHeJeA5nZe4kNsSLn+y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Network-Message-Id: 1c35a11b-4c22-4b33-0c81-08db8964d597 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:03:57.8745 (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: xJofCFlWvmImR5elua+dJzr2CsbGRTs7pgKCwKfPRymy65IWCAlF8ePSoB7GmwtJmUObdc8AdVMYX7n8zPRTuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6892 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH 1/4] drm/xe: Only set PCI d3cold_allowed when we are really allowing. 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" First of all it was strange to see: if (allowed) { ... } else { D3COLD_ENABLE } But besides this misalignment, let's also use the pci d3cold_allowed useful to us and know that we are not really allowing d3cold. Cc: Anshuman Gupta Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 78df43c20cd2..0c4051f4f746 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -794,6 +794,7 @@ static int xe_pci_runtime_suspend(struct device *dev) pci_save_state(pdev); if (xe->d3cold.allowed) { + d3cold_toggle(pdev, D3COLD_ENABLE); pci_disable_device(pdev); pci_ignore_hotplug(pdev); pci_set_power_state(pdev, PCI_D3cold); @@ -823,8 +824,6 @@ static int xe_pci_runtime_resume(struct device *dev) return err; pci_set_master(pdev); - } else { - d3cold_toggle(pdev, D3COLD_ENABLE); } return xe_pm_runtime_resume(xe); From patchwork Thu Jul 20 21:03:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 13321075 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 B8529EB64DD for ; Thu, 20 Jul 2023 21:04:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20AC310E1AB; Thu, 20 Jul 2023 21:04:26 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 44BD210E1AB for ; Thu, 20 Jul 2023 21:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689887064; x=1721423064; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=alIiAVRLZP+hPx+YEPuRluJyKOfuVNfzhq/DVTPkBnk=; b=VT5nNT6mfh4A/pV5iKx0b3UC4HYUEjzYP27Q1ojrYiEIEoqZMUG9xxrr /2L+eQR5EgTeWyV7P0lRTjrumMA/9qXuj37IVfoZ7bP18347PDH7FO+w5 Tn5uWCRDmzecSXA+keNA/fRenQs2FQsj5XQcA+0BJnlKrxlGoSpPoG/gr LqS51uLf4MNAj+zUU0XBbznXYeoPcueTl0ifGWZWwRb8a2C163yL0smul oMgEhYYx0jSCdbVuEAnAJ4N6RI36HJK64dAigzpxP/CorHYZ78zNuM26Y zsJ8wx0Y8IbO4XU9r2PspmmFucTrCqhQUNmOFTZ1fr44Skwdl/tmpYM+3 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="397752276" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="397752276" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 14:04:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="718580540" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="718580540" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga007.jf.intel.com with ESMTP; 20 Jul 2023 14:04:22 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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; Thu, 20 Jul 2023 14:04:21 -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:21 -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:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUo+AEZuCDOggXa+6XxMFANiY4dkGZdmH2iXd+6OZYvd+ACJoYNfCucNEng6cmMLtYJHKQdjvmW8b3MMcbOF2M0hP/mea43VegsBOi4bsbFCiNexHRsk4cg613y3ntloRXrIV+wyvuCIsCNiVd74wnelpRd0mQhDC9mQ5+JDR+qDNrA8RFaWcgBvy+lgdf6VDWZd/JOEGsdUu18+TDwwqSzKXya7jz7Zm2o3jLa89xzM7bLJJjtsNoGlAHr35u4N8wauwGbCJw7gEXjLGupYkfXAPgxuNhuw3TF8UmHph7N9bCvsfaluKKaYv56g4i6FoQvbWjEH4dLHMsU8baOE1g== 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=g0FNAPHZzTnVrMoIcBoJxi711iGfLPNqJJPksAg8g2k=; b=Gd7wEUbmuJSMDfl88MiTGkz75MbDxMHVIJLkbXQc+kgkXBKmQrNpgqZ0y7d62QyP9RGUpoOXmcwxMBUcao2Pk49K6yCbKfbGT4LW13YQ5HlHtiq9ZHl5D1psFpVF+vi1ACRS91Hl8EHe7x1Gg0G1AR5EBBCQvLN3viho1cu9GGFcxOZm++SlWf5kGPYXYsNp4EcBg2ZqcfmfX9b9C1hwv2lUdNtxSNTRjMfXCjQziLS0eLG8rWUjLvW9yHl65ntAXCH4Rx2QCCH8dCCPWeqXE6UatNQC9bfNOynaalKyA07vIMSGxmY8siSnBjd28KZzh1OmU9C+kSyoJTwch4Ph3Q== 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:02 +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:02 +0000 From: Rodrigo Vivi To: Date: Thu, 20 Jul 2023 17:03:51 -0400 Message-ID: <20230720210353.214385-2-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: BYAPR07CA0040.namprd07.prod.outlook.com (2603:10b6:a03:60::17) 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: 1ff11d53-af1a-4419-4779-08db8964d818 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mN4bgnqzZAKrrWDN07rwTsvbawks5rGzwzB7ZP2EgOyM7Oi6J/2gTMQ0Dr4oMiFAoSXPjO1zVug7K8XzvwjqkjFD1v4xUzmReuX4GPjuKtOLOhLiIWUmwvXWMSJLsV1YvjSPU4r8e78Bz45zZOPFskZuj99R+ab+r36kfwsUhKtNBRp6xacI2Fj4b/oCtEfdHp4PJZI+XNAVDYhbQCHFJrhZ4us8nEsQXzRNA8jWhU1ipQ2gTUV7e5qCqVZ4MWokAoxqm7T0jxWMxkSOeuN3xYOrlRiku02tqGcqsNhmN8XmFXnhC8Wb7veo7t0WFwrzX65QpXcKU7j0c31K0PaL1qxsk4nRkBX82juSoHYzQS9FmhjnMbfRqD5q7cRqPjgqz0ouVMoW+yZzpPCQ2sZ1+SrUO66lJAYJLa758lfiIX0ZwSngBAMGMgbmTVbT3anx8ikCTgjh4Gylb9RiWEbSWwkDkBVNBWSxNxI2IDmx/8pqMDp2q/0ntCGe9dbx8HHg5CjGkpFNUigpwIpRRdxchEMBMkZi4ysPcEUYeBe24NAezxImpKg6qrfrwpJG1Tq1 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); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K3J0c1BLdMoeLLxz9A55Q1dPoeR/9kgfInnN3l0zfAZGJclIjyvs1yHTmvBeKem9MrtBOzFWmqSd/G1EJ+Q4/qcbsnWehZk4vm0q/yOPJL0WBtJeT7kFKnU6BINFcOTHpGOPOwC3Pe0Hdn/gjkO2m9uRqzrHTZjrDlCHsn7XIog8p2PiFBZNRAHzF/LT5v32KPi0r6AIGjttEJk7+fBe3pInbyrDnQYI4/Wg83f4liLoNRQ7rYAojWvbfsiD7z2g+lBNRd36TM3Re8cyuZfhNiRsWZCa1LiO4Q3y3Dr/dV2RohD3oFIEQyy4vPRx3RacindDsFC2OaHuvtU4OPec8ClJzUe9BRhLgzWCoF0jNj5WZJEzdc0O/P2/ilwWXCjQuDtzaaFN9GBxm6m8LGf7OUw3sLTXCMTbONREXrb/p/ByBmBTsmuCnz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IqI+hWpJtHgoHjZwksP636CdiU9dQlKpd/Raj4vJaCIFC9ikLMk8mhyh4PvfQdUnoZvcJzQHYWOOh6Nk/A== X-MS-Exchange-CrossTenant-Network-Message-Id: 1ff11d53-af1a-4419-4779-08db8964d818 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:02.0158 (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: BnZWkYhRAyhCnaTUZpjsXMYPf/NZiE8Ey2hX2Sz+EkxWH1QRK94BvIHZhPeiPOoZjrrOX4Rk1hdTL9XOCeUnIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6892 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH 2/4] drm/xe: Move d3cold_allowed decision all together. 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" And let's use the VRAM threshold to keep d3cold temporarily disabled. With this we have the ability to run D3Cold experiments just by touching the vram_d3cold_threshold sysfs entry. Cc: Anshuman Gupta Signed-off-by: Rodrigo Vivi Reviewed-by: Anshuman Gupta --- drivers/gpu/drm/xe/xe_pci.c | 15 +-------------- drivers/gpu/drm/xe/xe_pm.c | 5 +++++ drivers/gpu/drm/xe/xe_pm.h | 7 ++++++- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 0c4051f4f746..06759afb4224 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -834,20 +834,7 @@ static int xe_pci_runtime_idle(struct device *dev) struct pci_dev *pdev = to_pci_dev(dev); struct xe_device *xe = pdev_to_xe_device(pdev); - if (!xe->d3cold.capable) { - xe->d3cold.allowed = false; - } else { - xe_pm_d3cold_allowed_toggle(xe); - - /* - * TODO: d3cold should be allowed (true) if - * (IS_DGFX(xe) && !xe_device_mem_access_ongoing(xe)) - * but maybe include some other conditions. So, before - * we can re-enable the D3cold, we need to: - * 1. rewrite the VRAM save / restore to avoid buffer object locks - */ - xe->d3cold.allowed = false; - } + xe_pm_d3cold_allowed_toggle(xe); return 0; } diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index 17a69b7af155..a6459df2599e 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -326,6 +326,11 @@ void xe_pm_d3cold_allowed_toggle(struct xe_device *xe) u64 vram_used; int i; + if (!xe->d3cold.capable) { + xe->d3cold.allowed = false; + return; + } + for (i = XE_PL_VRAM0; i <= XE_PL_VRAM1; ++i) { man = ttm_manager_type(&xe->ttm, i); if (man) { diff --git a/drivers/gpu/drm/xe/xe_pm.h b/drivers/gpu/drm/xe/xe_pm.h index 08a633ce5145..6b9031f7af24 100644 --- a/drivers/gpu/drm/xe/xe_pm.h +++ b/drivers/gpu/drm/xe/xe_pm.h @@ -8,7 +8,12 @@ #include -#define DEFAULT_VRAM_THRESHOLD 300 /* in MB */ +/* + * TODO: Threshold = 0 will block D3Cold. + * Before we can move this to a higher value (like 300), we need to: + * 1. rewrite the VRAM save / restore to avoid buffer object locks + */ +#define DEFAULT_VRAM_THRESHOLD 0 /* in MB */ struct xe_device; 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/8NJiJDlAGQwUT3wFkVdAR3V2QZj9YuY4c+YHL8GiTTLzF15+4yOvh9qd9qRMem6t4m5gRd854M5u1DiU+v+w6bfHRKyjOeyU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IWUjwiDk/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) From patchwork Thu Jul 20 21:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 13321077 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 9EEB6EB64DD for ; Thu, 20 Jul 2023 21:04:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F9A010E1B1; Thu, 20 Jul 2023 21:04:44 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E87510E1B0 for ; Thu, 20 Jul 2023 21:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689887081; x=1721423081; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=VmBFqFqb3GpAN6uTipXqQYCeL6RvPBf1tihOIgBjIZ8=; b=FJ8qFBbZ3c4YQJoSbD7AZpm1BYMr6Q8s5jk5N6BT18aJJZuii5XwDlHR 3MyF+kIcEa8WS+x5/erz30CZ4k4YSN6Pl1c3f6Tg3K2zZ96YZuWRNIron WCNL0V5kadoINwDIAvLjIldDYopEDigNiqFMADIY8SVvqPQAqIpWyvUDa hE9+pQxtAe+u/M6DBtutTuVZetr8CELvPrx1J3JesrId0JzTjpvBDJVct fJsMz+bPmk7TNBmj0yhdJaqDGuEhgIj6QqvdBtLdI7WdNb3fS/H73DlKD oWcOHgSaVAJrp4TRSCmGP35DY3v24PTevJgZYaPiVoGOgcAIYFRrA7V91 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="347166430" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="347166430" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 14:04:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="754177397" X-IronPort-AV: E=Sophos;i="6.01,219,1684825200"; d="scan'208";a="754177397" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 20 Jul 2023 14:04:40 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:39 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) 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:39 -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:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iyDZjJ0rWpXiAuEZr/fP8gzPxTfbzCTjDWRU/ZqBlHkZJZKLrI+0MWaENjJYZn5PUDwZBAoQWYbMD7G1S+n/PLjzrucuCmJOHGjVhxvtMUJ58ijcgoilgF+47V3p3s+WSoDaHGsT6d0ttXIE/LHTGIHwvRSA/TS4LmbJ/gOQmUWopHFoGtb0VgxSmzxjmS3ySDWWZVA1krD/aCjIaDkd2TCYGJ5Wcs0ATaqVHCtZ8+3GBHqnhfPTv3kIdjp4x6Ft2AC7O1oBEDqSJUZ4KMjmssP09WwwQb+8it2t1Yqx+tXt8SvhRpjrBM1/G+lIsQgVbbUKg/4Rj3f3wJwRQ1pOfg== 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=l72OOg/p9mWTK41pPRlrY1cLibREztTh3jhJeu86ZpY=; b=foK3iS8m07yU6a6CBko4nUHaae41bXIBj6xOwN3jcQjeVkYRLxYK3O8henBnkKPjEJpTDHZybdEEsSm3WYrp0VPobkQp4ofM+LrymtyJjsZ33o9I6JRmojaTbinvI8ujkzlJ6WCoOrcGnV9bevBIb5lVbsF2617Vui3gNIQq/ZBLN86ilIxt8GQREFI5cap01CPtYc2Pl2KQ1SINwUetLoTVCtoKKh4a4l/S7i9X9cH1ytcE/0Thubw1Srqf/9PvPvBsf9z8Mt4yGeuZjqV/8gESRB4kglCDuWgzDehFvomLn0FJmgr5yreX1XfimO03L2mqsAKEaeGkBbQom4Q1lw== 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:09 +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:09 +0000 From: Rodrigo Vivi To: Date: Thu, 20 Jul 2023 17:03:53 -0400 Message-ID: <20230720210353.214385-4-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: SJ0PR03CA0202.namprd03.prod.outlook.com (2603:10b6:a03:2ef::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: e9ede7b3-9dbd-4776-b6ff-08db8964dc8b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xl6t5khNKDxjev1PWHIVLDi30XDx4jYzFAcuyKSizyYV/bU0TGOX7Tn2SY8ESHZP8Uja6q1ARdwv2zas3m1B+dK123IxtByItlCewN5TRDv0b9W7uBKzD6+L8ke5YWjM3z270wxgVXmrGmgG8kCc1P9w8bP6CgoOX6P5rBt7Htcrh9wAN5ew8KVe8Ztpa5Ed7jDAgoEPf28FcUnDok8BCY/Aoq/N2GWTf6ONJhSuY4aHhrdQf53Mn2mGbWfNP4L4cKo6B64acyR4VrQCIYdhczNDBZv+xv/FYGu/9Dus/oALrEtaRmKAYkujYUnPMMKr+mp/RSJdSabungvQlaK6OjwTdL5eWHLKKFLduRUh6gyzu9MRV4/u9EulB3hUBg6mW3A9Xc2YN8utpoudF2QLzMy8sMCDe75yphAtOuCUmATlBy/RkUfzn2AFYPS+4JZujrKjMw5c3T37wyOOT5RngMEMOHPnP6MFOS7dZcOwaAyJDFH1F0pRtMBVxL2e1qOWvd8XmLPHMGrhxVKg/H9ycvrxgSagKsDSENILG4AdomD9Jtz8PgdD5zwUmljME9khpLbsJITNe+3V7PD3iEyeFvyU56ln/zzcHiWtIkK6fWQcSr5i8fA0sHSIbSSkmlW7uQPBQVz1Hoq169w8/oP4hQ== 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)(4744005)(478600001)(54906003)(2906002)(82960400001)(36756003)(86362001)(44832011)(42413004)(32563001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 62d8RlbMVGEWZaZ74N4iVdfBiNaCbZiI4s3oRfJ5ZP+8TKxW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9I0sL1j+zUp3Q8M0JVYxGZL0hvOIfpQdsZmwVp8xdbcA2tUAGVwyGcsYBGRJ1c7UoZP7ToN4Y4HI2qBpL31atfP8K+ExFURKarMn3t5LzV6LHhc3mI5XAdrqVrkv7Q4LioVyryvcaynBl64S5aQscAafpSUW20DSOLTuHpd0eF84balOT5ddTokrJ6KWRRtiF53uGgl4Oke3lVCZJYjlQME5ML/5fR/ZRhM3yJ5uw6Qcax3Wh2gKQgwvSmoGJYTqAv5icHSvm3KOraVfecvnokZ8B4O85VKk+7Gu9mlAKEUUo/SId/DXyu7RcUUClpQCewZniGKWgcSGWH+h88FBeQ1yonKxkRdZss74j3G0PU1tSO74RqjYQReXvKkaolSaxV5HmCwITb0uTp/q5qyFnh9R5GM11QDfWCbc38Lk1rCS5D5MwDoJ/y6iZJKiEPElt4VRlGJ/w5Osbq9W/Yg1XmGNWhfejw== X-MS-Exchange-CrossTenant-Network-Message-Id: e9ede7b3-9dbd-4776-b6ff-08db8964dc8b 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:09.4127 (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: 9tVtY8SB9sWwRVTsVjznfIR6EoZSCBieOFk0XuSNzVfnPLqU/oArhnHwIt+YlBWZixHZ/6WRmkgFFzjc5e2IqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6892 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH 4/4] drm/xe: Only init runtime PM after all d3cold config is in place. 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" We cannot allow runtime pm suspend after we configured the d3cold capable and threshold. Cc: Anshuman Gupta Signed-off-by: Rodrigo Vivi Reviewed-by: Anshuman Gupta --- drivers/gpu/drm/xe/xe_pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index 73bcb76c2d42..366ee446af38 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -152,10 +152,12 @@ void xe_pm_init(struct xe_device *xe) struct pci_dev *pdev = to_pci_dev(xe->drm.dev); drmm_mutex_init(&xe->drm, &xe->d3cold.lock); - xe_pm_runtime_init(xe); + xe->d3cold.capable = xe_pm_pci_d3cold_capable(pdev); xe_device_sysfs_init(xe); xe_pm_set_vram_threshold(xe, DEFAULT_VRAM_THRESHOLD); + + xe_pm_runtime_init(xe); } void xe_pm_runtime_fini(struct xe_device *xe)