* [GIT PULL] iommu/arm-smmu: Fixes for 4.9 @ 2016-10-28 16:01 Will Deacon [not found] ` <20161028160148.GD1076-5wv7dgnIgG8@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Will Deacon @ 2016-10-28 16:01 UTC (permalink / raw) To: joro-zLv9SwRftAIdnm+yROfE0A Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Hi Joerg, Please pull the following pair of fixes from Robin for the ARM SMMU drivers. Thanks, Will --->8 The following changes since commit 1001354ca34179f3db924eb66672442a173147dc: Linux 4.9-rc1 (2016-10-15 12:17:50 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-joerg/arm-smmu/fixes for you to fetch changes up to 5a5a057d2ba73ae4990b6dc283465b4886d93993: iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s (2016-10-26 19:21:38 +0100) ---------------------------------------------------------------- Robin Murphy (2): iommu/arm-smmu: Work around ARM DMA configuration iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s drivers/iommu/arm-smmu-v3.c | 11 ++++------- drivers/iommu/arm-smmu.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20161028160148.GD1076-5wv7dgnIgG8@public.gmane.org>]
* Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.9 [not found] ` <20161028160148.GD1076-5wv7dgnIgG8@public.gmane.org> @ 2016-11-03 15:33 ` Joerg Roedel [not found] ` <20161103153303.GA837-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Joerg Roedel @ 2016-11-03 15:33 UTC (permalink / raw) To: Will Deacon Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Fri, Oct 28, 2016 at 05:01:48PM +0100, Will Deacon wrote: > iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s Hmm, this patch is pretty ugly. Wouldn't it be better to have hardware-independent init-routine in the arm-smmu-v3 driver that checks DT whether there is an SMMU at all and if yes, sets the per-bus iommu-ops? Joerg ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20161103153303.GA837-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>]
* Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.9 [not found] ` <20161103153303.GA837-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> @ 2016-11-03 16:00 ` Will Deacon [not found] ` <20161103160006.GS22791-5wv7dgnIgG8@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Will Deacon @ 2016-11-03 16:00 UTC (permalink / raw) To: Joerg Roedel Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Hi Joerg, On Thu, Nov 03, 2016 at 09:33:04AM -0600, Joerg Roedel wrote: > On Fri, Oct 28, 2016 at 05:01:48PM +0100, Will Deacon wrote: > > iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s > > Hmm, this patch is pretty ugly. Wouldn't it be better to have > hardware-independent init-routine in the arm-smmu-v3 driver that checks > DT whether there is an SMMU at all and if yes, sets the per-bus > iommu-ops? We're basically doing that already, since the bus_set_iommu call happens in the probe routine, which won't run unless an SMMUv3 has been found in the DT. The issue we're trying to avoid is failing the probe of a second SMMUv3 in the system, because the bus will already have the iommu ops set by the first SMMUv3 that probed. I suppose we could go and compare bus->iommu_ops with &arm_smmu_ops, but given that we can't support different IOMMU types on a single bus, I don't think we gain anything from that. Will ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20161103160006.GS22791-5wv7dgnIgG8@public.gmane.org>]
* Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.9 [not found] ` <20161103160006.GS22791-5wv7dgnIgG8@public.gmane.org> @ 2016-11-03 16:14 ` Joerg Roedel [not found] ` <20161103161407.GR3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Joerg Roedel @ 2016-11-03 16:14 UTC (permalink / raw) To: Will Deacon Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Thu, Nov 03, 2016 at 04:00:06PM +0000, Will Deacon wrote: > We're basically doing that already, since the bus_set_iommu call happens in > the probe routine, which won't run unless an SMMUv3 has been found in the > DT. The issue we're trying to avoid is failing the probe of a second SMMUv3 > in the system, because the bus will already have the iommu ops set by the > first SMMUv3 that probed. > > I suppose we could go and compare bus->iommu_ops with &arm_smmu_ops, but > given that we can't support different IOMMU types on a single bus, I don't > think we gain anything from that. Can you instead check whether there is already another smmu probed and skip the bus_set_iommu call then? Joerg ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20161103161407.GR3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>]
* Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.9 [not found] ` <20161103161407.GR3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> @ 2016-11-03 16:22 ` Robin Murphy [not found] ` <0dbf2665-4292-d49a-b9e7-688bcdf29c6e-5wv7dgnIgG8@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Robin Murphy @ 2016-11-03 16:22 UTC (permalink / raw) To: Joerg Roedel, Will Deacon Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 03/11/16 16:14, Joerg Roedel wrote: > On Thu, Nov 03, 2016 at 04:00:06PM +0000, Will Deacon wrote: >> We're basically doing that already, since the bus_set_iommu call happens in >> the probe routine, which won't run unless an SMMUv3 has been found in the >> DT. The issue we're trying to avoid is failing the probe of a second SMMUv3 >> in the system, because the bus will already have the iommu ops set by the >> first SMMUv3 that probed. >> >> I suppose we could go and compare bus->iommu_ops with &arm_smmu_ops, but >> given that we can't support different IOMMU types on a single bus, I don't >> think we gain anything from that. > > Can you instead check whether there is already another smmu probed and > skip the bus_set_iommu call then? But bus_set_iommu() is already checking whether another SMMU (in this case) has probed, by virtue of bus->iommu_ops being non-NULL, and returning without doing anything if so. What's the value of adding a whole bunch more code to effectively duplicate that in a less elegant manner? Robin. > > > Joerg > ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <0dbf2665-4292-d49a-b9e7-688bcdf29c6e-5wv7dgnIgG8@public.gmane.org>]
* Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.9 [not found] ` <0dbf2665-4292-d49a-b9e7-688bcdf29c6e-5wv7dgnIgG8@public.gmane.org> @ 2016-11-03 16:29 ` Joerg Roedel [not found] ` <20161103162943.GS3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Joerg Roedel @ 2016-11-03 16:29 UTC (permalink / raw) To: Robin Murphy Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Will Deacon, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Thu, Nov 03, 2016 at 04:22:04PM +0000, Robin Murphy wrote: > But bus_set_iommu() is already checking whether another SMMU (in this > case) has probed, by virtue of bus->iommu_ops being non-NULL, and > returning without doing anything if so. What's the value of adding a > whole bunch more code to effectively duplicate that in a less elegant > manner? No, bus_set_iommu() checks whether there is _any_ other IOMMU already registered. This doesn't need to be an smmu. So I think the return value of bus_set_iommu shouldn't be generally ignored. Joerg ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20161103162943.GS3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>]
* Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.9 [not found] ` <20161103162943.GS3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> @ 2016-11-03 16:57 ` Robin Murphy [not found] ` <a6ded15c-5eea-70b8-61a1-b40873af8699-5wv7dgnIgG8@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Robin Murphy @ 2016-11-03 16:57 UTC (permalink / raw) To: Joerg Roedel Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Will Deacon, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 03/11/16 16:29, Joerg Roedel wrote: > On Thu, Nov 03, 2016 at 04:22:04PM +0000, Robin Murphy wrote: >> But bus_set_iommu() is already checking whether another SMMU (in this >> case) has probed, by virtue of bus->iommu_ops being non-NULL, and >> returning without doing anything if so. What's the value of adding a >> whole bunch more code to effectively duplicate that in a less elegant >> manner? > > No, bus_set_iommu() checks whether there is _any_ other IOMMU already > registered. This doesn't need to be an smmu. So I think the return value > of bus_set_iommu shouldn't be generally ignored. But if it is someone else's ops, then all that means is that the SMMU driver isn't going to get notified about devices on that bus, or get called with them later, so I still don't see where the problem is. If there are devices on that bus which the SMMU *is* supposed to be managing, then that system can't be supported with the current API anyway. Robin. ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <a6ded15c-5eea-70b8-61a1-b40873af8699-5wv7dgnIgG8@public.gmane.org>]
* Re: [GIT PULL] iommu/arm-smmu: Fixes for 4.9 [not found] ` <a6ded15c-5eea-70b8-61a1-b40873af8699-5wv7dgnIgG8@public.gmane.org> @ 2016-11-03 17:29 ` Joerg Roedel 0 siblings, 0 replies; 8+ messages in thread From: Joerg Roedel @ 2016-11-03 17:29 UTC (permalink / raw) To: Robin Murphy Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Will Deacon, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Thu, Nov 03, 2016 at 04:57:40PM +0000, Robin Murphy wrote: > But if it is someone else's ops, then all that means is that the SMMU > driver isn't going to get notified about devices on that bus, or get > called with them later, so I still don't see where the problem is. If > there are devices on that bus which the SMMU *is* supposed to be > managing, then that system can't be supported with the current API anyway. If another IOMMU is already probed and set its iommu_ops, than there is no point in probing the smmu anyway, no? The probe function should return the failed probe in that case and not proceed silently. Joerg ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-11-03 17:29 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-10-28 16:01 [GIT PULL] iommu/arm-smmu: Fixes for 4.9 Will Deacon [not found] ` <20161028160148.GD1076-5wv7dgnIgG8@public.gmane.org> 2016-11-03 15:33 ` Joerg Roedel [not found] ` <20161103153303.GA837-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> 2016-11-03 16:00 ` Will Deacon [not found] ` <20161103160006.GS22791-5wv7dgnIgG8@public.gmane.org> 2016-11-03 16:14 ` Joerg Roedel [not found] ` <20161103161407.GR3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> 2016-11-03 16:22 ` Robin Murphy [not found] ` <0dbf2665-4292-d49a-b9e7-688bcdf29c6e-5wv7dgnIgG8@public.gmane.org> 2016-11-03 16:29 ` Joerg Roedel [not found] ` <20161103162943.GS3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> 2016-11-03 16:57 ` Robin Murphy [not found] ` <a6ded15c-5eea-70b8-61a1-b40873af8699-5wv7dgnIgG8@public.gmane.org> 2016-11-03 17:29 ` Joerg Roedel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).