diff mbox series

drm: dpcd: Print more useful information during error

Message ID 20200409195200.5483-1-mail@aurabindo.in (mailing list archive)
State New, archived
Headers show
Series drm: dpcd: Print more useful information during error | expand

Commit Message

Aurabindo Pillai April 9, 2020, 7:52 p.m. UTC
When DPCD access errors occur, knowing the register and request
associated with the error helps debugging, so print the
details in the debug message.

Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>
---
 drivers/gpu/drm/drm_dp_helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jani Nikula April 14, 2020, 11:03 a.m. UTC | #1
On Thu, 09 Apr 2020, Aurabindo Pillai <mail@aurabindo.in> wrote:
> When DPCD access errors occur, knowing the register and request
> associated with the error helps debugging, so print the
> details in the debug message.
>
> Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>
> ---
>  drivers/gpu/drm/drm_dp_helper.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index a5364b519..545606aac 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -257,7 +257,9 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
>  			err = ret;
>  	}
>  
> -	DRM_DEBUG_KMS("Too many retries, giving up. First error: %d\n", err);
> +	DRM_DEBUG_KMS("dpcd: Too many retries, giving up. First error: %d\t"
> +		      "address: %x\trequest: %x\t size:%zu\n",
> +		      err, msg.address, msg.request, msg.size);

Nitpicks, please don't add tabs, maybe use commas instead, and please
add 0x in front of hex.

BR,
Jani.


>  	ret = err;
>  
>  unlock:
Aurabindo Pillai April 16, 2020, 1:44 a.m. UTC | #2
When DPCD access errors occur, knowing the register and request
associated with the error helps debugging, so print the
details in the debug message.

Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>
---
 drivers/gpu/drm/drm_dp_helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index c6fbe6e6b..8aafc01f5 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -257,7 +257,9 @@ static int drm_dp_dpcd_access(struct drm_dp_aux
*aux, u8 request,
                        err = ret;
        }

-       DRM_DEBUG_KMS("Too many retries, giving up. First error: %d\n", err);
+       DRM_DEBUG_KMS("dpcd: Too many retries, giving up. First error: %d,"
+                     " address: 0x%x, request: 0x%x, size:%zu\n",
+                     err, msg.address, msg.request, msg.size);
        ret = err;

 unlock:
--
2.26.0

On Tue, Apr 14, 2020 at 7:04 AM Jani Nikula <jani.nikula@linux.intel.com> wrote:
>
> On Thu, 09 Apr 2020, Aurabindo Pillai <mail@aurabindo.in> wrote:
> > When DPCD access errors occur, knowing the register and request
> > associated with the error helps debugging, so print the
> > details in the debug message.
> >
> > Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>
> > ---
> >  drivers/gpu/drm/drm_dp_helper.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > index a5364b519..545606aac 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -257,7 +257,9 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
> >                       err = ret;
> >       }
> >
> > -     DRM_DEBUG_KMS("Too many retries, giving up. First error: %d\n", err);
> > +     DRM_DEBUG_KMS("dpcd: Too many retries, giving up. First error: %d\t"
> > +                   "address: %x\trequest: %x\t size:%zu\n",
> > +                   err, msg.address, msg.request, msg.size);
>
> Nitpicks, please don't add tabs, maybe use commas instead, and please
> add 0x in front of hex.
>
> BR,
> Jani.
>
>
> >       ret = err;
> >
> >  unlock:
>
> --
> Jani Nikula, Intel Open Source Graphics Center
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index a5364b519..545606aac 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -257,7 +257,9 @@  static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
 			err = ret;
 	}
 
-	DRM_DEBUG_KMS("Too many retries, giving up. First error: %d\n", err);
+	DRM_DEBUG_KMS("dpcd: Too many retries, giving up. First error: %d\t"
+		      "address: %x\trequest: %x\t size:%zu\n",
+		      err, msg.address, msg.request, msg.size);
 	ret = err;
 
 unlock: