All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
@ 2015-06-29 16:47 ` Will Deacon
  0 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-06-29 16:47 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Will Deacon,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi Joerg,

Since you're sending a batch of IOMMU fixes tomorrow, could you include
these two ARM SMMU fixes as well please?

Cheers,

Will

--->8

Markus Elfring (1):
  iommu/arm-smmu: Delete an unnecessary check before the function call
    "free_io_pgtable_ops"

Will Deacon (1):
  iommu/arm-smmu: Fix broken ATOS check

 drivers/iommu/arm-smmu-v3.c | 3 +--
 drivers/iommu/arm-smmu.c    | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
@ 2015-06-29 16:47 ` Will Deacon
  0 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-06-29 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Joerg,

Since you're sending a batch of IOMMU fixes tomorrow, could you include
these two ARM SMMU fixes as well please?

Cheers,

Will

--->8

Markus Elfring (1):
  iommu/arm-smmu: Delete an unnecessary check before the function call
    "free_io_pgtable_ops"

Will Deacon (1):
  iommu/arm-smmu: Fix broken ATOS check

 drivers/iommu/arm-smmu-v3.c | 3 +--
 drivers/iommu/arm-smmu.c    | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/2] iommu/arm-smmu: Fix broken ATOS check
  2015-06-29 16:47 ` Will Deacon
  (?)
@ 2015-06-29 16:47     ` Will Deacon
  -1 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-06-29 16:47 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Will Deacon,
	stable-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Commit 83a60ed8f0b5 ("iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS
condition") accidentally negated the ID0_ATOSNS predicate in the ATOS
feature check, causing the driver to attempt ATOS requests on SMMUv2
hardware without the ATOS feature implemented.

This patch restores the predicate to the correct value.

Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # 4.0+
Reported-by: Varun Sethi <varun.sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Signed-off-by: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
---
 drivers/iommu/arm-smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index dce041b1c139..4cd0c29cb585 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1566,7 +1566,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
 		return -ENODEV;
 	}
 
-	if ((id & ID0_S1TS) && ((smmu->version == 1) || (id & ID0_ATOSNS))) {
+	if ((id & ID0_S1TS) && ((smmu->version == 1) || !(id & ID0_ATOSNS))) {
 		smmu->features |= ARM_SMMU_FEAT_TRANS_OPS;
 		dev_notice(smmu->dev, "\taddress translation ops\n");
 	}
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 1/2] iommu/arm-smmu: Fix broken ATOS check
@ 2015-06-29 16:47     ` Will Deacon
  0 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-06-29 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 83a60ed8f0b5 ("iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS
condition") accidentally negated the ID0_ATOSNS predicate in the ATOS
feature check, causing the driver to attempt ATOS requests on SMMUv2
hardware without the ATOS feature implemented.

This patch restores the predicate to the correct value.

Cc: <stable@vger.kernel.org> # 4.0+
Reported-by: Varun Sethi <varun.sethi@freescale.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 drivers/iommu/arm-smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index dce041b1c139..4cd0c29cb585 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1566,7 +1566,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
 		return -ENODEV;
 	}
 
-	if ((id & ID0_S1TS) && ((smmu->version == 1) || (id & ID0_ATOSNS))) {
+	if ((id & ID0_S1TS) && ((smmu->version == 1) || !(id & ID0_ATOSNS))) {
 		smmu->features |= ARM_SMMU_FEAT_TRANS_OPS;
 		dev_notice(smmu->dev, "\taddress translation ops\n");
 	}
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 1/2] iommu/arm-smmu: Fix broken ATOS check
@ 2015-06-29 16:47     ` Will Deacon
  0 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-06-29 16:47 UTC (permalink / raw)
  To: joro; +Cc: iommu, linux-arm-kernel, Will Deacon, stable

Commit 83a60ed8f0b5 ("iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS
condition") accidentally negated the ID0_ATOSNS predicate in the ATOS
feature check, causing the driver to attempt ATOS requests on SMMUv2
hardware without the ATOS feature implemented.

This patch restores the predicate to the correct value.

Cc: <stable@vger.kernel.org> # 4.0+
Reported-by: Varun Sethi <varun.sethi@freescale.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 drivers/iommu/arm-smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index dce041b1c139..4cd0c29cb585 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1566,7 +1566,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
 		return -ENODEV;
 	}
 
-	if ((id & ID0_S1TS) && ((smmu->version == 1) || (id & ID0_ATOSNS))) {
+	if ((id & ID0_S1TS) && ((smmu->version == 1) || !(id & ID0_ATOSNS))) {
 		smmu->features |= ARM_SMMU_FEAT_TRANS_OPS;
 		dev_notice(smmu->dev, "\taddress translation ops\n");
 	}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/2] iommu/arm-smmu: Delete an unnecessary check before the function call "free_io_pgtable_ops"
  2015-06-29 16:47 ` Will Deacon
@ 2015-06-29 16:47     ` Will Deacon
  -1 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-06-29 16:47 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Will Deacon,
	Markus Elfring, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>

The free_io_pgtable_ops() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Signed-off-by: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
---
 drivers/iommu/arm-smmu-v3.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index f14130121298..8e9ec81ce4bb 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1389,8 +1389,7 @@ static void arm_smmu_domain_free(struct iommu_domain *domain)
 	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
 	struct arm_smmu_device *smmu = smmu_domain->smmu;
 
-	if (smmu_domain->pgtbl_ops)
-		free_io_pgtable_ops(smmu_domain->pgtbl_ops);
+	free_io_pgtable_ops(smmu_domain->pgtbl_ops);
 
 	/* Free the CD and ASID, if we allocated them */
 	if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/2] iommu/arm-smmu: Delete an unnecessary check before the function call "free_io_pgtable_ops"
@ 2015-06-29 16:47     ` Will Deacon
  0 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-06-29 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

From: Markus Elfring <elfring@users.sourceforge.net>

The free_io_pgtable_ops() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 drivers/iommu/arm-smmu-v3.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index f14130121298..8e9ec81ce4bb 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1389,8 +1389,7 @@ static void arm_smmu_domain_free(struct iommu_domain *domain)
 	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
 	struct arm_smmu_device *smmu = smmu_domain->smmu;
 
-	if (smmu_domain->pgtbl_ops)
-		free_io_pgtable_ops(smmu_domain->pgtbl_ops);
+	free_io_pgtable_ops(smmu_domain->pgtbl_ops);
 
 	/* Free the CD and ASID, if we allocated them */
 	if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
  2015-06-29 16:47 ` Will Deacon
@ 2015-06-29 19:43     ` Joerg Roedel
  -1 siblings, 0 replies; 13+ messages in thread
From: Joerg Roedel @ 2015-06-29 19:43 UTC (permalink / raw)
  To: Will Deacon
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi Will,

On Mon, Jun 29, 2015 at 05:47:41PM +0100, Will Deacon wrote:
> Since you're sending a batch of IOMMU fixes tomorrow, could you include
> these two ARM SMMU fixes as well please?

Sure, applied directly to my 'next' branch too.


	Joerg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
@ 2015-06-29 19:43     ` Joerg Roedel
  0 siblings, 0 replies; 13+ messages in thread
From: Joerg Roedel @ 2015-06-29 19:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Will,

On Mon, Jun 29, 2015 at 05:47:41PM +0100, Will Deacon wrote:
> Since you're sending a batch of IOMMU fixes tomorrow, could you include
> these two ARM SMMU fixes as well please?

Sure, applied directly to my 'next' branch too.


	Joerg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
  2015-06-29 16:47 ` Will Deacon
@ 2015-07-01  7:09     ` Joerg Roedel
  -1 siblings, 0 replies; 13+ messages in thread
From: Joerg Roedel @ 2015-07-01  7:09 UTC (permalink / raw)
  To: Will Deacon
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, Jun 29, 2015 at 05:47:41PM +0100, Will Deacon wrote:
> Since you're sending a batch of IOMMU fixes tomorrow, could you include
> these two ARM SMMU fixes as well please?

Sorry, this got delayed because I was waiting for a testing result of
another fix. But this one is pushed out too now and I am going to send
the fixes this evening.


	Joerg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
@ 2015-07-01  7:09     ` Joerg Roedel
  0 siblings, 0 replies; 13+ messages in thread
From: Joerg Roedel @ 2015-07-01  7:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 29, 2015 at 05:47:41PM +0100, Will Deacon wrote:
> Since you're sending a batch of IOMMU fixes tomorrow, could you include
> these two ARM SMMU fixes as well please?

Sorry, this got delayed because I was waiting for a testing result of
another fix. But this one is pushed out too now and I am going to send
the fixes this evening.


	Joerg

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
  2015-07-01  7:09     ` Joerg Roedel
@ 2015-07-01  9:12         ` Will Deacon
  -1 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-07-01  9:12 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

On Wed, Jul 01, 2015 at 08:09:02AM +0100, Joerg Roedel wrote:
> On Mon, Jun 29, 2015 at 05:47:41PM +0100, Will Deacon wrote:
> > Since you're sending a batch of IOMMU fixes tomorrow, could you include
> > these two ARM SMMU fixes as well please?
> 
> Sorry, this got delayed because I was waiting for a testing result of
> another fix. But this one is pushed out too now and I am going to send
> the fixes this evening.

No problem, thanks Joerg,

I'll probably have a second round of fixes later on, once I've run some
more SMMUv3 testing.

Will

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 0/2] iommu/arm-smmu: fixes for 4.2
@ 2015-07-01  9:12         ` Will Deacon
  0 siblings, 0 replies; 13+ messages in thread
From: Will Deacon @ 2015-07-01  9:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 01, 2015 at 08:09:02AM +0100, Joerg Roedel wrote:
> On Mon, Jun 29, 2015 at 05:47:41PM +0100, Will Deacon wrote:
> > Since you're sending a batch of IOMMU fixes tomorrow, could you include
> > these two ARM SMMU fixes as well please?
> 
> Sorry, this got delayed because I was waiting for a testing result of
> another fix. But this one is pushed out too now and I am going to send
> the fixes this evening.

No problem, thanks Joerg,

I'll probably have a second round of fixes later on, once I've run some
more SMMUv3 testing.

Will

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-07-01  9:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29 16:47 [PATCH 0/2] iommu/arm-smmu: fixes for 4.2 Will Deacon
2015-06-29 16:47 ` Will Deacon
     [not found] ` <1435596463-19247-1-git-send-email-will.deacon-5wv7dgnIgG8@public.gmane.org>
2015-06-29 16:47   ` [PATCH 1/2] iommu/arm-smmu: Fix broken ATOS check Will Deacon
2015-06-29 16:47     ` Will Deacon
2015-06-29 16:47     ` Will Deacon
2015-06-29 16:47   ` [PATCH 2/2] iommu/arm-smmu: Delete an unnecessary check before the function call "free_io_pgtable_ops" Will Deacon
2015-06-29 16:47     ` Will Deacon
2015-06-29 19:43   ` [PATCH 0/2] iommu/arm-smmu: fixes for 4.2 Joerg Roedel
2015-06-29 19:43     ` Joerg Roedel
2015-07-01  7:09   ` Joerg Roedel
2015-07-01  7:09     ` Joerg Roedel
     [not found]     ` <20150701070902.GQ18569-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-07-01  9:12       ` Will Deacon
2015-07-01  9:12         ` Will Deacon

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.