diff mbox

cmd64x: irq 14: nobody cared - system is dreadfully slow

Message ID 200906221321.44672.bzolnier@gmail.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Bartlomiej Zolnierkiewicz June 22, 2009, 11:21 a.m. UTC
On Monday 22 June 2009 08:43:13 Frans Pop wrote:
> On Monday 22 June 2009, David Miller wrote:
> > Some things other than the commit in question have changed in the area
> > of interrupt and chip initialization and I'll try to go through
> > the commits to get some clues.
> 
> Great.
> 
> JFTR, here's the full output of your debug print. All 32 prints are
> identical and the "nobody cared" is printed immediately after.
> No really new info I guess...

Frans, here is a draft fix (sorry for not being able to finish it yesterday
so we could potentially close the issue within 24h of the initial report).

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: fix handling of unexpected IRQs vs request_irq()

Add ide_host_enable_irqs() helper and use it in ide_host_register()
before registering ports.  Then remove no longer needed IRQ unmasking
from in init_irq().

This should fix the problem with "screaming" shared IRQ on the first
port (after request_irq() call while we have the unexpected IRQ pending
on the second port) which was uncovered by my rework of the serialized
interfaces support.

Cc: David Miller <davem@davemloft.net>
Reported-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
David, if it doesn't work I think that the next thing to look into is
the change of nIEN setting itself (some devices are just buggy and may
generate spurious IRQs on such operation).

Alternatively you can fix the issue quickly be extending the coverage of
the recently added IDE_PFLAG_PROBING port flag and testing for the flag
inside ide_intr().

 drivers/ide/ide-probe.c |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

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

Comments

Frans Pop June 22, 2009, 2:04 p.m. UTC | #1
On Monday 22 June 2009, you wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] ide: fix handling of unexpected IRQs vs request_irq()
>
> Add ide_host_enable_irqs() helper and use it in ide_host_register()
> before registering ports.  Then remove no longer needed IRQ unmasking
> from in init_irq().
>
> This should fix the problem with "screaming" shared IRQ on the first
> port (after request_irq() call while we have the unexpected IRQ pending
> on the second port) which was uncovered by my rework of the serialized
> interfaces support.

Thanks Bart. This does solve the "nobody cared" problem.
Tested-by: Frans Pop <elendil@planet.nl>

I also tested it without David's initial patch (i.e. *with* 
IDE_HFLAG_SERIALIZE in host-flags) and that seems to work fine too:
ide0 at 0x1fe02c00000-0x1fe02c00007,0x1fe02c0000a on irq 14 (serialized)
ide1 at 0x1fe02c00010-0x1fe02c00017,0x1fe02c0001a on irq 14 (serialized)

No idea whether serialized is to be preferred or not. Guess that's David's 
call now.


I do still get the "bad DMA info in identify block" error for the CD 
drive, so that's still a regression relative to 2.6.26:
 hdd: host max PIO5 wanted PIO255(auto-tune) selected PIO4
-hdd: MWDMA2 mode selected
+hdd: bad DMA info in identify block
+hdd: host max PIO5 wanted PIO255(auto-tune) selected PIO4

Cheers,
FJP
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller June 23, 2009, 10:43 a.m. UTC | #2
From: Frans Pop <elendil@planet.nl>
Date: Mon, 22 Jun 2009 16:04:15 +0200

> On Monday 22 June 2009, you wrote:
>> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>> Subject: [PATCH] ide: fix handling of unexpected IRQs vs request_irq()
>>
>> Add ide_host_enable_irqs() helper and use it in ide_host_register()
>> before registering ports.  Then remove no longer needed IRQ unmasking
>> from in init_irq().
>>
>> This should fix the problem with "screaming" shared IRQ on the first
>> port (after request_irq() call while we have the unexpected IRQ pending
>> on the second port) which was uncovered by my rework of the serialized
>> interfaces support.
> 
> Thanks Bart. This does solve the "nobody cared" problem.
> Tested-by: Frans Pop <elendil@planet.nl>

I've applied this patch to my tree, thanks everyone!
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Frans Pop July 31, 2009, 2:08 p.m. UTC | #3
On Tuesday 23 June 2009, David Miller wrote:
> From: Frans Pop <elendil@planet.nl> Date: Mon, 22 Jun 2009:
> > On Monday 22 June 2009, you wrote:
> >> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> >> Subject: [PATCH] ide: fix handling of unexpected IRQs vs
> >> request_irq()
> >>
> > Thanks Bart. This does solve the "nobody cared" problem.
> > Tested-by: Frans Pop <elendil@planet.nl>
>
> I've applied this patch to my tree, thanks everyone!

Please consider the following two patches for the next stable update:

commit ffc36c7610731115c77700dcc53901920361c235
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
ide: fix handling of unexpected IRQs vs request_irq()

commit 346c17a6cf60375323adfaa4b8a9d841049f890e
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
ide: relax DMA info validity checking

The current 2.6.30 Debian kernel (based on .30.3) is still failing on my
Sparc Ultra 10 because those patches are missing.

TIA,
FJP
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Aug. 1, 2009, 5:46 a.m. UTC | #4
From: Frans Pop <elendil@planet.nl>
Date: Fri, 31 Jul 2009 16:08:59 +0200

> On Tuesday 23 June 2009, David Miller wrote:
>> From: Frans Pop <elendil@planet.nl> Date: Mon, 22 Jun 2009:
>> > On Monday 22 June 2009, you wrote:
>> >> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>> >> Subject: [PATCH] ide: fix handling of unexpected IRQs vs
>> >> request_irq()
>> >>
>> > Thanks Bart. This does solve the "nobody cared" problem.
>> > Tested-by: Frans Pop <elendil@planet.nl>
>>
>> I've applied this patch to my tree, thanks everyone!
> 
> Please consider the following two patches for the next stable update:
> 
> commit ffc36c7610731115c77700dcc53901920361c235
> Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ide: fix handling of unexpected IRQs vs request_irq()
> 
> commit 346c17a6cf60375323adfaa4b8a9d841049f890e
> Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ide: relax DMA info validity checking
> 
> The current 2.6.30 Debian kernel (based on .30.3) is still failing on my
> Sparc Ultra 10 because those patches are missing.

Agreed, these should be applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH Aug. 5, 2009, 8:43 p.m. UTC | #5
On Fri, Jul 31, 2009 at 04:08:59PM +0200, Frans Pop wrote:
> On Tuesday 23 June 2009, David Miller wrote:
> > From: Frans Pop <elendil@planet.nl> Date: Mon, 22 Jun 2009:
> > > On Monday 22 June 2009, you wrote:
> > >> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > >> Subject: [PATCH] ide: fix handling of unexpected IRQs vs
> > >> request_irq()
> > >>
> > > Thanks Bart. This does solve the "nobody cared" problem.
> > > Tested-by: Frans Pop <elendil@planet.nl>
> >
> > I've applied this patch to my tree, thanks everyone!
> 
> Please consider the following two patches for the next stable update:
> 
> commit ffc36c7610731115c77700dcc53901920361c235
> Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ide: fix handling of unexpected IRQs vs request_irq()
> 
> commit 346c17a6cf60375323adfaa4b8a9d841049f890e
> Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ide: relax DMA info validity checking
> 
> The current 2.6.30 Debian kernel (based on .30.3) is still failing on my
> Sparc Ultra 10 because those patches are missing.

I have queued both of these up now for the next .30-stable release.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -818,6 +818,24 @@  static int ide_port_setup_devices(ide_hw
 	return j;
 }
 
+static void ide_host_enable_irqs(struct ide_host *host)
+{
+	ide_hwif_t *hwif;
+	int i;
+
+	ide_host_for_each_port(i, hwif, host) {
+		if (hwif == NULL)
+			continue;
+
+		/* clear any pending IRQs */
+		hwif->tp_ops->read_status(hwif);
+
+		/* unmask IRQs */
+		if (hwif->io_ports.ctl_addr)
+			hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
+	}
+}
+
 /*
  * This routine sets up the IRQ for an IDE interface.
  */
@@ -831,9 +849,6 @@  static int init_irq (ide_hwif_t *hwif)
 	if (irq_handler == NULL)
 		irq_handler = ide_intr;
 
-	if (io_ports->ctl_addr)
-		hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
-
 	if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
 		goto out_up;
 
@@ -1404,6 +1419,8 @@  int ide_host_register(struct ide_host *h
 			ide_port_tune_devices(hwif);
 	}
 
+	ide_host_enable_irqs(host);
+
 	ide_host_for_each_port(i, hwif, host) {
 		if (hwif == NULL)
 			continue;