summaryrefslogtreecommitdiffstats
path: root/sys/x86/isa/atrtc.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-07-12 06:46:17 +0000
committermav <mav@FreeBSD.org>2010-07-12 06:46:17 +0000
commit55884c87574a0c88e64c6d5790d2d7c387cdcadc (patch)
tree0a4f8bc7c864f9c216cf4666cde3f1c7b11f314e /sys/x86/isa/atrtc.c
parent33e025b3ecf239bbee42b065ff61d24099ab6785 (diff)
downloadFreeBSD-src-55884c87574a0c88e64c6d5790d2d7c387cdcadc.zip
FreeBSD-src-55884c87574a0c88e64c6d5790d2d7c387cdcadc.tar.gz
Instead of deleting existing IRQ resource, which is not really working for
ACPI bus, find wanted IRQ rid or spare one. This should fix panic during boot on systems reporting fancy IRQ numbers for attimer and atrtc.
Diffstat (limited to 'sys/x86/isa/atrtc.c')
-rw-r--r--sys/x86/isa/atrtc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c
index 9e28379..0b913c3 100644
--- a/sys/x86/isa/atrtc.c
+++ b/sys/x86/isa/atrtc.c
@@ -244,6 +244,7 @@ static int
atrtc_attach(device_t dev)
{
struct atrtc_softc *sc;
+ u_long s;
int i, diag;
sc = device_get_softc(dev);
@@ -260,7 +261,9 @@ atrtc_attach(device_t dev)
(resource_int_value(device_get_name(dev), device_get_unit(dev),
"clock", &i) != 0 || i != 0)) {
sc->intr_rid = 0;
- bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid);
+ while (bus_get_resource(dev, SYS_RES_IRQ, sc->intr_rid,
+ &s, NULL) == 0 && s != 8)
+ sc->intr_rid++;
if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ,
&sc->intr_rid, 8, 8, 1, RF_ACTIVE))) {
device_printf(dev,"Can't map interrupt.\n");
OpenPOWER on IntegriCloud