EDAC, pnd2: Fix ioremap() size in dnv_rd_reg()
authorStephen Douthit <stephend@silicom-usa.com>
Fri, 9 Aug 2019 14:18:02 +0000 (14:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 11:09:39 +0000 (13:09 +0200)
commit4410b85179504a08a9c0953b6615c458870e9273
tree8d2ab0e2da258075268f39fc2cf7ca1c27b0b3d4
parentcf8f20a1aacf0bd88ed675e1edcde57d3f634edb
EDAC, pnd2: Fix ioremap() size in dnv_rd_reg()

[ Upstream commit 29a3388bfcce7a6d087051376ea02bf8326a957b ]

Depending on how BIOS has marked the reserved region containing the 32KB
MCHBAR you can get warnings like:

resource sanity check: requesting [mem 0xfed10000-0xfed1ffff], which spans more than reserved [mem 0xfed10000-0xfed17fff]
caller dnv_rd_reg+0xc8/0x240 [pnd2_edac] mapping multiple BARs

Not all of the mmio regions used in dnv_rd_reg() are the same size.  The
MCHBAR window is 32KB and the sideband ports are 64KB.  Pass the correct
size to ioremap() depending on which resource we're reading from.

Signed-off-by: Stephen Douthit <stephend@silicom-usa.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/edac/pnd2_edac.c