]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PCI: fix return value from pcix_get_max_mmrbc()
authorDean Nelson <dnelson@redhat.com>
Wed, 10 Mar 2010 03:26:40 +0000 (22:26 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 23:01:48 +0000 (16:01 -0700)
commit1ed0d0b7fac8892828cc15a20fb7e7824c2598a1
treed58c6c0d9d68fc09dfd99d87e0b4956b939251e0
parent29ef84453e8cecb4d75e4ca8f5e28b96014d0d9d
PCI: fix return value from pcix_get_max_mmrbc()

commit 25daeb550b69e89aff59bc6a84218a12b5203531 upstream.

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.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pci.c