aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Nelson <dnelson@redhat.com>2010-03-09 22:26:40 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-03-19 15:36:51 -0400
commit25daeb550b69e89aff59bc6a84218a12b5203531 (patch)
tree6e3f7191269e7199482f492bc6a43676742f3a94
parentfc7f99cf36ebae853639dabb43bc2f0098c59aef (diff)
PCI: fix return value from pcix_get_max_mmrbc()
For the PCI_X_STATUS register, pcix_get_max_mmrbc() is returning an incorrect value, which is based on: (stat & PCI_X_STATUS_MAX_READ) >> 12 Valid return values are 512, 1024, 2048, 4096, which correspond to a 'stat' (masked and right shifted by 21) of 0, 1, 2, 3, respectively. A right shift by 11 would generate the correct return value when 'stat' (masked and right shifted by 21) has a value of 1 or 2. But for a value of 0 or 3 it's not possible to generate the correct return value by only right shifting. Fix is based on pcix_get_mmrbc()'s similar dealings with the PCI_X_CMD register. Cc: stable@kernel.org Signed-off-by: Dean Nelson <dnelson@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index cb1dd5f4988c..ed9eb68fd940 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2587,7 +2587,7 @@ int pcix_get_max_mmrbc(struct pci_dev *dev)
2587 if (err) 2587 if (err)
2588 return -EINVAL; 2588 return -EINVAL;
2589 2589
2590 return (stat & PCI_X_STATUS_MAX_READ) >> 12; 2590 return 512 << ((stat & PCI_X_STATUS_MAX_READ) >> 21);
2591} 2591}
2592EXPORT_SYMBOL(pcix_get_max_mmrbc); 2592EXPORT_SYMBOL(pcix_get_max_mmrbc);
2593 2593