parisc: mask out enable and reserved bits from sba imask
authorSven Schnelle <svens@stackframe.org>
Tue, 11 Aug 2020 16:19:19 +0000 (18:19 +0200)
committerHelge Deller <deller@gmx.de>
Wed, 12 Aug 2020 01:55:40 +0000 (03:55 +0200)
When using kexec the SBA IOMMU IBASE might still have the RE
bit set. This triggers a WARN_ON when trying to write back the
IBASE register later, and it also makes some mask calculations fail.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/parisc/sba_iommu.c

index 7e112829d2503aebab87cb6a29fd6aa3ee845f17..00785fa81ff76bb0b1e1d5a81c5b12bc7d063cff 100644 (file)
@@ -1270,7 +1270,7 @@ sba_ioc_init_pluto(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
        ** (one that doesn't overlap memory or LMMIO space) in the
        ** IBASE and IMASK registers.
        */
-       ioc->ibase = READ_REG(ioc->ioc_hpa + IOC_IBASE);
+       ioc->ibase = READ_REG(ioc->ioc_hpa + IOC_IBASE) & ~0x1fffffULL;
        iova_space_size = ~(READ_REG(ioc->ioc_hpa + IOC_IMASK) & 0xFFFFFFFFUL) + 1;
 
        if ((ioc->ibase < 0xfed00000UL) && ((ioc->ibase + iova_space_size) > 0xfee00000UL)) {