Patchwork [RFC,3/4] prep: Fix duplicate ISA IDE IRQ

login
register
mail settings
Submitter Andreas Färber
Date Dec. 14, 2010, 12:49 a.m.
Message ID <1292287758-8009-4-git-send-email-andreas.faerber@web.de>
Download mbox | patch
Permalink /patch/75455/
State New
Headers show

Comments

Andreas Färber - Dec. 14, 2010, 12:49 a.m.
Calling isa_ide_init() twice with the same IRQ 13 fails:

qemu: hardware error: isa irq 13 already assigned

Use a different IRQ (14) for the second one to avoid this.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 hw/ppc_prep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Andreas Färber - Dec. 20, 2010, 6:37 a.m.
Am 14.12.2010 um 01:49 schrieb Andreas Färber:

> Calling isa_ide_init() twice with the same IRQ 13 fails:
>
> qemu: hardware error: isa irq 13 already assigned
>
> Use a different IRQ (14) for the second one to avoid this.
>
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> Cc: Alexander Graf <agraf@suse.de>
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>

The implied question behind "RFC" is, has this been a dormant bug in  
ppc_prep.c or would this need to be fixed at ISA level (allowing two  
devices to share the same IRQ) in isa-bus.c where the above error  
message is raised?

Andreas

> ---
> hw/ppc_prep.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
> index 3575dee..3073870 100644
> --- a/hw/ppc_prep.c
> +++ b/hw/ppc_prep.c
> @@ -76,7 +76,7 @@ qemu_log_mask(CPU_LOG_IOPORT, fmt, ## __VA_ARGS__)
> /* Constants for devices init */
> static const int ide_iobase[2] = { 0x1f0, 0x170 };
> static const int ide_iobase2[2] = { 0x3f6, 0x376 };
> -static const int ide_irq[2] = { 13, 13 };
> +static const int ide_irq[2] = { 13, 14 };
Alexander Graf - Dec. 20, 2010, 9:07 a.m.
On 20.12.2010, at 07:37, Andreas Färber wrote:

> Am 14.12.2010 um 01:49 schrieb Andreas Färber:
> 
>> Calling isa_ide_init() twice with the same IRQ 13 fails:
>> 
>> qemu: hardware error: isa irq 13 already assigned
>> 
>> Use a different IRQ (14) for the second one to avoid this.
>> 
>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>> Cc: Alexander Graf <agraf@suse.de>
>> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
> 
> The implied question behind "RFC" is, has this been a dormant bug in ppc_prep.c or would this need to be fixed at ISA level (allowing two devices to share the same IRQ) in isa-bus.c where the above error message is raised?

That depends on the hardware. Usually ISA can't share IRQs. There are some exceptions though, where ISA controllers have some built in magic to enable sharing along identical devices. Not sure which case we're looking at here, but having them separate is certainly the safe choice.


Alex
Aurelien Jarno - Jan. 16, 2011, 11:34 p.m.
On Tue, Dec 14, 2010 at 01:49:17AM +0100, Andreas Färber wrote:
> Calling isa_ide_init() twice with the same IRQ 13 fails:
> 
> qemu: hardware error: isa irq 13 already assigned
> 
> Use a different IRQ (14) for the second one to avoid this.

I am not sure it is actually a good idea. While it fixes the QEMU error,
it breaks the kernel boot which waits for both IDE channels on IRQ 13.
This causes an endless boot, so the machine never finishes to boot:

| ide0 at 0x1f0-0x1f7,0x3f6 on irq 13
| ide1 at 0x170-0x177,0x376 on irq 13 (shared with ide0)
| hda: max request size: 512KiB
| hda: 20971520 sectors (10737 MB) w/256KiB Cache, CHS=16383/255/63
| hda: cache flushes supported
| hda: hda1 hda2
| ide-cd: cmd 0x5a timed out
| hdc: lost interrupt
| ide-cd: cmd 0x5a timed out
| hdc: lost interrupt
| hdc: ATAPI 4X CD-ROM drive, 512kB Cache
| Uniform CD-ROM driver Revision: 3.20
| hdc: lost interrupt
| ide-cd: cmd 0x3 timed out
| hdc: lost interrupt
| ide-cd: cmd 0x3 timed out
| hdc: lost interrupt
| hdc: lost interrupt
| ...

As a temporary workaround it seems better to disable the second IDE
channel, this solution works.

Patch

diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 3575dee..3073870 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -76,7 +76,7 @@  qemu_log_mask(CPU_LOG_IOPORT, fmt, ## __VA_ARGS__)
 /* Constants for devices init */
 static const int ide_iobase[2] = { 0x1f0, 0x170 };
 static const int ide_iobase2[2] = { 0x3f6, 0x376 };
-static const int ide_irq[2] = { 13, 13 };
+static const int ide_irq[2] = { 13, 14 };
 
 #define NE2000_NB_MAX 6