Re: [patch V2a 35/45] genirq/manage: Rework irq_set_irq_wake()

Jon Hunter
2025-05-13T17:32:59Z

Hi Thomas,

On 30/04/2025 13:48, Thomas Gleixner wrote:
> Use the new guards to get and lock the interrupt descriptor and tidy up the
> code.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> V2a: Fix the return value for the on/off paths - Jiry
> ---
> kernel/irq/manage.c | 65 ++++++++++++++++++++++++----------------------------
> 1 file changed, 30 insertions(+), 35 deletions(-)
>
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -846,45 +846,40 @@ static int set_irq_wake_real(unsigned in
> */
> int irq_set_irq_wake(unsigned int irq, unsigned int on)
> {
> - unsigned long flags;
> - struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
> - int ret = 0;
> + scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_GLOBAL) {

I noticed a suspend regression on some of our Tegra boards and bisect
pointed to this commit. I made the following change and this does appear
to fix it ...

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 2861e11acf3a..c94837382037 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -846,7 +846,7 @@ static int set_irq_wake_real(unsigned int irq,
unsigned int on)
*/
int irq_set_irq_wake(unsigned int irq, unsigned int on)
{
- scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_GLOBAL) {
+ scoped_irqdesc_get_and_buslock(irq, IRQ_GET_DESC_CHECK_GLOBAL) {
struct irq_desc *desc = scoped_irqdesc;
int ret = 0;

Hence, I wanted to ask if this should still be using the buslock scope here?

Thanks!
Jon

--
nvpublic