All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/sun50i: fix protection flag check
@ 2021-07-16  4:24 ` David Stevens
  0 siblings, 0 replies; 4+ messages in thread
From: David Stevens @ 2021-07-16  4:24 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: linux-sunxi, iommu, David Stevens

From: David Stevens <stevensd@chromium.org>

Fix RW protection check when making a pte, so that it properly checks
that both R and W flags are set, instead of either R or W.

Signed-off-by: David Stevens <stevensd@chromium.org>
---
 drivers/iommu/sun50i-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index 181bb1c3437c..11cf5af30956 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -271,7 +271,7 @@ static u32 sun50i_mk_pte(phys_addr_t page, int prot)
 	enum sun50i_iommu_aci aci;
 	u32 flags = 0;
 
-	if (prot & (IOMMU_READ | IOMMU_WRITE))
+	if ((prot & IOMMU_READ) && (prot & IOMMU_WRITE))
 		aci = SUN50I_IOMMU_ACI_RD_WR;
 	else if (prot & IOMMU_READ)
 		aci = SUN50I_IOMMU_ACI_RD;
-- 
2.32.0.402.g57bb445576-goog


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

* [PATCH] iommu/sun50i: fix protection flag check
@ 2021-07-16  4:24 ` David Stevens
  0 siblings, 0 replies; 4+ messages in thread
From: David Stevens @ 2021-07-16  4:24 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: iommu, linux-sunxi, David Stevens

From: David Stevens <stevensd@chromium.org>

Fix RW protection check when making a pte, so that it properly checks
that both R and W flags are set, instead of either R or W.

Signed-off-by: David Stevens <stevensd@chromium.org>
---
 drivers/iommu/sun50i-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index 181bb1c3437c..11cf5af30956 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -271,7 +271,7 @@ static u32 sun50i_mk_pte(phys_addr_t page, int prot)
 	enum sun50i_iommu_aci aci;
 	u32 flags = 0;
 
-	if (prot & (IOMMU_READ | IOMMU_WRITE))
+	if ((prot & IOMMU_READ) && (prot & IOMMU_WRITE))
 		aci = SUN50I_IOMMU_ACI_RD_WR;
 	else if (prot & IOMMU_READ)
 		aci = SUN50I_IOMMU_ACI_RD;
-- 
2.32.0.402.g57bb445576-goog

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

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

* Re: [PATCH] iommu/sun50i: fix protection flag check
  2021-07-16  4:24 ` David Stevens
@ 2021-07-16  7:31   ` Maxime Ripard
  -1 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2021-07-16  7:31 UTC (permalink / raw)
  To: David Stevens; +Cc: linux-sunxi, iommu

On Fri, Jul 16, 2021 at 01:24:31PM +0900, David Stevens wrote:
> From: David Stevens <stevensd@chromium.org>
> 
> Fix RW protection check when making a pte, so that it properly checks
> that both R and W flags are set, instead of either R or W.
> 
> Signed-off-by: David Stevens <stevensd@chromium.org>

Acked-by: Maxime Ripard <maxime@cerno.tech>

Thanks!
Maxime

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

* Re: [PATCH] iommu/sun50i: fix protection flag check
@ 2021-07-16  7:31   ` Maxime Ripard
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2021-07-16  7:31 UTC (permalink / raw)
  To: David Stevens; +Cc: iommu, linux-sunxi

On Fri, Jul 16, 2021 at 01:24:31PM +0900, David Stevens wrote:
> From: David Stevens <stevensd@chromium.org>
> 
> Fix RW protection check when making a pte, so that it properly checks
> that both R and W flags are set, instead of either R or W.
> 
> Signed-off-by: David Stevens <stevensd@chromium.org>

Acked-by: Maxime Ripard <maxime@cerno.tech>

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

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

end of thread, other threads:[~2021-07-16  7:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16  4:24 [PATCH] iommu/sun50i: fix protection flag check David Stevens
2021-07-16  4:24 ` David Stevens
2021-07-16  7:31 ` Maxime Ripard
2021-07-16  7:31   ` Maxime Ripard

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.