linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] cxl: Fix number of allocated pages in SPA
@ 2015-10-06 14:19 Christophe Lombard
  2015-10-07  3:51 ` Ian Munsie
  0 siblings, 1 reply; 10+ messages in thread
From: Christophe Lombard @ 2015-10-06 14:19 UTC (permalink / raw)
  To: imunsie; +Cc: linuxppc-dev

This moves the initialisation of the num_procs to before the SPA
allocation.
The field 'num_procs' of the structure cxl_afu is not updated to the
right value (maximum number of processes that can be supported by
the AFU) when the pages are allocated (i.e. when  cxl_alloc_spa() is called).
The number of allocates pages depends on the max number of processes.

Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
---
 drivers/misc/cxl/native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index b37f2e8..d2e75c8 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -457,6 +457,7 @@ static int activate_afu_directed(struct cxl_afu *afu)
 
 	dev_info(&afu->dev, "Activating AFU directed mode\n");
 
+	afu->num_procs = afu->max_procs_virtualised;
 	if (afu->spa == NULL) {
 		if (cxl_alloc_spa(afu))
 			return -ENOMEM;
@@ -468,7 +469,6 @@ static int activate_afu_directed(struct cxl_afu *afu)
 	cxl_p1n_write(afu, CXL_PSL_ID_An, CXL_PSL_ID_An_F | CXL_PSL_ID_An_L);
 
 	afu->current_mode = CXL_MODE_DIRECTED;
-	afu->num_procs = afu->max_procs_virtualised;
 
 	if ((rc = cxl_chardev_m_afu_add(afu)))
 		return rc;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] cxl: Fix number of allocated pages in SPA
@ 2015-10-02 14:01 Christophe Lombard
  2015-10-06  0:23 ` Ian Munsie
  2015-10-06  6:19 ` Michael Ellerman
  0 siblings, 2 replies; 10+ messages in thread
From: Christophe Lombard @ 2015-10-02 14:01 UTC (permalink / raw)
  To: imunsie; +Cc: linuxppc-dev

This moves the initialisation of the num_procs to before the SPA
allocation.

Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
---
 drivers/misc/cxl/native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index b37f2e8..d2e75c8 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -457,6 +457,7 @@ static int activate_afu_directed(struct cxl_afu *afu)
 
 	dev_info(&afu->dev, "Activating AFU directed mode\n");
 
+	afu->num_procs = afu->max_procs_virtualised;
 	if (afu->spa == NULL) {
 		if (cxl_alloc_spa(afu))
 			return -ENOMEM;
@@ -468,7 +469,6 @@ static int activate_afu_directed(struct cxl_afu *afu)
 	cxl_p1n_write(afu, CXL_PSL_ID_An, CXL_PSL_ID_An_F | CXL_PSL_ID_An_L);
 
 	afu->current_mode = CXL_MODE_DIRECTED;
-	afu->num_procs = afu->max_procs_virtualised;
 
 	if ((rc = cxl_chardev_m_afu_add(afu)))
 		return rc;
-- 
1.9.1

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

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 14:19 [PATCH v2] cxl: Fix number of allocated pages in SPA Christophe Lombard
2015-10-07  3:51 ` Ian Munsie
2015-10-07  4:09   ` Michael Ellerman
2015-10-07  5:07     ` [PATCH] " Ian Munsie
2015-10-07 10:10       ` Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2015-10-02 14:01 [PATCH] " Christophe Lombard
2015-10-06  0:23 ` Ian Munsie
2015-10-06  6:19 ` Michael Ellerman
2015-10-06  9:21   ` christophe lombard
2015-10-07  3:24   ` Ian Munsie

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).