From patchwork Fri Jan 10 14:08:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Karas X-Patchwork-Id: 13934705 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 1FEB8E77188 for ; Fri, 10 Jan 2025 14:08:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EFA710E507; Fri, 10 Jan 2025 14:08:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="bzxl1hHz"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9018210E507; Fri, 10 Jan 2025 14:08: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=1736518098; x=1768054098; h=date:from:to:cc:subject:message-id:mime-version; bh=z6iB1x75vLmX2Zbzl+m2MgP9vamsLwAWdO6rahOMCLw=; b=bzxl1hHzL+F9odCl1Pflzu/bVYFN76VJZTmQDs0U7/rz5G2srLWK2rLp r+W6j/MSLs70BoGvKBoFV+kkZeF8Eepc1L7lNbalbAyILvnvKHWCmcr61 IuiNy7p8LoOH47Lhw7A3ZgDHQdTx+jn0TST7l3qK6CWkoLJK8ki/5UUl9 VHC/0lSCnCZCluohEnUKN5MZxGB/abrJqUpPQFPzBP/RljgSeCU72XAdT 35Qg8A1L9Zep7LjaLiWBlCO034h/sQ0AolNRV8rXk4ou186QOGpu4Wwet iJlBHK3+EFZusRB2k8qfPHfFK8gVQ16D+rzxP/QXX2WMADO5nBWcRfN3B w==; X-CSE-ConnectionGUID: lomOAcL5SpmaC/7npCVBQw== X-CSE-MsgGUID: 3zdc+ir+QGSGyaOxmS1H3g== X-IronPort-AV: E=McAfee;i="6700,10204,11311"; a="48179551" X-IronPort-AV: E=Sophos;i="6.12,303,1728975600"; d="scan'208";a="48179551" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2025 06:08:18 -0800 X-CSE-ConnectionGUID: JgFqDOJASg+23hA1HrdPTw== X-CSE-MsgGUID: mFyFuh4tT2CugqE2nysxHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,303,1728975600"; d="scan'208";a="103799267" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Jan 2025 06:08:18 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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.44; Fri, 10 Jan 2025 06:08:17 -0800 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.44 via Frontend Transport; Fri, 10 Jan 2025 06:08:17 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) 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.44; Fri, 10 Jan 2025 06:08:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l1W5nd8S1FJa3m+cg4nymXw04zgIYMxBnwdl6cS681Ib78XDOtj+htX04z23bdMftdaoIEUDN0pfAAiCAuJUttZmi9mIsTHggYvoNNhFt/RnMesk1Pet0mHcbZxAemoQENf2cxbNf8XkUiy0T+EECumsNna4N+QPhnO2IFrkWVbPViUwwIdmLtmXJrSTxfle9wzAYnF5f7b6ixo9YewNWsHtVm8825FtL7pTi5Avcf8x2NWINonEMqJM4enp3Aij19O6nPC0q0oZAEryCcR/uw+mzujUnQ3paLwPX846qRSXpScHaq1WVOYUcXaBhYypiYq6JuPkJrCAHXRhAFjAIA== 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=kbgsDfJtA1KkxOUAE4+j/nk07m6LYXksT3OWq7KuE/s=; b=ul0FvSRt2TNm/imZgfo6uKqOHhRG9OM9hYxQKiDbs9DFiMCJjTFvCtHLCkJUh61l8IY3Ncaq5s3mwymsK19O6eN5Jpfk+TjSj0woYnYbVfYXWtXcaoD6ZecsjymyEI52oEqJ43E7M9noJ9EG2U/ENfk5WBHatmlqWd1XcAtKH1hnNoYwXhSeFGQXUBpYL+Nj745hvKEvr4rCbajTuW3850yM6fFEAHkqK2sCQ19+at7XnoJE2BNy76E/M4z3KXno5hrjBRMGQRELz6VToVyGCCm1vcPiDFWyJFZ/N2kAXfThyE38X002beNoJ2HsAzz+wlU0VqsxJrjCVxAlKLqgmw== 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 CO1PR11MB5057.namprd11.prod.outlook.com (2603:10b6:303:6c::15) by MW4PR11MB6933.namprd11.prod.outlook.com (2603:10b6:303:22a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.12; Fri, 10 Jan 2025 14:08:15 +0000 Received: from CO1PR11MB5057.namprd11.prod.outlook.com ([fe80::4610:6d6c:9af6:2548]) by CO1PR11MB5057.namprd11.prod.outlook.com ([fe80::4610:6d6c:9af6:2548%4]) with mapi id 15.20.8335.012; Fri, 10 Jan 2025 14:08:15 +0000 Date: Fri, 10 Jan 2025 14:08:06 +0000 From: Krzysztof Karas To: intel-gfx , dri-devel CC: Krzysztof Karas Subject: [PATCH] drm/i915/gt: Ensure irqs' status does not change with spin_unlock Message-ID: "Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316" Content-Disposition: inline X-ClientProxiedBy: DB7PR02CA0031.eurprd02.prod.outlook.com (2603:10a6:10:52::44) To CO1PR11MB5057.namprd11.prod.outlook.com (2603:10b6:303:6c::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB5057:EE_|MW4PR11MB6933:EE_ X-MS-Office365-Filtering-Correlation-Id: deed5f79-70cd-4962-b66c-08dd31803993 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?77bhMpabCVoEhoo6g9VkrOFIMhOFiFo?= =?utf-8?q?s3RuNLI3V1hL4Zht8Rgn/FLixf2PRDtpM8Cv5+3if5+YogkABJwW2f/K07IVH3RAY?= =?utf-8?q?iMLAY7KTL4AJL3fg0Ewd/Y8sdUEWAZAJNpgHowJRgLrBn0zU96oinfemgGazIboQj?= =?utf-8?q?SFc61RJqphEFREtAxMb2fjJ0ADCsm/gSSzB/YBmGUvYwkDipLh3Waq+ZXn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?utf-8?q?I6eCnEs5VLmkcLHgPQuP6khCRGifDfqC3eCIHTIbbQfd3iuNnWpWBXz8RMTLPYhiN?= =?utf-8?q?t3wA8HvA/n2NoX/GGG9KA9vNk5yAkyMw9AV/Gpdi6UxUCD65UCAGBPfD5Erp3DWdh?= =?utf-8?q?jQXs+YjU4Gb3O38yrnVDW2HK/LWjcEniYgzI//CRdi0VDkbaSoM6hCB9mHDj3yRNu?= =?utf-8?q?7BYBsHMnhh5l72Z+yU+MMSL+0UYN+ISYJ6XmkZqqK5uZHUZxMI9/ggv2K5gnkv+V6?= =?utf-8?q?NtSjcm4Jf4fF?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB5057.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?BlWNJ4+Cn2QmeWDs+O0PSOjCWuQG?= =?utf-8?q?DMbQYfP8rkw8eJ4yD6tHuzgP77j1W8rjZcl8wL65xxeoESGYymaYZQ71NAsKybzCZ?= =?utf-8?q?jcZnkIZ/dbKqV+I5hyhn9+8Lg9PiporIw8On2ZegaoBcqt90hJrTyqVBDT/IMsBRJ?= =?utf-8?q?K/8aD280EpoaFYlKzO+yujuR3sen5dhSySyQbLbkU1jV27gK9ND8inYhKKAf80XQc?= =?utf-8?q?WU+YEi1tr3bmL2r0qLsEkNeuSwSMVj1plH4OOxvrfEr4r2r13j4uXmwvwjXx5ARpg?= =?utf-8?q?oxpoocZMU96cdfsg3+iF513kxOCgfRJxsS4A1mJZhFN/qis0SwopaaU0EEKXG3V9t?= =?utf-8?q?xLc5jfS6FSAP2f77YaU71B4SGA35umsRiEv/JsiwbzJT7z1SzD95iBGYI/83Tupth?= =?utf-8?q?tHtqEkDRFYUmcpSlJvbT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7XKS/mp9FxIJD6bgCWzVnr0yYvxzIVYAG?= =?utf-8?q?Pz2rhfuMU9oE/8iIk6/ejo6LQ75F23Pw/sHGygK4O1L+q+k8zMptEJ6k7ew2MyQR3?= =?utf-8?q?+afZZ71XpfGdEw3Mjnpd/T0t0qsSAsnvszo1K/NfRL3xA25vN7fDQ7FlRIkARp6Ih?= =?utf-8?q?eVKwW4YPSJIB9nQ42flb97nxgqExkom59cOSBu9/ei9ysEUf441+gENHPY5buvq+v?= =?utf-8?q?Aw6Pc1dPLvL2rcPCLRlqEV01cP47gX+WIg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: deed5f79-70cd-4962-b66c-08dd31803993 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5057.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 14:08:15.0132 (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: lwQuWK7th/dnUAwB37TcAnaPjlE6qBXDZPh0Bf0pamePgqlkh3u02K2ORsY5IDvfmcFy/Ql6La55g6zLkdH5IsjE/akqViZKX/VgKFhYnTA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB6933 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" spin_unlock() function enables irqs regardless of their state before spin_lock() was called. This might result in an interrupt while holding a lock further down in the execution, as seen in GitLab issue #13399. Try to remedy the problem by saving irq state before spin lock acquisition. Signed-off-by: Krzysztof Karas --- This issue is hit rarely on CI and I was not able to reproduce it locally. There might be more places where we should save and restore irq state, so I am not adding "Closes" label for the issue yet. drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index 12f1ba7ca9c1..e9102f7246f5 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -4338,10 +4338,11 @@ static void guc_bump_inflight_request_prio(struct i915_request *rq, static void guc_retire_inflight_request_prio(struct i915_request *rq) { struct intel_context *ce = request_to_scheduling_context(rq); + unsigned long flags; - spin_lock(&ce->guc_state.lock); + spin_lock_irqsave(&ce->guc_state.lock, flags); guc_prio_fini(rq, ce); - spin_unlock(&ce->guc_state.lock); + spin_unlock_irqrestore(&ce->guc_state.lock, flags); } static void sanitize_hwsp(struct intel_engine_cs *engine)