summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-03-27 09:46:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-03-27 09:46:53 -0700
commit3a90a72aca0a98125f0c7350ffb7cc63665f8047 (patch)
treef05c5a54a7eb69c99865dc44cfe6961bcd8fb717 /drivers
parent3536cb1e5753a832f88c268e328c644f6e367980 (diff)
parent47a60391ae0ed04ffbb9bd8dcd94ad9d08b41288 (diff)
Merge tag 'asm-generic-6.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull asm-generic updates from Arnd Bergmann: "This is mainly set of cleanups of asm-generic/io.h, resolving problems with inconsistent semantics of ioread64/iowrite64 that were causing runtime and build issues. The "GENERIC_IOMAP" version that switches between inb()/outb() and readb()/writeb() style accessors is now only used on architectures that have PC-style ISA devices that are not memory mapped (x86, uml, m68k-q40 and powerpc-powernv), while alpha and parisc use a more complicated variant and everything else just maps the ioread interfaces to plan MMIO (readb/writeb etc). In addition there are two small changes from Raag Jadav to simplify the asm-generic/io.h indirect inclusions and from Jann Horn to fix a corner case with read_word_at_a_time" * tag 'asm-generic-6.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: rwonce: fix crash by removing READ_ONCE() for unaligned read rwonce: handle KCSAN like KASAN in read_word_at_a_time() m68k: coldfire: select PCI_IOMAP for PCI mips: export pci_iounmap() mips: fix PCI_IOBASE definition m68k/nommu: stop using GENERIC_IOMAP mips: drop GENERIC_IOMAP wrapper powerpc: asm/io.h: remove split ioread64/iowrite64 helpers parisc: stop using asm-generic/iomap.h sh: remove duplicate ioread/iowrite helpers alpha: stop using asm-generic/iomap.h io.h: drop unused headers drm/draw: include missing headers asm-generic/io.h: rework split ioread64/iowrite64 helpers
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_draw.c2
-rw-r--r--drivers/sh/clk/cpg.c25
2 files changed, 16 insertions, 11 deletions
diff --git a/drivers/gpu/drm/drm_draw.c b/drivers/gpu/drm/drm_draw.c
index cb2ad12bce57..385eb5e10047 100644
--- a/drivers/gpu/drm/drm_draw.c
+++ b/drivers/gpu/drm/drm_draw.c
@@ -5,6 +5,8 @@
*/
#include <linux/bits.h>
+#include <linux/bug.h>
+#include <linux/export.h>
#include <linux/iosys-map.h>
#include <linux/types.h>
diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index fd72d9088bdc..64ed7d64458a 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -26,6 +26,19 @@ static unsigned int sh_clk_read(struct clk *clk)
return ioread32(clk->mapped_reg);
}
+static unsigned int sh_clk_read_status(struct clk *clk)
+{
+ void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
+ (phys_addr_t)clk->enable_reg + clk->mapped_reg;
+
+ if (clk->flags & CLK_ENABLE_REG_8BIT)
+ return ioread8(mapped_status);
+ else if (clk->flags & CLK_ENABLE_REG_16BIT)
+ return ioread16(mapped_status);
+
+ return ioread32(mapped_status);
+}
+
static void sh_clk_write(int value, struct clk *clk)
{
if (clk->flags & CLK_ENABLE_REG_8BIT)
@@ -40,20 +53,10 @@ static int sh_clk_mstp_enable(struct clk *clk)
{
sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
if (clk->status_reg) {
- unsigned int (*read)(const void __iomem *addr);
int i;
- void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
- (phys_addr_t)clk->enable_reg + clk->mapped_reg;
-
- if (clk->flags & CLK_ENABLE_REG_8BIT)
- read = ioread8;
- else if (clk->flags & CLK_ENABLE_REG_16BIT)
- read = ioread16;
- else
- read = ioread32;
for (i = 1000;
- (read(mapped_status) & (1 << clk->enable_bit)) && i;
+ (sh_clk_read_status(clk) & (1 << clk->enable_bit)) && i;
i--)
cpu_relax();
if (!i) {