From mboxrd@z Thu Jan 1 00:00:00 1970 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 EA8BAC369D3 for ; Fri, 25 Apr 2025 06:05:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBB2F10E889; Fri, 25 Apr 2025 06:04:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="T5uY7f/a"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0501710E889; Fri, 25 Apr 2025 06:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745561096; x=1777097096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3t+D9Lfr67XaN/OQI2Y5+/XH4J/b8IDwoIxmQNpmNHk=; b=T5uY7f/aHvWYBTvdjf89EjK3Gy8dHjJ7LAJf7h/q/XkJLByBD+xSSd8n KOGZ4AvVL2+7e2yeuVOclWZ/gjHrUwer8i3kmxG6v7tMU5jMg4W3Wei+7 hAdHKtb2idacAoGr7X/PZnSaC5GT4Wn7dbYPk1IclVXz+JkQNoBhFqKl6 8e9K2aizdvrfKnqFMHZfI2ZulDugWamRdXyhJg6UlK9AWYNMNvDJlyPQz u+i3tt/YRyTKi6QWWUgJwPtKLxih3SOFCCk5cPnrbKwvHDj9oIEuecBY4 f8bRziGDGjiObrx3DazqEB2W+HtR+uL2k582JlUJQZ5GNfE817+UIllTu w==; X-CSE-ConnectionGUID: /ImVAhYqQa6zG4rPiMn3qA== X-CSE-MsgGUID: kC3iD09sRomTNwhLO5ny/A== X-IronPort-AV: E=McAfee;i="6700,10204,11413"; a="51021649" X-IronPort-AV: E=Sophos;i="6.15,238,1739865600"; d="scan'208";a="51021649" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2025 23:04:54 -0700 X-CSE-ConnectionGUID: kxh1GToFSUq1UwgD/emrLw== X-CSE-MsgGUID: bMWV5gwtTsmWaKtljNz7Ew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,238,1739865600"; d="scan'208";a="133350476" Received: from junxiaochang.bj.intel.com ([10.238.157.86]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2025 23:04:50 -0700 From: Junxiao Chang To: tomas.winkler@intel.com, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Daniele Ceraolo Spurio , Vitaly Lubart , Alexander Usyskin , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Cc: junxiao.chang@intel.com, furong.zhou@intel.com Subject: [PATCH] drm/i915/gsc: mei interrupt top half should be in irq disabled context Date: Fri, 25 Apr 2025 14:04:54 +0800 Message-Id: <20250425060455.641008-1-junxiao.chang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250424065609.624457-1-junxiao.chang@intel.com> References: <20250424065609.624457-1-junxiao.chang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" MEI GSC interrupt comes from i915. It has top half and bottom half. Top half is called from i915 interrupt handler. It should be in irq disabled context. With RT kernel, by default i915 IRQ handler is in threaded IRQ. MEI GSC top half might be in threaded IRQ context. generic_handle_irq_safe API could be called from either IRQ or process context, it disables local IRQ then calls MEI GSC interrupt top half. This change fixes A380/A770 GPU boot hang issue with RT kernel. Fixes: 1e3dc1d8622b ("drm/i915/gsc: add gsc as a mei auxiliary device") Tested-by: Furong Zhou Suggested-by: Sebastian Andrzej Siewior Signed-off-by: Junxiao Chang --- drivers/gpu/drm/i915/gt/intel_gsc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gsc.c b/drivers/gpu/drm/i915/gt/intel_gsc.c index 1e925c75fb080..a099d885508ac 100644 --- a/drivers/gpu/drm/i915/gt/intel_gsc.c +++ b/drivers/gpu/drm/i915/gt/intel_gsc.c @@ -284,7 +284,9 @@ static void gsc_irq_handler(struct intel_gt *gt, unsigned int intf_id) if (gt->gsc.intf[intf_id].irq < 0) return; - ret = generic_handle_irq(gt->gsc.intf[intf_id].irq); + /* It can be called in both irq context and in thread context */ + ret = generic_handle_irq_safe(gt->gsc.intf[intf_id].irq); + if (ret) gt_err_ratelimited(gt, "error handling GSC irq: %d\n", ret); } -- 2.34.1