All of lore.kernel.org
 help / color / mirror / Atom feed
From: isaacm@codeaurora.org
To: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Cc: will@kernel.org, pdaly@codeaurora.org, robin.murphy@arm.com,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	pratikp@codeaurora.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/5] Optimize iommu_map_sg() performance
Date: Mon, 11 Jan 2021 07:12:42 -0800	[thread overview]
Message-ID: <6f57460f1b95373c615fdbad97edd9ed@codeaurora.org> (raw)
In-Reply-To: <5a29b6e339c66e9c7cd9a608baa3f9e1@codeaurora.org>

On 2021-01-10 23:52, Sai Prakash Ranjan wrote:
> On 2021-01-11 11:52, Sai Prakash Ranjan wrote:
>> Hi Isaac,
>> 
>> I gave this series a go on chromebook and saw these warnings
>> and several device probe failures, logs attached below:
>> 
>> WARN corresponds to this code in arm_lpae_map_by_pgsize()
>> 
>> 	if (WARN_ON(iaext || (paddr + size) >> cfg->oas))
>> 		return -ERANGE;
>> 
>> Logs:
>> 
>> [    2.411391] ------------[ cut here ]------------
>> [    2.416149] WARNING: CPU: 6 PID: 56 at
>> drivers/iommu/io-pgtable-arm.c:492 arm_lpae_map_sg+0x234/0x248
>> [    2.425606] Modules linked in:
>> [    2.428749] CPU: 6 PID: 56 Comm: kworker/6:1 Not tainted 5.10.5 
>> #970
>> [    2.440287] Workqueue: events deferred_probe_work_func
>> [    2.445563] pstate: 20c00009 (nzCv daif +PAN +UAO -TCO BTYPE=--)
>> [    2.451726] pc : arm_lpae_map_sg+0x234/0x248
>> [    2.456112] lr : arm_lpae_map_sg+0xe0/0x248
>> [    2.460410] sp : ffffffc010513750
>> [    2.463820] x29: ffffffc010513790 x28: ffffffb943332000
>> [    2.469281] x27: 0000000ffffff000 x26: ffffffb943d14900
>> [    2.474738] x25: 0000000000001000 x24: 0000000103465000
>> [    2.480196] x23: 0000000000000001 x22: 0000000103466000
>> [    2.485645] x21: 0000000000000003 x20: 0000000000000a20
>> [    2.491103] x19: ffffffc010513850 x18: 0000000000000001
>> [    2.496562] x17: 0000000000000002 x16: 00000000ffffffff
>> [    2.502021] x15: 0000000000000000 x14: 0000000000000000
>> [    2.507479] x13: 0000000000000001 x12: 0000000000000000
>> [    2.512928] x11: 0000001000000000 x10: 0000000000000000
>> [    2.518385] x9 : 0000000000000001 x8 : 0000000040201000
>> [    2.523844] x7 : 0000000000000a20 x6 : ffffffb943463000
>> [    2.529302] x5 : 0000000000000003 x4 : 0000000000001000
>> [    2.534760] x3 : 0000000000000001 x2 : ffffffb941f605a0
>> [    2.540219] x1 : 0000000000000003 x0 : 0000000000000e40
>> [    2.545679] Call trace:
>> [    2.548196]  arm_lpae_map_sg+0x234/0x248
>> [    2.552225]  arm_smmu_map_sg+0x80/0xc4
>> [    2.556078]  __iommu_map_sg+0x6c/0x188
>> [    2.559931]  iommu_map_sg_atomic+0x18/0x20
>> [    2.564144]  iommu_dma_alloc_remap+0x26c/0x34c
>> [    2.568703]  iommu_dma_alloc+0x9c/0x268
>> [    2.572647]  dma_alloc_attrs+0x88/0xfc
>> [    2.576503]  gsi_ring_alloc+0x50/0x144
>> [    2.580356]  gsi_init+0x2c4/0x5c4
>> [    2.583766]  ipa_probe+0x14c/0x2b4
>> [    2.587263]  platform_drv_probe+0x94/0xb4
>> [    2.591377]  really_probe+0x138/0x348
>> [    2.595145]  driver_probe_device+0x80/0xb8
>> [    2.599358]  __device_attach_driver+0x90/0xa8
>> [    2.603829]  bus_for_each_drv+0x84/0xcc
>> [    2.607772]  __device_attach+0xc0/0x148
>> [    2.611713]  device_initial_probe+0x18/0x20
>> [    2.616012]  bus_probe_device+0x38/0x94
>> [    2.619953]  deferred_probe_work_func+0x78/0xb0
>> [    2.624611]  process_one_work+0x210/0x3dc
>> [    2.628726]  worker_thread+0x284/0x3e0
>> [    2.632578]  kthread+0x148/0x1a8
>> [    2.635891]  ret_from_fork+0x10/0x18
>> [    2.639562] ---[ end trace 9bac18cad6a9862e ]---
>> [    2.644414] ipa 1e40000.ipa: error -12 allocating channel 0 event 
>> ring
>> [    2.651656] ipa: probe of 1e40000.ipa failed with error -12
>> [    2.660072] dwc3 a600000.dwc3: Adding to iommu group 8
>> [    2.668632] xhci-hcd xhci-hcd.13.auto: xHCI Host Controller
>> [    2.674680] xhci-hcd xhci-hcd.13.auto: new USB bus registered,
>> assigned bus number 1
>> 
> 
> <snip>...
> 
> Isaac provided a fix which he will post as v2 and no warnings were 
> observed
> with that fix.
> 
> Tested-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> 
> Thanks,
> Sai

Thanks for testing out the patches. I've added the fix (there was an 
off-by-one error in the calculation
used to check if the IOVA/physical addresses are within limits) to 
version 2 of the series:
https://lore.kernel.org/linux-iommu/1610376862-927-1-git-send-email-isaacm@codeaurora.org/T/#t

Thanks,
Isaac
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: isaacm@codeaurora.org
To: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Cc: iommu@lists.linux-foundation.org, joro@8bytes.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, pdaly@codeaurora.org,
	pratikp@codeaurora.org, robin.murphy@arm.com, will@kernel.org
Subject: Re: [PATCH 0/5] Optimize iommu_map_sg() performance
Date: Mon, 11 Jan 2021 07:12:42 -0800	[thread overview]
Message-ID: <6f57460f1b95373c615fdbad97edd9ed@codeaurora.org> (raw)
In-Reply-To: <5a29b6e339c66e9c7cd9a608baa3f9e1@codeaurora.org>

On 2021-01-10 23:52, Sai Prakash Ranjan wrote:
> On 2021-01-11 11:52, Sai Prakash Ranjan wrote:
>> Hi Isaac,
>> 
>> I gave this series a go on chromebook and saw these warnings
>> and several device probe failures, logs attached below:
>> 
>> WARN corresponds to this code in arm_lpae_map_by_pgsize()
>> 
>> 	if (WARN_ON(iaext || (paddr + size) >> cfg->oas))
>> 		return -ERANGE;
>> 
>> Logs:
>> 
>> [    2.411391] ------------[ cut here ]------------
>> [    2.416149] WARNING: CPU: 6 PID: 56 at
>> drivers/iommu/io-pgtable-arm.c:492 arm_lpae_map_sg+0x234/0x248
>> [    2.425606] Modules linked in:
>> [    2.428749] CPU: 6 PID: 56 Comm: kworker/6:1 Not tainted 5.10.5 
>> #970
>> [    2.440287] Workqueue: events deferred_probe_work_func
>> [    2.445563] pstate: 20c00009 (nzCv daif +PAN +UAO -TCO BTYPE=--)
>> [    2.451726] pc : arm_lpae_map_sg+0x234/0x248
>> [    2.456112] lr : arm_lpae_map_sg+0xe0/0x248
>> [    2.460410] sp : ffffffc010513750
>> [    2.463820] x29: ffffffc010513790 x28: ffffffb943332000
>> [    2.469281] x27: 0000000ffffff000 x26: ffffffb943d14900
>> [    2.474738] x25: 0000000000001000 x24: 0000000103465000
>> [    2.480196] x23: 0000000000000001 x22: 0000000103466000
>> [    2.485645] x21: 0000000000000003 x20: 0000000000000a20
>> [    2.491103] x19: ffffffc010513850 x18: 0000000000000001
>> [    2.496562] x17: 0000000000000002 x16: 00000000ffffffff
>> [    2.502021] x15: 0000000000000000 x14: 0000000000000000
>> [    2.507479] x13: 0000000000000001 x12: 0000000000000000
>> [    2.512928] x11: 0000001000000000 x10: 0000000000000000
>> [    2.518385] x9 : 0000000000000001 x8 : 0000000040201000
>> [    2.523844] x7 : 0000000000000a20 x6 : ffffffb943463000
>> [    2.529302] x5 : 0000000000000003 x4 : 0000000000001000
>> [    2.534760] x3 : 0000000000000001 x2 : ffffffb941f605a0
>> [    2.540219] x1 : 0000000000000003 x0 : 0000000000000e40
>> [    2.545679] Call trace:
>> [    2.548196]  arm_lpae_map_sg+0x234/0x248
>> [    2.552225]  arm_smmu_map_sg+0x80/0xc4
>> [    2.556078]  __iommu_map_sg+0x6c/0x188
>> [    2.559931]  iommu_map_sg_atomic+0x18/0x20
>> [    2.564144]  iommu_dma_alloc_remap+0x26c/0x34c
>> [    2.568703]  iommu_dma_alloc+0x9c/0x268
>> [    2.572647]  dma_alloc_attrs+0x88/0xfc
>> [    2.576503]  gsi_ring_alloc+0x50/0x144
>> [    2.580356]  gsi_init+0x2c4/0x5c4
>> [    2.583766]  ipa_probe+0x14c/0x2b4
>> [    2.587263]  platform_drv_probe+0x94/0xb4
>> [    2.591377]  really_probe+0x138/0x348
>> [    2.595145]  driver_probe_device+0x80/0xb8
>> [    2.599358]  __device_attach_driver+0x90/0xa8
>> [    2.603829]  bus_for_each_drv+0x84/0xcc
>> [    2.607772]  __device_attach+0xc0/0x148
>> [    2.611713]  device_initial_probe+0x18/0x20
>> [    2.616012]  bus_probe_device+0x38/0x94
>> [    2.619953]  deferred_probe_work_func+0x78/0xb0
>> [    2.624611]  process_one_work+0x210/0x3dc
>> [    2.628726]  worker_thread+0x284/0x3e0
>> [    2.632578]  kthread+0x148/0x1a8
>> [    2.635891]  ret_from_fork+0x10/0x18
>> [    2.639562] ---[ end trace 9bac18cad6a9862e ]---
>> [    2.644414] ipa 1e40000.ipa: error -12 allocating channel 0 event 
>> ring
>> [    2.651656] ipa: probe of 1e40000.ipa failed with error -12
>> [    2.660072] dwc3 a600000.dwc3: Adding to iommu group 8
>> [    2.668632] xhci-hcd xhci-hcd.13.auto: xHCI Host Controller
>> [    2.674680] xhci-hcd xhci-hcd.13.auto: new USB bus registered,
>> assigned bus number 1
>> 
> 
> <snip>...
> 
> Isaac provided a fix which he will post as v2 and no warnings were 
> observed
> with that fix.
> 
> Tested-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> 
> Thanks,
> Sai

Thanks for testing out the patches. I've added the fix (there was an 
off-by-one error in the calculation
used to check if the IOVA/physical addresses are within limits) to 
version 2 of the series:
https://lore.kernel.org/linux-iommu/1610376862-927-1-git-send-email-isaacm@codeaurora.org/T/#t

Thanks,
Isaac

  reply	other threads:[~2021-01-11 15:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09  1:50 [PATCH 0/5] Optimize iommu_map_sg() performance Isaac J. Manjarres
2021-01-09  1:50 ` Isaac J. Manjarres
2021-01-09  1:50 ` [PATCH 1/5] iommu/io-pgtable: Introduce map_sg() as a page table op Isaac J. Manjarres
2021-01-09  1:50   ` Isaac J. Manjarres
2021-01-09  1:50 ` [PATCH 2/5] iommu/io-pgtable-arm: Hook up map_sg() Isaac J. Manjarres
2021-01-09  1:50   ` Isaac J. Manjarres
2021-01-09  1:50 ` [PATCH 3/5] iommu/io-pgtable-arm-v7s: " Isaac J. Manjarres
2021-01-09  1:50   ` Isaac J. Manjarres
2021-01-09  1:50 ` [PATCH 4/5] iommu: Introduce map_sg() as an IOMMU op for IOMMU drivers Isaac J. Manjarres
2021-01-09  1:50   ` Isaac J. Manjarres
2021-01-09  1:50 ` [PATCH 5/5] iommu/arm-smmu: Hook up map_sg() Isaac J. Manjarres
2021-01-09  1:50   ` Isaac J. Manjarres
2021-01-11  6:22 ` [PATCH 0/5] Optimize iommu_map_sg() performance Sai Prakash Ranjan
2021-01-11  6:22   ` Sai Prakash Ranjan
2021-01-11  7:52   ` Sai Prakash Ranjan
2021-01-11  7:52     ` Sai Prakash Ranjan
2021-01-11 15:12     ` isaacm [this message]
2021-01-11 15:12       ` isaacm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f57460f1b95373c615fdbad97edd9ed@codeaurora.org \
    --to=isaacm@codeaurora.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pdaly@codeaurora.org \
    --cc=pratikp@codeaurora.org \
    --cc=robin.murphy@arm.com \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.