aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/xics
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-09-22 22:04:59 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-10-11 01:48:46 -0400
commitbf8e0f891a32ba24fa8811e496fabb449589d942 (patch)
tree2a42bfbffff6183addc41f0752fa253aa440b888 /arch/powerpc/sysdev/xics
parent46d319e5d8c8add09378a67e27237504d0132283 (diff)
powerpc/powernv: Fix endian issues in OPAL ICS backend
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/xics')
-rw-r--r--arch/powerpc/sysdev/xics/ics-opal.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c
index 39d72212655e..3c6ee1b64e5d 100644
--- a/arch/powerpc/sysdev/xics/ics-opal.c
+++ b/arch/powerpc/sysdev/xics/ics-opal.c
@@ -112,6 +112,7 @@ static int ics_opal_set_affinity(struct irq_data *d,
112 bool force) 112 bool force)
113{ 113{
114 unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d); 114 unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d);
115 __be16 oserver;
115 int16_t server; 116 int16_t server;
116 int8_t priority; 117 int8_t priority;
117 int64_t rc; 118 int64_t rc;
@@ -120,13 +121,13 @@ static int ics_opal_set_affinity(struct irq_data *d,
120 if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS) 121 if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)
121 return -1; 122 return -1;
122 123
123 rc = opal_get_xive(hw_irq, &server, &priority); 124 rc = opal_get_xive(hw_irq, &oserver, &priority);
124 if (rc != OPAL_SUCCESS) { 125 if (rc != OPAL_SUCCESS) {
125 pr_err("%s: opal_set_xive(irq=%d [hw 0x%x] server=%x)" 126 pr_err("%s: opal_get_xive(irq=%d [hw 0x%x]) error %lld\n",
126 " error %lld\n", 127 __func__, d->irq, hw_irq, rc);
127 __func__, d->irq, hw_irq, server, rc);
128 return -1; 128 return -1;
129 } 129 }
130 server = be16_to_cpu(oserver);
130 131
131 wanted_server = xics_get_irq_server(d->irq, cpumask, 1); 132 wanted_server = xics_get_irq_server(d->irq, cpumask, 1);
132 if (wanted_server < 0) { 133 if (wanted_server < 0) {
@@ -181,7 +182,7 @@ static int ics_opal_map(struct ics *ics, unsigned int virq)
181{ 182{
182 unsigned int hw_irq = (unsigned int)virq_to_hw(virq); 183 unsigned int hw_irq = (unsigned int)virq_to_hw(virq);
183 int64_t rc; 184 int64_t rc;
184 int16_t server; 185 __be16 server;
185 int8_t priority; 186 int8_t priority;
186 187
187 if (WARN_ON(hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS)) 188 if (WARN_ON(hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS))
@@ -201,7 +202,7 @@ static int ics_opal_map(struct ics *ics, unsigned int virq)
201static void ics_opal_mask_unknown(struct ics *ics, unsigned long vec) 202static void ics_opal_mask_unknown(struct ics *ics, unsigned long vec)
202{ 203{
203 int64_t rc; 204 int64_t rc;
204 int16_t server; 205 __be16 server;
205 int8_t priority; 206 int8_t priority;
206 207
207 /* Check if HAL knows about this interrupt */ 208 /* Check if HAL knows about this interrupt */
@@ -215,14 +216,14 @@ static void ics_opal_mask_unknown(struct ics *ics, unsigned long vec)
215static long ics_opal_get_server(struct ics *ics, unsigned long vec) 216static long ics_opal_get_server(struct ics *ics, unsigned long vec)
216{ 217{
217 int64_t rc; 218 int64_t rc;
218 int16_t server; 219 __be16 server;
219 int8_t priority; 220 int8_t priority;
220 221
221 /* Check if HAL knows about this interrupt */ 222 /* Check if HAL knows about this interrupt */
222 rc = opal_get_xive(vec, &server, &priority); 223 rc = opal_get_xive(vec, &server, &priority);
223 if (rc != OPAL_SUCCESS) 224 if (rc != OPAL_SUCCESS)
224 return -1; 225 return -1;
225 return ics_opal_unmangle_server(server); 226 return ics_opal_unmangle_server(be16_to_cpu(server));
226} 227}
227 228
228int __init ics_opal_init(void) 229int __init ics_opal_init(void)