* [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device
@ 2006-06-05 8:46 Adam Belay
2006-06-05 16:37 ` Rajesh Shah
2006-06-06 0:32 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 4+ messages in thread
From: Adam Belay @ 2006-06-05 8:46 UTC (permalink / raw)
To: Greg KH, Andrew Morton; +Cc: linux-kernel, linux-pci
This patch modifies pci_disable_device() to clear IO and MEM from the
COMMAND PCI config register. This is required before entering D3, but
also probably a good general practice for system suspend.
Signed-off-by: Adam Belay <abelay@novell.com>
---
pci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff -urN a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c 2006-05-31 20:40:25.000000000 -0400
+++ b/drivers/pci/pci.c 2006-06-04 15:09:16.000000000 -0400
@@ -312,8 +312,12 @@
u16 pci_command;
pci_read_config_word(dev, PCI_COMMAND, &pci_command);
- if (pci_command & PCI_COMMAND_MASTER) {
- pci_command &= ~PCI_COMMAND_MASTER;
+ if (pci_command & (PCI_COMMAND_MASTER |
+ PCI_COMMAND_IO |
+ PCI_COMMAND_MEMORY)) {
+ pci_command &= ~ (PCI_COMMAND_MASTER |
+ PCI_COMMAND_IO |
+ PCI_COMMAND_MEMORY);
pci_write_config_word(dev, PCI_COMMAND, pci_command);
}
dev->is_busmaster = 0;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device
2006-06-05 8:46 [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device Adam Belay
@ 2006-06-05 16:37 ` Rajesh Shah
2006-06-06 0:32 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 4+ messages in thread
From: Rajesh Shah @ 2006-06-05 16:37 UTC (permalink / raw)
To: Adam Belay; +Cc: Greg KH, Andrew Morton, linux-kernel, linux-pci
On Mon, Jun 05, 2006 at 04:46:16AM -0400, Adam Belay wrote:
> This patch modifies pci_disable_device() to clear IO and MEM from the
> COMMAND PCI config register. This is required before entering D3, but
> also probably a good general practice for system suspend.
>
I'd submitted a patch to do this about a month ago, see
http://marc.theaimsgroup.com/?l=linux-pci&m=114669552428309&w=2
That patch does the same thing, but in arch specific code (since
that's where memory and IO decode get enabled today). This patch
will cover the other arch's too, so I'm fine with this if this
is the right thing to do. My original patch is already in Greg's
tree and needs to be removed if this patch is accepted.
thanks,
Rajesh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device
2006-06-05 8:46 [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device Adam Belay
2006-06-05 16:37 ` Rajesh Shah
@ 2006-06-06 0:32 ` Benjamin Herrenschmidt
2006-06-07 3:16 ` Adam Belay
1 sibling, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2006-06-06 0:32 UTC (permalink / raw)
To: Adam Belay; +Cc: Greg KH, Andrew Morton, linux-kernel, linux-pci
On Mon, 2006-06-05 at 04:46 -0400, Adam Belay wrote:
> This patch modifies pci_disable_device() to clear IO and MEM from the
> COMMAND PCI config register. This is required before entering D3, but
> also probably a good general practice for system suspend.
And will break a great deal of platforms. Don't do it :) The problem is,
I think, mostly related to firmware issues.
Ben.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device
2006-06-06 0:32 ` Benjamin Herrenschmidt
@ 2006-06-07 3:16 ` Adam Belay
0 siblings, 0 replies; 4+ messages in thread
From: Adam Belay @ 2006-06-07 3:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Greg KH, Andrew Morton, linux-kernel, linux-pci
On Tue, 2006-06-06 at 10:32 +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2006-06-05 at 04:46 -0400, Adam Belay wrote:
> > This patch modifies pci_disable_device() to clear IO and MEM from the
> > COMMAND PCI config register. This is required before entering D3, but
> > also probably a good general practice for system suspend.
>
> And will break a great deal of platforms. Don't do it :) The problem is,
> I think, mostly related to firmware issues.
>
> Ben.
If the device must be enabled before passing control to firmware, then
shouldn't its controlling driver never call pci_disable_device()? I'd
like to have pci_disable_device() actually disable devices, as this is
needed for D3.
Thanks,
Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-06-07 3:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-05 8:46 [PATCH 8/9] PCI PM: clear IO and MEM when disabling a device Adam Belay
2006-06-05 16:37 ` Rajesh Shah
2006-06-06 0:32 ` Benjamin Herrenschmidt
2006-06-07 3:16 ` Adam Belay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome