diff mbox series

[05/20] media: atomisp: Log an error on failing to alloc private-mem

Message ID 20221120224101.746199-6-hdegoede@redhat.com
State New
Headers show
Series media: atomisp: Misc. cleanups / fixes | expand

Commit Message

Hans de Goede Nov. 20, 2022, 10:40 p.m. UTC
I managed to trigger an atomisp_css_start() error by pushing my test
system towards an OOM situation, this resulted in the following errors:

atomisp-isp2 0000:00:03.0: alloc pages err...
atomisp-isp2 0000:00:03.0: hmm_bo_alloc_pages failed.
atomisp-isp2 0000:00:03.0: stream[0] start error.

But it is not entirely clear what the root cause of
the "alloc pages err..." error is. I suspect the root cause is
alloc_pages_bulk_array() failing. Add a log message to make
the root cause more clear if this is hit again.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/hmm/hmm_bo.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andy Shevchenko Nov. 21, 2022, 8:58 a.m. UTC | #1
On Sun, Nov 20, 2022 at 11:40:46PM +0100, Hans de Goede wrote:
> I managed to trigger an atomisp_css_start() error by pushing my test
> system towards an OOM situation, this resulted in the following errors:
> 
> atomisp-isp2 0000:00:03.0: alloc pages err...
> atomisp-isp2 0000:00:03.0: hmm_bo_alloc_pages failed.
> atomisp-isp2 0000:00:03.0: stream[0] start error.
> 
> But it is not entirely clear what the root cause of
> the "alloc pages err..." error is. I suspect the root cause is
> alloc_pages_bulk_array() failing. Add a log message to make
> the root cause more clear if this is hit again.

...

> +		dev_err(atomisp_dev, "alloc_pages_bulk_array() failed\n");

I would put it after calling the below function, but I'm not sure about side
effects (if the below can hang or something else).

>  		free_pages_bulk_array(ret, bo->pages);
>  		return -ENOMEM;
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
index 465ba837f2ed..3c150268db51 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
@@ -637,6 +637,7 @@  static int alloc_private_pages(struct hmm_buffer_object *bo)
 
 	ret = alloc_pages_bulk_array(gfp, bo->pgnr, bo->pages);
 	if (ret != bo->pgnr) {
+		dev_err(atomisp_dev, "alloc_pages_bulk_array() failed\n");
 		free_pages_bulk_array(ret, bo->pages);
 		return -ENOMEM;
 	}