[PATCH] iio: xilinx-ams: Unmask interrupts after updating alarms

Michal Simek michal.simek at amd.com
Thu Jul 24 21:47:16 PDT 2025



On 7/24/25 17:32, Jonathan Cameron wrote:
> On Mon, 14 Jul 2025 20:28:47 -0400
> Sean Anderson <sean.anderson at linux.dev> wrote:
> 
>> To convert level-triggered alarms into edge-triggered IIO events, alarms
>> are masked when they are triggered. To ensure we catch subsequent
>> alarms, we then periodically poll to see if the alarm is still active.
>> If it isn't, we unmask it. Active but masked alarms are stored in
>> current_masked_alarm.
>>
>> If an active alarm is disabled, it will remain set in
>> current_masked_alarm until ams_unmask_worker clears it. If the alarm is
>> re-enabled before ams_unmask_worker runs, then it will never be cleared
>> from current_masked_alarm. This will prevent the alarm event from being
>> pushed even if the alarm is still active.
>>
>> Fix this by recalculating current_masked_alarm immediately when enabling
>> or disabling alarms.
>>
>> Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
>> Signed-off-by: Sean Anderson <sean.anderson at linux.dev>
>> ---
> Anand?
> 
> This seems fine to me, but I'm not that familiar with the hardware or driver.

Anand left some time ago. Salih or Conall should be able to provide some input.

Thanks,
Michal



More information about the linux-arm-kernel mailing list