From patchwork Fri Aug 30 18:35:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 13785439 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 46F40CA100E for ; Fri, 30 Aug 2024 18:35:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B50910EACB; 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="X/FwTd+h"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 886D510EAC9; Fri, 30 Aug 2024 18:35:18 +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: content-transfer-encoding:mime-version; bh=vgnNfQgmE7frUKPJOdbhv92q/KjR/VY6+5PZQrosbfo=; b=X/FwTd+himZIp3eYEpyJFxHP0Axgl53SvxRNe52Lo45GC2Tyj3KEu+sI NqslFgyZJoJuxjRQFstXCVb3DX2Hzz1vzPdtxMSFeER6VSRaG5oA9Dj0S pNYjWbx3JUPJtjkWnh/dttp2dwWWShoL8qE7bKWmizEw4JcZFMxFmvVvA YGUMg4ZP5YZ65Q2GviL/ZbJ0JjK507dNdxD0aAYOT8OlT8P5we5PNUexm u09OM10aR7BrbfGirHopPBqOwFczBiZQ99g1JaepkilmiVqwalGxp+FBk SiZTy/GdHpFDZ5HYeIcaMGT8OuNmMHi2DvGP4ajtlfDOqYWxaMHBLYUmG A==; X-CSE-ConnectionGUID: WrbxNhqYQLGfFFCnGK5TcQ== X-CSE-MsgGUID: MtGtuG6qRmmnPo2LxnpmAQ== X-IronPort-AV: E=McAfee;i="6700,10204,11180"; a="23862454" X-IronPort-AV: E=Sophos;i="6.10,189,1719903600"; d="scan'208";a="23862454" 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:18 -0700 X-CSE-ConnectionGUID: TpQ8eZYGT0SNYj5OpNqZkA== X-CSE-MsgGUID: U+KeSa3JRxGGIgwwL56dTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,189,1719903600"; d="scan'208";a="64021315" 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:18 -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:17 -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:17 -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:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DMPpQjN7G30/hVqUTGf3Evufn86FecIOOJO7XQNC9TptaYrLoOc8Y34avahDuigOTC8OYpLeWcTSc3h7T1WHTQNf0DlJ0lFrtMz0xMG6Z4Hj5rCaEd/SeCv3hpbpT5ii0x6+VBEMLR1j5QNs3zDpQ9eHqWifPytKJr7UHOVmCqvwftg5k9o+xmPfAPbgjmnqZTgGBpI6XlELMYNa9nLqvgZVABNcbgFB9bQ8gNYySiBtXX9ThKMwos6v01wNBFw+OkZIrOYb1FZLuUs8qUH5OEC+7sADQMurGkdm7Oc1L8ZbWHaDEwwBUeyaILWrhH+RGFgBtGsxbAC82LL0IR4Xow== 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=EmwsQ3yptalnZLd5+4IE7hMNcPsqAAqboAezfzQMReQ=; b=gUiTNxUHgMJYdqacmah/nxxA2X7lsbooidCzHzfJxBxAUpTbCFyUnHG3YSm9L/ArKo1KrG3Eb2yMM7kgFv5g/pJoFMg0TVAS6f2zIKMT7NhJYbdI4LusFLKWDvd9c77lU0ISEsA1W+IeefzWF+VVEcDC76T8pVu25W5ypiXaK6OlylrTCJI4xLfEf48AVLvccRk2LGXpCxQLxjzC6caE0wC7bzRCKtDGK8F99vGdVrqqivv8ib26PVcNwOq2mLMIAJwqsn8ERFnF4BmUOo/5qbXVaNyKmLcBLT3DyHErR3+anv+2DSOX2CVm8TRfNMsDnECC3imDe8nJ6KEf/uUy9w== 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:11 +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:11 +0000 From: Rodrigo Vivi To: , CC: Rodrigo Vivi , Himal Prasad Ghimiray , Matthew Brost Subject: [PATCH 1/2] drm/xe: Add missing runtime reference to wedged upon gt_reset Date: Fri, 30 Aug 2024 14:35:06 -0400 Message-ID: <20240830183507.298351-1-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.46.0 X-ClientProxiedBy: MW4PR04CA0078.namprd04.prod.outlook.com (2603:10b6:303:6b::23) 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: f1f6ab55-7d3d-43e8-9ff1-08dcc9227b1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: zQ+YleP8zTwAX0ZoZzpOJPZnfHavDNdYMObzpykWuxsfBm7RJwu8eRNlGGxsxF2gWjQdsQ1Dn3ZsBRGmDv2DpVCD4MwRoy647Rtyl/x+PrdTU/msBFqie2wW2sqDJSbzN7qXKvvGpenH14+9Ca6fSzF96O+pXBulohWj4Y2ch4YQ6RonW4hEIEFx8m58YajaBiN/nxI4oSwa2ivditSNRshB7ZDGyFRQRRt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qjtMTuL+1T5XtB4XrUrjXvpqSw9UDwSHqCEjDzUoGCOHgRJI50eM7zA6Q== 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: ppyaLTawMVhZvyJ0qX4+vaEFoldXGBwfiE3fJ0919utvE0pmI5Ghr4B2SyeaoUsrbQrGeZSsTkJbauGdpHlZnL92hT+r6/dkCy1iuE7stoeVuW+ligT4upq87SSj0yCNmFab/lhqc5W5Q4XofkZydiushDfLxbViawcssXKyv2STyru1YoEL4U78+mqKxN/K9nvb2qoRBmotX2Ug/Ya8YmSthh/N60MuOX006V87z4BqYek291t0kSuWP399vRMj52Umrz73JoBGZH2ElZW3IbAWmtWg8Yk4y9ZT+1OO9gmCgRivjMB/9f3g6UiJvTw23QMDOkIbStQr9nKvIlR1i9T90qNIH9qh6ueNr1Pbo/r4M3umOHdAIEk58omTYTOSA9/k0cWOZFEIj3ZYTXgKtqlIIv8H/CWiyV3RD23MiUivt/R8kM8NXzKNmAxXjo7vm7az5W8zyfL/ILw+ilGqcahz7BXU00fiXTve0jsXvfUFmJhSYzLxEWYaRuWYIX2Ck4xlNpaU+bTe85/yH0vHsuyDjg6iTCkzBWQiwN7IpYf7+Y/g9OqIllPMfgWWg/M4IZz4rkdTzh48Oy6Pn27mWMKSNRh9Mf5Ga8S9vjiEdLX6KMQtTlTNqG23oWvPgJgpjb08jFRZf4Yiqmwje+w7uoylwFRmVEtwJj/72fwJ/hznimjOHUphKeW0Goo8P07tXTWzQhYIO1L2fHw0rqKMHSofyUX40DAWyzvoBUhYXPbqLdgmwqBtW4ky0bIbRZ3mGbeEEQjbavpMufYpP0k9JTztU+/BZCPxO9JSCJvIynQ/2UwuVAZ2cRQwYmdEy1xYzRDjdjVEsskQkNM7iubO/P7h9+v/t7f8Y/v8q8fSV4mpe4yREMrMaXiMNf+Dkfkapz1x3yPJvD5XjZ7tVUIQK/n9pz9LmDeCET/24+YoLjbBra4bRIGpCge60Ff+xBWYO2JLBcbC7H49UYJOTRGe8uwQ9JBEPhFn5jOMK6MBth3gaGNJTFrjRXOP7Y0YsaD4enyIlq9za3wIIBct5ixfU0pg+7Yv0ipu40mgg+si7GMmYcvioZ4nE5VWy/CnwvSYmiBwA2Th0O3gfvbYHJuT1QctCjp5C+S+z15ENKE+Lb55olDi094T0Q2y36qbXoA1Vrx2z/AyUZyt+UQyv7Xi+5WWo1lrkZNUlKaw2dI+QmrCb+ql1JTbUkX1zja3/bC5z1cbcPWb+KzMLVn33da/g4hvCAR+A7Izb/5X04EBzF9Vx6otcli9sjowAieqGeO3l8hwBELq/a2a8vCKbiLEojYh9E86woiE9HCSgcI7cqWPo0oKGO/5Zr/1jrkewdwS1E7e/pQfCKzXmu3EGf1NMQ6uwqHYv3Ik1rlSYM/Vr8T8T9cbLSS0rw6LMmYgTrju0TernTx5RZHsQtXIf2e8DETsnmMN2OxhEosXSHsJaJ0gGAsy8fgEiuBxkM6mzYxe8/W4+UVC6WzdpsLVkGk5yo3uXfSWMbma9/csJNSUxdk0N09u27J7DMvqodONAOu635IyPz3OZ070mX59R75kMpXyWdS3ZNPxAnEOk20EDJNRPOGOt9S22Y91pJDJ24u7tLX9hd+iTk3XsyJRwBHMrg== X-MS-Exchange-CrossTenant-Network-Message-Id: f1f6ab55-7d3d-43e8-9ff1-08dcc9227b1f 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:11.3786 (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: XhSdKnm6I8Acej+dT97X9hU7xCrTo+fAiWlGdfa9qybEXaNaduLxlEuUcCW/XQEqqxTWTVgqz0DYW+gziX/bXw== 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" Fixes this missed case: xe 0000:00:02.0: [drm] Missing outer runtime PM protection WARNING: CPU: 99 PID: 1455 at drivers/gpu/drm/xe/xe_pm.c:564 xe_pm_runtime_get_noresume+0x48/0x60 [xe] Call Trace: ? show_regs+0x67/0x70 ? __warn+0x94/0x1b0 ? xe_pm_runtime_get_noresume+0x48/0x60 [xe] ? report_bug+0x1b7/0x1d0 ? handle_bug+0x46/0x80 ? exc_invalid_op+0x19/0x70 ? asm_exc_invalid_op+0x1b/0x20 ? xe_pm_runtime_get_noresume+0x48/0x60 [xe] xe_device_declare_wedged+0x91/0x280 [xe] gt_reset_worker+0xa2/0x250 [xe] v2: Also move get and get the right Fixes tag (Himal, Brost) Fixes: fb74b205cdd2 ("drm/xe: Introduce a simple wedged state") Cc: Himal Prasad Ghimiray Cc: Matthew Brost Signed-off-by: Rodrigo Vivi Reviewed-by: Jonathan Cavitt Reviewed-by: Himal Prasad Ghimiray --- drivers/gpu/drm/xe/xe_gt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c index f82b3e8ac5c8..dd96dec95b19 100644 --- a/drivers/gpu/drm/xe/xe_gt.c +++ b/drivers/gpu/drm/xe/xe_gt.c @@ -754,12 +754,13 @@ static int gt_reset(struct xe_gt *gt) xe_gt_info(gt, "reset started\n"); + xe_pm_runtime_get(gt_to_xe(gt)); + if (xe_fault_inject_gt_reset()) { err = -ECANCELED; goto err_fail; } - xe_pm_runtime_get(gt_to_xe(gt)); xe_gt_sanitize(gt); err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL); @@ -794,11 +795,11 @@ static int gt_reset(struct xe_gt *gt) XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL)); err_msg: XE_WARN_ON(xe_uc_start(>->uc)); - xe_pm_runtime_put(gt_to_xe(gt)); err_fail: xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err)); xe_device_declare_wedged(gt_to_xe(gt)); + xe_pm_runtime_put(gt_to_xe(gt)); return err; } 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:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: ez3PbKtVO9S1JWvYtWWJe5B1agojAmuRcl9wAqwvl0l9xsQXFQlkSeWouLNT/9GtGnzvVniafGAkGro9a55Sb8NqYPQEM0sBTnR42UXI3Cndk+VZ/BxyK0sDSc/mW6Jy0xdT+OFj5cbP4hzDGDDx8pXkkg/NIzraiswKqDErk0Vjl9eNyboQa5qFp9QJB8wI8u0TWPlHAaprXtuIyjJbYgePz2sGA6oQ9IpnGEeZe+r0aPknMemP9gu3TeRosYAmdgWgeEwEBSPXps8fv9oBRjZRZzWhyzSWuxhL/K6BjLOQmnWqxJSXfSedBK33u0vRWdOGYpn53o98H82SDHLWF2sxf2l4W70+SR0kvVZSk9GfMdKNMlB5P30COrk/3VfehAdTPAYkaP7JhJQCAEoTEmcOYCXQ1j1FqyOU2l7OKQQqye3P1j6hiQSVdwlFEDabetE1oKKpdVfRTyNOEjA6Qj8N1zJ+YT0NGUQ+zcG9gAyxm7RfXILJrKIaCEvgxttwuvzaiTPCXefH71N1HqlwoDjemEKy9htspbKLZtO4lVadEjXniS/niujb3Pr8IrWZ4iTLYyZ4oODq+waDcn9THgpyC8uG9Q4+/zhhLBjCZGsOuVT0Vk9yqu9FHknrzxGynChRPeD31xvPkXeWDS5KMTg8sWpJCV93zovlCrKOspJGRdX9OpKJJwNl7JQHfYXiLBhsWYIyBtx7F/nWezaLjIe+AFXdB0Vjeq9LWyaens+04Mi1SMLpWkv+WKcaU9JIs7KIjj3D/pPOvHmjqLD1BZQ/6ezYWfMsfVUKQOQw9qPa3MLxx0TOvRwqLzlHjoQJD63wwUyafaIvIUimqttLE9ZWCX2Zznbuyyk4ytyasDnZjVF5riDEQAjgUFroKw8lQwzLhjW1HoK2flLRl6PiQljF5EhkczVIfH/5a/Y9WwXuR1wXv9tUNRP3tFEfs/eZVWJKqgxgZDoTjTNLXgsf7tCgFoHbLPLLbL7qrPoYxN8mJ1vwrM4BT7Kz3WtP7QxH/0QOWv9jVd031iYb93jT7PduFPEntdtmM2jsUyy9hqmOpD9hDJqId6iP63RekFareD+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+aDZvTCGUOKpEqgxpJverFqVeit53R1J3c64YiVKYz2E0E9o1BXOmswKggUGLjysUOfn0yW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rXC2Bvb0g32bOkpGMNDqG5DpWF6TfAIveUHuNXUEtt6M/OyOep60tX7ItGQ+g1Pro7qbncyi/YpHcn1fWsd8k4RkwrJ2pU6UzlcdBNX93oHeAkW4aSJVK0iMkBjTuEwxvOA/kz4XQDgOXdE1hzpB1CuzJAvT6WhKClpe+tsAwKrKVpfqFFBzhNukYIlfkKvUYqi9X+srOW7vCNC6SwFDJTVCYpr5wrpP62EY1J/MWWRntRZ+KPPvkQsOnB5AHVDI7vGMafN8ExCl5UmxIO30WnzEifBpQEXWv1fvIjHVe9JG9vgCHWrGn+OC1ieTu4rcCCK45IbzgXSieib+dnXqrfZIhW0ztn4JFKUjKPYHctvlDaLA== X-MS-Exchange-CrossTenant-Network-Message-Id: 66f97810-dec7-45ed-5365-08dcc9227d63 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);