Re: [PATCH 1/2] power: bq24190_charger: Check the interrupt status on resume

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

 



Hi,

On Sat, Jan 21, 2017 at 12:08:02AM -0800, Liam Breck wrote:
> > +static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
> > +{
> > +       struct bq24190_dev_info *bdi = data;
> > +
> > +       bdi->irq_event = true;
> > +       pm_runtime_get_sync(bdi->dev);
> 
> Do we need to call pm_runtime_irq_safe() prior to the above?

It's not needed here, since the irq handler does not run in
irq context (it's a threaded irq handler).

Btw. calling pm_runtime_irq_safe() basically means, that your
driver's power-management is broken:

http://lxr.free-electrons.com/source/drivers/base/power/runtime.c#L1288

(The relevant part is: »It also causes the parent's usage counter to
be permanently incremented«)

> > +       bq24190_check_status(bdi);
> > +       pm_runtime_put_sync(bdi->dev);
> > +       bdi->irq_event = false;
> >
> >         return IRQ_HANDLED;
> >  }

-- Sebastian

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux