mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Kevin Hilman <khilman@deeprootsystems.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] genirq: do not disable IRQ_WAKEUP marked irqs on suspend
Date: Fri, 12 Jun 2009 21:52:46 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0906122039420.2800@localhost.localdomain> (raw)
In-Reply-To: <87hbylb8u3.fsf@deeprootsystems.com>

On Fri, 12 Jun 2009, Kevin Hilman wrote:
>   http://lkml.org/lkml/2009/5/4/448
> 
> Only difference is I did the checking outside of the lock, which is
> probably wrong.  In any case, you'll be interested in the thread that
> follows.

Hmm, darn. That means that on hardware which has trouble with the
delayed disable and therefor uses it's own chip->disable_irq() method
the suspend logic is wreckaged.

But there is always a way to get broken hardware tamed. :)

suspend does:
	__disable_irq();
		status |= IRQ_SUSPENDED;
		chip->disable_irq();

resume does:
       __enable_irq();
		status &= ~IRQ_SUSPENDED;
		chip->enable_irq();

So

-      set_irq_handler(handle_level_irq);
+      set_irq_handler(my_own_handler);

+my_own_handler()
+{
+	if (!(status & IRQ_SUSPENDED)) {
+	       handle_level_irq();
+	} else {
+	       mask_at_hardware_level();
+	       status |= IRQ_PENDING;
+	       save_important_information();
+	} 
+}

my_disable_irq()
{
+	if (!(status & IRQ_SUSPENDED))
	       mask_at_hardware_level();
}

my_enable_irq()
{
+	if (important_information_has_been_saved)
+	       replay_what_happened();
+
        unmask_at_hardware_level();
}

Ugly, but that might work somehow. Not sure about the replay part, but
that can be deferred via some more hackery as well :)

Raphael, these delayed disable and the chip->irq_disable() override
implications vs. suspend really need to be documented. The current
comment of suspend_device_irqs() is bogus:

 * During system-wide suspend or hibernation device interrupts need to be
 * disabled at the chip level and this function is provided for this purpose.
   ^^^^^^^^^^^^^^^^^^^^^^^^^^

Thanks,

	tglx

  reply	other threads:[~2009-06-12 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cMiA9-1MZ-13@gated-at.bofh.it>
2009-06-12 17:56 ` Kevin Hilman
2009-06-12 18:09   ` Thomas Gleixner
2009-06-12 18:33     ` Kevin Hilman
2009-06-12 19:52       ` Thomas Gleixner [this message]
2009-06-22 21:27         ` Andrew Morton
2009-06-22 22:56           ` Rafael J. Wysocki
2009-06-22 22:54         ` Rafael J. Wysocki
2009-06-12 17:09 Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0906122039420.2800@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®