linuxppc / issues

Issues repository for linuxppc
5 stars 0 forks source link

Review OPAL_BUSY / OPAL_BUSY_EVENT / opal_poll_events loops #135

Open npiggin opened 6 years ago

npiggin commented 6 years ago

We have a number of loops that call an opal function and loop on busy. There are lots of variations of these loops, for no apparent reason. Some sleep between polls, some delay, some have no delay, some sleep only for OPAL_BUSY, some only for OPAL_BUSY_EVENT, etc.

These should be reviewed and changed to all the same form, only with variations necessary to calling context (e.g., sleep vs delay), and any particular requirements from specific opal calls. Sleeping is preferable, if that can't be done (e.g., due to holding a spinlock), then a delay may still be preferable to a busy loop because OPAL runs with interrupts hard disabled.

mpe commented 6 years ago

Partially (?) fixed in:

682e6b4da5cb rtc: opal: Fix OPAL RTC driver OPAL_BUSY loops 3b8070335f75 powerpc/powernv: Fix OPAL NVRAM driver OPAL_BUSY loops 34dd25de9fe3 powerpc/powernv: define a standard delay for OPAL_BUSY type retry loops

mpe commented 6 years ago

Still pending:

http://patchwork.ozlabs.org/patch/906728/ http://patchwork.ozlabs.org/patch/906729/