Re: [meta-xilinx] [PATCH v2] kernel-module-mali: add patch to check dma_map_page error

2019-03-13 Thread Manjukumar Harthikote Matha



> -Original Message-
> From: meta-xilinx-boun...@yoctoproject.org [mailto:meta-xilinx-
> boun...@yoctoproject.org] On Behalf Of Hyun Kwon
> Sent: Tuesday, March 12, 2019 11:24 AM
> To: Jean-Francois Dagenais ; meta-
> xil...@lists.yoctoproject.org
> Cc: Madhurkiran Harikrishnan 
> Subject: Re: [meta-xilinx] [PATCH v2] kernel-module-mali: add patch to check
> dma_map_page error
> 
> Hi JFD,
> 
> + Mads
> 
> Thanks for the patch.
> 
> > -Original Message-
> > From: Jean-Francois Dagenais [mailto:jeff.dagen...@gmail.com]
> > Sent: Tuesday, March 12, 2019 11:17 AM
> > To: meta-xil...@lists.yoctoproject.org
> > Cc: Hyun Kwon ; Jean-Francois Dagenais
> > 
> > Subject: [PATCH v2] kernel-module-mali: add patch to check
> > dma_map_page error
> >
> > This fixes an error when using the module in a kernel configured with
> > the CONFIG_DMA_API_DEBUG flag.
> >
> > utgard fd4b.gpu: DMA-API: device driver failed to check map
> > error[device address=0x325b] [size=4096 bytes] [mapped as
> > page] ...
> >  [] check_unmap+0x44c/0x7e8  []
> > debug_dma_unmap_page+0x60/0x68  []
> > mali_mem_os_alloc_pages+0x230/0x498 [mali] ...
> >
> > Acked-by: Hyun Kwon 
> > Signed-off-by: Jean-Francois Dagenais 
> > ---
> >  .../recipes-graphics/mali/kernel-module-mali.bb |  1 +
> >  .../0007-fix-driver-failed-to-check-map-error.patch | 17
> > +
> >  2 files changed, 18 insertions(+)
> >  create mode 100644
> > meta-xilinx-bsp/recipes-graphics/mali/kernel-module-
> > mali/0007-fix-driver-failed-to-check-map-error.patch
> >
> > diff --git
> > a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> > b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> > index 0f44d25..5833239 100644
> > --- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> > +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> > @@ -16,6 +16,7 @@ SRC_URI = " \
> > file://0004-staging-mali-r8p0-01rel0-Don-t-include-
> > mali_read_phy.patch \
> > file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-
> > a.patch \
> > file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-
> > ke.patch \
> > +   file://0007-fix-driver-failed-to-check-map-error.patch \
> > file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-
> > removi.patch \
> > file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-
> > r.patch\
> > "
> 
> I'm still not sure why this list looks different here, unless I'm missing 
> something:
> 
> https://github.com/Xilinx/meta-xilinx/blob/rel-v2018.3/meta-xilinx-bsp/recipes-
> graphics/mali/kernel-module-mali.bb

This is based on Rocko release

> https://github.com/Xilinx/meta-xilinx/blob/master-next/meta-xilinx-bsp/recipes-
> graphics/mali/kernel-module-mali.bb
> 

master-next is WIP tree, may not be in sync with master.

> If that is the case, it'll probably fail to apply.

The patch should be apply to master tree, if not it will fail

Thanks,
Manju
-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


Re: [meta-xilinx] [PATCH v2] kernel-module-mali: add patch to check dma_map_page error

2019-03-12 Thread Hyun Kwon
Hi JFD,

+ Mads

Thanks for the patch.

> -Original Message-
> From: Jean-Francois Dagenais [mailto:jeff.dagen...@gmail.com]
> Sent: Tuesday, March 12, 2019 11:17 AM
> To: meta-xil...@lists.yoctoproject.org
> Cc: Hyun Kwon ; Jean-Francois Dagenais
> 
> Subject: [PATCH v2] kernel-module-mali: add patch to check
> dma_map_page error
> 
> This fixes an error when using the module in a kernel configured with
> the CONFIG_DMA_API_DEBUG flag.
> 
> utgard fd4b.gpu: DMA-API: device driver failed to check map
> error[device address=0x325b] [size=4096 bytes] [mapped as
> page]
> ...
>  [] check_unmap+0x44c/0x7e8
>  [] debug_dma_unmap_page+0x60/0x68
>  [] mali_mem_os_alloc_pages+0x230/0x498 [mali]
> ...
> 
> Acked-by: Hyun Kwon 
> Signed-off-by: Jean-Francois Dagenais 
> ---
>  .../recipes-graphics/mali/kernel-module-mali.bb |  1 +
>  .../0007-fix-driver-failed-to-check-map-error.patch | 17
> +
>  2 files changed, 18 insertions(+)
>  create mode 100644 meta-xilinx-bsp/recipes-graphics/mali/kernel-module-
> mali/0007-fix-driver-failed-to-check-map-error.patch
> 
> diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> index 0f44d25..5833239 100644
> --- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
> @@ -16,6 +16,7 @@ SRC_URI = " \
>   file://0004-staging-mali-r8p0-01rel0-Don-t-include-
> mali_read_phy.patch \
>   file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-
> a.patch \
>   file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-
> ke.patch \
> + file://0007-fix-driver-failed-to-check-map-error.patch \
>   file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-
> removi.patch \
>   file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-
> r.patch\
>   "

I'm still not sure why this list looks different here, unless I'm missing 
something:

https://github.com/Xilinx/meta-xilinx/blob/rel-v2018.3/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
https://github.com/Xilinx/meta-xilinx/blob/master-next/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb

If that is the case, it'll probably fail to apply.

Thanks,
-hyun


-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx


[meta-xilinx] [PATCH v2] kernel-module-mali: add patch to check dma_map_page error

2019-03-12 Thread Jean-Francois Dagenais
This fixes an error when using the module in a kernel configured with
the CONFIG_DMA_API_DEBUG flag.

utgard fd4b.gpu: DMA-API: device driver failed to check map
error[device address=0x325b] [size=4096 bytes] [mapped as
page]
...
 [] check_unmap+0x44c/0x7e8
 [] debug_dma_unmap_page+0x60/0x68
 [] mali_mem_os_alloc_pages+0x230/0x498 [mali]
...

Acked-by: Hyun Kwon 
Signed-off-by: Jean-Francois Dagenais 
---
 .../recipes-graphics/mali/kernel-module-mali.bb |  1 +
 .../0007-fix-driver-failed-to-check-map-error.patch | 17 +
 2 files changed, 18 insertions(+)
 create mode 100644 
meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-fix-driver-failed-to-check-map-error.patch

diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb 
b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
index 0f44d25..5833239 100644
--- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
@@ -16,6 +16,7 @@ SRC_URI = " \
file://0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch \
file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch \
file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch \
+   file://0007-fix-driver-failed-to-check-map-error.patch \
file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \
file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch\
"
diff --git 
a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-fix-driver-failed-to-check-map-error.patch
 
b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-fix-driver-failed-to-check-map-error.patch
new file mode 100644
index 000..5363c37
--- /dev/null
+++ 
b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-fix-driver-failed-to-check-map-error.patch
@@ -0,0 +1,17 @@
+Index: mali/linux/mali_memory_os_alloc.c
+===
+--- mali.orig/linux/mali_memory_os_alloc.c
 mali/linux/mali_memory_os_alloc.c
+@@ -239,8 +239,10 @@ int mali_mem_os_alloc_pages(mali_mem_os_
+   /* Ensure page is flushed from CPU caches. */
+   dma_addr = dma_map_page(_platform_device->dev, new_page,
+   0, _MALI_OSK_MALI_PAGE_SIZE, 
DMA_BIDIRECTIONAL);
+-  dma_unmap_page(_platform_device->dev, dma_addr,
+- _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
++  err = dma_mapping_error(_platform_device->dev, dma_addr);
++  if (likely(!err))
++  dma_unmap_page(_platform_device->dev, dma_addr,
++ _MALI_OSK_MALI_PAGE_SIZE, 
DMA_BIDIRECTIONAL);
+   dma_addr = dma_map_page(_platform_device->dev, new_page,
+   0, _MALI_OSK_MALI_PAGE_SIZE, 
DMA_BIDIRECTIONAL);
+ 
-- 
2.11.0

-- 
___
meta-xilinx mailing list
meta-xilinx@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-xilinx