Re: [PATCH v2 2/2] spi: pic32-sqi: add SPI driver for PIC32 SQI controller.

From: Mark Brown
Date: Fri Apr 15 2016 - 05:35:51 EST


On Fri, Apr 15, 2016 at 11:59:55AM +0530, Purna Chandra Mandal wrote:
> On 04/14/2016 11:25 AM, Mark Brown wrote:
> > On Wed, Apr 13, 2016 at 06:52:58PM +0530, Purna Chandra Mandal wrote:

> >> + enable = readl(sqi->regs + PESQI_INT_ENABLE_REG);
> >> + status = readl(sqi->regs + PESQI_INT_STAT_REG);
> >> + if (!status)
> >> + return IRQ_NONE;

> > For robustness the check should be if there was anything handled, not if
> > there was anything set.

> In PESQI controller INT_STAT_REG specifies interrupting reason(s) as usual,
> but mostly to confirm completion of on-going DMA operation. It is sticky,
> no way to acknowledge the interrupt source except masking the source.
> In short, whole interrupt logic is mere extension of status polling logic.

> And in driver isr logic is completely depended on the INT_STAT_REG; if status
> is zero no handling can be done and is unexpected!

That's fine, if something goes wrong there's error handling in genirq
which will notice that the interrupt is screaming and disable it.

Attachment: signature.asc
Description: PGP signature