Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1939579imi; Sun, 24 Jul 2022 01:27:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sQkrTaM89mpOC8ZUj7/8gKpmxVVAK4qF0VKxuYTJNhI9nJevnFkuhxYq+luHWLUshc5Dhn X-Received: by 2002:a05:6402:524a:b0:43a:c2a7:f52b with SMTP id t10-20020a056402524a00b0043ac2a7f52bmr8024431edd.258.1658651226979; Sun, 24 Jul 2022 01:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658651226; cv=none; d=google.com; s=arc-20160816; b=iKJwJfiKCWtkpk8+gn47/2pJFZzO/ckgAPoVN/4MZw6op3FFn7YpJlQ3hxOp47Fexw UtL0StEHYTmnfD5NRY3SMoLjsgdbppmnAopDXPqFNNiOsa3imT8wsL8x8A9r03vdp/aO 13hMbL5Ev6U2k4X4zoVozZUpPU9ndwYmT25AijZyuiJ6kBFv6TPffvwdX/f62Kh99CSp lSw6ikr3/yLiM45j6G/siBT1FY0oWhktRpQALJ9oitzhiM2tXty7VKKxArV0l7HXCIET zFBz5/aSxwsrmAkO2qsZ4fZrX+ZdDqpbjhb8qIw45pwIoSRxE752PfyE3pJ36lnR4zHe /PoA== 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=5HgifkQfh88nqJAMDJrZ+1ODmwGI2hpsvCiH5aayOxw=; b=Gpt6dbj9cmUTSYqtjmDOqyxuYJy0LQKZIPlC2L0iZyn5rchgVJMGT5GjfPvBYLAFAM EpKhtpVc3Qvf45ABVs9oqireZaS4kxLjFJYh5iWmzjck5BkI3kUrui7h4KslE8ECRFW+ ghLaLI2nHW8VG0fw60togKeG6di2tS95agYRrFh2jP/gZTaxea7oJrwrsY3UuRj4dcM3 HLPdC8JOduKX2Xwozh+/7ITkNaQtNmm1DRRBoWvZL8PrgrmYO2md0t1S5ofupWh7faBU y7hUF4LawHGvmUrU/1/zXzjhRgwudkDDMv6yUDCuuif8qpqlU8wto2/iSu6gRdSXhomw 29RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cbLbIi3+; 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 x6-20020a05640226c600b0043be972ae5bsi1517427edd.495.2022.07.24.01.26.42; Sun, 24 Jul 2022 01:27:06 -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=cbLbIi3+; 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 S229728AbiGXIYz (ORCPT + 99 others); Sun, 24 Jul 2022 04:24:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiGXIYx (ORCPT ); Sun, 24 Jul 2022 04:24:53 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCE0E11D for ; Sun, 24 Jul 2022 01:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658651092; x=1690187092; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IEgz+QvgbUQ49mLzfjgcodQfPHVlULtQu4Tbk92itYI=; b=cbLbIi3+gwEwt47JQYVQmdIjYHQj/pKiwolSxzviGq1COG34RgYfS+Ll QkmJBxJ8/RNSmcj48k6r+2Hvk6ZgkfRpyJ0gGVZtmfyJWeip1xBFsPZUU QZP0MQUU8kVZy6GvPtH9yjrDg4Cct1VuFoTp4toqy9VUapKHUERl5i7Sx PPL3C0zx3xP2w8DQ0hDiAEKinBh96uWYZo2GcpZSdbIXwpiGcORf/KPDP AtDg/PeiiCLhITaU3thQSSlGx+5DjDRuzjjIJzQPCJBpQxmtlmXWj3uOL OXYqsotGBoI1SuV3v3j4R/5/zc3mT3qnhzytEZjyt+9cE2ULfTSwj2t8+ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10417"; a="313267940" X-IronPort-AV: E=Sophos;i="5.93,190,1654585200"; d="scan'208";a="313267940" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2022 01:24:52 -0700 X-IronPort-AV: E=Sophos;i="5.93,190,1654585200"; d="scan'208";a="657756200" Received: from twinkler-lnx.jer.intel.com ([10.12.87.143]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2022 01:24:49 -0700 From: Tomas Winkler To: Greg Kroah-Hartman , David Airlie , Daniel Vetter Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomas Winkler , Alexander Usyskin , Vitaly Lubart , Daniele Ceraolo Spurio Subject: [PATCH v6 01/14] drm/i915/gsc: skip irq initialization if using polling Date: Sun, 24 Jul 2022 11:24:15 +0300 Message-Id: <20220724082428.218628-2-tomas.winkler@intel.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220724082428.218628-1-tomas.winkler@intel.com> References: <20220724082428.218628-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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.35.3