Re: [PATCH 07/11] i2c: designware: Do not process interrupt when device is suspended

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 26, 2022 at 04:28:59PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 26, 2022 at 03:39:08PM +0300, Jarkko Nikula wrote:
> > Do not return with interrupt handled if host controller is off and thus
> > interrupt is originating from other device or is spurious.
> > 
> > Add a check to detect when controller is runtime suspended or
> > transitioning/reset. In latter case all raw interrupt status register
> > bits may read one. In both cases return IRQ_NONE to indicate interrupt
> > was not from this device.

...

> >  	dev_dbg(dev->dev, "enabled=%#x stat=%#x\n", enabled, stat);
> >  	if (!enabled || !(stat & ~DW_IC_INTR_ACTIVITY))
> >  		return IRQ_NONE;
> > +	if (pm_runtime_suspended(dev->dev) || stat == ~0)
> > +		return IRQ_NONE;
> 
> I haven't checked the type of 'stat', but usually be careful with ~0.
> Due to integer promotion it may give the unexpected results.

That said, GENMASK(hi, 0) in this case is better.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux