Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp216716rwn; Wed, 7 Sep 2022 15:25:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR46OQWethodJHgu44tTjrjRYpajwZKzviB8RA/NKFyQhmtCZCGPvbWelt+yVX5EjyeBJxBF X-Received: by 2002:a17:907:6e14:b0:730:a229:f747 with SMTP id sd20-20020a1709076e1400b00730a229f747mr4040301ejc.202.1662589559575; Wed, 07 Sep 2022 15:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662589559; cv=none; d=google.com; s=arc-20160816; b=uyDz7GACCRxDTTimBkUFXPOU9tCo0X2qfywKR1lIcZNkofM+4yZVOj4mIYciVJSrZn TCbLMErgpGpfNc2UPRb7yQ/sysiKYhePWzJmNJSZnlotFHj9Bjdo+W4kLT772P4onft7 USGqI3/xNNB3u5zmIobKTdu6nHXvcmv8h/gy3CMRbcVHWUqA6YcRxzALXVm1890zWGJ0 cunQpzcWtQ/UO7peZxlMEzYjMZLOSDqn5rl+nUmhkuUqkX6x3fLLelJC2MH5DCUFSE+2 97EI+4NZ5OaPJ/uwKdAQUuugHJNjfSLPxknRP9ulFEetKFE/rt/XQVHjt+IRal8Ltz9V ZmtQ== 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=vnHz9ej6eILxVy5twrkB8A7EN8QyQKbviQ1vWVhSJks=; b=UDK7n+jjAJdmA5hgya3Z+tUlpx5BO2PyKxvtI8Vfwx2jUhQEKnIftrTJj90XIxuHvk 2jdALUb23u418u1OLzojSd2X0yQl/oSf2XdgxhwGIHAPE3zde6gf0LaI6NfkyzWlpD2b zXGgUI/yY/bEqvrDiWu9vWPyoqbGTvDyeROgVuZWJYVntxn45quSxO4ZL6eD4yBxaKPl WO4tCtEXhodk5mdR6OlU7rzXvU+LJITuhbREGD+5RF7rLNLg2V2qHVgvlaEFrH0mCjDb n8lZC8NE8fPQS8NN0v4on/mJ/77JOOMiB32Rx7C6QmghVje8AgmtzSv3yt8luo7IxWA4 qtHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Tzj0VOvo; 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 hk17-20020a170906c9d100b0072ab5d0fc33si343028ejb.863.2022.09.07.15.25.34; Wed, 07 Sep 2022 15:25:59 -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=Tzj0VOvo; 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 S230349AbiIGVvl (ORCPT + 99 others); Wed, 7 Sep 2022 17:51:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbiIGVvi (ORCPT ); Wed, 7 Sep 2022 17:51:38 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A9772C64B for ; Wed, 7 Sep 2022 14:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662587496; x=1694123496; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qlmNsU/mtZ1sVUmZ/WKotIS9i/3ehbFGR8PsPUiu5h8=; b=Tzj0VOvox+Re3L2z9VaAZ7Mrl4jkzgBGgEQxbuWrHfgin98Yx4jioXio dOIvRUjZ02o8u8iQElBAEMl6Gu+UvI3t7FdCzSa2IYZ0W+x1He+9XBsJv 1DL1zi9NHIi/Z6raBX14Vg4Odk8my1Eo9fjoJPjileC8YncJRlRZWV2/b 1L5YTQtm0hPGwXz/6/KmI0DO5chJDME9rLx6budajl2aAxPVtOIKb/KSL x4+qH5lMs3BLzHYwhFYogm/6dtI8sOjEeILtoMPeEIMZJl0+6b2ZqZ0sp zuOalQWC+twra40zZiLhw5W1/qd0SXjzbAqmyA7X/jeeldLWy1MXxRCOl w==; X-IronPort-AV: E=McAfee;i="6500,9779,10463"; a="295740259" X-IronPort-AV: E=Sophos;i="5.93,298,1654585200"; d="scan'208";a="295740259" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 14:51:35 -0700 X-IronPort-AV: E=Sophos;i="5.93,298,1654585200"; d="scan'208";a="790207823" Received: from twinkler-lnx.jer.intel.com ([10.12.87.143]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 14:51:32 -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 v9 01/16] drm/i915/gsc: skip irq initialization if using polling Date: Thu, 8 Sep 2022 00:50:58 +0300 Message-Id: <20220907215113.1596567-2-tomas.winkler@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907215113.1596567-1-tomas.winkler@intel.com> References: <20220907215113.1596567-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 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 --- V9: Rebase 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