mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alessio Belle <Alessio.Belle@imgtec.com>
To: Alexandru Dadu <Alexandru.Dadu@imgtec.com>
Cc: Luigi Santivetti <Luigi.Santivetti@imgtec.com>,
	"opensource@mtcoster.net" <opensource@mtcoster.net>,
	"imagination@lists.freedesktop.org"
	<imagination@lists.freedesktop.org>,
	"tzimmermann@suse.de" <tzimmermann@suse.de>,
	"simona@ffwll.ch" <simona@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"maarten.lankhorst@linux.intel.com"
	<maarten.lankhorst@linux.intel.com>,
	"mripard@kernel.org" <mripard@kernel.org>
Subject: Re: [PATCH 3/4] drm/imagination: Improve some logging in error paths
Date: Tue, 20 Oct 2026 18:15:50 +0000	[thread overview]
Message-ID: <443d310865c4589f5b2e8955384a840f31931de9.camel@imgtec.com> (raw)
In-Reply-To: <20261014-b4-simplify-mips-pte-defs-v1-3-b4ad7bb68e22@imgtec.com>

On Wed, 2026-10-14 at 11:13 +0300, Alexandru Dadu wrote:
> From: Matt Coster <matt.coster@imgtec.com>
> 
> Add error messages for attempts to map an already mapped firmware
> object, unmap an already unmapped firmware object, and provide too few
> DMA address slots for the firmware page table.
> 
> Signed-off-by: Matt Coster <matt.coster@imgtec.com>
> Signed-off-by: Alexandru Dadu <alexandru.dadu@imgtec.com>

Reviewed-by: Alessio Belle <alessio.belle@imgtec.com>

Thanks,
Alessio

> ---
>  drivers/gpu/drm/imagination/pvr_fw.c      | 6 ++++--
>  drivers/gpu/drm/imagination/pvr_vm_mips.c | 7 ++++++-
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imagination/pvr_fw.c b/drivers/gpu/drm/imagination/pvr_fw.c
> index c6c77b152342..4f2b5c4df600 100644
> --- a/drivers/gpu/drm/imagination/pvr_fw.c
> +++ b/drivers/gpu/drm/imagination/pvr_fw.c
> @@ -1165,8 +1165,9 @@ pvr_fw_object_fw_map(struct pvr_device *pvr_dev, struct pvr_fw_object *fw_obj, u
>  	spin_lock(&fw_dev->fw_mm_lock);
>  
>  	if (drm_mm_node_allocated(&fw_obj->fw_mm_node)) {
> -		err = -EINVAL;
> -		goto err_unlock;
> +		spin_unlock(&fw_dev->fw_mm_lock);
> +		drm_err(from_pvr_device(pvr_dev), "FW object is already mapped!\n");
> +		return -EINVAL;
>  	}
>  
>  	if (!dev_addr) {
> @@ -1232,6 +1233,7 @@ pvr_fw_object_fw_unmap(struct pvr_fw_object *fw_obj)
>  
>  	if (!drm_mm_node_allocated(&fw_obj->fw_mm_node)) {
>  		spin_unlock(&fw_dev->fw_mm_lock);
> +		drm_err(from_pvr_device(pvr_dev), "FW object is already unmapped!\n");
>  		return -EINVAL;
>  	}
>  
> diff --git a/drivers/gpu/drm/imagination/pvr_vm_mips.c b/drivers/gpu/drm/imagination/pvr_vm_mips.c
> index 84e023fffe5a..40495b1486a2 100644
> --- a/drivers/gpu/drm/imagination/pvr_vm_mips.c
> +++ b/drivers/gpu/drm/imagination/pvr_vm_mips.c
> @@ -11,6 +11,7 @@
>  #include "pvr_vm_mips.h"
>  
>  #include <drm/drm_managed.h>
> +#include <drm/drm_print.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/err.h>
>  #include <linux/slab.h>
> @@ -278,8 +279,12 @@ pvr_vm_get_pt_phys_addrs(struct pvr_device *pvr_dev, u64 *phys_addrs, int max_nu
>  	struct pvr_fw_device *fw_dev = &pvr_dev->fw_dev;
>  	struct pvr_vm_mips_data *vm_data = fw_dev->processor_data.mips_data.vm_data;
>  
> -	if (ARRAY_SIZE(vm_data->pt_pages) > max_num_addrs)
> +	if (ARRAY_SIZE(vm_data->pt_pages) > max_num_addrs) {
> +		drm_err(from_pvr_device(pvr_dev),
> +			"Minimum %zu pages required for FW PT, but only %d DMA address slots were provided\n",
> +			ARRAY_SIZE(vm_data->pt_pages), max_num_addrs);
>  		return -EINVAL;
> +	}
>  
>  	for (u32 page_nr = 0; page_nr < max_num_addrs; page_nr++) {
>  		/* Firmware expects 4k pages, but host page size might be different. */
> 


  reply	other threads:[~2026-10-20 18:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  8:13 [PATCH 0/4] drm/imagination: Clean up MIPS firmware interfaces Alexandru Dadu
2026-10-14  8:13 ` [PATCH 1/4] drm/imagination: Limit access to the MIPS firmware interface Alexandru Dadu
2026-10-14  8:13 ` [PATCH 2/4] drm/imagination: Make the MIPS firmware headers arch-independent Alexandru Dadu
2026-10-14  8:13 ` [PATCH 3/4] drm/imagination: Improve some logging in error paths Alexandru Dadu
2026-10-20 18:15   ` Alessio Belle [this message]
2026-10-14  8:13 ` [PATCH 4/4] drm/imagination: Simplify MIPS PTE definitions Alexandru Dadu
2026-10-20 18:14   ` Alessio Belle

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=443d310865c4589f5b2e8955384a840f31931de9.camel@imgtec.com \
    --to=alessio.belle@imgtec.com \
    --cc=Alexandru.Dadu@imgtec.com \
    --cc=Luigi.Santivetti@imgtec.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imagination@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=opensource@mtcoster.net \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®