From owner-freebsd-current@FreeBSD.ORG Wed Feb 7 18:05:36 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F84A16A402 for ; Wed, 7 Feb 2007 18:05:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 1C93A13C491 for ; Wed, 7 Feb 2007 18:05:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l17I5VLv080529; Wed, 7 Feb 2007 13:05:32 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Scott Long Date: Wed, 7 Feb 2007 13:05:47 -0500 User-Agent: KMail/1.9.1 References: <17855.30388.764471.322562@grasshopper.cs.duke.edu> <200702071212.06578.jhb@freebsd.org> <45CA1273.8080205@samsco.org> In-Reply-To: <45CA1273.8080205@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702071305.48190.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 07 Feb 2007 13:05:32 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2533/Wed Feb 7 09:20:47 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-current@freebsd.org, Andrew Gallatin Subject: Re: restoring PCI config space X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2007 18:05:36 -0000 On Wednesday 07 February 2007 12:54, Scott Long wrote: > John Baldwin wrote: > > On Wednesday 31 January 2007 12:08, Scott Long wrote: > >> Andrew Gallatin wrote: > >>> Scott Long writes: > >>> > I need to do the same thing, and I concluded that pci_cfg_restore needs > >>> > to be exported out via a DEVMETHOD. It might also be useful to export > >>> > >>> Hurray! Do you plan to do this soon? > >>> > >>> > a pci_cfg_save function. > >>> > >>> Doesn't the config space get saved in pci_add_child? > >>> > >>> Drew > >> Wouldn't you want to preserve driver-local changes that are made to the > >> config space? Things like the busmaster enable bit comes to mind. > > > > If you use 'pci_enable_busmaster()' then that updates the copy in the dinfo. > > > > Do changes to the MSI/MSIX config space registers also get preserved? I currently cache MSI (but not MSI-X yet) and they are restored on resume via pci_cfg_restore(). That should all be transparent to the driver though as the driver shouldn't be touching those directly, but just via the pci_*_msi[x]() calls. -- John Baldwin