Date: Wed, 30 Dec 2009 20:49:13 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r201280 - head/sys/dev/cardbus Message-ID: <200912302049.nBUKnDIx070490@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Wed Dec 30 20:49:13 2009 New Revision: 201280 URL: http://svn.freebsd.org/changeset/base/201280 Log: Delete the CIS resource after releasing it. This is needed when the CIS is stored in a BAR since the CIS BAR is mapped before the PCI bus driver enumerates all the BARs. Without this change, the PCI bus driver would attempt to initialize a BAR that was already allocated resulting in a panic. Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:47:14 2009 (r201279) +++ head/sys/dev/cardbus/cardbus_cis.c Wed Dec 30 20:49:13 2009 (r201280) @@ -430,6 +430,7 @@ cardbus_read_tuple_finish(device_t cbdev { if (res != CIS_CONFIG_SPACE) { bus_release_resource(child, SYS_RES_MEMORY, rid, res); + bus_delete_resource(child, SYS_RES_MEMORY, rid); } } @@ -492,8 +493,8 @@ cardbus_read_tuple_init(device_t cbdev, device_printf(cbdev, "Bad header in rom %d: " "[%x] %04x\n", romnum, imagebase + CARDBUS_EXROM_SIGNATURE, romsig); - bus_release_resource(child, SYS_RES_MEMORY, - *rid, res); + cardbus_read_tuple_finish(cbdev, child, *rid, + res); *rid = 0; return (NULL); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912302049.nBUKnDIx070490>