All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: linux1394-devel@lists.sourceforge.net,
	Stefan Richter <stefanr@s5r6.in-berlin.de>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [patch] ohci1394: don't leave interrupts enabled during suspend/resume
Date: Sat, 6 Dec 2008 15:36:47 +0100	[thread overview]
Message-ID: <200812061536.47894.elendil@planet.nl> (raw)
In-Reply-To: <200812061316.38460.elendil@planet.nl>

On my HP 2510p I get the following in dmesg during near the end of most
resumes from suspend to RAM:

irq 19: nobody cared (try booting with the "irqpoll" option)
Pid: 0, comm: swapper Not tainted 2.6.28-rc7 #67
Call Trace:
 <IRQ>  [<ffffffffa00ee9e1>] ? ohci_irq_handler+0x60/0x7e9 [ohci1394]
 [<ffffffff8026aa4d>] __report_bad_irq+0x38/0x87
 [<ffffffff8026abaa>] note_interrupt+0x10e/0x174
 [<ffffffff8026b262>] handle_fasteoi_irq+0xa7/0xd1
 [<ffffffff8020eb87>] do_IRQ+0x73/0xe4
 [<ffffffff8020c626>] ret_from_intr+0x0/0xa
 <EOI>  [<ffffffffa0012606>] ? acpi_idle_enter_bm+0x26b/0x2b2 [processor]
 [<ffffffffa00125fc>] ? acpi_idle_enter_bm+0x261/0x2b2 [processor]
 [<ffffffff8024f30f>] ? notifier_call_chain+0x33/0x5b
 [<ffffffff803b9c64>] ? cpuidle_idle_call+0x8c/0xc4
 [<ffffffff8020b312>] ? cpu_idle+0x4a/0x9a
 [<ffffffff8042c5c8>] ? rest_init+0x5c/0x5e
handlers:
[<ffffffffa00ee981>] (ohci_irq_handler+0x0/0x7e9 [ohci1394])
Disabling IRQ #19

There also seems to be an interrupt storm during suspend/resume when this
happens:
 19:      99968         33   IO-APIC-fasteoi   ohci1394

This patch gets rid of both issues and makes the resume as a whole
significantly faster.

Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>

---
New try and this actually _does_ seem to both make sense and work.

I've verified that the interrupt storm really only happens during the
suspend/resume process and not at other times.

I don't actually use firewire, so I cannot test anything other than
checking dmesg and seeing that there are no changes. With the patch
I do see a very slow increase of the interrupt count, so the device
seems active.

Please review the patch carefully, especially the error handling.
The patch is essentially only copy-and-paste work, with checks against
other drivers and the ohci1394_pci_probe function.

diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index e509e13..d2942e6 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -3381,6 +3381,7 @@ static int ohci1394_pci_suspend(struct pci_dev *dev, pm_message_t state)
 	ohci_devctl(ohci->host, RESET_BUS, LONG_RESET_NO_FORCE_ROOT);
 	ohci_soft_reset(ohci);
 
+	free_irq(dev->irq, ohci);
 	err = pci_save_state(dev);
 	if (err) {
 		PRINT(KERN_ERR, "pci_save_state failed with %d", err);
@@ -3421,6 +3422,13 @@ static int ohci1394_pci_resume(struct pci_dev *dev)
 	reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff);
 	reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff);
 	mdelay(50);
+
+	if (request_irq(dev->irq, ohci_irq_handler, IRQF_SHARED,
+			OHCI1394_DRIVER_NAME, ohci)) {
+		PRINT_G(KERN_ERR, "Failed to allocate interrupt %d", dev->irq);
+		return -EIO;
+        }
+
 	ohci_initialize(ohci);
 
 	hpsb_resume_host(ohci->host);

  parent reply	other threads:[~2008-12-06 14:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-06 12:16 ohci1394: "irq 19: nobody cared" during resume from suspend to ram Frans Pop
2008-12-06 13:11 ` Stefan Richter
2008-12-06 13:37   ` Frans Pop
2008-12-06 14:36 ` Frans Pop [this message]
2008-12-06 16:12   ` [patch] ohci1394: don't leave interrupts enabled during suspend/resume Stefan Richter
2008-12-06 21:03   ` Robert Hancock
     [not found]     ` <tkrat.fd592eed61e41b8f@s5r6.in-berlin.de>
2008-12-07  3:28       ` Robert Hancock
2008-12-07  9:19         ` Stefan Richter
2008-12-07 18:57           ` Robert Hancock
2008-12-10 13:24             ` Frans Pop
2008-12-10 20:55               ` Stefan Richter
2008-12-10 21:46                 ` Frans Pop
2008-12-10 22:25                   ` Stefan Richter
2008-12-11 16:02                     ` Frans Pop
2008-12-10 13:23           ` Frans Pop

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=200812061536.47894.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=rjw@sisk.pl \
    --cc=stefanr@s5r6.in-berlin.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.