From: Andrew Morton <akpm@osdl.org>
To: Ryan Lortie <desrt@desrt.ca>
Cc: linux-kernel@vger.kernel.org, mjg59@srcf.ucam.org,
bcollins@ubuntu.com, Greg KH <greg@kroah.com>
Subject: Re: pci_restore_state
Date: Sun, 4 Jun 2006 03:27:46 -0700 [thread overview]
Message-ID: <20060604032746.a5b3e2dd.akpm@osdl.org> (raw)
In-Reply-To: <1149416010.30767.14.camel@moonpix.desrt.ca>
On Sun, 04 Jun 2006 06:13:30 -0400
Ryan Lortie <desrt@desrt.ca> wrote:
> Currently pci_restore_state() (drivers/pci/pci.c) restores the PCI state
> by copying in the saved PCI configuration space, a dword at a time,
> starting from 0 up to 15.
>
> This causes a crash when my Macbook resumes from sleep (specifically,
> when restoring the configuration space of the PCI bridge).
>
> Reading the PCI specification, the register at dword 1 (ie: bytes 4-7)
> is split half and half between status and command words. The command
> word effectively controls the way which the PCI device interacts with
> the system. If it is 0, the device is logically disconnected from the
> bus (PCI Local Bus Specification Revision 2.2, 6.2.2 "Device
> Control").
>
> When a device first powers up, the command register value is normally
> zero (and is zero in my specific case).
>
> The problem with the way that the PCI state is currently restored is
> that the write to the command register logically reconnects the device
> to the bus before the rest of the configuration space has been filled
> in.
>
> My Macbook crashes on resume.
>
> If I reverse the for loop to start from 15 and count down to 0, then the
> majority of the configuration space is filled in _before_ the command
> word is modified. No crash.
We have a patch pending which will do that.
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-03-pci/pci-reverse-pci-config-space-restore-order.patch
The present plan will be to get this into 2.6.18.
next prev parent reply other threads:[~2006-06-04 10:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-04 10:13 pci_restore_state Ryan Lortie
2006-06-04 10:27 ` Andrew Morton [this message]
2006-06-04 11:20 ` pci_restore_state Paul Mackerras
2006-06-05 18:42 ` pci_restore_state Adam Belay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060604032746.a5b3e2dd.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=bcollins@ubuntu.com \
--cc=desrt@desrt.ca \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.