Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp502736iog; Wed, 29 Jun 2022 04:50:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sdL22InaLEwQoEXCc2sUmXZ/0tFGu8vdzYu50SgAMbW7BtzIrTlboi7/mR9IQBGzZ/BPsd X-Received: by 2002:a05:6402:2806:b0:431:87c8:b45e with SMTP id h6-20020a056402280600b0043187c8b45emr3873901ede.130.1656503427864; Wed, 29 Jun 2022 04:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656503427; cv=none; d=google.com; s=arc-20160816; b=BiPU3Tl9jKuLPMeJFOjcWdG1z+71xCOJOmaYETOsoFLcYrAScwmexf3WijV/m9IzJD R2aj9TISl8G9DJukNcINOIrfXMeXF4eRslYO9sPXQesp8uVb5/dewewPLD6d4opiM8EC w/63yXCjrRErK2DUu0FQbhJu0PeNvvxJS1Krreb55WKASv0e6ruCZMmIAyeBQ0/PtSCQ LJC0GRwFX5n1iplkbOTNbCL3qkI2ZGYpntqlbEzQpErbY1/6TA2SPk4zL/uOIkPkwgZC l1kGKoVBv7y6wRDLI2PrRLbwG1cCNNQ/DB/D92CLUGKNz+eP8FQW9SMvwkzYap0UIxrN pUXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D5j3aq6rmUdviHj52AwzlQau1Sk7AGOs/2qLFHoiGj0=; b=jsbXsx5cdEEIJXG39J7QSp5VAZgVo/rDUeSozvasqR6kzRZ9hHWuYIRVIpaBG41IKN Qtsn7O5/SZ3H3sGk7YJnN2LzrD7Lil6tvfpyjzUPN3NxLZn+yJNsBC/DKBuFbbwTbSzZ 8z2ZryDWv6FMZjSxNNgBR+sVt9Z9IRi6exbQfaHj/ZkIX1J96fFfYsPpGYBCNzUtmudd siNiRUZ4RhlpK/m5hWXwhecXk2WlBlR/5FdaLaPjH7obW3maLcFSnjJVjxbCL1+Nxx5B AlonR4kZ7cpDsaoeXzptJstSC+hoqS2RKXqnNB4ylTwzDwDS3rOBqxt1SGX+ryaRsSjP GmBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XSVaicoT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f14-20020aa7d84e000000b0043574de150asi6394409eds.34.2022.06.29.04.50.02; Wed, 29 Jun 2022 04:50:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XSVaicoT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232563AbiF2L3l (ORCPT + 99 others); Wed, 29 Jun 2022 07:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232673AbiF2L3g (ORCPT ); Wed, 29 Jun 2022 07:29:36 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C7C23EAAA for ; Wed, 29 Jun 2022 04:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656502174; x=1688038174; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fMJWfltOfFJMxVswzKOrQgNi1Q52cAI5noW02Iljmjk=; b=XSVaicoTZQ6dcWinF3OT65lHnbSTjnDMi3t1OL2PuOL2IAoC04GW1cvN FX10xPJqnOnbwBPD3KM3WI+H7Xmw4aICwGYgtm7ARfEtBZBwOECKA/O0v HcXXr+URmkOQfyR0qBac/lq6OUh6Zpk/9pfFAyV2SLucCMdy2Qq1tlTmo 6U0qP9+eIWZhS3he4n+v04fhECranXSQ2JUxhgC2Wf2dbFqL03jT2ubtK UfhQFvv3y9D6qZi/EYtqjEX9meqr7OGHUp4uH+TLNwaW0QvXlEFbiokhz y7fYnGGKI21pKQiY9yAVU4jlkd/swuao7PrFbXGqUxooUVPLTCob3GiKM g==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="368319217" X-IronPort-AV: E=Sophos;i="5.92,231,1650956400"; d="scan'208";a="368319217" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2022 04:29:34 -0700 X-IronPort-AV: E=Sophos;i="5.92,231,1650956400"; d="scan'208";a="647353027" Received: from sannilnx.jer.intel.com ([10.12.26.157]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2022 04:29:31 -0700 From: Alexander Usyskin To: Greg Kroah-Hartman , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Tvrtko Ursulin Cc: Tomas Winkler , Alexander Usyskin , Vitaly Lubart , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Daniele Ceraolo Spurio Subject: [PATCH v4 02/14] drm/i915/gsc: skip irq initialization if using polling Date: Wed, 29 Jun 2022 14:29:01 +0300 Message-Id: <20220629112913.1210933-3-alexander.usyskin@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220629112913.1210933-1-alexander.usyskin@intel.com> References: <20220629112913.1210933-1-alexander.usyskin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Lubart Some platforms require the host to poll on the GSC registers instead of relaying on the interrupts. For those platforms, irq initialization should be skipped Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Daniele Ceraolo Spurio --- drivers/gpu/drm/i915/gt/intel_gsc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gsc.c b/drivers/gpu/drm/i915/gt/intel_gsc.c index 0e494028b81d..e0236ff1d072 100644 --- a/drivers/gpu/drm/i915/gt/intel_gsc.c +++ b/drivers/gpu/drm/i915/gt/intel_gsc.c @@ -40,6 +40,7 @@ struct gsc_def { const char *name; unsigned long bar; size_t bar_size; + bool use_polling; }; /* gsc resources and definitions (HECI1 and HECI2) */ @@ -117,6 +118,10 @@ static void gsc_init_one(struct drm_i915_private *i915, return; } + /* skip irq initialization */ + if (def->use_polling) + goto add_device; + intf->irq = irq_alloc_desc(0); if (intf->irq < 0) { drm_err(&i915->drm, "gsc irq error %d\n", intf->irq); @@ -129,6 +134,7 @@ static void gsc_init_one(struct drm_i915_private *i915, goto fail; } +add_device: adev = kzalloc(sizeof(*adev), GFP_KERNEL); if (!adev) goto fail; @@ -182,10 +188,8 @@ static void gsc_irq_handler(struct intel_gt *gt, unsigned int intf_id) return; } - if (gt->gsc.intf[intf_id].irq < 0) { - drm_err_ratelimited(>->i915->drm, "GSC irq: irq not set"); + if (gt->gsc.intf[intf_id].irq < 0) return; - } ret = generic_handle_irq(gt->gsc.intf[intf_id].irq); if (ret) -- 2.34.1