| From d7cd2d8d07649b15752d8d37ecd3d966028cb7d7 Mon Sep 17 00:00:00 2001 |
| From: Bingbu Cao <bingbu.cao@intel.com> |
| Date: Thu, 9 May 2024 14:31:26 +0800 |
| Subject: [PATCH] CHROMIUM: media/ipu6: use vm_insert_pages() and check the |
| return value |
| |
| vm_insert_page/pages() can return error code for error, driver need |
| to check the return value and return the error code to caller. |
| |
| UPSTREAM-TASK=b:149068439 |
| UPSTREAM-TASK=b:149068672 |
| BUG=b:339582975 |
| TEST=Basic camera functions verified on rex |
| |
| Change-Id: Iec25d0167e001c8a6756f18133ef00fbcfb26558 |
| Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5569875 |
| Commit-Queue: Sergey Senozhatsky <senozhatsky@chromium.org> |
| Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> |
| --- |
| drivers/media/pci/intel/ipu-dma.c | 7 +------ |
| 1 file changed, 1 insertion(+), 6 deletions(-) |
| |
| diff --git a/drivers/media/pci/intel/ipu-dma.c b/drivers/media/pci/intel/ipu-dma.c |
| index d37762cb7841c42901f10b96043e822355fe1e8c..92af84ba6e108e1380aef022f059d9a5b0000158 100644 |
| --- a/drivers/media/pci/intel/ipu-dma.c |
| +++ b/drivers/media/pci/intel/ipu-dma.c |
| @@ -303,7 +303,6 @@ static int ipu_dma_mmap(struct device *dev, struct vm_area_struct *vma, |
| struct ipu_mmu *mmu = to_ipu_bus_device(dev)->mmu; |
| struct vm_info *info; |
| size_t count = PAGE_ALIGN(size) >> PAGE_SHIFT; |
| - size_t i; |
| |
| info = get_vm_info(mmu, iova); |
| if (!info) |
| @@ -318,11 +317,7 @@ static int ipu_dma_mmap(struct device *dev, struct vm_area_struct *vma, |
| if (size > info->size) |
| return -EFAULT; |
| |
| - for (i = 0; i < count; i++) |
| - vm_insert_page(vma, vma->vm_start + (i << PAGE_SHIFT), |
| - info->pages[i]); |
| - |
| - return 0; |
| + return vm_insert_pages(vma, vma->vm_start, info->pages, &count); |
| } |
| |
| static void ipu_dma_unmap_sg(struct device *dev, |
| -- |
| 2.47.0.105.g07ac214952-goog |
| |