diff mbox series

[4/4] drm/i915: Fix oops on platforms w/o hpd support

Message ID 20211014090941.12159-5-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Make the driver not oops on load on old machines | expand

Commit Message

Ville Syrjälä Oct. 14, 2021, 9:09 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We don't have hpd support on i8xx/i915 which means hotplug_funcs==NULL.
Let's not oops when loading the driver on one those machines.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Fixes: cd030c7c11a4 ("drm/i915: constify hotplug function vtable.")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_hotplug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jani Nikula Oct. 14, 2021, 9:18 a.m. UTC | #1
On Thu, 14 Oct 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> We don't have hpd support on i8xx/i915 which means hotplug_funcs==NULL.
> Let's not oops when loading the driver on one those machines.

D'oh!

Lemme guess, CI just casually dropped the machines from the results
because they didn't boot?

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Fixes: cd030c7c11a4 ("drm/i915: constify hotplug function vtable.")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hotplug.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> index 3c1cec953b42..0e949a258a22 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> @@ -215,7 +215,8 @@ intel_hpd_irq_storm_switch_to_polling(struct drm_i915_private *dev_priv)
>  
>  static void intel_hpd_irq_setup(struct drm_i915_private *i915)
>  {
> -	if (i915->display_irqs_enabled && i915->hotplug_funcs->hpd_irq_setup)
> +	if (i915->display_irqs_enabled &&
> +	    i915->hotplug_funcs && i915->hotplug_funcs->hpd_irq_setup)
>  		i915->hotplug_funcs->hpd_irq_setup(i915);
>  }
Jani Nikula Oct. 14, 2021, 9:20 a.m. UTC | #2
On Thu, 14 Oct 2021, Jani Nikula <jani.nikula@intel.com> wrote:
> On Thu, 14 Oct 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> We don't have hpd support on i8xx/i915 which means hotplug_funcs==NULL.
>> Let's not oops when loading the driver on one those machines.
>
> D'oh!
>
> Lemme guess, CI just casually dropped the machines from the results
> because they didn't boot?
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
>>
>> Cc: Dave Airlie <airlied@redhat.com>
>> Cc: Jani Nikula <jani.nikula@intel.com>
>> Fixes: cd030c7c11a4 ("drm/i915: constify hotplug function vtable.")
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_hotplug.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
>> index 3c1cec953b42..0e949a258a22 100644
>> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
>> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
>> @@ -215,7 +215,8 @@ intel_hpd_irq_storm_switch_to_polling(struct drm_i915_private *dev_priv)
>>  
>>  static void intel_hpd_irq_setup(struct drm_i915_private *i915)
>>  {
>> -	if (i915->display_irqs_enabled && i915->hotplug_funcs->hpd_irq_setup)
>> +	if (i915->display_irqs_enabled &&
>> +	    i915->hotplug_funcs && i915->hotplug_funcs->hpd_irq_setup)

Btw i915->hotplug_funcs->hpd_irq_setup is always set if
i915->hotplug_funcs is set, so that bit is a bit redundant.

Anyway, r-b stands either way you decide to go.


>>  		i915->hotplug_funcs->hpd_irq_setup(i915);
>>  }
Ville Syrjälä Oct. 14, 2021, 9:27 a.m. UTC | #3
On Thu, Oct 14, 2021 at 12:20:24PM +0300, Jani Nikula wrote:
> On Thu, 14 Oct 2021, Jani Nikula <jani.nikula@intel.com> wrote:
> > On Thu, 14 Oct 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>
> >> We don't have hpd support on i8xx/i915 which means hotplug_funcs==NULL.
> >> Let's not oops when loading the driver on one those machines.
> >
> > D'oh!
> >
> > Lemme guess, CI just casually dropped the machines from the results
> > because they didn't boot?
> >
> > Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> >
> >>
> >> Cc: Dave Airlie <airlied@redhat.com>
> >> Cc: Jani Nikula <jani.nikula@intel.com>
> >> Fixes: cd030c7c11a4 ("drm/i915: constify hotplug function vtable.")
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> ---
> >>  drivers/gpu/drm/i915/display/intel_hotplug.c | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> >> index 3c1cec953b42..0e949a258a22 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> >> @@ -215,7 +215,8 @@ intel_hpd_irq_storm_switch_to_polling(struct drm_i915_private *dev_priv)
> >>  
> >>  static void intel_hpd_irq_setup(struct drm_i915_private *i915)
> >>  {
> >> -	if (i915->display_irqs_enabled && i915->hotplug_funcs->hpd_irq_setup)
> >> +	if (i915->display_irqs_enabled &&
> >> +	    i915->hotplug_funcs && i915->hotplug_funcs->hpd_irq_setup)
> 
> Btw i915->hotplug_funcs->hpd_irq_setup is always set if
> i915->hotplug_funcs is set, so that bit is a bit redundant.

Right. I'll drop the drop the belt, leaving just the suspenders.

> 
> Anyway, r-b stands either way you decide to go.
> 
> 
> >>  		i915->hotplug_funcs->hpd_irq_setup(i915);
> >>  }
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center
Ville Syrjälä Oct. 14, 2021, 9:29 a.m. UTC | #4
On Thu, Oct 14, 2021 at 12:18:23PM +0300, Jani Nikula wrote:
> On Thu, 14 Oct 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > We don't have hpd support on i8xx/i915 which means hotplug_funcs==NULL.
> > Let's not oops when loading the driver on one those machines.
> 
> D'oh!
> 
> Lemme guess, CI just casually dropped the machines from the results
> because they didn't boot?

Dunno where the gdg has gone actually. Tomi?

> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> >
> > Cc: Dave Airlie <airlied@redhat.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Fixes: cd030c7c11a4 ("drm/i915: constify hotplug function vtable.")
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_hotplug.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> > index 3c1cec953b42..0e949a258a22 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> > +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> > @@ -215,7 +215,8 @@ intel_hpd_irq_storm_switch_to_polling(struct drm_i915_private *dev_priv)
> >  
> >  static void intel_hpd_irq_setup(struct drm_i915_private *i915)
> >  {
> > -	if (i915->display_irqs_enabled && i915->hotplug_funcs->hpd_irq_setup)
> > +	if (i915->display_irqs_enabled &&
> > +	    i915->hotplug_funcs && i915->hotplug_funcs->hpd_irq_setup)
> >  		i915->hotplug_funcs->hpd_irq_setup(i915);
> >  }
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center
Sarvela, Tomi P Oct. 14, 2021, 9:31 a.m. UTC | #5
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> On Thu, Oct 14, 2021 at 12:18:23PM +0300, Jani Nikula wrote:
> > On Thu, 14 Oct 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > We don't have hpd support on i8xx/i915 which means
> hotplug_funcs==NULL.
> > > Let's not oops when loading the driver on one those machines.
> >
> > D'oh!
> >
> > Lemme guess, CI just casually dropped the machines from the results
> > because they didn't boot?
> 
> Dunno where the gdg has gone actually. Tomi?

Both GDGs are dead to old age (PSU / power delivery).

Tomi
Ville Syrjälä Oct. 14, 2021, 9:36 a.m. UTC | #6
On Thu, Oct 14, 2021 at 09:31:40AM +0000, Sarvela, Tomi P wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > On Thu, Oct 14, 2021 at 12:18:23PM +0300, Jani Nikula wrote:
> > > On Thu, 14 Oct 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > >
> > > > We don't have hpd support on i8xx/i915 which means
> > hotplug_funcs==NULL.
> > > > Let's not oops when loading the driver on one those machines.
> > >
> > > D'oh!
> > >
> > > Lemme guess, CI just casually dropped the machines from the results
> > > because they didn't boot?
> > 
> > Dunno where the gdg has gone actually. Tomi?
> 
> Both GDGs are dead to old age (PSU / power delivery).

We don't have spare PSUs to throw at them? Or are the boards also
semi-dead due to rotted caps etc.?
Sarvela, Tomi P Oct. 14, 2021, 9:42 a.m. UTC | #7
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> On Thu, Oct 14, 2021 at 09:31:40AM +0000, Sarvela, Tomi P wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > On Thu, Oct 14, 2021 at 12:18:23PM +0300, Jani Nikula wrote:
> > > > On Thu, 14 Oct 2021, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > >
> > > > > We don't have hpd support on i8xx/i915 which means
> > > hotplug_funcs==NULL.
> > > > > Let's not oops when loading the driver on one those machines.
> > > >
> > > > D'oh!
> > > >
> > > > Lemme guess, CI just casually dropped the machines from the results
> > > > because they didn't boot?
> > >
> > > Dunno where the gdg has gone actually. Tomi?
> >
> > Both GDGs are dead to old age (PSU / power delivery).
> 
> We don't have spare PSUs to throw at them? Or are the boards also
> semi-dead due to rotted caps etc.?

It could be MB caps, PSU caps, or PSU anything else. Nothing comes on
when power is turned on, no fans, no leds, nothing. Same issue on both
hosts. No surprises there, they're identical models. It could be CPU,
but IIRC I already tried changing that.

The PSU part is vendor-specific. Standard PSU maybe could be retrofitted,
but that'd need some dedicated time.

Tomi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
index 3c1cec953b42..0e949a258a22 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
@@ -215,7 +215,8 @@  intel_hpd_irq_storm_switch_to_polling(struct drm_i915_private *dev_priv)
 
 static void intel_hpd_irq_setup(struct drm_i915_private *i915)
 {
-	if (i915->display_irqs_enabled && i915->hotplug_funcs->hpd_irq_setup)
+	if (i915->display_irqs_enabled &&
+	    i915->hotplug_funcs && i915->hotplug_funcs->hpd_irq_setup)
 		i915->hotplug_funcs->hpd_irq_setup(i915);
 }