From patchwork Fri Aug 30 18:35:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 13785438 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 C88BCCA100C for ; Fri, 30 Aug 2024 18:35:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 56EF410EACA; Fri, 30 Aug 2024 18:35:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="hcrNBK1F"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3473310EACA; Fri, 30 Aug 2024 18:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725042919; x=1756578919; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=bijXNps0QPv+TfQKvSZB31VvSFDGkqQ/rb8N3cAkCdc=; b=hcrNBK1FmbV2bmUhWJ9ZYs4wTeHhRu7nS1ihXxQJe4nul4r/jxGipwwH u8uJvhkP9bA4GdXZcJmAY9fMmeCgNbZGttnUQZukJzN+AhLrd0XUqnff+ DD4i4O1yXm+PrCJSR2+MIMV0YmGBJS/wPLD6S4pmfe1bGuH1dyV3GENCQ P59NfG45rop8fRux/kasWiCXn54VG1alj4ABj7iJOpZaVBgI75dq8s/1i oEbvDbeTXG9VzQXBRxvK/Oo+lYHn/N5wzUPb8CpdPxq0pbGE4NbLaAe1P 4rcnP1KRF+5fc3ZYPEeCnQ+lK46m/hK9WPFrABD5b0HzWkkdgbCbUDkVp g==; X-CSE-ConnectionGUID: sdYjNMhVQOiE5rcRuTmhig== X-CSE-MsgGUID: EmVSHutqTa+FVR1HGoPZ7w== X-IronPort-AV: E=McAfee;i="6700,10204,11180"; a="23862461" X-IronPort-AV: E=Sophos;i="6.10,189,1719903600"; d="scan'208";a="23862461" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2024 11:35:19 -0700 X-CSE-ConnectionGUID: lflu0tNzTCGBKEvXAXWeYg== X-CSE-MsgGUID: YmTffnebRTyznENJnuZoyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,189,1719903600"; d="scan'208";a="64021320" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Aug 2024 11:35:19 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 30 Aug 2024 11:35:18 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 30 Aug 2024 11:35:18 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 30 Aug 2024 11:35:18 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.43) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 30 Aug 2024 11:35:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xwp4w5PhsIIfGHkeFAD5de7cpY3nY7SSbw3KGdIxDV0PHDGDfQYrtzGesTwG7fsz2zA96OUqK4DXbVraomm3l8b/pGA7mLptoQgPuG9mQ9oin+tQmKPC0OvVr2WRxGEKUR/vLe6+UPRfrk7SgvwAFRYMq/8fTVGinGY+ifVDtnEYKMQuAu/2nM1HCZeb/eYYuRyq/R+Wz80SIkvwHgJ5fDTfhDmPF7K5olDKDl8zgU1kC+3beHgfmziOhmn8A1qAfX/OjYMv4DOt1s+HJD7Pkaz0KXpU6sbUw4HkHIMERksBEuboO/KbnbkeQUey4TmQJ4LCxN5iBumR6Y1YR+Zy0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NJ8D/r5I9LCOBbtaN9me5PRJyUKVdGRDBPjESgT/jcs=; b=pA3/qOkr9vxQN6KR9T6ENLJa5PVcBSLBZJFb5vreQ17MwQpdWosUS07NuJoHCop1dUiaxyv056EpFbjbjvAQuBVGUvRNtkmS5qauyiN+xxTQeviszx0pAQjaMWlj0CE5thjgUScnePfZzaqUULIqds0VNoGBrnD67+psTN0oBh28qnGhX7nL5ADsG0MjZCIgHbFUTmu6be/NG9lgRlxuzMdwSVvL8lXqupJ4qgQFNyi2RDuZg5VZ3nzhDh9VvQ0hP1z/2y3UlG1qLPjBd03YUnbDx14cjxlVyjVQzHJ0WbGUPgPHZH6Avw+qZrNBcnMJDeiBsCBfHfxU0ccdyRHaJw== 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 BYAPR11MB2854.namprd11.prod.outlook.com (2603:10b6:a02:c9::12) by IA1PR11MB6465.namprd11.prod.outlook.com (2603:10b6:208:3a7::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 18:35:15 +0000 Received: from BYAPR11MB2854.namprd11.prod.outlook.com ([fe80::8a98:4745:7147:ed42]) by BYAPR11MB2854.namprd11.prod.outlook.com ([fe80::8a98:4745:7147:ed42%5]) with mapi id 15.20.7897.014; Fri, 30 Aug 2024 18:35:15 +0000 From: Rodrigo Vivi To: , CC: Rodrigo Vivi , Imre Deak Subject: [PATCH 2/2] drm/xe/display: Avoid encoder_suspend at runtime suspend Date: Fri, 30 Aug 2024 14:35:07 -0400 Message-ID: <20240830183507.298351-2-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240830183507.298351-1-rodrigo.vivi@intel.com> References: <20240830183507.298351-1-rodrigo.vivi@intel.com> X-ClientProxiedBy: MW4PR03CA0224.namprd03.prod.outlook.com (2603:10b6:303:b9::19) To BYAPR11MB2854.namprd11.prod.outlook.com (2603:10b6:a02:c9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR11MB2854:EE_|IA1PR11MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: 66f97810-dec7-45ed-5365-08dcc9227d63 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA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d031iYb93jT7PduFPEntdtmM2jsUyy9hqmOpD9hDJqId6iP63RekFareD+2zP0qF4jheUZLN44Bv5Cs6Ktwh59YBo4hyVPPl/xz/gBjSssjJu/zhdFrGYYinQFN+ZDplVKbAZbVzjpFcPygfIrqN2dJXMhAhC/P3RgJH5/dI0ozYnf/ovFfVOqFK70cjkMVaDV9wGzNK04zamNKAODjEE0I1P4XtL2IzckT0dKbz2DdfcW81hn/foaHpLBEt23Y8g2Da99G5P85OAv0KHx84bwwlSkfeictV9Q= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2854.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M9jCWUnQpvx1gy6Q5st7gSJ4TpNMTSjL4masaL5hmdhlSgw9Gjvgij171fjn9AP31ZrDpLwddVABxP2LmvVHwmg8DEnyGPk4S5+aDZvTCGUOKpEqgxpJverFqVeit53R1J3c64YiVKYz2E0E9o1BXOmswKggUGLjysUOfn0yWkEWHZ0y7+Ch3U8xIWrfy2lTprejyOv45g3XnYJDVKr9wr6GH4Br6M+gVJdP0X96sRPR8v+gB9M1/8p3BRLYIaftkLAe5mYUrrynpdwBQHoRDT+9PqiwSHwBntFnCxmy5osLvPYORc7VBQPluY9Nd30rqSZG5n/+xzFSoZkDTmUHYb9kfoLuGnKxYhCOAfH2EwglYqKlp1Ggu2JkFbX+07gQMSUugz6OGJbNMTBvLsB/MCSgNQOUfwWpRqwlmCfd/DLbsjOAcqzXZ23GTZAGXZB5FnW86uDxb2C3i+hHmR3zTj2FtFGRPsGHbu45aO+vFtdqase5T8JfhdCDe2auDbW4U706P7TJkZwzVTaDRloTIERe7BGr9HHDh/9PIRjFwqjuQaDxObBzkM2GY2Vi9x5izNO7xfhUURcrvI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cc9227d63 X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2854.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 18:35:15.1639 (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: Gb+B5LfrR+NZVwXPKIRCnkjNpo0Rmxthja7Ip/naAdNOprDQ+boRW1CPXHwhnfKqE36ezXiC/pDeHuvtWdbBVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6465 X-OriginatorOrg: intel.com 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Fix circular locking dependency on runtime suspend. <4> [74.952215] ====================================================== <4> [74.952217] WARNING: possible circular locking dependency detected <4> [74.952219] 6.10.0-rc7-xe #1 Not tainted <4> [74.952221] ------------------------------------------------------ <4> [74.952223] kworker/7:1/82 is trying to acquire lock: <4> [74.952226] ffff888120548488 (&dev->mode_config.mutex){+.+.}-{3:3}, at: drm_modeset_lock_all+0x40/0x1e0 [drm] <4> [74.952260] but task is already holding lock: <4> [74.952262] ffffffffa0ae59c0 (xe_pm_runtime_lockdep_map){+.+.}-{0:0}, at: xe_pm_runtime_suspend+0x2f/0x340 [xe] <4> [74.952322] which lock already depends on the new lock. The commit b1d90a86 ("drm/xe: Use the encoder suspend helper also used by the i915 driver") didn't do anything wrong. It actually fixed a critical bug, because the encoder_suspend was never getting actually called because it was returning if (has_display(xe)) instead of if (!has_display(xe)). However, this ended up introducing the encoder suspend calls in the runtime routines as well, causing the circular locking dependency. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2304 Fixes: b1d90a862c89 ("drm/xe: Use the encoder suspend helper also used by the i915 driver") Cc: Imre Deak Signed-off-by: Rodrigo Vivi Reviewed-by: Jonathan Cavitt --- drivers/gpu/drm/xe/display/xe_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c index ae92012253f8..75736faf2a80 100644 --- a/drivers/gpu/drm/xe/display/xe_display.c +++ b/drivers/gpu/drm/xe/display/xe_display.c @@ -345,10 +345,10 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime) intel_hpd_cancel_work(xe); - if (!runtime && has_display(xe)) + if (!runtime && has_display(xe)) { intel_display_driver_suspend_access(xe); - - intel_encoder_suspend_all(&xe->display); + intel_encoder_suspend_all(&xe->display); + } intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);