Fixed system lockup in native mode with compat irq 14/15, which can be selected

with the use-compat-native-irq property. It was caused by handling irqs from
both channels at once with the wrong interrupt handler routine
(pciide_pci_intr). Now pciide_compat_intr is installed for each channel.
Also renamed the function to via_pegasos_mapregs_native(), which seems more
appropriate.
This commit is contained in:
phx 2008-06-15 10:29:34 +00:00
parent 9087265ab9
commit 8fcd99cbd6
1 changed files with 9 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: viaide.c,v 1.54 2008/05/14 19:32:18 dholland Exp $ */
/* $NetBSD: viaide.c,v 1.55 2008/06/15 10:29:34 phx Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: viaide.c,v 1.54 2008/05/14 19:32:18 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: viaide.c,v 1.55 2008/06/15 10:29:34 phx Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -46,9 +46,8 @@ static int via_pcib_match(struct pci_attach_args *);
static void via_chip_map(struct pciide_softc *, struct pci_attach_args *);
static void via_mapchan(struct pci_attach_args *, struct pciide_channel *,
pcireg_t, bus_size_t *, bus_size_t *, int (*)(void *));
static void vt8231_mapregs_native(struct pci_attach_args *,
struct pciide_channel *, bus_size_t *, bus_size_t *,
int (*)(void *));
static void via_pegasos_mapregs_native(struct pci_attach_args *,
struct pciide_channel *, bus_size_t *, bus_size_t *);
static int via_sata_chip_map_common(struct pciide_softc *,
struct pci_attach_args *);
static void via_sata_chip_map(struct pciide_softc *,
@ -627,8 +626,7 @@ via_mapchan(struct pci_attach_args *pa, struct pciide_channel *cp,
/* native mode with irq 14/15 requested? */
if (compat_nat_enable != NULL &&
prop_bool_true(compat_nat_enable))
vt8231_mapregs_native(pa, cp, cmdsizep, ctlsizep,
pci_intr);
via_pegasos_mapregs_native(pa, cp, cmdsizep, ctlsizep);
else
pciide_mapregs_native(pa, cp, cmdsizep, ctlsizep,
pci_intr);
@ -648,8 +646,8 @@ via_mapchan(struct pci_attach_args *pa, struct pciide_channel *cp,
* handler for each channel, as in compatibility mode.
*/
static void
vt8231_mapregs_native(struct pci_attach_args *pa, struct pciide_channel *cp,
bus_size_t *cmdsizep, bus_size_t *ctlsizep, int (*pci_intr)(void *))
via_pegasos_mapregs_native(struct pci_attach_args *pa,
struct pciide_channel *cp, bus_size_t *cmdsizep, bus_size_t *ctlsizep)
{
struct ata_channel *wdc_cp;
struct pciide_softc *sc;
@ -663,11 +661,12 @@ vt8231_mapregs_native(struct pci_attach_args *pa, struct pciide_channel *cp,
pciide_mapregs_native(pa, cp, cmdsizep, ctlsizep, NULL);
/* interrupts are fixed to 14/15, as in compatibility mode */
cp->compat = 1;
if ((wdc_cp->ch_flags & ATACH_DISABLED) == 0) {
#ifdef __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
cp->ih = pciide_machdep_compat_intr_establish(
sc->sc_wdcdev.sc_atac.atac_dev, pa, wdc_cp->ch_channel,
pci_intr, sc);
pciide_compat_intr, cp);
if (cp->ih == NULL) {
#endif
aprint_error_dev(sc->sc_wdcdev.sc_atac.atac_dev,