From owner-freebsd-acpi@FreeBSD.ORG Mon Jan 3 03:56:33 2005 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EF3716A4CE for ; Mon, 3 Jan 2005 03:56:33 +0000 (GMT) Received: from ylpvm29.prodigy.net (ylpvm29-ext.prodigy.net [207.115.57.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18BCB43D2D for ; Mon, 3 Jan 2005 03:56:33 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.5.51] (adsl-64-171-186-95.dsl.snfc21.pacbell.net [64.171.186.95])j033uNh2005401; Sun, 2 Jan 2005 22:56:23 -0500 Message-ID: <41D8C26A.8030105@root.org> Date: Sun, 02 Jan 2005 19:56:26 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0RC1 (X11/20041205) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sam Leffler References: <200501021735.j02HZWAs017587@sana.init-main.com> <41D8B4D2.4050700@root.org> <41D8B6DF.7040703@errno.com> In-Reply-To: <41D8B6DF.7040703@errno.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-acpi@freebsd.org Subject: Re: ACPI C3 patch for atheros X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2005 03:56:33 -0000 Sam Leffler wrote: > Lots of old code here; at the time I cribbed the suspend-resume code I > don't believe the pci registers were saved for drivers. > > Here's the code from which the change originated: > > > /* > >> * Suspend/Resume resets the PCI configuration space, so we > have to > >> * re-disable the RETRY_TIMEOUT register (0x41) to keep > >> * PCI Tx retries from interfering with C3 CPU state > >> * > >> * Code taken from ipw2100 driver - jg > >> */ > >> pci_read_config_dword(pdev, 0x40, &val); > >> if ((val & 0x0000ff00) != 0) > >> pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); > > > I was waiting for a reply from Warner about whether or not this belonged > in the driver or if the pci layer should be handling this. If the comment is correct and the value is only lost due to suspend/resume, this should already be covered by us saving/restoring config registers although I believe we only save the normal registers (first 64 bytes). Since RETRY_TIMEOUT is beyond that range, it's probably not currently saved. In any case, I'd prefer we fix pci_cfg_save/restore() instead of doing this in the driver. Overall, it would be useful to analyze and improve coverage of what values we save and restore from config space. We definitely need to cover type 1 and 2 (bridge) devices as well. -- Nate