remoteproc: xlnx: allow single core use in split mode
PATCH v2 1/1 remoteproc: xlnx: allow single core use in split mode
It's a valid use case to have only one core enabled in cluster in split mode. Remove exact core count expecatation from the driver.
---
Change in v2:
- limit core_count to max 2
drivers/remoteproc/xlnx_r5_remoteproc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +1 -4
@@ -1336,12 +1336,9 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)* and ignore core1 dt node. */ core_count =of_get_available_child_count (dev_node); -if (core_count ==0 ) { +if (core_count ==0 || core_count >2 ) {dev_err (dev,"Invalid number of r5 cores %d" , core_count);return -EINVAL ; - }else if (cluster_mode ==SPLIT_MODE && core_count !=2 ) { -dev_err (dev,"Invalid number of r5 cores for split mode\n" ); -return -EINVAL ; }else if (cluster_mode ==LOCKSTEP_MODE && core_count ==2 ) {dev_warn (dev,"Only r5 core0 will be used\n" ); core_count =1 ;
base-commit: dc8417021bcd01914a416bf8bab811a6c5e7d99a
Signature · 1 line
2.34.1
Quoted 4 lines · Tanmay Shah
It's a valid use case to have only one core enabled in cluster in split mode. Remove exact core count expecatation from the driver.
Signed-off-by Tanmay Shah <[email protected]>
Mathieu Poirier
maintainerGood day,
Quoted 2 lines · Tanmay Shah
It's a valid use case to have only one core enabled in cluster in split mode. Remove exact core count expecatation from the driver.
I suggest:
"When operating in split mode, it is a valid usecase to have only one core enabled in the cluster. Remove..."
Quoted 18 lines
Signed-off-by Tanmay Shah <[email protected]>---
Change in v2:
- limitcore_countto max 2drivers/remoteproc/xlnx_r5_remoteproc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/remoteproc/xlnx_r5_remoteproc.c +0
-0@@ -1336,12 +1336,9 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)* and ignore core1 dt node. */ core_count =of_get_available_child_count (dev_node);
drivers/remoteproc/xlnx_r5_remoteproc.c static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) · line 1344
Quoted 10 lines
drivers/remoteproc/xlnx_r5_remoteproc.c +1
-4-if (core_count ==0 ) { +if (core_count ==0 || core_count >2 ) {dev_err (dev,"Invalid number of r5 cores %d" , core_count);return -EINVAL ; - }else if (cluster_mode ==SPLIT_MODE && core_count !=2 ) { -dev_err (dev,"Invalid number of r5 cores for split mode\n" ); -return -EINVAL ; }else if (cluster_mode ==LOCKSTEP_MODE && core_count ==2 ) {dev_warn (dev,"Only r5 core0 will be used\n" ); core_count =1 ;
When thinking about the specific usecase where, in split mode, a single core is enabled - can it be either core0 or core1 or does it have to be core0?
Is the code in the driver ready to handle this configuration?
The inline comments you already have to explain the possible configurations need to be update to address this new usecase.
Thanks,
Mathieu
Quoted 5 lines
base-commit:
dc8417021bcd01914a416bf8bab811a6c5e7d99aSignature · 1 line
2.34.1
Quoted 11 lines · Mathieu Poirier
Good day,
Quoted 2 lines · Tanmay Shah
It's a valid use case to have only one core enabled in cluster in split mode. Remove exact core count expecatation from the driver.
I suggest:
"When operating in split mode, it is a valid usecase to have only one core enabled in the cluster. Remove..."
Ack, will update commit message in next rev.
Quoted 23 lines
Quoted 23 lines
Signed-off-by Tanmay Shah <[email protected]>---
Change in v2:
- limitcore_countto max 2drivers/remoteproc/xlnx_r5_remoteproc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/remoteproc/xlnx_r5_remoteproc.c +1
-2@@ -1336,12 +1336,9 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)* and ignore core1 dt node. */ core_count =of_get_available_child_count (dev_node); -if (core_count ==0 ) { +if (core_count ==0 || core_count >2 ) {dev_err (dev,"Invalid number of r5 cores %d" , core_count);return -EINVAL ; - }else if (cluster_mode ==SPLIT_MODE && core_count !=2 ) {
Quoted 9 lines
drivers/remoteproc/xlnx_r5_remoteproc.c static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) · line 1344
Quoted 5 lines
drivers/remoteproc/xlnx_r5_remoteproc.c +0
-2-dev_err (dev,"Invalid number of r5 cores for split mode\n" ); -return -EINVAL ; }else if (cluster_mode ==LOCKSTEP_MODE && core_count ==2 ) {dev_warn (dev,"Only r5 core0 will be used\n" ); core_count =1 ;When thinking about the specific usecase where, in split mode, a single core is enabled - can it be either core0 or core1 or does it have to be core0?
Correct. It doesn't have to be core0.
Quoted 2 lines
Is the code in the driver ready to handle this configuration?
Yes, driver will handle all following cases correctly.
Case 1: core0 enabled, core1 disabled
Case 2: core0 disabled, core1 enabled
Case 3: core0 enabled, core 1 enabled
I will document all cases in the comment in the driver.
Quoted 11 lines
The inline comments you already have to explain the possible configurations need to be update to address this new usecase.
Thanks,
MathieuQuoted 5 lines
base-commit:
dc8417021bcd01914a416bf8bab811a6c5e7d99aSignature · 1 line
2.34.1