[4/4] drm/v3d: Skip debugfs dumping GCA on platforms without GCA.

Submitted by Eric Anholt on Sept. 28, 2018, 11:21 p.m.

Details

Message ID 20180928232126.4332-4-eric@anholt.net
State Accepted
Series "Series without cover letter"
Commit 2f20fa8d12e859a03f68bdd81d75830141bc9ac9
Headers show

Commit Message

Eric Anholt Sept. 28, 2018, 11:21 p.m.
Fixes an oops reading this debugfs entry on BCM7278.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/gpu/drm/v3d/v3d_debugfs.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/v3d/v3d_debugfs.c b/drivers/gpu/drm/v3d/v3d_debugfs.c
index d48008adb085..eb2b2d2f8553 100644
--- a/drivers/gpu/drm/v3d/v3d_debugfs.c
+++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
@@ -71,10 +71,13 @@  static int v3d_v3d_debugfs_regs(struct seq_file *m, void *unused)
 			   V3D_READ(v3d_hub_reg_defs[i].reg));
 	}
 
-	for (i = 0; i < ARRAY_SIZE(v3d_gca_reg_defs); i++) {
-		seq_printf(m, "%s (0x%04x): 0x%08x\n",
-			   v3d_gca_reg_defs[i].name, v3d_gca_reg_defs[i].reg,
-			   V3D_GCA_READ(v3d_gca_reg_defs[i].reg));
+	if (v3d->ver < 41) {
+		for (i = 0; i < ARRAY_SIZE(v3d_gca_reg_defs); i++) {
+			seq_printf(m, "%s (0x%04x): 0x%08x\n",
+				   v3d_gca_reg_defs[i].name,
+				   v3d_gca_reg_defs[i].reg,
+				   V3D_GCA_READ(v3d_gca_reg_defs[i].reg));
+		}
 	}
 
 	for (core = 0; core < v3d->cores; core++) {

Comments

Boris Brezillon Oct. 9, 2018, 1:30 p.m.
On Fri, 28 Sep 2018 16:21:26 -0700
Eric Anholt <eric@anholt.net> wrote:

> Fixes an oops reading this debugfs entry on BCM7278.
> 

You probably want to add:

Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
Cc: <stable@vger.kernel.org>

> Signed-off-by: Eric Anholt <eric@anholt.net>

In any case, this is

Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>

> ---
>  drivers/gpu/drm/v3d/v3d_debugfs.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_debugfs.c b/drivers/gpu/drm/v3d/v3d_debugfs.c
> index d48008adb085..eb2b2d2f8553 100644
> --- a/drivers/gpu/drm/v3d/v3d_debugfs.c
> +++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
> @@ -71,10 +71,13 @@ static int v3d_v3d_debugfs_regs(struct seq_file *m, void *unused)
>  			   V3D_READ(v3d_hub_reg_defs[i].reg));
>  	}
>  
> -	for (i = 0; i < ARRAY_SIZE(v3d_gca_reg_defs); i++) {
> -		seq_printf(m, "%s (0x%04x): 0x%08x\n",
> -			   v3d_gca_reg_defs[i].name, v3d_gca_reg_defs[i].reg,
> -			   V3D_GCA_READ(v3d_gca_reg_defs[i].reg));
> +	if (v3d->ver < 41) {
> +		for (i = 0; i < ARRAY_SIZE(v3d_gca_reg_defs); i++) {
> +			seq_printf(m, "%s (0x%04x): 0x%08x\n",
> +				   v3d_gca_reg_defs[i].name,
> +				   v3d_gca_reg_defs[i].reg,
> +				   V3D_GCA_READ(v3d_gca_reg_defs[i].reg));
> +		}
>  	}
>  
>  	for (core = 0; core < v3d->cores; core++) {