diff mbox series

drm/msm: Use the correct dma_sync calls harder

Message ID 20190904171723.2956-1-robdclark@gmail.com (mailing list archive)
State Accepted
Commit 9f614197c744002f9968e82c649fdf7fe778e1e7
Headers show
Series drm/msm: Use the correct dma_sync calls harder | expand

Commit Message

Rob Clark Sept. 4, 2019, 5:17 p.m. UTC
From: Rob Clark <robdclark@chromium.org>

Looks like the dma_sync calls don't do what we want on armv7 either.
Fixes:

  Unable to handle kernel paging request at virtual address 50001000
  pgd = (ptrval)
  [50001000] *pgd=00000000
  Internal error: Oops: 805 [#1] SMP ARM
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-00271-g9f159ae07f07 #4
  Hardware name: Freescale i.MX53 (Device Tree Support)
  PC is at v7_dma_clean_range+0x20/0x38
  LR is at __dma_page_cpu_to_dev+0x28/0x90
  pc : [<c011c76c>]    lr : [<c01181c4>]    psr: 20000013
  sp : d80b5a88  ip : de96c000  fp : d840ce6c
  r10: 00000000  r9 : 00000001  r8 : d843e010
  r7 : 00000000  r6 : 00008000  r5 : ddb6c000  r4 : 00000000
  r3 : 0000003f  r2 : 00000040  r1 : 50008000  r0 : 50001000
  Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
  Control: 10c5387d  Table: 70004019  DAC: 00000051
  Process swapper/0 (pid: 1, stack limit = 0x(ptrval))

Signed-off-by: Rob Clark <robdclark@chromium.org>
Fixes: 3de433c5b38a ("drm/msm: Use the correct dma_sync calls in msm_gem")
Tested-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/gpu/drm/msm/msm_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Fabio Estevam Oct. 8, 2019, 4:11 p.m. UTC | #1
Hi Rob,

On Wed, Sep 4, 2019 at 2:19 PM Rob Clark <robdclark@gmail.com> wrote:
>
> From: Rob Clark <robdclark@chromium.org>
>
> Looks like the dma_sync calls don't do what we want on armv7 either.
> Fixes:
>
>   Unable to handle kernel paging request at virtual address 50001000
>   pgd = (ptrval)
>   [50001000] *pgd=00000000
>   Internal error: Oops: 805 [#1] SMP ARM
>   Modules linked in:
>   CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-00271-g9f159ae07f07 #4
>   Hardware name: Freescale i.MX53 (Device Tree Support)
>   PC is at v7_dma_clean_range+0x20/0x38
>   LR is at __dma_page_cpu_to_dev+0x28/0x90
>   pc : [<c011c76c>]    lr : [<c01181c4>]    psr: 20000013
>   sp : d80b5a88  ip : de96c000  fp : d840ce6c
>   r10: 00000000  r9 : 00000001  r8 : d843e010
>   r7 : 00000000  r6 : 00008000  r5 : ddb6c000  r4 : 00000000
>   r3 : 0000003f  r2 : 00000040  r1 : 50008000  r0 : 50001000
>   Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
>   Control: 10c5387d  Table: 70004019  DAC: 00000051
>   Process swapper/0 (pid: 1, stack limit = 0x(ptrval))
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> Fixes: 3de433c5b38a ("drm/msm: Use the correct dma_sync calls in msm_gem")
> Tested-by: Fabio Estevam <festevam@gmail.com>

I see this one got applied in linux-next already.
Could it be sent to 5.4-rc, please?

mx53 boards cannot boot in mainline because of this.

Thanks
Rob Clark Oct. 8, 2019, 11:08 p.m. UTC | #2
On Tue, Oct 8, 2019 at 9:11 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Rob,
>
> On Wed, Sep 4, 2019 at 2:19 PM Rob Clark <robdclark@gmail.com> wrote:
> >
> > From: Rob Clark <robdclark@chromium.org>
> >
> > Looks like the dma_sync calls don't do what we want on armv7 either.
> > Fixes:
> >
> >   Unable to handle kernel paging request at virtual address 50001000
> >   pgd = (ptrval)
> >   [50001000] *pgd=00000000
> >   Internal error: Oops: 805 [#1] SMP ARM
> >   Modules linked in:
> >   CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.0-rc6-00271-g9f159ae07f07 #4
> >   Hardware name: Freescale i.MX53 (Device Tree Support)
> >   PC is at v7_dma_clean_range+0x20/0x38
> >   LR is at __dma_page_cpu_to_dev+0x28/0x90
> >   pc : [<c011c76c>]    lr : [<c01181c4>]    psr: 20000013
> >   sp : d80b5a88  ip : de96c000  fp : d840ce6c
> >   r10: 00000000  r9 : 00000001  r8 : d843e010
> >   r7 : 00000000  r6 : 00008000  r5 : ddb6c000  r4 : 00000000
> >   r3 : 0000003f  r2 : 00000040  r1 : 50008000  r0 : 50001000
> >   Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
> >   Control: 10c5387d  Table: 70004019  DAC: 00000051
> >   Process swapper/0 (pid: 1, stack limit = 0x(ptrval))
> >
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > Fixes: 3de433c5b38a ("drm/msm: Use the correct dma_sync calls in msm_gem")
> > Tested-by: Fabio Estevam <festevam@gmail.com>
>
> I see this one got applied in linux-next already.
> Could it be sent to 5.4-rc, please?

afaict this should be at least in v5.4-rc2.. am I missing something?

BR,
-R

>
> mx53 boards cannot boot in mainline because of this.
>
> Thanks
Fabio Estevam Oct. 8, 2019, 11:19 p.m. UTC | #3
Hi Rob,

On Tue, Oct 8, 2019 at 8:08 PM Rob Clark <robdclark@gmail.com> wrote:

> afaict this should be at least in v5.4-rc2.. am I missing something?

You are right, it is in 5.4-rc indeed, sorry.

It is 5.3.x stable that has this commit missing, but I guess it will
be backported at some point.

Thanks!
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 7263f4373f07..5a6a79fbc9d6 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -52,7 +52,7 @@  static void sync_for_device(struct msm_gem_object *msm_obj)
 {
 	struct device *dev = msm_obj->base.dev->dev;
 
-	if (get_dma_ops(dev)) {
+	if (get_dma_ops(dev) && IS_ENABLED(CONFIG_ARM64)) {
 		dma_sync_sg_for_device(dev, msm_obj->sgt->sgl,
 			msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
 	} else {
@@ -65,7 +65,7 @@  static void sync_for_cpu(struct msm_gem_object *msm_obj)
 {
 	struct device *dev = msm_obj->base.dev->dev;
 
-	if (get_dma_ops(dev)) {
+	if (get_dma_ops(dev) && IS_ENABLED(CONFIG_ARM64)) {
 		dma_sync_sg_for_cpu(dev, msm_obj->sgt->sgl,
 			msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
 	} else {