* [PATCH] soc/fsl/qbman: Check if CPU is offline when initializing portals
@ 2017-05-25 20:32 ` Roy Pledge
0 siblings, 0 replies; 4+ messages in thread
From: Roy Pledge @ 2017-05-25 20:32 UTC (permalink / raw)
To: oss, linuxppc-dev, linux-arm-kernel, linux-kernel
Cc: madalin.bucur, Roy Pledge
If the affine portal for a specific CPU is offline at boot time
affine its interrupt to CPU 0. If the CPU is later brought online
the hotplug handler will correctly adjust the affinity.
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
drivers/soc/fsl/qbman/bman.c | 17 +++++++++++++----
drivers/soc/fsl/qbman/qman.c | 18 +++++++++++++-----
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c
index 1fa9099..b72a92c 100644
--- a/drivers/soc/fsl/qbman/bman.c
+++ b/drivers/soc/fsl/qbman/bman.c
@@ -560,10 +560,19 @@ static int bman_create_portal(struct bman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need RCR to be empty before continuing */
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index aebcf16..b1b1268 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -941,7 +941,6 @@ static inline int qm_mc_result_timeout(struct qm_portal *portal,
break;
udelay(1);
} while (--timeout);
-
return timeout;
}
@@ -1218,10 +1217,19 @@ static int qman_create_portal(struct qman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need EQCR to be empty before continuing */
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] soc/fsl/qbman: Check if CPU is offline when initializing portals
@ 2017-05-25 20:32 ` Roy Pledge
0 siblings, 0 replies; 4+ messages in thread
From: Roy Pledge @ 2017-05-25 20:32 UTC (permalink / raw)
To: linux-arm-kernel
If the affine portal for a specific CPU is offline at boot time
affine its interrupt to CPU 0. If the CPU is later brought online
the hotplug handler will correctly adjust the affinity.
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
drivers/soc/fsl/qbman/bman.c | 17 +++++++++++++----
drivers/soc/fsl/qbman/qman.c | 18 +++++++++++++-----
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c
index 1fa9099..b72a92c 100644
--- a/drivers/soc/fsl/qbman/bman.c
+++ b/drivers/soc/fsl/qbman/bman.c
@@ -560,10 +560,19 @@ static int bman_create_portal(struct bman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need RCR to be empty before continuing */
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index aebcf16..b1b1268 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -941,7 +941,6 @@ static inline int qm_mc_result_timeout(struct qm_portal *portal,
break;
udelay(1);
} while (--timeout);
-
return timeout;
}
@@ -1218,10 +1217,19 @@ static int qman_create_portal(struct qman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need EQCR to be empty before continuing */
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] soc/fsl/qbman: Check if CPU is offline when initializing portals
@ 2018-01-29 19:47 ` Roy Pledge
0 siblings, 0 replies; 4+ messages in thread
From: Roy Pledge @ 2018-01-29 19:47 UTC (permalink / raw)
To: linuxppc-dev, linux-arm-kernel, linux-kernel, leoyang.li
Cc: madalin.bucur, Roy Pledge
If the affine portal for a specific CPU is offline at boot time
affine its interrupt to CPU 0. If the CPU is later brought online
the hotplug handler will correctly adjust the affinity.
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
drivers/soc/fsl/qbman/bman.c | 17 +++++++++++++----
drivers/soc/fsl/qbman/qman.c | 18 +++++++++++++-----
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c
index f9485ce..2e6e682 100644
--- a/drivers/soc/fsl/qbman/bman.c
+++ b/drivers/soc/fsl/qbman/bman.c
@@ -562,10 +562,19 @@ static int bman_create_portal(struct bman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need RCR to be empty before continuing */
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index e4f5bb0..463e65d 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -935,7 +935,6 @@ static inline int qm_mc_result_timeout(struct qm_portal *portal,
break;
udelay(1);
} while (--timeout);
-
return timeout;
}
@@ -1209,10 +1208,19 @@ static int qman_create_portal(struct qman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need EQCR to be empty before continuing */
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] soc/fsl/qbman: Check if CPU is offline when initializing portals
@ 2018-01-29 19:47 ` Roy Pledge
0 siblings, 0 replies; 4+ messages in thread
From: Roy Pledge @ 2018-01-29 19:47 UTC (permalink / raw)
To: linux-arm-kernel
If the affine portal for a specific CPU is offline at boot time
affine its interrupt to CPU 0. If the CPU is later brought online
the hotplug handler will correctly adjust the affinity.
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
---
drivers/soc/fsl/qbman/bman.c | 17 +++++++++++++----
drivers/soc/fsl/qbman/qman.c | 18 +++++++++++++-----
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c
index f9485ce..2e6e682 100644
--- a/drivers/soc/fsl/qbman/bman.c
+++ b/drivers/soc/fsl/qbman/bman.c
@@ -562,10 +562,19 @@ static int bman_create_portal(struct bman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need RCR to be empty before continuing */
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index e4f5bb0..463e65d 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -935,7 +935,6 @@ static inline int qm_mc_result_timeout(struct qm_portal *portal,
break;
udelay(1);
} while (--timeout);
-
return timeout;
}
@@ -1209,10 +1208,19 @@ static int qman_create_portal(struct qman_portal *portal,
dev_err(c->dev, "request_irq() failed\n");
goto fail_irq;
}
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
- dev_err(c->dev, "irq_set_affinity() failed\n");
- goto fail_affinity;
+ if (cpu_online(c->cpu) && c->cpu != -1 &&
+ irq_can_set_affinity(c->irq)) {
+ if (irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
+ dev_err(c->dev, "irq_set_affinity() failed %d\n",
+ c->cpu);
+ goto fail_affinity;
+ }
+ } else {
+ /* CPU is offline, direct IRQ to CPU 0 */
+ if (irq_set_affinity(c->irq, cpumask_of(0))) {
+ dev_err(c->dev, "irq_set_affinity() cpu 0 failed\n");
+ goto fail_affinity;
+ }
}
/* Need EQCR to be empty before continuing */
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-29 19:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25 20:32 [PATCH] soc/fsl/qbman: Check if CPU is offline when initializing portals Roy Pledge
2017-05-25 20:32 ` Roy Pledge
2018-01-29 19:47 Roy Pledge
2018-01-29 19:47 ` Roy Pledge
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.