From owner-freebsd-current@FreeBSD.ORG Tue Jun 10 13:17:59 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA6B337B401; Tue, 10 Jun 2003 13:17:59 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FCBC43FD7; Tue, 10 Jun 2003 13:17:57 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h5AKHukA014791; Tue, 10 Jun 2003 14:17:56 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 10 Jun 2003 14:16:32 -0600 (MDT) Message-Id: <20030610.141632.71103986.imp@bsdimp.com> To: marks@ripe.net From: "M. Warner Losh" In-Reply-To: <20030610191504.GA8927@laptop.6bone.nl> References: <20030609035127.GA36909@laptop.6bone.nl> <200306101644.h5AGiawR066527@puma.icir.org> <20030610191504.GA8927@laptop.6bone.nl> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: current@freebsd.org cc: orion@freebsd.org Subject: Re: Correct PCI suspend and resume operations X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 10 Jun 2003 20:18:00 -0000 In message: <20030610191504.GA8927@laptop.6bone.nl> Mark Santcroos writes: : On Tue, Jun 10, 2003 at 09:44:36AM -0700, Orion Hodson wrote: : > It looks like the pci configuration space state has been lost during : > the suspend and resume. This may be because the bus has removed power : > from the devices attached to it on suspend. : : For sure, in S4 mode the devices are powered down totally. : : > I've been through a cross section of drivers this morning and some : > explicitly save and restore the PCI configuration state space and : > others don't. The former seems like the safest path in most cases. : : Yes, it is absolutely necessary even. (For the reason stated above) : : > AFAICT, we don't common code for handling this and maybe there should : > be some rather than have each driver replicate this behaviour. : : In general, that would of course be better. However, I don't know if the : PCI layer (in this case) always knows enough. : On the other side, if the device itself has to do some special things, the : PCI layer could at least do the generic stuff. : (Warner, will this also be covered by the stuff you are doing?) Yes. I'm still working out those fields that we need to save. In general, BARs and a few other things aren't preserved accross D3 -> D0 state transitions. Some drivers try to cope, but it should be done in the main pci thread. Warner