media: atomisp: add debug for hmm alloc
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 26 May 2020 12:35:16 +0000 (14:35 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 11 Jun 2020 16:13:03 +0000 (18:13 +0200)
The hmm code is still complex and has bugs. Add a debug print
when memory gets allocated, in order to help identifying what's
happening out there.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/hmm/hmm.c

index 462f20652209995f2cf07534aa1203c664af1546..f9c2c7896520558ff20b3b8e03dd2e3971e0cd55 100644 (file)
@@ -253,7 +253,7 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
                goto alloc_page_err;
        }
 
-       /* Combind the virtual address and pages togather */
+       /* Combine the virtual address and pages together */
        ret = hmm_bo_bind(bo);
        if (ret) {
                dev_err(atomisp_dev, "hmm_bo_bind failed.\n");
@@ -265,6 +265,10 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
        if (attrs & ATOMISP_MAP_FLAG_CLEARED)
                hmm_set(bo->start, 0, bytes);
 
+           dev_dbg(atomisp_dev,
+           "%s: pages: 0x%08x (%ld bytes), type: %d from highmem %d, user ptr %p, cached %d\n",
+           __func__, bo->start, bytes, type, from_highmem, userptr, cached);
+
        return bo->start;
 
 bind_err: