From: Qiuxu Zhuo <qiuxu.z...@intel.com>

commit d84676a9e12817c8435e836911800bdcc67928a0 upstream.

Bit[0] of BAR is always zero. Bit[2:1] and bit[3] of BAR contain the
information of 'type' and the 'prefetchable' accordingly. Therefore,
mask the lower four bits to retrieve the actual base address of a BAR.

Signed-off-by: Qiuxu Zhuo <qiuxu.z...@intel.com>
Cc: Tony Luck <tony.l...@intel.com>
Cc: linux-edac <linux-e...@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170814154813.21619-1-qiuxu.z...@intel.com
Signed-off-by: Borislav Petkov <b...@suse.de>
Signed-off-by: Liwei Song <liwei.s...@windriver.com>
---
 drivers/edac/pnd2_edac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
index a3180a87ff96..2b16b95201eb 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -241,6 +241,7 @@ static u64 get_sideband_reg_base_addr(void)
        if (pdev) {
                pci_read_config_dword(pdev, 0x10, &lo);
                pci_read_config_dword(pdev, 0x14, &hi);
+               lo &= 0xfffffff0;
                pci_dev_put(pdev);
                return (U64_LSHIFT(hi, 32) | U64_LSHIFT(lo, 0));
        } else {
-- 
2.7.4

-- 
_______________________________________________
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto

Reply via email to