Re: [PATCH 02/14] platform/x86: add backend for macsmc in intel macs

From: Andy Shevchenko

Date: Fri Dec 04 2026 - 15:24:19 EST


On Fri, Dec 04, 2026 at 02:57:44PM -0500, Atharva Tiwari wrote:

...

> > > + bool has_interrupt;
> >
> > Why? Isn't non-positive value means no interrupt?

> > > + bool interrupt_enabled;
> >
> > Why? Isn't IRQ core provides something for this?
>
> Sorry if i was not clear, but basically
>
> has_interrupt means that there is a interrupt line present in ACPI and
> the driver should write to NTOK key.
>
> interrupt_enabled means that interrupts are enabled (NTOK written successfully)
> and interrupts can be used for reading and writing, thats why when a interrupt
> is missed, the driver sets interrupt_enabled to 0:

Okay, so this is the state of the communication with the remote side.

> + if (smc->interrupt_enabled) {
> + if (wait_for_completion_timeout(&smc->cmd_done,
> + msecs_to_jiffies(SMC_TIMEOUT_MS)) > 0)
> + return 0;
> +
> + smc->interrupt_enabled = 0;
> + dev_dbg(smc->dev, "mmio/wait: interrupt missed, reverting to polling\n");
> + }
>
> interrupt_enabled is not used anywhere else except in the resume code.
>
> I will remove the has_interrupt variable, because you said non-positive irq
> means no interrupt.

This is usual interpretation of a value in IRQ (that's why in many places in
the code it's signed; where it's unsigned 0 means NOIRQ).

--
With Best Regards,
Andy Shevchenko