Re: [Bug #13306] hibernate slow on _second_ run

Rafael J. Wysocki
2009-06-03T09:16:04Z

On Wednesday 03 June 2009, Johannes Berg wrote:
> On Mon, 2009-06-01 at 22:48 +0200, Rafael J. Wysocki wrote:
> > > No, it's now hanging 20 seconds much later, after returning to
> > > userspace :( But the dmesg log still has a hang of ~20.5 seconds just
> > > like before, between two kernel messages...
> >
> > Hmm. Can you try to comment out suspend_device_irqs() and resume_device_irqs()
> > in drivers/base/power/main.c and see what happens?
>
> Oddly, that does seem to help. I'm sure it can't be a solution though :)

Not really. ;-)

Still, something like the (untested) patch below can be. Can you please give
it a try?

Rafael

---
kernel/irq/manage.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

Index: linux-2.6/kernel/irq/manage.c
===================================================================
--- linux-2.6.orig/kernel/irq/manage.c
+++ linux-2.6/kernel/irq/manage.c
@@ -187,9 +187,9 @@ static inline int setup_affinity(unsigne
void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
{
if (suspend) {
- if (!desc->action || (desc->action->flags & IRQF_TIMER))
- return;
- desc->status |= IRQ_SUSPENDED;
+ if (desc->action && !(desc->action->flags & IRQF_TIMER))
+ desc->status |= IRQ_SUSPENDED | IRQ_DISABLED;
+ return;
}

if (!desc->depth++) {
@@ -250,8 +250,12 @@ EXPORT_SYMBOL(disable_irq);

void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume)
{
- if (resume)
+ if (resume) {
desc->status &= ~IRQ_SUSPENDED;
+ if (!desc->depth)
+ desc->status &= ~IRQ_DISABLED;
+ return;
+ }

switch (desc->depth) {
case 0: