Message ID | 381813296.167766.9867e3e7-5710-4844-a098-6f44bd852a6d.open-xchange@email.1und1.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 06/11/2016 11:20, Stefan Wahren wrote: > Hi, > >> Russell King - ARM Linux <linux@armlinux.org.uk> hat am 5. November 2016 um >> 19:05 geschrieben: >> >> >> On Sat, Nov 05, 2016 at 04:28:37PM +0100, Stefan Wahren wrote: >>> As i wrote in my email before, i added a pr_info() into freeze_wake. >>> But i never see the output of this message. So i assume freeze_wake >>> is never called. Again, how could this happen? >> >> Hmm, so the bit that you're getting stuck on is: >> >> wait_event(suspend_freeze_wait_head, >> suspend_freeze_state == FREEZE_STATE_WAKE); >> > > thanks for all the feedback. The real cause for this issue is in the irqchip > driver. I fixed it with this patch: Mind to give some details ? > diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c > index 1730470..05fa9f7 100644 > --- a/drivers/irqchip/irq-mxs.c > +++ b/drivers/irqchip/irq-mxs.c > @@ -131,12 +131,16 @@ static void asm9260_unmask_irq(struct irq_data *d) > .irq_ack = icoll_ack_irq, > .irq_mask = icoll_mask_irq, > .irq_unmask = icoll_unmask_irq, > + .flags = IRQCHIP_MASK_ON_SUSPEND | > + IRQCHIP_SKIP_SET_WAKE, > }; > > static struct irq_chip asm9260_icoll_chip = { > .irq_ack = icoll_ack_irq, > .irq_mask = asm9260_mask_irq, > .irq_unmask = asm9260_unmask_irq, > + .flags = IRQCHIP_MASK_ON_SUSPEND | > + IRQCHIP_SKIP_SET_WAKE, > }; > > asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs) >
> Daniel Lezcano <daniel.lezcano@linaro.org> hat am 6. November 2016 um 15:55 > geschrieben: > > > On 06/11/2016 11:20, Stefan Wahren wrote: > > Hi, > > > >> Russell King - ARM Linux <linux@armlinux.org.uk> hat am 5. November 2016 um > >> 19:05 geschrieben: > >> > >> > >> On Sat, Nov 05, 2016 at 04:28:37PM +0100, Stefan Wahren wrote: > >>> As i wrote in my email before, i added a pr_info() into freeze_wake. > >>> But i never see the output of this message. So i assume freeze_wake > >>> is never called. Again, how could this happen? > >> > >> Hmm, so the bit that you're getting stuck on is: > >> > >> wait_event(suspend_freeze_wait_head, > >> suspend_freeze_state == FREEZE_STATE_WAKE); > >> > > > > thanks for all the feedback. The real cause for this issue is in the irqchip > > driver. I fixed it with this patch: > > Mind to give some details ? > No. AFAIK the serial_core already handles the suspend to idle. But it requires that enable_irq_wake for the UART IRQ succeed. Unfortunately the irq-mxs (like a couple of other irqchip drivers) neither implemented set_irq_wake or set IRQCHIP_SKIP_SET_WAKE so enable_irq_wake will fail with -ENXIO and the UART won't be setup as wakeup source. As the mxs interrupt controller doesn't provide any facility to setup wakeup source i choose to use IRQCHIP_SKIP_SET_WAKE. Instead of failing silently it would be better if sysfs won't allow to enable wakeup source in this case or at least the serial core should complains about it.
diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c index 1730470..05fa9f7 100644 --- a/drivers/irqchip/irq-mxs.c +++ b/drivers/irqchip/irq-mxs.c @@ -131,12 +131,16 @@ static void asm9260_unmask_irq(struct irq_data *d) .irq_ack = icoll_ack_irq, .irq_mask = icoll_mask_irq, .irq_unmask = icoll_unmask_irq, + .flags = IRQCHIP_MASK_ON_SUSPEND | + IRQCHIP_SKIP_SET_WAKE, }; static struct irq_chip asm9260_icoll_chip = { .irq_ack = icoll_ack_irq, .irq_mask = asm9260_mask_irq, .irq_unmask = asm9260_unmask_irq, + .flags = IRQCHIP_MASK_ON_SUSPEND | + IRQCHIP_SKIP_SET_WAKE, }; asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)