[PATCH] regmap/hexagon: Properly fix the generic IO helpers

Linus Walleij posted 1 patch 3 years, 7 months ago
arch/hexagon/include/asm/io.h | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
[PATCH] regmap/hexagon: Properly fix the generic IO helpers
Posted by Linus Walleij 3 years, 7 months ago
I was too naive in just including <asm-generic/io.h> into
hexagon: one has to specify defines for every call that uses
a (static) inline or this will not work.

Fix it up by providing proper defines for all shorthands that
hexagon provides.

Compile-tested with hexagon LLVM which is the only working cross
compiler for hexagon ATM after commenting out the
-fno-inline-functions-called-once switch which isn't working
with LLVM.

Cc: Brian Cain <bcain@quicinc.com>
Cc: linux-hexagon@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>
Fixes: 81c0386c1376 ("regmap: mmio: Support accelerared noinc operations")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Mark: please apply this to the regmap tree as a fix on
my sloppy commit so your tree compiles on hexagon. I hope the hexagon
folks will not mind.
---
 arch/hexagon/include/asm/io.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index 8e938dc1ca4b..46a099de85b7 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -308,6 +308,29 @@ static inline void outsl(unsigned long port, const void *buffer, int count)
 	}
 }
 
+/*
+ * These defines are necessary to use the generic io.h for filling in
+ * the missing parts of the API contract. This is because the platform
+ * uses (inline) functions rather than defines and the generic helper
+ * fills in the undefined.
+ */
+#define virt_to_phys virt_to_phys
+#define phys_to_virt phys_to_virt
+#define memset_io memset_io
+#define memcpy_fromio memcpy_fromio
+#define memcpy_toio memcpy_toio
+#define readb readb
+#define readw readw
+#define readl readl
+#define writeb writeb
+#define writew writew
+#define writel writel
+#define insb insb
+#define insw insw
+#define insl insl
+#define outsb outsb
+#define outsw outsw
+#define outsl outsl
 #include <asm-generic/io.h>
 
 #endif /* __KERNEL__ */
-- 
2.37.2
Re: [PATCH] regmap/hexagon: Properly fix the generic IO helpers
Posted by Mark Brown 3 years, 7 months ago
On Thu, 18 Aug 2022 14:12:27 +0200, Linus Walleij wrote:
> I was too naive in just including <asm-generic/io.h> into
> hexagon: one has to specify defines for every call that uses
> a (static) inline or this will not work.
> 
> Fix it up by providing proper defines for all shorthands that
> hexagon provides.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap/hexagon: Properly fix the generic IO helpers
      commit: f8f60615379c1b36d9220f3886fb9b229e95d8cd

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark