Re: [PATCH v1 1/1] serial: 8250_port: properly handle runtime PM in IRQ

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

 



On 2016-11-07 15:48:50 [+0200], Andy Shevchenko wrote:
> On Thu, 2016-11-03 at 17:29 +0100, Sebastian Andrzej Siewior wrote:
> > On 2016-11-03 18:14:23 [+0200], Andy Shevchenko wrote:
> > > We can't and basically don't need to call runtime PM in IRQ handler.
> > > If IRQ is
> > > ours, device must be powered on. Otherwise check if the device is
> > > powered off
> > > and return immediately.
> > 
> > The old beagle board does PM put once it does not use the UART anymore
> > /
> > the UART is idle.
> 
> And how can it generate interrupts?

It has this
	priv->wakeirq = irq_of_parse_and_map(pdev->dev.of_node, 1);
line in the driver. I *think* it is a different interrupt (same source
but different PM setup and thus different number) and the driver needs
to be invoked in order to ACK it.

> > You need to PM get the device even if the device is not yet suspended
> > because it might get suspended in the middle of your operation (maybe
> > not while you serve the IRQ but we have threaded interrupts). 
> 
> I grepped code and found no driver under 8250 which is using threaded
> IRQ handler. What did I miss?

Documentation/kernel-parameters.txt:    threadirqs      [KNL]

> > If the HW is off then it will be woken by an RX interrupt and I think
> > it
> > is a different one (I remember Tony wanted to rework that part so that
> > the device/UART does not need to care about that).
> 
> Rx interrupt from other device?
> 
> Or OMAP UART has inbound wake source?

See above. It is the "priv->wakeirq" thing.
It is a wake source which is the RX pin setup differently (my memory
here). Tony wanted to change PM code in regard to this as he wasn't too
happy about it, too.


> > This should work in general but I think that is racy with threaded
> > interrupts: What stops the PM core to shutdown the HW before
> > serial_port_in() ?
> 
> Basically what I understand from this the question is: "Is
> pm_runtime_suspended() synchronous with regard to
> pm_runtime_get()/pm_runtime_suspend()?".

I guess so.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux