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 D5D8CC7EE31 for ; Thu, 1 Jun 2023 20:30:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D92810E5D3; Thu, 1 Jun 2023 20:30:38 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6136E10E5C0 for ; Thu, 1 Jun 2023 20:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685651435; x=1717187435; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=szMOtzJGl9OogaJyZLvK3DFYvfQy4k+TLtFoXQzcqas=; b=JxS5A3l2t36SOl879PGuCnS/KyDSrhAiBgJkmBtLLjoCKJkDyEr2Aonu dgkLBpjUTN+Vsu9Aj4tiKWN1N6HCWPYeFHo0/pfYsUOPHNNRoHYaS1DLU r8m/K6GQdfRrFEhEYHkZsi6IV6PxD5RbcQkJnIEMMmod2tM0z/LMv481q d3YU6Vb1RyNqbPhoXIg7eOUQ7CyFbbxjA8th0N9UGqcycOj8PZvGWdUet d+LFHYvhPoMqiMgPdZ7nkL5RGgtzW7m0HCEJhLoFT8kogqiqSta/nIAVX F4681yadnSGQ8Arx1kBnGZKycxbxy8KL2ospVk21cQdbjTuvckLaysquN Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="358102543" X-IronPort-AV: E=Sophos;i="6.00,210,1681196400"; d="scan'208";a="358102543" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 13:30:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="740493288" X-IronPort-AV: E=Sophos;i="6.00,210,1681196400"; d="scan'208";a="740493288" Received: from mdroper-desk1.fm.intel.com ([10.1.27.147]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 13:30:34 -0700 From: Matt Roper To: intel-xe@lists.freedesktop.org Date: Thu, 1 Jun 2023 13:30:18 -0700 Message-Id: <20230601203025.615494-25-matthew.d.roper@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601203025.615494-1-matthew.d.roper@intel.com> References: <20230601203025.615494-1-matthew.d.roper@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-xe] [CI 24/31] drm/xe/irq: Untangle postinstall functions X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthew.d.roper@intel.com Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" The xe_irq_postinstall() never actually gets called after installing the interrupt handler. This oversight seems to get papered over due to the fact that the (misnamed) xe_gt_irq_postinstall does more than it really should and gets called in the middle of the GT initialization. The callstack for postinstall is also a bit muddled with top-level device interrupt enablement happening within platform-specific functions called from the per-tile xe_gt_irq_postinstall() function. Clean this all up by adding the missing call to xe_irq_postinstall() after installing the interrupt handler and pull top-level irq enablement up to xe_irq_postinstall where we'd expect it to be. The xe_gt_irq_postinstall() function is still a bit misnamed here; an upcoming patch will refocus its purpose and rename it. v2: - Squash in patch to actually call xe_irq_postinstall() after installing the interrupt handler. Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi --- drivers/gpu/drm/xe/xe_irq.c | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c index c069e374a947..85bb9bd6b6be 100644 --- a/drivers/gpu/drm/xe/xe_irq.c +++ b/drivers/gpu/drm/xe/xe_irq.c @@ -122,7 +122,7 @@ static inline void xelp_intr_enable(struct xe_device *xe, bool stall) xe_mmio_read32(mmio, GFX_MSTR_IRQ); } -static void gt_irq_postinstall(struct xe_tile *tile) +void xe_gt_irq_postinstall(struct xe_tile *tile) { struct xe_device *xe = tile_to_xe(tile); struct xe_gt *mmio = tile->primary_gt; @@ -181,15 +181,6 @@ static void gt_irq_postinstall(struct xe_tile *tile) xe_mmio_write32(mmio, GUC_SG_INTR_MASK, ~0); } -static void xelp_irq_postinstall(struct xe_device *xe, struct xe_tile *tile) -{ - /* TODO: PCH */ - - gt_irq_postinstall(tile); - - xelp_intr_enable(xe, true); -} - static u32 gt_engine_identity(struct xe_device *xe, struct xe_gt *mmio, @@ -366,14 +357,6 @@ static void dg1_intr_enable(struct xe_device *xe, bool stall) xe_mmio_read32(mmio, DG1_MSTR_TILE_INTR); } -static void dg1_irq_postinstall(struct xe_device *xe, struct xe_tile *tile) -{ - gt_irq_postinstall(tile); - - if (tile->id == 0) - dg1_intr_enable(xe, true); -} - /* * Top-level interrupt handler for Xe_LP+ and beyond. These platforms have * a "master tile" interrupt register which must be consulted before the @@ -512,16 +495,6 @@ static void xe_irq_reset(struct xe_device *xe) xe_display_irq_reset(xe); } -void xe_gt_irq_postinstall(struct xe_tile *tile) -{ - struct xe_device *xe = tile_to_xe(tile); - - if (GRAPHICS_VERx100(xe) >= 1210) - dg1_irq_postinstall(xe, tile); - else - xelp_irq_postinstall(xe, tile); -} - static void xe_irq_postinstall(struct xe_device *xe) { struct xe_tile *tile; @@ -538,6 +511,12 @@ static void xe_irq_postinstall(struct xe_device *xe) */ unmask_and_enable(xe_device_get_root_tile(xe), GU_MISC_IRQ_OFFSET, GU_MISC_GSE); + + /* Enable top-level interrupts */ + if (GRAPHICS_VERx100(xe) >= 1210) + dg1_intr_enable(xe, true); + else + xelp_intr_enable(xe, true); } static irq_handler_t xe_irq_handler(struct xe_device *xe) @@ -588,6 +567,8 @@ int xe_irq_install(struct xe_device *xe) return err; } + xe_irq_postinstall(xe); + err = drmm_add_action_or_reset(&xe->drm, irq_uninstall, xe); if (err) return err; -- 2.40.1