Skip to contentSkip to conversation

cxl: Set the valid bit in PE for dedicated mode

PATCH Applied Vaibhav Jain 4 participants 4 messages Sep 4, 2017 – Oct 5, 2017 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cxl: Set the valid bit in PE for dedicated mode

Make sure to set the valid-bit in software-state field of the populated PE. This was earlier missing for dedicated mode AFUs, hence was causing a PSL freeze when the AFU was activated.

---
Changelog:

v2 -> Removed a call to smp_wmb() after setting the bit [Michael Ellerman]
---

 drivers/misc/cxl/native.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/misc/cxl/native.c +8 -0
index 4a82c313cf71..75df74d59527 100644
@@ -897,6 +897,14 @@ int cxl_attach_dedicated_process_psl9(struct cxl_context *ctx, u64 wed, u64 amr)
 	if (ctx->afu->adapter->native->sl_ops->update_dedicated_ivtes)
 		afu->adapter->native->sl_ops->update_dedicated_ivtes(ctx);
 
+	ctx->elem->software_state = cpu_to_be32(CXL_PE_SOFTWARE_STATE_V);
+	/*
+	 * Ideally we should do a wmb() here to make sure the changes to the
+	 * PE are visible to the card before we call afu_enable.
+	 * On ppc64 though all mmios are preceded by a 'sync' instruction hence
+	 * we dont dont need one here.
+	 */
+
 	result = cxl_ops->afu_reset(afu);
 	if (result)
 		return result;
Signature · 1 line
2.13.5
Acked-by on v2 1/1
#1 lore raw
Quoted 10 lines · Vaibhav Jain

Make sure to set the valid-bit in software-state field of the populated PE. This was earlier missing for dedicated mode AFUs, hence was causing a PSL freeze when the AFU was activated.

---
Changelog:

v2 -> Removed a call to smp_wmb() after setting the bit [Michael Ellerman]
---

Quoted 24 lines
  drivers/misc/cxl/native.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/misc/cxl/native.c +8 -0
index 4a82c313cf71..75df74d59527 100644
@@ -897,6 +897,14 @@ int cxl_attach_dedicated_process_psl9(struct cxl_context *ctx, u64 wed, u64 amr)
  	if (ctx->afu->adapter->native->sl_ops->update_dedicated_ivtes)
  		afu->adapter->native->sl_ops->update_dedicated_ivtes(ctx);
 
+	ctx->elem->software_state = cpu_to_be32(CXL_PE_SOFTWARE_STATE_V);
+	/*
+	 * Ideally we should do a wmb() here to make sure the changes to the
+	 * PE are visible to the card before we call afu_enable.
+	 * On ppc64 though all mmios are preceded by a 'sync' instruction hence
+	 * we dont dont need one here.
+	 */
+
  	result = cxl_ops->afu_reset(afu);
  	if (result)
  		return result;
Acked-by on v2 1/1
#2 lore raw
In reply to Vaibhav Jain
Quoted 34 lines · Vaibhav Jain

Make sure to set the valid-bit in software-state field of the populated PE. This was earlier missing for dedicated mode AFUs, hence was causing a PSL freeze when the AFU was activated.

---
Changelog:

v2 -> Removed a call to smp_wmb() after setting the bit [Michael Ellerman]
---

  drivers/misc/cxl/native.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/misc/cxl/native.c +8 -0
index 4a82c313cf71..75df74d59527 100644
@@ -897,6 +897,14 @@ int cxl_attach_dedicated_process_psl9(struct cxl_context *ctx, u64 wed, u64 amr)
  	if (ctx->afu->adapter->native->sl_ops->update_dedicated_ivtes)
  		afu->adapter->native->sl_ops->update_dedicated_ivtes(ctx);
 
+	ctx->elem->software_state = cpu_to_be32(CXL_PE_SOFTWARE_STATE_V);
+	/*
+	 * Ideally we should do a wmb() here to make sure the changes to the
+	 * PE are visible to the card before we call afu_enable.
+	 * On ppc64 though all mmios are preceded by a 'sync' instruction hence
+	 * we dont dont need one here.
+	 */
+
  	result = cxl_ops->afu_reset(afu);
  	if (result)
  		return result;
Signature · 2 lines
Andrew Donnellan              OzLabs, ADL Canberra
[email protected]  IBM Australia Limited
#3 lore raw
In reply to Vaibhav Jain
Quoted 7 lines · Vaibhav Jain

Make sure to set the valid-bit in software-state field of the populated PE. This was earlier missing for dedicated mode AFUs, hence was causing a PSL freeze when the AFU was activated.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/8512bffd6226fea259f94fd23fc3b6

cheers