public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* MMCONFIG violates pci power mgmt spec
@ 2004-08-05 21:50 Michael Chan
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2004-08-05 21:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: Steve Lindsay, Marcus Calescibetta

We are encountering a problem with the MMCONFIG code with respect to
power management. Specifically, when pci_mmcfg_write is used to program
a PCI Express device's PMCSR to a different power state, the dummy read
at the end of that routine violates the transition delay specified in
the PCI power management spec.

For example, if the device is transitioning into or out of D3hot, the
spec requires a delay of 10 msec before any accesses can be made to the
device. The dummy read in pci_mmcfg_write violates the delay
requirements even though pci_set_power_state has all the necessary
delays.

I have contacted "Durairaj, Sundarapandian
<sundarapandian.durairaj@intel.com>" but did not get a response, and so
I'm posting to this list. One question I wanted to ask him was whether
the dummy read was necessary. If the Intel chipset treats the mmconfig
write as a non-posted write, the dummy read becomes unnecessary and
removing it will solve the problem. If it is treated as a posted write,
I wonder if there is another way to flush it other than reading from the
target device.

Thanks,
Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MMCONFIG violates pci power mgmt spec
       [not found] <2pYrs-17y-31@gated-at.bofh.it>
@ 2004-08-05 22:28 ` Andi Kleen
  2004-08-05 22:45   ` Roland Dreier
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2004-08-05 22:28 UTC (permalink / raw)
  To: Michael Chan; +Cc: linux-kernel

"Michael Chan" <mchan@broadcom.com> writes:

> For example, if the device is transitioning into or out of D3hot, the
> spec requires a delay of 10 msec before any accesses can be made to the
> device. The dummy read in pci_mmcfg_write violates the delay
> requirements even though pci_set_power_state has all the necessary
> delays.

Interesting. What happens? Hangs? 

>
> I have contacted "Durairaj, Sundarapandian
> <sundarapandian.durairaj@intel.com>" but did not get a response, and so
> I'm posting to this list. One question I wanted to ask him was whether
> the dummy read was necessary. If the Intel chipset treats the mmconfig
> write as a non-posted write, the dummy read becomes unnecessary and
> removing it will solve the problem. If it is treated as a posted write,

This was added to keep the new access method to be as compatible
as possible to the old method (which never posts). 

If someone cites the spec that says that it is not allowed I guess
it could be removed.

In the worst case we could add a new pci_read_config_*_relaxed() 
or somesuch.

> I wonder if there is another way to flush it other than reading from the
> target device.

Reading is the official way to flush.

-Andi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MMCONFIG violates pci power mgmt spec
  2004-08-05 22:28 ` MMCONFIG violates pci power mgmt spec Andi Kleen
@ 2004-08-05 22:45   ` Roland Dreier
  0 siblings, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2004-08-05 22:45 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Michael Chan, linux-kernel

    Andi> If someone cites the spec that says that it is not allowed I
    Andi> guess it could be removed.

I believe the PCI Express spec says that config writes are never posted.
(I'll check later to be sure)

 - Roland

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: MMCONFIG violates pci power mgmt spec
@ 2004-08-05 23:22 Michael Chan
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2004-08-05 23:22 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, Steve Lindsay, Marcus Calescibetta


> > For example, if the device is transitioning into or out of 
> D3hot, the 
> > spec requires a delay of 10 msec before any accesses can be made to 
> > the device. The dummy read in pci_mmcfg_write violates the delay 
> > requirements even though pci_set_power_state has all the necessary 
> > delays.
> 
> Interesting. What happens? Hangs? 
> 

What happens depends on the system/chipset/bios. Sometimes we see an
NMI, sometimes nothing bad happens.

> 
> Reading is the official way to flush.
> 

The MMCONFIG ECN document from pcisig below gives a few examples on how
the mmconfig write can be flushed. The exact mechanism of course is
implemention specific.

http://www.pcisig.com/specifications/pciexpress/specifications

Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: MMCONFIG violates pci power mgmt spec
@ 2004-08-05 23:30 Michael Chan
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Chan @ 2004-08-05 23:30 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-kernel


> 
> I believe the PCI Express spec says that config writes are 
> never posted. (I'll check later to be sure)
> 
>  - Roland
> 

Yes, the config write on the PCI Express link is never posted. But the
mmconfig write that gets translated by the chipset to config write on
the PCI Express link may or may not be posted. It is implementation
specific.

Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-05 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2pYrs-17y-31@gated-at.bofh.it>
2004-08-05 22:28 ` MMCONFIG violates pci power mgmt spec Andi Kleen
2004-08-05 22:45   ` Roland Dreier
2004-08-05 23:30 Michael Chan
  -- strict thread matches above, loose matches on Subject: below --
2004-08-05 23:22 Michael Chan
2004-08-05 21:50 Michael Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox