diff mbox series

drm/i915/gsc: Only initialize GSC in tile 0

Message ID 20221031055117.1043830-1-alexander.usyskin@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/gsc: Only initialize GSC in tile 0 | expand

Commit Message

Alexander Usyskin Oct. 31, 2022, 5:51 a.m. UTC
From: José Roberto de Souza <jose.souza@intel.com>

For multi-tile setups the GSC operational only on the tile 0.
Skip GSC auxiliary device creation for all other tiles.

Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Vitaly Lubart <vitaly.lubart@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Rodrigo Vivi Oct. 31, 2022, 9:35 a.m. UTC | #1
On Mon, Oct 31, 2022 at 07:51:17AM +0200, Alexander Usyskin wrote:
> From: José Roberto de Souza <jose.souza@intel.com>
> 
> For multi-tile setups the GSC operational only on the tile 0.
> Skip GSC auxiliary device creation for all other tiles.
> 
> Cc: Tomas Winkler <tomas.winkler@intel.com>
> Cc: Vitaly Lubart <vitaly.lubart@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index 2e796ffad911..92ad8cd45ddb 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -456,7 +456,10 @@ void intel_gt_chipset_flush(struct intel_gt *gt)
>  
>  void intel_gt_driver_register(struct intel_gt *gt)
>  {
> -	intel_gsc_init(&gt->gsc, gt->i915);
> +	if (gt->info.id == 0)
> +		intel_gsc_init(&gt->gsc, gt->i915);
> +	else
> +		drm_dbg(&gt->i915->drm, "Not initializing gsc for remote tiles\n");

It looks to me that we need to move the gsc out of the intel_gt
instead of workaround the initialization.

>  
>  	intel_rps_driver_register(&gt->rps);
>  
> @@ -787,7 +790,8 @@ void intel_gt_driver_unregister(struct intel_gt *gt)
>  
>  	intel_gt_sysfs_unregister(gt);
>  	intel_rps_driver_unregister(&gt->rps);
> -	intel_gsc_fini(&gt->gsc);
> +	if (gt->info.id == 0)
> +		intel_gsc_fini(&gt->gsc);
>  
>  	intel_pxp_fini(&gt->pxp);
>  
> -- 
> 2.34.1
>
Winkler, Tomas Oct. 31, 2022, 9:48 a.m. UTC | #2
> 
> On Mon, Oct 31, 2022 at 07:51:17AM +0200, Alexander Usyskin wrote:
> > From: José Roberto de Souza <jose.souza@intel.com>
> >
> > For multi-tile setups the GSC operational only on the tile 0.
> > Skip GSC auxiliary device creation for all other tiles.
> >
> > Cc: Tomas Winkler <tomas.winkler@intel.com>
> > Cc: Vitaly Lubart <vitaly.lubart@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_gt.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c
> > b/drivers/gpu/drm/i915/gt/intel_gt.c
> > index 2e796ffad911..92ad8cd45ddb 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> > @@ -456,7 +456,10 @@ void intel_gt_chipset_flush(struct intel_gt *gt)
> >
> >  void intel_gt_driver_register(struct intel_gt *gt)  {
> > -	intel_gsc_init(&gt->gsc, gt->i915);
> > +	if (gt->info.id == 0)
> > +		intel_gsc_init(&gt->gsc, gt->i915);
> > +	else
> > +		drm_dbg(&gt->i915->drm, "Not initializing gsc for remote
> tiles\n");
> 
> It looks to me that we need to move the gsc out of the intel_gt instead of
> workaround the initialization.

The interrupts are handled by gt, so where this should go ?
Rodrigo Vivi Oct. 31, 2022, 10:15 a.m. UTC | #3
On Mon, Oct 31, 2022 at 05:48:07AM -0400, Winkler, Tomas wrote:
> 
> > 
> > On Mon, Oct 31, 2022 at 07:51:17AM +0200, Alexander Usyskin wrote:
> > > From: José Roberto de Souza <jose.souza@intel.com>
> > >
> > > For multi-tile setups the GSC operational only on the tile 0.
> > > Skip GSC auxiliary device creation for all other tiles.
> > >
> > > Cc: Tomas Winkler <tomas.winkler@intel.com>
> > > Cc: Vitaly Lubart <vitaly.lubart@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/gt/intel_gt.c | 8 ++++++--
> > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c
> > > b/drivers/gpu/drm/i915/gt/intel_gt.c
> > > index 2e796ffad911..92ad8cd45ddb 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> > > +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> > > @@ -456,7 +456,10 @@ void intel_gt_chipset_flush(struct intel_gt *gt)
> > >
> > >  void intel_gt_driver_register(struct intel_gt *gt)  {
> > > -	intel_gsc_init(&gt->gsc, gt->i915);
> > > +	if (gt->info.id == 0)
> > > +		intel_gsc_init(&gt->gsc, gt->i915);
> > > +	else
> > > +		drm_dbg(&gt->i915->drm, "Not initializing gsc for remote
> > tiles\n");
> > 
> > It looks to me that we need to move the gsc out of the intel_gt instead of
> > workaround the initialization.
> 
> The interrupts are handled by gt, so where this should go ? 
> 

Ouch, I've seen it now. But still this patch brings me more doubts...

is gsc really a per-gt thing? if not why the gsc irq is in the gt domain?
if yes why the one in the second tile not operational?

if it is not a per-tile thing and only the irq is in a bad spot we could
still move it outside gt and make the irq to be redirected.

well, if it is really a per tile thing but it is fused of, do we have hw
ways to detect that?

if it is really a tile thing and we don't have better ways to identify
we might want to do with this patch, but add a bit more information on the
reasons and also double checking if by avoiding the initialization we are
sure that we are not going to reach any case of attempting to utilize the
un-initialized gsc.
Alexander Usyskin Nov. 9, 2022, 2:56 p.m. UTC | #4
> > >
> > > It looks to me that we need to move the gsc out of the intel_gt instead of
> > > workaround the initialization.
> >
> > The interrupts are handled by gt, so where this should go ?
> >
> 
> Ouch, I've seen it now. But still this patch brings me more doubts...
> 
> is gsc really a per-gt thing? if not why the gsc irq is in the gt domain?
> if yes why the one in the second tile not operational?
> 
> if it is not a per-tile thing and only the irq is in a bad spot we could
> still move it outside gt and make the irq to be redirected.
> 
> well, if it is really a per tile thing but it is fused of, do we have hw
> ways to detect that?
> 
> if it is really a tile thing and we don't have better ways to identify
> we might want to do with this patch, but add a bit more information on the
> reasons and also double checking if by avoiding the initialization we are
> sure that we are not going to reach any case of attempting to utilize the
> un-initialized gsc.

The GSC is present on all tiles but functional only on the first one.
There is no way to detect if GSC is functional per-tile.

Good point about double check, we have also interrupt handler.
Should not fire without GSC running, but better to protect here too.

We have code that skip initialization of one of the heads provided by GSC.
I'll utilize the same path to disable here, so that should be safe and already broadly tested.
Will publish new version soon.

--
Alexander (Sasha) Usyskin

CSE FW Dev - Host SW
Intel Israel (74) Limited
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index 2e796ffad911..92ad8cd45ddb 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -456,7 +456,10 @@  void intel_gt_chipset_flush(struct intel_gt *gt)
 
 void intel_gt_driver_register(struct intel_gt *gt)
 {
-	intel_gsc_init(&gt->gsc, gt->i915);
+	if (gt->info.id == 0)
+		intel_gsc_init(&gt->gsc, gt->i915);
+	else
+		drm_dbg(&gt->i915->drm, "Not initializing gsc for remote tiles\n");
 
 	intel_rps_driver_register(&gt->rps);
 
@@ -787,7 +790,8 @@  void intel_gt_driver_unregister(struct intel_gt *gt)
 
 	intel_gt_sysfs_unregister(gt);
 	intel_rps_driver_unregister(&gt->rps);
-	intel_gsc_fini(&gt->gsc);
+	if (gt->info.id == 0)
+		intel_gsc_fini(&gt->gsc);
 
 	intel_pxp_fini(&gt->pxp);