Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5914508rwb; Wed, 7 Sep 2022 09:44:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6zCq06KSHkmcJNP9/O+1zqwqYH9iNP/VcfOvKyXsiwG/aUyL4NaaHipEn4AQSJjlAepnPK X-Received: by 2002:aa7:da9a:0:b0:44e:9774:c2ab with SMTP id q26-20020aa7da9a000000b0044e9774c2abmr3911678eds.10.1662569087007; Wed, 07 Sep 2022 09:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662569087; cv=none; d=google.com; s=arc-20160816; b=X4jGLE55VamsTdVUsoYk7TPmJK1vZ19KQNoLi/E0/o/glr+NZmwvOzt1W/MRTfC/7Q V5N47MyDgNTx+/cPsTO4q8JYfLpJzH3mPWxATIu1ZMyzgXNZLL+JmyqfJSC9kfhrsBNQ zBnd601ZmIxmfvVpyYVpXY25349rOqR3T9SRltGTot5TFSquQP0q/CUo30GwjzSe/aG4 rls5wP+MmUpkf9yaYEhex27fy9+WoPw7F5djT7tV4hGAfDC1cpkUOt5jQdNEWx/iGTbO HyajjSc1xNqrn1gFyCY2JnBnkIZlWuXy+HiYh+I3i+gWW4jUWdNrD0fk3x8IdQFEnPSm rRiA== 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=sj57Qun820joQ4JGmoSGzrggVZT2/+AkY6aO7RWJA2I=; b=tFs+R9uvTAU0FVRguz0kTgArRTrfMEMV5fBfy+UZPXC9TjOs10W0jpKkaurX4gnlao VNhNczH2OfRnNbNIpRLWS0o8caayHi+hMoVIpPsP/Els8Veasi+YdDn6SYGC7+RNycK4 SfI/jvXEtyI7gxRuFu0xVHow8LFzI+JLqYsmtUOFAgRiheqLhfxnPYV5qDU/18VA5pxb WFgcm1FBgSCyw1nHzepnu8zzN56lxWjW+CA3b2rq3bDkKKjvkxA+fhqtRNF/O0n62s3o HH3lG6abyXJu/DCMnZWMkRMB0wD8n+CwlYnfh03v3+481xiYXSPXxpoGoq+LAgPdiW4k Q99A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PMmsrEAC; 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 qw23-20020a1709066a1700b007307f95bc5dsi12533869ejc.383.2022.09.07.09.44.21; Wed, 07 Sep 2022 09:44:46 -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=PMmsrEAC; 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 S229993AbiIGP7V (ORCPT + 99 others); Wed, 7 Sep 2022 11:59:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbiIGP7P (ORCPT ); Wed, 7 Sep 2022 11:59:15 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE8D4B8F19 for ; Wed, 7 Sep 2022 08:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662566354; x=1694102354; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yfA4CNwJAJ4VUJ6uoZRsu0YLI1UJHJwg6/XHOvPCJnI=; b=PMmsrEACpHbTlSnTBgUIM8ccbpt+zbJqc294x1BB/LE8t2AltrdOUkcc aIpL6iWdY9oFLG+E4GCAfaSfTpXb04/YfMmiCE4AxHt4+rBRTVIhrbeTb 1K6BRryGGAVtae7dYGKbYklqmb5FW36lxMJH1+tI6uaqB8qoBSwT+Liw6 WrVOdnTbimsealywPl8VdNAz21foK5G+sn5/LsccwgFpvN+7YCr5NVPYy Ij8hhs94khwm00V4+paFlr8ibaM93Q43L+LuG8hTSRDjPv+qO5xLkZSVv /f/GqnwMgrYo5Ukm7ztSwmQDhaI9rDF3r5sUQ9dWy8cJEWqyoCjm1V/hv A==; X-IronPort-AV: E=McAfee;i="6500,9779,10463"; a="294501427" X-IronPort-AV: E=Sophos;i="5.93,297,1654585200"; d="scan'208";a="294501427" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 08:58:45 -0700 X-IronPort-AV: E=Sophos;i="5.93,297,1654585200"; d="scan'208";a="676247503" 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; 07 Sep 2022 08:58:40 -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 v8 01/16] drm/i915/gsc: skip irq initialization if using polling Date: Wed, 7 Sep 2022 18:57:58 +0300 Message-Id: <20220907155813.1427526-2-tomas.winkler@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907155813.1427526-1-tomas.winkler@intel.com> References: <20220907155813.1427526-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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.37.2