Re: arm-smmu 5000000.iommu: Cannot accommodate DMA offset for IOMMU page tables

2020-10-09 Thread Naresh Kamboju
On Fri, 9 Oct 2020 at 19:24, Naresh Kamboju  wrote:
>
>
>
> On Thu, 24 Sep 2020 at 15:26, Joerg Roedel  wrote:
> >
> > On Thu, Sep 24, 2020 at 10:36:47AM +0100, Robin Murphy wrote:
> > > Yes, the issue was introduced by one of the changes in "dma-mapping:
> > > introduce DMA range map, supplanting dma_pfn_offset", so it only existed 
> > > in
> > > the dma-mapping/for-next branch anyway.
>

FYI,
The reported problem still exists on 5.9.0-rc8-next-20201009.

[1.843814] Driver must set ecc.strength when using hardware ECC
[1.849847] WARNING: CPU: 4 PID: 1 at
drivers/mtd/nand/raw/nand_base.c:5687 nand_scan_with_ids+0x1450/0x1470
[1.859676] Modules linked in:
[1.862730] CPU: 4 PID: 1 Comm: swapper/0 Not tainted
5.9.0-rc8-next-20201009 #1
[1.870125] Hardware name: Freescale Layerscape 2088A RDB Board (DT)
[1.876478] pstate: 4005 (nZcv daif -PAN -UAO -TCO BTYPE=--)
[1.882483] pc : nand_scan_with_ids+0x1450/0x1470
[1.887183] lr : nand_scan_with_ids+0x1450/0x1470

full test log,
https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20201009/testrun/3284876/suite/linux-log-parser/test/check-kernel-warning-92014/log

> >
> > Okay, alright then.
> >

- Naresh
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: arm-smmu 5000000.iommu: Cannot accommodate DMA offset for IOMMU page tables

2020-10-09 Thread Naresh Kamboju
On Thu, 24 Sep 2020 at 15:26, Joerg Roedel  wrote:
>
> On Thu, Sep 24, 2020 at 10:36:47AM +0100, Robin Murphy wrote:
> > Yes, the issue was introduced by one of the changes in "dma-mapping:
> > introduce DMA range map, supplanting dma_pfn_offset", so it only existed in
> > the dma-mapping/for-next branch anyway.

FYI,
The reported problem still exists
>
> Okay, alright then.
>
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


arm-smmu 5000000.iommu: Cannot accommodate DMA offset for IOMMU page tables

2020-09-21 Thread Naresh Kamboju
arm64  Freescale Layerscape 2088A RDB Board boot failed with linux-next
5.9.0-rc5-next-20200921 kernel tag version. The kernel warning and then
kernel panic happened.

Reported-by: Naresh Kamboju 

metadata:
  git branch: master
  git repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next
  git commit: b10b8ad862118bf42c28a98b0f067619aadcfb23
  git describe: next-20200921
  make_kernelversion: 5.9.0-rc5
  kernel-config:
https://builds.tuxbuild.com/GxPuM0SSznSoSYYG8deYpQ/kernel.config


crash log,

[1.811830] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x48
[1.818202] nand: Micron MT29F16G08ABACAWP
[1.822314] nand: 2048 MiB, SLC, erase size: 512 KiB, page size:
4096, OOB size: 224
[1.830078] [ cut here ]
[1.834703] Driver must set ecc.strength when using hardware ECC
[1.840739] WARNING: CPU: 1 PID: 1 at
drivers/mtd/nand/raw/nand_base.c:5671 nand_scan_with_ids+0x110c/0x1498
[1.850568] Modules linked in:
[1.853621] CPU: 1 PID: 1 Comm: swapper/0 Not tainted
5.9.0-rc5-next-20200921 #1
[1.861015] Hardware name: Freescale Layerscape 2088A RDB Board (DT)
[1.867368] pstate: 4005 (nZcv daif -PAN -UAO -TCO BTYPE=--)
[1.873373] pc : nand_scan_with_ids+0x110c/0x1498
[1.878073] lr : nand_scan_with_ids+0x110c/0x1498
[1.882774] sp : 80001005ba50
[1.886083] x29: 80001005ba50 x28: 
[1.891395] x27: 0082edf98638 x26: 0048
[1.896706] x25: 002c x24: 0082edf98578
[1.902018] x23: 0001 x22: 0082ee6b
[1.907329] x21: 0082edf98840 x20: 
[1.912640] x19: 0082edf98080 x18: 0010
[1.917951] x17: 0010 x16: 833b5ff2
[1.923262] x15: 0082ee6b0480 x14: 
[1.928572] x13: 80009005b737 x12: 80001005b73f
[1.933883] x11: 80001005ba50 x10: 80001005ba50
[1.939194] x9 : dc379157bfbc x8 : 657274732e636365
[1.944504] x7 : 2074657320747375 x6 : dc37937ba000
[1.949815] x5 : dc37937baa58 x4 : 80001005b840
[1.955125] x3 :  x2 : 0082ee6b
[1.960436] x1 : 4732f0d38a403700 x0 : 
[1.965748] Call trace:
[1.968189]  nand_scan_with_ids+0x110c/0x1498
[1.972542]  fsl_ifc_nand_probe+0x474/0x6e0
[1.976723]  platform_drv_probe+0x5c/0xb0
[1.980729]  really_probe+0xf0/0x4d8
[1.984300]  driver_probe_device+0xfc/0x168
[1.988480]  device_driver_attach+0x7c/0x88
[1.992659]  __driver_attach+0xac/0x178
[1.996490]  bus_for_each_dev+0x78/0xc8
[2.000321]  driver_attach+0x2c/0x38
[2.003893]  bus_add_driver+0x14c/0x230
[2.007724]  driver_register+0x6c/0x128
[2.011555]  __platform_driver_register+0x50/0x60
[2.016258]  fsl_ifc_nand_driver_init+0x24/0x30
[2.020786]  do_one_initcall+0x4c/0x2d0
[2.024560] ata1: SATA link down (SStatus 0 SControl 300)
[2.024618]  kernel_init_freeable+0x214/0x280
[2.024624]  kernel_init+0x1c/0x120
[2.037849]  ret_from_fork+0x10/0x30
[2.041420] CPU: 1 PID: 1 Comm: swapper/0 Not tainted
5.9.0-rc5-next-20200921 #1
[2.048815] Hardware name: Freescale Layerscape 2088A RDB Board (DT)
[2.055166] Call trace:
[2.057606]  dump_backtrace+0x0/0x1e0
[2.061263]  show_stack+0x20/0x30
[2.064574]  dump_stack+0xf8/0x168
[2.067972]  __warn+0xfc/0x178
[2.071023]  report_bug+0xfc/0x170
[2.074419]  bug_handler+0x28/0x70
[2.077816]  call_break_hook+0x70/0x88
[2.080559] ata2: SATA link down (SStatus 0 SControl 300)
[2.081560]  brk_handler+0x24/0x68
[2.081566]  do_debug_exception+0xb8/0x130
[2.094442]  el1_sync_handler+0xd8/0x120
[2.098360]  el1_sync+0x80/0x100
[2.101583]  nand_scan_with_ids+0x110c/0x1498
[2.105935]  fsl_ifc_nand_probe+0x474/0x6e0
[2.110115]  platform_drv_probe+0x5c/0xb0
[2.114120]  really_probe+0xf0/0x4d8
[2.117691]  driver_probe_device+0xfc/0x168
[2.121871]  device_driver_attach+0x7c/0x88
[2.126050]  __driver_attach+0xac/0x178
[2.129882]  bus_for_each_dev+0x78/0xc8
[2.133714]  driver_attach+0x2c/0x38
[2.137284]  bus_add_driver+0x14c/0x230
[2.141116]  driver_register+0x6c/0x128
[2.144946]  __platform_driver_register+0x50/0x60
[2.149647]  fsl_ifc_nand_driver_init+0x24/0x30
[2.154173]  do_one_initcall+0x4c/0x2d0
[2.158004]  kernel_init_freeable+0x214/0x280
[2.162358]  kernel_init+0x1c/0x120
[2.165841]  ret_from_fork+0x10/0x30
[2.169415] ---[ end trace d051012f465b08eb ]---
[2.174073] fsl,ifc-nand: probe of 53000.nand failed with error -22
[2.181882] spi-nor spi0.0: unrecognized JEDEC id bytes: 1c 38 78 e1 e3 c7
[2.189409] spi-nor spi1.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00
[2.196301] spi-nor: probe of spi1.0 failed with error -2
[2.203202] libphy: Fixed MDIO Bus: probed
[2.208607] thunder_xcv, ver 1.0
[2.211860] thunder_bgx, ver 1.0
[2.215114

Re: [Freedreno] arm64: Internal error: Oops: qcom_iommu_tlb_inv_context free_io_pgtable_ops on db410c

2020-07-20 Thread Naresh Kamboju
On Mon, 20 Jul 2020 at 21:27, Rob Clark  wrote:
>
> On Mon, Jul 20, 2020 at 4:28 AM Robin Murphy  wrote:
> >
> > On 2020-07-20 08:17, Arnd Bergmann wrote:
> > > On Mon, Jul 20, 2020 at 8:36 AM Naresh Kamboju
> > >  wrote:
<>
> > >> [5.444121] Unable to handle kernel NULL pointer dereference at
> > >> virtual address 0018
> > >> [5.456615]   ESR = 0x9604
> > >> [5.464471]   SET = 0, FnV = 0
> > >> [5.464487]   EA = 0, S1PTW = 0
> > >> [5.466521] Data abort info:
> > >> [5.469971]   ISV = 0, ISS = 0x0004
> > >> [5.472768]   CM = 0, WnR = 0
> > >> [5.476172] user pgtable: 4k pages, 48-bit VAs, pgdp=bacba000
> > >> [5.479349] [0018] pgd=, 
> > >> p4d=
> > >> [5.485820] Internal error: Oops: 9604 [#1] PREEMPT SMP
> > >> [5.492448] Modules linked in: crct10dif_ce adv7511(+)
> > >> qcom_spmi_temp_alarm cec msm(+) mdt_loader qcom_camss videobuf2_dma_sg
> > >> drm_kms_helper v4l2_fwnode videobuf2_memops videobuf2_v4l2 qcom_rng
> > >> videobuf2_common i2c_qcom_cci display_connector socinfo drm qrtr ns
> > >> rmtfs_mem fuse
> > >> [5.500256] CPU: 0 PID: 286 Comm: systemd-udevd Not tainted 5.8.0-rc5 
> > >> #1
> > >> [5.522484] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC 
> > >> (DT)
> > >> [5.529170] pstate: 2005 (nzCv daif -PAN -UAO BTYPE=--)
> > >> [5.535856] pc : qcom_iommu_tlb_inv_context+0x18/0xa8
> > >> [5.541148] lr : free_io_pgtable_ops+0x28/0x58
<>
> > >> [5.628297] Call trace:
> > >> [5.633592]  qcom_iommu_tlb_inv_context+0x18/0xa8
> > >
> > > This means that dev_iommu_fwspec_get() has returned NULL
> > > in qcom_iommu_tlb_inv_context(), either because dev->iommu
> > > is NULL, or because dev->iommu->fwspec is NULL.
> > >
> > > qcom_iommu_tlb_inv_context() does not check for a NULL
> > > pointer before using the returned object.
> > >
> > > The bug is either in the lack of error handling, or the fact
> > > that it's possible to get into this function for a device
> > > that has not been fully set up.
> >
> > Not quite - the device *was* properly set up, but has already been
> > properly torn down again in the removal path by iommu_release_device().
> > The problem is that qcom-iommu kept the device pointer as its TLB cookie
> > for the domain, but the domain has a longer lifespan than the validity
> > of that device - that's a fundamental design flaw in the driver.
>
> fwiw, I just sent "iommu/qcom: Use domain rather than dev as tlb
> cookie".. untested but looks like a straightforward enough change to
> switch over to using the domain rather than dev as cookie

The proposed patch tested and confirmed the reported problem fixed.

ref:
https://lore.kernel.org/linux-iommu/ca+g9fytj1rbycphxzrm-qm5ygtdlj1jd8vfzsqqvwi_dnjl...@mail.gmail.com/T/#m36a1fca18098f6c34275d928f9ba9c40c6d7fd63
https://lkft.validation.linaro.org/scheduler/job/1593950#L3392


>
> BR,
> -R


- Naresh
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH] iommu/qcom: Use domain rather than dev as tlb cookie

2020-07-20 Thread Naresh Kamboju
On Mon, 20 Jul 2020 at 21:21, Rob Clark  wrote:
>
> From: Rob Clark 
>
> The device may be torn down, but the domain should still be valid.  Lets
> use that as the tlb flush ops cookie.
>
> Fixes a problem reported in [1]

This proposed fix patch applied on top of linux mainline master
and boot test PASS on db410c.

The reported problem got fixed.

>
> [1] https://lkml.org/lkml/2020/7/20/104
>
> Signed-off-by: Rob Clark 

Reported-by: Naresh Kamboju 
Tested-by: Naresh Kamboju 

> ---
> Note I don't have a good setup to test this atm, but I think it should
> work.
>
>  drivers/iommu/qcom_iommu.c | 37 +
>  1 file changed, 17 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c
> index c3e1fbd1988c..d176df569af8 100644
> --- a/drivers/iommu/qcom_iommu.c
> +++ b/drivers/iommu/qcom_iommu.c
> @@ -65,6 +65,7 @@ struct qcom_iommu_domain {
> struct mutex init_mutex; /* Protects iommu pointer */
> struct iommu_domain  domain;
> struct qcom_iommu_dev   *iommu;
> +   struct iommu_fwspec *fwspec;
>  };
>
>  static struct qcom_iommu_domain *to_qcom_iommu_domain(struct iommu_domain 
> *dom)
> @@ -84,9 +85,9 @@ static struct qcom_iommu_dev * to_iommu(struct device *dev)
> return dev_iommu_priv_get(dev);
>  }
>
> -static struct qcom_iommu_ctx * to_ctx(struct device *dev, unsigned asid)
> +static struct qcom_iommu_ctx * to_ctx(struct qcom_iommu_domain *d, unsigned 
> asid)
>  {
> -   struct qcom_iommu_dev *qcom_iommu = to_iommu(dev);
> +   struct qcom_iommu_dev *qcom_iommu = d->iommu;
> if (!qcom_iommu)
> return NULL;
> return qcom_iommu->ctxs[asid - 1];
> @@ -118,14 +119,12 @@ iommu_readq(struct qcom_iommu_ctx *ctx, unsigned reg)
>
>  static void qcom_iommu_tlb_sync(void *cookie)
>  {
> -   struct iommu_fwspec *fwspec;
> -   struct device *dev = cookie;
> +   struct qcom_iommu_domain *qcom_domain = cookie;
> +   struct iommu_fwspec *fwspec = qcom_domain->fwspec;
> unsigned i;
>
> -   fwspec = dev_iommu_fwspec_get(dev);
> -
> for (i = 0; i < fwspec->num_ids; i++) {
> -   struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
> +   struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, 
> fwspec->ids[i]);
> unsigned int val, ret;
>
> iommu_writel(ctx, ARM_SMMU_CB_TLBSYNC, 0);
> @@ -139,14 +138,12 @@ static void qcom_iommu_tlb_sync(void *cookie)
>
>  static void qcom_iommu_tlb_inv_context(void *cookie)
>  {
> -   struct device *dev = cookie;
> -   struct iommu_fwspec *fwspec;
> +   struct qcom_iommu_domain *qcom_domain = cookie;
> +   struct iommu_fwspec *fwspec = qcom_domain->fwspec;
> unsigned i;
>
> -   fwspec = dev_iommu_fwspec_get(dev);
> -
> for (i = 0; i < fwspec->num_ids; i++) {
> -   struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
> +   struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, 
> fwspec->ids[i]);
> iommu_writel(ctx, ARM_SMMU_CB_S1_TLBIASID, ctx->asid);
> }
>
> @@ -156,16 +153,14 @@ static void qcom_iommu_tlb_inv_context(void *cookie)
>  static void qcom_iommu_tlb_inv_range_nosync(unsigned long iova, size_t size,
> size_t granule, bool leaf, void 
> *cookie)
>  {
> -   struct device *dev = cookie;
> -   struct iommu_fwspec *fwspec;
> +   struct qcom_iommu_domain *qcom_domain = cookie;
> +   struct iommu_fwspec *fwspec = qcom_domain->fwspec;
> unsigned i, reg;
>
> reg = leaf ? ARM_SMMU_CB_S1_TLBIVAL : ARM_SMMU_CB_S1_TLBIVA;
>
> -   fwspec = dev_iommu_fwspec_get(dev);
> -
> for (i = 0; i < fwspec->num_ids; i++) {
> -   struct qcom_iommu_ctx *ctx = to_ctx(dev, fwspec->ids[i]);
> +   struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, 
> fwspec->ids[i]);
> size_t s = size;
>
> iova = (iova >> 12) << 12;
> @@ -256,7 +251,9 @@ static int qcom_iommu_init_domain(struct iommu_domain 
> *domain,
> };
>
> qcom_domain->iommu = qcom_iommu;
> -   pgtbl_ops = alloc_io_pgtable_ops(ARM_32_LPAE_S1, _cfg, dev);
> +   qcom_domain->fwspec = fwspec;
> +
> +   pgtbl_ops = alloc_io_pgtable_ops(ARM_32_LPAE_S1, _cfg, 
> qcom_domain);
> if (!pgtbl_ops) {
> dev_err(qcom_iommu->dev, "failed to allocate pagetable 
> ops\n");
> ret

arm64: Internal error: Oops: qcom_iommu_tlb_inv_context free_io_pgtable_ops on db410c

2020-07-20 Thread Naresh Kamboju
This kernel oops while boot linux mainline kernel on arm64  db410c device.

metadata:
  git branch: master
  git repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  git commit: f8456690ba8eb18ea4714e68554e242a04f65cff
  git describe: v5.8-rc5-48-gf8456690ba8e
  make_kernelversion: 5.8.0-rc5
  kernel-config:
https://builds.tuxbuild.com/2aLnwV7BLStU0t1R1QPwHQ/kernel.config

[5.444121] Unable to handle kernel NULL pointer dereference at
virtual address 0018
[5.456615]   ESR = 0x9604
[5.464471]   SET = 0, FnV = 0
[5.464487]   EA = 0, S1PTW = 0
[5.466521] Data abort info:
[5.469971]   ISV = 0, ISS = 0x0004
[5.472768]   CM = 0, WnR = 0
[5.476172] user pgtable: 4k pages, 48-bit VAs, pgdp=bacba000
[5.479349] [0018] pgd=, p4d=
[5.485820] Internal error: Oops: 9604 [#1] PREEMPT SMP
[5.492448] Modules linked in: crct10dif_ce adv7511(+)
qcom_spmi_temp_alarm cec msm(+) mdt_loader qcom_camss videobuf2_dma_sg
drm_kms_helper v4l2_fwnode videobuf2_memops videobuf2_v4l2 qcom_rng
videobuf2_common i2c_qcom_cci display_connector socinfo drm qrtr ns
rmtfs_mem fuse
[5.500256] CPU: 0 PID: 286 Comm: systemd-udevd Not tainted 5.8.0-rc5 #1
[5.522484] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[5.529170] pstate: 2005 (nzCv daif -PAN -UAO BTYPE=--)
[5.535856] pc : qcom_iommu_tlb_inv_context+0x18/0xa8
[5.541148] lr : free_io_pgtable_ops+0x28/0x58
[5.546350] sp : 80001219b5f0
[5.550689] x29: 80001219b5f0 x28: 0013
[5.554078] x27: 0100 x26: 36add3b8
[5.559459] x25: 8915e910 x24: 3a5458c0
[5.564753] x23: 0003 x22: 36a37058
[5.570049] x21: 36a3a100 x20: 36a3a480
[5.575344] x19: 36a37158 x18: 
[5.580639] x17:  x16: 
[5.585935] x15: 0004 x14: 0368
[5.591229] x13:  x12: 39c61798
[5.596525] x11: 39c616d0 x10: 4000
[5.601820] x9 :  x8 : 39c616f8
[5.607114] x7 :  x6 : 09f699a0
[5.612410] x5 : 80001219b520 x4 : 36a3a000
[5.617705] x3 : 09f69904 x2 : 
[5.623001] x1 : 8000107e27e8 x0 : 3a545810
[5.628297] Call trace:
[5.633592]  qcom_iommu_tlb_inv_context+0x18/0xa8
[5.635764]  free_io_pgtable_ops+0x28/0x58
[5.640624]  qcom_iommu_domain_free+0x38/0x60
[5.644617]  iommu_group_release+0x4c/0x70
[5.649045]  kobject_put+0x6c/0x120
[5.653035]  kobject_del+0x64/0x90
[5.656421]  kobject_put+0xfc/0x120
[5.659893]  iommu_group_remove_device+0xdc/0xf0
[5.663281]  iommu_release_device+0x44/0x70
[5.668142]  iommu_bus_notifier+0xbc/0xd0
[5.672048]  notifier_call_chain+0x54/0x98
[5.676214]  blocking_notifier_call_chain+0x48/0x70
[5.680209]  device_del+0x26c/0x3a0
[5.684981]  platform_device_del.part.0+0x1c/0x88
[5.688453]  platform_device_unregister+0x24/0x40
[5.693316]  of_platform_device_destroy+0xe4/0xf8
[5.698002]  device_for_each_child+0x5c/0xa8
[5.702689]  of_platform_depopulate+0x3c/0x80
[5.707144]  msm_pdev_probe+0x1c4/0x308 [msm]
[5.711286]  platform_drv_probe+0x54/0xa8
[5.715624]  really_probe+0xd8/0x320
[5.719617]  driver_probe_device+0x58/0xb8
[5.723263]  device_driver_attach+0x74/0x80
[5.727168]  __driver_attach+0x58/0xe0
[5.731248]  bus_for_each_dev+0x70/0xc0
[5.735067]  driver_attach+0x24/0x30
[5.738801]  bus_add_driver+0x14c/0x1f0
[5.742619]  driver_register+0x64/0x120
[5.746178]  __platform_driver_register+0x48/0x58
[5.750099]  msm_drm_register+0x58/0x70 [msm]
[5.754861]  do_one_initcall+0x54/0x1a0
[5.759200]  do_init_module+0x54/0x200
[5.762846]  load_module+0x1d1c/0x2300
[5.74]  __do_sys_finit_module+0xd8/0xf0
[5.770398]  __arm64_sys_finit_module+0x20/0x30
[5.774826]  el0_svc_common.constprop.0+0x6c/0x168
[5.779078]  do_el0_svc+0x24/0x90
[5.783939]  el0_sync_handler+0x90/0x198
[5.787323]  el0_sync+0x158/0x180
[5.791323] Code: 910003fd f9417404 b4000484 f9401482 (b9401846)
[5.794532] ---[ end trace 3d6a53241629e560 ]---

full crash log details.
https://qa-reports.linaro.org/lkft/linux-mainline-oe/build/v5.8-rc5-48-gf8456690ba8e/testrun/2945157/suite/linux-log-parser/test/check-kernel-oops-1573988/log

-- 
Linaro LKFT
https://lkft.linaro.org
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


drivers/iommu/qcom_iommu.c:348 qcom_iommu_domain_free+0x5c/0x70

2020-02-18 Thread Naresh Kamboju
We have noticed these kernel warnings on APQ 8016 SBC  (dragonboard
410c ) running stable rc 5.5, 5.4 branches and linux mainline and
linux-next master branches.

This warning started happening from linux mainline 5.3 onwards (2019-08-29)

[5.488128] [ cut here ]
[5.488161] WARNING: CPU: 3 PID: 221 at
drivers/iommu/qcom_iommu.c:348 qcom_iommu_domain_free+0x5c/0x70
[5.491817] Modules linked in: crct10dif_ce(+) adv7511(+) cec
msm(+) mdt_loader drm_kms_helper drm fuse
[5.491842] CPU: 3 PID: 221 Comm: systemd-udevd Not tainted
5.4.21-rc1-00037-g6f8f5c79416e #1
[5.491844] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[5.491849] pstate: 0005 (nzcv daif -PAN -UAO)
[5.491858] pc : qcom_iommu_domain_free+0x5c/0x70
[5.491865] lr : iommu_group_release+0x44/0x60
[5.491867] sp : 800011e83600
 Starting Network Manager...[5.491870] x29:
800011e83600 x28: 0100
[5.491893] x19: 36a9e500 x18: 0001
[5.491898] x17:  x16: 
[5.491902] x15: 0004 x14: 
[5.491907] x13:  x12: 3a137aa0
[5.491911] x11: 3a137908 x10: 
[5.491916] x9 : 0eb2c098 x8 : 0eb2c090
[5.491920] x7 : 400c x6 : 0004
[5.491924] x5 : 0001 x4 : 
[5.491929] x3 :  x2 : 
[5.491933] x1 : 3bdb9680 x0 : 36aa0ab0
[5.491938] Call trace:
[5.491946]  qcom_iommu_domain_free+0x5c/0x70
[5.491951]  iommu_group_release+0x44/0x60
[5.491957]  kobject_put+0x6c/0xf0
[5.491962]  kobject_del+0x50/0x68
[5.491966]  kobject_put+0xd0/0xf0
[5.491972]  iommu_group_remove_device+0xd8/0xec
[5.491977]  qcom_iommu_remove_device+0x44/0x60
[5.491982]  iommu_release_device+0x28/0x40
[5.491987]  iommu_bus_notifier+0xac/0xc0
[5.491993]  notifier_call_chain+0x58/0x98
[5.491998]  blocking_notifier_call_chain+0x54/0x78
[5.492003]  device_del+0x224/0x348
[5.492008]  platform_device_del.part.0+0x18/0x88
[5.492012]  platform_device_unregister+0x20/0x38
[5.492019]  of_platform_device_destroy+0xdc/0xf0
[5.492023]  device_for_each_child+0x58/0xa0
[5.492028]  of_platform_depopulate+0x38/0x78
[5.492155]  msm_pdev_probe+0x1c0/0x308 [msm]
[5.492166]  platform_drv_probe+0x50/0xa0
[5.682404]  really_probe+0xd4/0x308
[5.686388]  driver_probe_device+0x54/0xe8
[5.690035]  device_driver_attach+0x6c/0x78
[5.693940]  __driver_attach+0x54/0xd0
[5.698020]  bus_for_each_dev+0x6c/0xc0
[5.701838]  driver_attach+0x20/0x28
[5.705572]  bus_add_driver+0x140/0x1e8
[5.709390]  driver_register+0x60/0x110
[5.712950]  __platform_driver_register+0x44/0x50
[5.716886]  msm_drm_register+0x54/0x68 [msm]
[5.721633]  do_one_initcall+0x50/0x190
[5.725972]  do_init_module+0x50/0x208
[5.729615]  load_module+0x1d1c/0x2298
[5.733435]  __do_sys_finit_module+0xd0/0xe8
[5.737169]  __arm64_sys_finit_module+0x1c/0x28
[5.741598]  el0_svc_common.constprop.0+0x68/0x160
[5.745851]  el0_svc_handler+0x20/0x80
[5.750709]  el0_svc+0x8/0xc
[5.754443] ---[ end trace 0ebe200932dd18fc ]---


Full test log link,
https://lkft.validation.linaro.org/scheduler/job/1226062#L3841
https://lkft.validation.linaro.org/scheduler/job/1227242#L3877

Ref:
https://bugs.linaro.org/show_bug.cgi?id=5460

-- 
Linaro LKFT
https://lkft.linaro.org
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: dma-direct: don't check swiotlb=force in dma_direct_map_resource

2020-01-07 Thread Naresh Kamboju
Following build error on stable-rc 5.4.9-rc1 for arm architecture.

dma/direct.c: In function 'dma_direct_possible':
dma/direct.c:329:3: error: too many arguments to function 'dma_capable'
   dma_capable(dev, dma_addr, size, true);
   ^~~
In file included from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/dma-direct.h:12:0,
 from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/kernel/dma/direct.c:10:
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/arch/arm/include/asm/dma-direct.h:17:20:
note: declared here
 static inline bool dma_capable(struct device *dev, dma_addr_t addr,
size_t size)
^~~
In file included from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/init.h:5:0,
 from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/memblock.h:12,
 from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/kernel/dma/direct.c:7:
dma/direct.c: In function 'dma_direct_map_resource':
dma/direct.c:378:16: error: too many arguments to function 'dma_capable'
  if (unlikely(!dma_capable(dev, dma_addr, size, false))) {
^
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/compiler.h:78:42:
note: in definition of macro 'unlikely'
 # define unlikely(x) __builtin_expect(!!(x), 0)
  ^
In file included from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/include/linux/dma-direct.h:12:0,
 from
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/kernel/dma/direct.c:10:
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/arch/arm/include/asm/dma-direct.h:17:20:
note: declared here
 static inline bool dma_capable(struct device *dev, dma_addr_t addr,
size_t size)
^~~
/srv/oe/build/tmp-lkft-glibc/work-shared/am57xx-evm/kernel-source/scripts/Makefile.build:265:
recipe for target 'kernel/dma/direct.o' failed

Full build log link,
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-5.4/DISTRO=lkft,MACHINE=am57xx-evm,label=docker-lkft/44/consoleText

-- 
Linaro LKFT
https://lkft.linaro.org
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu