]> git.baikalelectronics.ru Git - kernel.git/commit
nios2: Fix ioremap
authorGuenter Roeck <linux@roeck-us.net>
Thu, 12 Dec 2019 08:34:03 +0000 (16:34 +0800)
committerLey Foon Tan <ley.foon.tan@intel.com>
Thu, 12 Dec 2019 08:34:33 +0000 (16:34 +0800)
commitda768eb1eedbe5c65038b76002b9f5b540f0aed6
treea6377ed4cb0d5f79f251a803a94198dfb8686fa6
parent47599c6298943ede4662b5e31dfe375feac1b48a
nios2: Fix ioremap

Commit 708a5aa1df93 ("nios2: remove __ioremap") removed the following code,
with the argument that cacheflag is always 0 and the expression would
therefore always be false.

if (IS_MAPPABLE_UNCACHEABLE(phys_addr) &&
    IS_MAPPABLE_UNCACHEABLE(last_addr) &&
    !(cacheflag & _PAGE_CACHED))
return (void __iomem *)(CONFIG_NIOS2_IO_REGION_BASE + phys_addr);

This did not take the "!" in the expression into account. Result is that
nios2 images no longer boot. Restoring the removed code fixes the problem.

Fixes: 708a5aa1df93 ("nios2: remove __ioremap")
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
arch/nios2/mm/ioremap.c