Page MenuHomeFreeBSD

pcib: Ignore power fault detected if a power controller is not present
ClosedPublic

Authored by jhb on Mon, Apr 21, 9:02 PM.
Tags
None
Referenced Files
F115415600: D49949.diff
Wed, Apr 23, 2:06 PM
F115376416: D49949.diff
Wed, Apr 23, 4:02 AM
Unknown Object (File)
Tue, Apr 22, 4:16 AM
Unknown Object (File)
Tue, Apr 22, 4:05 AM
Unknown Object (File)
Tue, Apr 22, 3:26 AM
Unknown Object (File)
Tue, Apr 22, 3:19 AM
Unknown Object (File)
Tue, Apr 22, 3:09 AM
Unknown Object (File)
Tue, Apr 22, 3:06 AM
Subscribers
None

Details

Summary

At least some PCI-express bridges exposed by Intel Volume Management
Devices report bogus power faults in their slot status register. As a
workaround, ignore the power fault detected flag if the slot
capability register does not indicate support for a power controller.

While the PCI-e spec does not explicitly state that the PFD flag
should always be zero if a power controller is not present, parts of
the spec do seem to assume this. For example, the flag is included in
the "Power Controller Registers" register group in 6.7.2.4, and the
definition of the value for this flag seems to presume the presence of
a power controller:

If a Power Controller that supports power fault detection is
implemented, this bit is Set when the Power Controller detects a
power fault at this slot. Note that, depending on hardware
capability, it is possible that a power fault can be detected at
any time, independent of the Power Controller Control setting or
the occupancy of the slot. If power fault detection is not
supported, this bit must not be Set.

PR: 285993
Reported by: Jim Long <freebsd-bugzilla@umpquanet.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63618
Build 60502: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Mon, Apr 21, 9:02 PM
jhb created this revision.
imp added inline comments.
sys/dev/pci/pci_pci.c
932

I might be tempted to call this out.
And since you added the &&, maybe parens around each of the bits are warranted from a readability point of view?

This revision is now accepted and ready to land.Mon, Apr 21, 9:36 PM
sys/dev/pci/pci_pci.c
932

I don't think I actually need to call it out in the comment, it's actually more consistent with existing code now since it already checks PCP to decide if the corresponding interrupt event should be enabled.

1309

In particular, here we are also checking PCP before enabling PFDE, so checking PCP before checking the status (PFD) is now more consistent.