]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Handle read-only BARs on AMD CS553x devices
authorMyron Stowe <myron.stowe@redhat.com>
Tue, 3 Feb 2015 23:01:24 +0000 (16:01 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 4 Feb 2015 02:28:02 +0000 (20:28 -0600)
commitd9601938f2c8bd5cfc6e546ca64191701dc3dfd9
tree27fde5e9789b9747378bf0eaa5a23b3e499c863b
parentc0f59b1d588bc5fe05d875aa7200baff54222bd2
PCI: Handle read-only BARs on AMD CS553x devices

Some AMD CS553x devices have read-only BARs because of a firmware or
hardware defect.  There's a workaround in quirk_cs5536_vsa(), but it no
longer works after 1aebf2a90458 ("PCI: Restore detection of read-only
BARs").  Prior to 1aebf2a90458, we filled in res->start; afterwards we
leave it zeroed out.  The quirk only updated the size, so the driver tried
to use a region starting at zero, which didn't work.

Expand quirk_cs5536_vsa() to read the base addresses from the BARs and
hard-code the sizes.

On Nix's system BAR 2's read-only value is 0x6200.  Prior to 1aebf2a90458,
we interpret that as a 512-byte BAR based on the lowest-order bit set.  Per
datasheet sec 5.6.1, that BAR (MFGPT) requires only 64 bytes; use that to
avoid clearing any address bits if a platform uses only 64-byte alignment.

[bhelgaas: changelog, reduce BAR 2 size to 64]
Fixes: 1aebf2a90458 ("PCI: Restore detection of read-only BARs")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=85991#c4
Link: http://support.amd.com/TechDocs/31506_cs5535_databook.pdf
Link: http://support.amd.com/TechDocs/33238G_cs5536_db.pdf
Reported-and-tested-by: Nix <nix@esperi.org.uk>
Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v.2.6.27+
drivers/pci/quirks.c