]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: mvebu: Use resource_size() to remap I/O space
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Fri, 3 Aug 2018 14:38:46 +0000 (16:38 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 8 Aug 2018 14:51:06 +0000 (15:51 +0100)
commitb79884b1690a6bf60611659620bc904df75cd1a0
tree19499d31b8adfc2c2afadc9b5af71bb84253a7e2
parentedcc4d43fc9f029818b8a0ac0a7fb57626b83a4e
PCI: mvebu: Use resource_size() to remap I/O space

Instead of hardcoding the remapping of IO_SPACE_LIMIT - SZ_64K, use
resource_size().

However, we cannot use just IO_SPACE_LIMIT, because pci_ioremap_io() has
a bug and doesn't allow remapping the last 64 KB before IO_SPACE_LIMIT,
so we ensure that we do not exceed this limit. When the pci_ioremap_io()
issue is fixed, this work around can be dropped.

Note that this workaround already existed, since we were mapping only
up to IO_SPACE_LIMIT - SZ_64K.

Suggested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[lorenzo.pieralisi@arm.com: tweaked the commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/controller/pci-mvebu.c