From owner-svn-src-all@FreeBSD.ORG Thu Dec 16 17:08:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E11E10656B2; Thu, 16 Dec 2010 17:08:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 626C28FC16; Thu, 16 Dec 2010 17:08:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGH8hqP069228; Thu, 16 Dec 2010 17:08:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGH8hoN069226; Thu, 16 Dec 2010 17:08:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161708.oBGH8hoN069226@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 17:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216491 - head/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 17:08:43 -0000 Author: jhb Date: Thu Dec 16 17:08:43 2010 New Revision: 216491 URL: http://svn.freebsd.org/changeset/base/216491 Log: - When moving the IRQ resource from the psmcpnp device to the psm device, delete the IRQ resource from the psmcpnp device completely. - Don't allocate the IRQ resource shared. It is not a shareable interrupt on ISA. The bus driver can set RF_SHAREABLE if the IRQ is actually shareable on a non-ISA bus. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Dec 16 17:05:28 2010 (r216490) +++ head/sys/dev/atkbdc/psm.c Thu Dec 16 17:08:43 2010 (r216491) @@ -1105,6 +1105,7 @@ psmidentify(driver_t *driver, device_t p irq = bus_get_resource_start(psmc, SYS_RES_IRQ, 0); if (irq <= 0) return; + bus_delete_resource(psmc, SYS_RES_IRQ, 0); bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1); } @@ -1133,8 +1134,7 @@ psmprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->intr == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -1438,8 +1438,7 @@ psmattach(device_t dev) /* Setup our interrupt handler */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->intr == NULL) return (ENXIO); error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, psmintr, sc, @@ -4628,6 +4627,7 @@ create_a_copy(device_t atkbdc, device_t /* move our resource to the found device */ irq = bus_get_resource_start(me, SYS_RES_IRQ, 0); + bus_delete_resource(me, SYS_RES_IRQ, 0); bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1); /* ...then probe and attach it */ @@ -4661,7 +4661,7 @@ psmcpnp_probe(device_t dev) "assuming irq %ld\n", irq); bus_set_resource(dev, SYS_RES_IRQ, rid, irq, 1); } - res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* keep quiet */ @@ -4675,22 +4675,12 @@ static int psmcpnp_attach(device_t dev) { device_t atkbdc; - int rid; /* find the keyboard controller, which may be on acpi* or isa* bus */ atkbdc = devclass_get_device(devclass_find(ATKBDC_DRIVER_NAME), device_get_unit(dev)); if ((atkbdc != NULL) && (device_get_state(atkbdc) == DS_ATTACHED)) create_a_copy(atkbdc, dev); - else { - /* - * If we don't have the AT keyboard controller yet, - * just reserve the IRQ for later use... - * (See psmidentify() above.) - */ - rid = 0; - bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); - } return (0); }