Skip to content

Commit 9c3250a

Browse files
ele0nmpe
authored andcommitted
powerpc/xive: Replace msleep(x) with msleep(OPAL_BUSY_DELAY_MS)
Replace msleep(x) with with msleep(OPAL_BUSY_DELAY_MS) to document these sleeps are to wait for opal (firmware). Signed-off-by: Daniel Klamt <eleon@ele0n.de> Signed-off-by: Bjoern Noetel <bjoern@br3ak3r.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 54dbcfc commit 9c3250a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

arch/powerpc/sysdev/xive/native.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ int xive_native_configure_irq(u32 hw_irq, u32 target, u8 prio, u32 sw_irq)
109109
rc = opal_xive_set_irq_config(hw_irq, target, prio, sw_irq);
110110
if (rc != OPAL_BUSY)
111111
break;
112-
msleep(1);
112+
msleep(OPAL_BUSY_DELAY_MS);
113113
}
114114
return rc == 0 ? 0 : -ENXIO;
115115
}
@@ -163,7 +163,7 @@ int xive_native_configure_queue(u32 vp_id, struct xive_q *q, u8 prio,
163163
rc = opal_xive_set_queue_info(vp_id, prio, qpage_phys, order, flags);
164164
if (rc != OPAL_BUSY)
165165
break;
166-
msleep(1);
166+
msleep(OPAL_BUSY_DELAY_MS);
167167
}
168168
if (rc) {
169169
pr_err("Error %lld setting queue for prio %d\n", rc, prio);
@@ -190,7 +190,7 @@ static void __xive_native_disable_queue(u32 vp_id, struct xive_q *q, u8 prio)
190190
rc = opal_xive_set_queue_info(vp_id, prio, 0, 0, 0);
191191
if (rc != OPAL_BUSY)
192192
break;
193-
msleep(1);
193+
msleep(OPAL_BUSY_DELAY_MS);
194194
}
195195
if (rc)
196196
pr_err("Error %lld disabling queue for prio %d\n", rc, prio);
@@ -253,7 +253,7 @@ static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc)
253253
for (;;) {
254254
irq = opal_xive_allocate_irq(chip_id);
255255
if (irq == OPAL_BUSY) {
256-
msleep(1);
256+
msleep(OPAL_BUSY_DELAY_MS);
257257
continue;
258258
}
259259
if (irq < 0) {
@@ -275,7 +275,7 @@ u32 xive_native_alloc_irq(void)
275275
rc = opal_xive_allocate_irq(OPAL_XIVE_ANY_CHIP);
276276
if (rc != OPAL_BUSY)
277277
break;
278-
msleep(1);
278+
msleep(OPAL_BUSY_DELAY_MS);
279279
}
280280
if (rc < 0)
281281
return 0;
@@ -289,7 +289,7 @@ void xive_native_free_irq(u32 irq)
289289
s64 rc = opal_xive_free_irq(irq);
290290
if (rc != OPAL_BUSY)
291291
break;
292-
msleep(1);
292+
msleep(OPAL_BUSY_DELAY_MS);
293293
}
294294
}
295295
EXPORT_SYMBOL_GPL(xive_native_free_irq);
@@ -305,7 +305,7 @@ static void xive_native_put_ipi(unsigned int cpu, struct xive_cpu *xc)
305305
for (;;) {
306306
rc = opal_xive_free_irq(xc->hw_ipi);
307307
if (rc == OPAL_BUSY) {
308-
msleep(1);
308+
msleep(OPAL_BUSY_DELAY_MS);
309309
continue;
310310
}
311311
xc->hw_ipi = 0;
@@ -400,7 +400,7 @@ static void xive_native_setup_cpu(unsigned int cpu, struct xive_cpu *xc)
400400
rc = opal_xive_set_vp_info(vp, OPAL_XIVE_VP_ENABLED, 0);
401401
if (rc != OPAL_BUSY)
402402
break;
403-
msleep(1);
403+
msleep(OPAL_BUSY_DELAY_MS);
404404
}
405405
if (rc) {
406406
pr_err("Failed to enable pool VP on CPU %d\n", cpu);
@@ -444,7 +444,7 @@ static void xive_native_teardown_cpu(unsigned int cpu, struct xive_cpu *xc)
444444
rc = opal_xive_set_vp_info(vp, 0, 0);
445445
if (rc != OPAL_BUSY)
446446
break;
447-
msleep(1);
447+
msleep(OPAL_BUSY_DELAY_MS);
448448
}
449449
}
450450

@@ -645,7 +645,7 @@ u32 xive_native_alloc_vp_block(u32 max_vcpus)
645645
rc = opal_xive_alloc_vp_block(order);
646646
switch (rc) {
647647
case OPAL_BUSY:
648-
msleep(1);
648+
msleep(OPAL_BUSY_DELAY_MS);
649649
break;
650650
case OPAL_XIVE_PROVISIONING:
651651
if (!xive_native_provision_pages())
@@ -687,7 +687,7 @@ int xive_native_enable_vp(u32 vp_id, bool single_escalation)
687687
rc = opal_xive_set_vp_info(vp_id, flags, 0);
688688
if (rc != OPAL_BUSY)
689689
break;
690-
msleep(1);
690+
msleep(OPAL_BUSY_DELAY_MS);
691691
}
692692
return rc ? -EIO : 0;
693693
}
@@ -701,7 +701,7 @@ int xive_native_disable_vp(u32 vp_id)
701701
rc = opal_xive_set_vp_info(vp_id, 0, 0);
702702
if (rc != OPAL_BUSY)
703703
break;
704-
msleep(1);
704+
msleep(OPAL_BUSY_DELAY_MS);
705705
}
706706
return rc ? -EIO : 0;
707707
}

0 commit comments

Comments
 (0)