From owner-freebsd-x11@FreeBSD.ORG Tue Jul 17 23:39:53 2012 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94DF5106566C; Tue, 17 Jul 2012 23:39:53 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 4C8018FC14; Tue, 17 Jul 2012 23:39:53 +0000 (UTC) Received: from ncsd.bris.ac.uk ([137.222.10.59] helo=ncs.bris.ac.uk) by dirg.bris.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1SrHMu-0003tx-Ea; Wed, 18 Jul 2012 00:39:52 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncs.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1SrHMu-0001Ux-7x; Wed, 18 Jul 2012 00:39:52 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5) with ESMTP id q6HNdpFY064787; Wed, 18 Jul 2012 00:39:51 +0100 (BST) (envelope-from mexas@bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5/Submit) id q6HNdpxi064786; Wed, 18 Jul 2012 00:39:51 +0100 (BST) (envelope-from mexas@bris.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bris.ac.uk using -f Date: Wed, 18 Jul 2012 00:39:51 +0100 From: Anton Shterenlikht To: freebsd-current@freebsd.org, freebsd-x11@freebsd.org Message-ID: <20120717233951.GA64762@mech-cluster241.men.bris.ac.uk> Mail-Followup-To: freebsd-current@freebsd.org, freebsd-x11@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: hdac0: Unexpected unsolicited response from address 0: 04a12020 X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 23:39:53 -0000 On amd64 r238558M (M is John Baldwin's pci.c patch, see at the end). I've hdac0: mem 0xc0000000-0xc0003fff irq 16 at device 20.2 on pci0 which seems to work fine, e.g. using /dev/dsp I then run X -configure The sound still works fine. However, as soon as I run X -config /root/xorg.conf.new -retro I see on the console: hdac0: Unexpected unsolicited response from address 0: 04a12020 hdac0: Unexpected unsolicited response from address 0: 00001727 hdac0: Unexpected unsolicited response from address 0: 00000020 hdac0: Unexpected unsolicited response from address 0: 00400187 hdac0: Unexpected unsolicited response from address 0: 00000002 hdac0: Unexpected unsolicited response from address 0: 00000e03 hdac0: Unexpected unsolicited response from address 0: 0181302e hdac0: Unexpected unsolicited response from address 0: 00001737 hdac0: Unexpected unsolicited response from address 0: 00000020 hdac0: Unexpected unsolicited response from address 0: 00400301 hdac0: Unexpected unsolicited response from address 0: 00000001 hdac0: Unexpected unsolicited response from address 0: 00000002 hdac0: Unexpected unsolicited response from address 0: 4145f0f0 hdac0: Unexpected unsolicited response from address 0: 00000010 hdac0: Unexpected unsolicited response from address 0: 00000040 hdac0: Unexpected unsolicited response from address 0: 00300101 hdac0: Unexpected unsolicited response from address 0: 00000006 hdac0: Unexpected unsolicited response from address 0: 0e090c03 hdac0: Unexpected unsolicited response from address 0: 00001805 hdac0: Unexpected unsolicited response from address 0: 00200101 hdac0: Unexpected unsolicited response from address 0: 00000002 hdac0: Unexpected unsolicited response from address 0: 00001f1e hdac0: Unexpected unsolicited response from address 0: 0030010c and another ~50 similar lines, and the sound no longer works until I reboot. I cannot narrow the problem any further. Please advise Many thanks **************************** John Baldwin's pci.c patch: Index: pci.c =================================================================== --- pci.c (revision 235475) +++ pci.c (working copy) @@ -2815,13 +2815,36 @@ pci_add_map(device_t bus, device_t dev, int reg, s */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, prefetch ? RF_PREFETCHABLE : 0); + if (res == NULL && (start != 0 || end != ~0ul)) { + /* + * If the allocation fails, try to allocate a resource for + * this BAR using any available range. The firmware felt + * it was important enough to assign a resource, so don't + * disable decoding if we can help it. + */ + resource_list_delete(rl, type, reg); + start = 0; + end = ~0ul; + resource_list_add(rl, type, reg, 0, ~0ul, count); + resource_list_add(rl, type, reg, start, end, count); + res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, + count, prefetch ? RF_PREFETCHABLE : 0); + } if (res == NULL) { /* * If the allocation fails, delete the resource list entry - * to force pci_alloc_resource() to allocate resources - * from the parent. + * and disable decoding for this device. + * + * If the driver requests this resource in the future, + * pci_reserve_map() will try to allocate fresh resources. */ resource_list_delete(rl, type, reg); + pci_disable_io(dev, type); + start = 0; + device_printf(bus, + "pci%d:%d:%d:%d bar %#x failed to allocate", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev), reg); } else { start = rman_get_start(res); pci_write_bar(dev, pm, start); -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423