login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
June
»
29
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues with preemptable hardirqs
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Benjamin Herrenschmidt
Subject:
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues with preemptable hardirqs
Date: Sunday, June 29, 2008 - 4:26 pm
On Sat, 2008-06-28 at 04:54 +0400, Anton Vorontsov wrote:
quoted text
> IDE interrupt handler relies on the fact that, if necessary, hardirqs > will re-trigger on ISR exit. The assumption is valid for level sensitive > interrupts. > > But some hardware (namely ULi M5228 in the ULi M1575 "Super South Brige") > behaves in a strange way: it asserts interrupts as edge sensitive. And > because preemptable IRQ handler disables PIC's interrupt, PIC will likely > miss it.
Don't we replay edge IRQs that happen while soft-disabled ? Could be a bug in your PIC code not to do so... Ben.
quoted text
> This patch fixes following issue: > > ALI15X3: IDE controller (0x10b9:0x5229 rev 0xc8) at PCI slot 0001:03:1f.0 > ALI15X3: 100% native mode on irq 18 > ide0: BM-DMA at 0x1120-0x1127, BIOS settings: hda:PIO, hdb:PIO > ide1: BM-DMA at 0x1128-0x112f, BIOS settings: hdc:PIO, hdd:PIO > hda: Optiarc DVD RW AD-7190A, ATAPI CD/DVD-ROM drive > hda: UDMA/66 mode selected > ide0 at 0x1100-0x1107,0x110a on irq 18 > ide-cd: cmd 0x5a timed out > hda: lost interrupt > hda: ATAPI 12X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache > Uniform CD-ROM driver Revision: 3.20 > ide-cd: cmd 0x3 timed out > hda: lost interrupt > ide-cd: cmd 0x3 timed out > hda: lost interrupt > ... > > It would be great to re-configure the ULi bridge or ULi IDE controller > to behave sanely, but no one knows how or if this is possible at all > (no available specifications). > > So.. to workaround the issue IDE interrupt handler should re-check for > any pending IRQs. This isn't bulletproof solution, but it works and this > is the best one we can do. > > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> > --- > > On Wed, Jun 25, 2008 at 04:34:31PM +0400, Anton Vorontsov wrote: > [...] > > The bug, as I see it, in the alim15x3 (ULi M5228) hardware: for some > > reason it does not hold IRQ line, but rises it for some short period > > of time (while the drive itself rises and holds it correctly -- I'm > > seeing it via oscilloscope). > > > > So this scheme does not work: > > mask_irq() > > ...do something that will trigger IDE interrupt... > > unmask_irq() > > > > Because at the unmask_irq() time IDE IRQ is gone already, and interrupt > > controller could not notice it (interrupts are level sensitive). > > > > I did following test: disable RT + insert mask/unmask sequence in the > > IDE IRQ handler, and I got the same behaviour as with RT enabled. > > > > Also, further testing showed that this issue isn't drive-specific, i.e. > > with a delay inserted before the unmask_irq(), the bug shows with any > > drive I have. > > > > So, in summary: I think that the patch is still correct as a hw bug > > workaround (I'll need to correct its comments and description though). > > Here is updated patch. > > drivers/ide/ide-io.c | 20 ++++++++++++++++---- > 1 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c > index 6c1b288..19d36f0 100644 > --- a/drivers/ide/ide-io.c > +++ b/drivers/ide/ide-io.c > @@ -1460,6 +1460,7 @@ static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup) > > irqreturn_t ide_intr (int irq, void *dev_id) > { > + irqreturn_t ret = IRQ_NONE; > unsigned long flags; > ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id; > ide_hwif_t *hwif; > @@ -1467,12 +1468,13 @@ irqreturn_t ide_intr (int irq, void *dev_id) > ide_handler_t *handler; > ide_startstop_t startstop; > > +again: > spin_lock_irqsave(&ide_lock, flags); > hwif = hwgroup->hwif; > > if (!ide_ack_intr(hwif)) { > spin_unlock_irqrestore(&ide_lock, flags); > - return IRQ_NONE; > + return ret; > } > > if ((handler = hwgroup->handler) == NULL || hwgroup->polling) { > @@ -1510,7 +1512,7 @@ irqreturn_t ide_intr (int irq, void *dev_id) > #endif /* CONFIG_BLK_DEV_IDEPCI */ > } > spin_unlock_irqrestore(&ide_lock, flags); > - return IRQ_NONE; > + return ret; > } > drive = hwgroup->drive; > if (!drive) { > @@ -1532,7 +1534,7 @@ irqreturn_t ide_intr (int irq, void *dev_id) > * enough advance overhead that the latter isn't a problem. > */ > spin_unlock_irqrestore(&ide_lock, flags); > - return IRQ_NONE; > + return ret; > } > if (!hwgroup->busy) { > hwgroup->busy = 1; /* paranoia */ > @@ -1578,7 +1580,17 @@ irqreturn_t ide_intr (int irq, void *dev_id) > } > } > spin_unlock_irqrestore(&ide_lock, flags); > - return IRQ_HANDLED; > + ret = IRQ_HANDLED; > + > + /* > + * Previous handler() may have set things up for another interrupt to > + * occur soon... with hardirqs preemption we may lose it because of > + * buggy hardware that asserts edge-sensitive IRQs, so try again and > + * then return gracefully if no IRQs were actually pending. > + */ > + if (hardirq_preemption && startstop != ide_stopped) > + goto again; > + return ret; > } > > /**
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH -rt] ide: fix interrupts processing issue with pree ...
, Anton Vorontsov
, (Mon Jun 23, 4:40 pm)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Ingo Molnar
, (Mon Jun 23, 4:51 pm)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Anton Vorontsov
, (Mon Jun 23, 4:52 pm)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Anton Vorontsov
, (Mon Jun 23, 5:00 pm)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Alan Cox
, (Wed Jun 25, 5:32 am)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Anton Vorontsov
, (Wed Jun 25, 5:34 am)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Sergei Shtylyov
, (Wed Jun 25, 6:15 am)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Anton Vorontsov
, (Wed Jun 25, 7:12 am)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Anton Vorontsov
, (Wed Jun 25, 7:22 am)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Alan Cox
, (Wed Jun 25, 7:32 am)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Anton Vorontsov
, (Wed Jun 25, 7:59 am)
Re: [PATCH -rt] ide: fix interrupts processing issue with ...
, Anton Vorontsov
, (Wed Jun 25, 8:26 am)
[PATCH v2 -rt] ide: workaround buggy hardware issues with ...
, Anton Vorontsov
, (Fri Jun 27, 5:54 pm)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Anton Vorontsov
, (Fri Jun 27, 6:09 pm)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Alan Cox
, (Sat Jun 28, 2:14 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Alan Cox
, (Sat Jun 28, 2:15 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Sergei Shtylyov
, (Sat Jun 28, 3:30 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Sergei Shtylyov
, (Sat Jun 28, 3:43 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Anton Vorontsov
, (Sat Jun 28, 4:31 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Sergei Shtylyov
, (Sat Jun 28, 4:52 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Alan Cox
, (Sun Jun 29, 5:49 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Sergei Shtylyov
, (Sun Jun 29, 6:17 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Anton Vorontsov
, (Sun Jun 29, 7:23 am)
Re: [PATCH v2 -rt] ide: workaround buggy hardware issues w ...
, Benjamin Herrenschmidt
, (Sun Jun 29, 4:26 pm)
[RT] MPIC edge sensitive issues with hardirq preemption (w ...
, Anton Vorontsov
, (Mon Jun 30, 12:01 pm)
Re: [RT] MPIC edge sensitive issues with hardirq preemptio ...
, Benjamin Herrenschmidt
, (Mon Jun 30, 2:59 pm)
Re: [RT] MPIC edge sensitive issues with hardirq preemptio ...
, Anton Vorontsov
, (Mon Jun 30, 3:37 pm)
Re: [RT] MPIC edge sensitive issues with hardirq preemption
, Sergei Shtylyov
, (Tue Jul 1, 3:41 am)
Re: [RT] MPIC edge sensitive issues with hardirq preemption
, Anton Vorontsov
, (Tue Jul 1, 4:34 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Francis Moreau
Re: Disk geometry from /sys
Rafael J. Wysocki
[Bug #11407] suspend: unable to handle kernel paging request
Christoph Lameter
Re: [bug] SLUB + mm/slab.c boot crash in -rc9
Jeremy Fitzhardinge
Re: [2.6.25] compat VDSO option not disabling
Rafael J. Wysocki
[Bug #11551] Semi-repeatable hard lockup on 2.6.27-rc6
git
:
Pat Thoyts
[PATCH] git-gui: use themed tk widgets with Tk 8.5
Tait
Re: [PATCH] Replace hard-coded path with one from <paths.h>
Frans Pop
'git gc --aggressive' effectively unusable
Stephan Beyer
Re: git sequencer prototype
Lynn Lin
Re: clearcase migration to git
linux-netdev
:
William Allen Simpson
[net-next-2.6 PATCH v8 0/7] TCPCT part 1: cookie option exchange
Eric Dumazet
Re: [PATCH net-next-2.6] net: Introduce skb_orphan_try()
David Miller
Re: [PATCH] IPv6: preferred lifetime of address not getting updated
Eric Dumazet
Re: [PATCH net-next-2.6] net: Introduce skb_orphan_try()
Mark McLoughlin
Re: [PATCH 2/3] virtio: fix delayed xmit of packet and freeing of old packets.
git-commits-head
:
Linux Kernel Mailing List
.gitignore: ignore *.lzo files
Linux Kernel Mailing List
init: Open /dev/console from rootfs
Linux Kernel Mailing List
imxfb: Fix margin settings
Linux Kernel Mailing List
udp: fix for unicast RX path optimization
Linux Kernel Mailing List
V4L/DVB (10826): cx88: Add IR support to pcHDTV HD3000 & HD5500
openbsd-misc
:
Robert
disklabel - cylinder rounding
nixlists
Re: Which laptops do the developers use?
admin
Drive a 2009 car from R799p/m
L. V. Lammert
OT, .. but has anyone seen a crontab editor
Darrin Chandler
Re: That whole "Linux stealing our code" thing
Colocation donated by:
Syndicate