All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manasi Navare <manasi.d.navare@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Prevent kernel panic on reading out compliance debugfs files
Date: Wed, 21 Jun 2017 15:08:26 -0700	[thread overview]
Message-ID: <20170621220825.GB28116@intel.com> (raw)
In-Reply-To: <20170621105941.11617-1-maarten.lankhorst@linux.intel.com>

Thanks fo rthis patch Maarten. I had noticed this while running the intel_dp_compliance
IGT tool. But I saw this with DP SST systems as well. What could be happening in that case?

Manasi

On Wed, Jun 21, 2017 at 12:59:41PM +0200, Maarten Lankhorst wrote:
> When reading all debugfs files on a system with DP-MST the kernel panics
> on a null pointer dereference because intel_dp is null for a DP-MST
> connector. Detect this case and skip those connectors.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 33 ++++++++++++++++++++++++---------
>  1 file changed, 24 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 1f1176b6400e..30e2e168fe92 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -3812,13 +3812,18 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data)
>  
>  	drm_connector_list_iter_begin(dev, &conn_iter);
>  	drm_for_each_connector_iter(connector, &conn_iter) {
> +		struct intel_encoder *encoder;
> +
>  		if (connector->connector_type !=
>  		    DRM_MODE_CONNECTOR_DisplayPort)
>  			continue;
>  
> -		if (connector->status == connector_status_connected &&
> -		    connector->encoder != NULL) {
> -			intel_dp = enc_to_intel_dp(connector->encoder);
> +		encoder = to_intel_encoder(connector->encoder);
> +		if (encoder && encoder->type == INTEL_OUTPUT_DP_MST)
> +			continue;
> +
> +		if (encoder && connector->status == connector_status_connected) {
> +			intel_dp = enc_to_intel_dp(&encoder->base);
>  			if (intel_dp->compliance.test_active)
>  				seq_puts(m, "1");
>  			else
> @@ -3858,13 +3863,18 @@ static int i915_displayport_test_data_show(struct seq_file *m, void *data)
>  
>  	drm_connector_list_iter_begin(dev, &conn_iter);
>  	drm_for_each_connector_iter(connector, &conn_iter) {
> +		struct intel_encoder *encoder;
> +
>  		if (connector->connector_type !=
>  		    DRM_MODE_CONNECTOR_DisplayPort)
>  			continue;
>  
> -		if (connector->status == connector_status_connected &&
> -		    connector->encoder != NULL) {
> -			intel_dp = enc_to_intel_dp(connector->encoder);
> +		encoder = to_intel_encoder(connector->encoder);
> +		if (encoder && encoder->type == INTEL_OUTPUT_DP_MST)
> +			continue;
> +
> +		if (encoder && connector->status == connector_status_connected) {
> +			intel_dp = enc_to_intel_dp(&encoder->base);
>  			if (intel_dp->compliance.test_type ==
>  			    DP_TEST_LINK_EDID_READ)
>  				seq_printf(m, "%lx",
> @@ -3911,13 +3921,18 @@ static int i915_displayport_test_type_show(struct seq_file *m, void *data)
>  
>  	drm_connector_list_iter_begin(dev, &conn_iter);
>  	drm_for_each_connector_iter(connector, &conn_iter) {
> +		struct intel_encoder *encoder;
> +
>  		if (connector->connector_type !=
>  		    DRM_MODE_CONNECTOR_DisplayPort)
>  			continue;
>  
> -		if (connector->status == connector_status_connected &&
> -		    connector->encoder != NULL) {
> -			intel_dp = enc_to_intel_dp(connector->encoder);
> +		encoder = to_intel_encoder(connector->encoder);
> +		if (encoder && encoder->type == INTEL_OUTPUT_DP_MST)
> +			continue;
> +
> +		if (encoder && connector->status == connector_status_connected) {
> +			intel_dp = enc_to_intel_dp(&encoder->base);
>  			seq_printf(m, "%02lx", intel_dp->compliance.test_type);
>  		} else
>  			seq_puts(m, "0");
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-06-21 22:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21 10:59 [PATCH] drm/i915: Prevent kernel panic on reading out compliance debugfs files Maarten Lankhorst
2017-06-21 12:04 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-21 20:57 ` [PATCH] " Pandiyan, Dhinakaran
2017-06-26  8:18   ` [PATCH] drm/i915: Prevent kernel panic when reading/writing compliance debugfs files, v2 Maarten Lankhorst
2017-06-26 17:07     ` Pandiyan, Dhinakaran
2017-06-21 22:08 ` Manasi Navare [this message]
2017-06-26 11:04 ` ✓ Fi.CI.BAT: success for drm/i915: Prevent kernel panic on reading out compliance debugfs files (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170621220825.GB28116@intel.com \
    --to=manasi.d.navare@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.