drm/i915: do not warn late about hdmi on port A
diff mbox series

Message ID 20191108214251.79305-1-lucas.demarchi@intel.com
State New
Headers show
Series
  • drm/i915: do not warn late about hdmi on port A
Related show

Commit Message

Lucas De Marchi Nov. 8, 2019, 9:42 p.m. UTC
The warning should be just a warning. Where it is currently is wrong
since we already registered the connector on drm, meaning it dies later
on a NULL pointer deref if the VBT-overriding we have is removed. Move
the warning up.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Matt Roper Nov. 12, 2019, 4:38 p.m. UTC | #1
On Fri, Nov 08, 2019 at 01:42:51PM -0800, Lucas De Marchi wrote:
> The warning should be just a warning. Where it is currently is wrong
> since we already registered the connector on drm, meaning it dies later
> on a NULL pointer deref if the VBT-overriding we have is removed. Move
> the warning up.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index e084c2f75379..ed4a68fb351f 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -3140,6 +3140,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>  	DRM_DEBUG_KMS("Adding HDMI connector on [ENCODER:%d:%s]\n",
>  		      intel_encoder->base.base.id, intel_encoder->base.name);
>  
> +	if (WARN_ON(port == PORT_A))
> +		return;
> +
>  	if (WARN(intel_dig_port->max_lanes < 4,
>  		 "Not enough lanes (%d) for HDMI on [ENCODER:%d:%s]\n",
>  		 intel_dig_port->max_lanes, intel_encoder->base.base.id,
> @@ -3159,8 +3162,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>  
>  	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
>  
> -	if (WARN_ON(port == PORT_A))
> -		return;
>  	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
>  
>  	if (HAS_DDI(dev_priv))
> -- 
> 2.24.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula Nov. 14, 2019, 12:46 p.m. UTC | #2
On Fri, 08 Nov 2019, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> The warning should be just a warning. Where it is currently is wrong
> since we already registered the connector on drm, meaning it dies later
> on a NULL pointer deref if the VBT-overriding we have is removed. Move
> the warning up.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Do *NOT* merge patches without full IGT results. BAT is *NOT* enough.

BR,
Jani.


> ---
>  drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index e084c2f75379..ed4a68fb351f 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -3140,6 +3140,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>  	DRM_DEBUG_KMS("Adding HDMI connector on [ENCODER:%d:%s]\n",
>  		      intel_encoder->base.base.id, intel_encoder->base.name);
>  
> +	if (WARN_ON(port == PORT_A))
> +		return;
> +
>  	if (WARN(intel_dig_port->max_lanes < 4,
>  		 "Not enough lanes (%d) for HDMI on [ENCODER:%d:%s]\n",
>  		 intel_dig_port->max_lanes, intel_encoder->base.base.id,
> @@ -3159,8 +3162,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>  
>  	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
>  
> -	if (WARN_ON(port == PORT_A))
> -		return;
>  	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
>  
>  	if (HAS_DDI(dev_priv))
Lucas De Marchi Nov. 14, 2019, 5:27 p.m. UTC | #3
On Thu, Nov 14, 2019 at 02:46:48PM +0200, Jani Nikula wrote:
>On Fri, 08 Nov 2019, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
>> The warning should be just a warning. Where it is currently is wrong
>> since we already registered the connector on drm, meaning it dies later
>> on a NULL pointer deref if the VBT-overriding we have is removed. Move
>> the warning up.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
>Do *NOT* merge patches without full IGT results. BAT is *NOT* enough.

You are right, my bad. I will be more careful next times.

Lucas De Marchi

>
>BR,
>Jani.
>
>
>> ---
>>  drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
>> index e084c2f75379..ed4a68fb351f 100644
>> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
>> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
>> @@ -3140,6 +3140,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>>  	DRM_DEBUG_KMS("Adding HDMI connector on [ENCODER:%d:%s]\n",
>>  		      intel_encoder->base.base.id, intel_encoder->base.name);
>>
>> +	if (WARN_ON(port == PORT_A))
>> +		return;
>> +
>>  	if (WARN(intel_dig_port->max_lanes < 4,
>>  		 "Not enough lanes (%d) for HDMI on [ENCODER:%d:%s]\n",
>>  		 intel_dig_port->max_lanes, intel_encoder->base.base.id,
>> @@ -3159,8 +3162,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>>
>>  	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
>>
>> -	if (WARN_ON(port == PORT_A))
>> -		return;
>>  	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
>>
>>  	if (HAS_DDI(dev_priv))
>
>-- 
>Jani Nikula, Intel Open Source Graphics Center

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index e084c2f75379..ed4a68fb351f 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -3140,6 +3140,9 @@  void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	DRM_DEBUG_KMS("Adding HDMI connector on [ENCODER:%d:%s]\n",
 		      intel_encoder->base.base.id, intel_encoder->base.name);
 
+	if (WARN_ON(port == PORT_A))
+		return;
+
 	if (WARN(intel_dig_port->max_lanes < 4,
 		 "Not enough lanes (%d) for HDMI on [ENCODER:%d:%s]\n",
 		 intel_dig_port->max_lanes, intel_encoder->base.base.id,
@@ -3159,8 +3162,6 @@  void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 
 	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
 
-	if (WARN_ON(port == PORT_A))
-		return;
 	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
 
 	if (HAS_DDI(dev_priv))