[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <796c188e-615d-0027-125c-484b11c85e9d@intel.com>
Date: Mon, 11 Apr 2022 14:30:33 -0700
From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@...el.com>
To: Alexander Usyskin <alexander.usyskin@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>
CC: <linux-kernel@...r.kernel.org>,
Tomas Winkler <tomas.winkler@...el.com>,
Vitaly Lubart <vitaly.lubart@...el.com>,
<intel-gfx@...ts.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 07/20] drm/i915/gsc: skip irq initialization
if using polling
On 4/7/2022 5:58 AM, Alexander Usyskin wrote:
> From: Vitaly Lubart <vitaly.lubart@...el.com>
>
> If we use polling instead of interrupts,
> irq initialization should be skipped.
This needs at least a 1 line explanation if why we might need to use
polling. Something like "some platforms require the host to poll on the
GSC reply instead of relaying on the interrupts. For those platforms,
irq initialization should be skipped."
>
> Signed-off-by: Vitaly Lubart <vitaly.lubart@...el.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@...el.com>
> Signed-off-by: Alexander Usyskin <alexander.usyskin@...el.com>
> ---
> 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 21e860861f0b..280dba4fd32d 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) */
> @@ -97,6 +98,10 @@ static void gsc_init_one(struct drm_i915_private *i915,
> return;
> }
>
> + /* skip irq initialization */
> + if (def->use_polling)
> + goto add_device;
We tend to limit the use of gotos to the error paths, so I'd prefer it
if this was flipped to avoid it, i.e.:
if (!def->use_polling) {
/* set up irqs */
[...]
}
But not a blocker. With the commit message updated:
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@...el.com>
Daniele
> +
> intf->irq = irq_alloc_desc(0);
> if (intf->irq < 0) {
> drm_err(&i915->drm, "gsc irq error %d\n", intf->irq);
> @@ -109,6 +114,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;
> @@ -162,10 +168,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)
Powered by blists - more mailing lists