Skip to contentSkip to conversation

ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()

PATCH New Magnus Damm 4 participants 6 messages Feb 17, 2014 – Feb 18, 2014

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()

From: Magnus Damm <[email protected]>

Remove __init from rcar_gen2_read_mode_pins() to allow it to be used after boot. For instance the R-Car Gen2 MD21 check is needed even in the case of CPU Hotplug.

---

Written against renesas-devel-v3.14-rc2-20140213

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
@@ -28,7 +28,7 @@
 
 #define MODEMR 0xe6160060
 
-u32 __init rcar_gen2_read_mode_pins(void)
+u32 rcar_gen2_read_mode_pins(void)
 {
 	void __iomem *modemr = ioremap_nocache(MODEMR, 4);
 	u32 mode;
#1 lore raw

PATCH 1/1 ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()

Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Remove __init from rcar_gen2_read_mode_pins() to allow it to be used after boot. For instance the R-Car Gen2 MD21 check is needed even in the case of CPU Hotplug.

This is a prerequisite for "[PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU"

Quoted 1 line

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw

PATCH 1/1 ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()

In reply to Magnus Damm

Hi Magnus,

Thank you for the patch.

Quoted 20 lines · On Monday 17 February 2014 15:35:10 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Remove __init from rcar_gen2_read_mode_pins() to allow it to be used after boot. For instance the R-Car Gen2 MD21 check is needed even in the case of CPU Hotplug.

---

Written against renesas-devel-v3.14-rc2-20140213

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0

15:02:48.000000000 +0900 @@ -28,7 +28,7 @@

#define MODEMR 0xe6160060

arch/arm/mach-shmobile/setup-rcar-gen2.c line 34

Quoted 5 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
-u32 __init rcar_gen2_read_mode_pins(void)
+u32 rcar_gen2_read_mode_pins(void)
 {
 	void __iomem *modemr = ioremap_nocache(MODEMR, 4);
 	u32 mode;

Should we read the value once at boot time and cache it ?

Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw

PATCH 1/1 ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()

Quoted 6 lines · Laurent Pinchart
Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0

15:02:48.000000000 +0900 @@ -28,7 +28,7 @@

#define MODEMR 0xe6160060

Quoted 7 lines

arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17

Quoted 5 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
-u32 __init rcar_gen2_read_mode_pins(void)
+u32 rcar_gen2_read_mode_pins(void)
 {
      void __iomem *modemr = ioremap_nocache(MODEMR, 4);
      u32 mode;

Should we read the value once at boot time and cache it ?

That sounds like a great idea to me. The value doesn't change, and it avoids the ioremap()/iounmap() overhead on subsequent calls.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#4 lore raw

PATCH 1/1 ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()

In reply to Laurent Pinchart

Hi Laurent,

Quoted 25 lines · Laurent Pinchart

Hi Magnus,

Thank you for the patch.

Quoted 20 lines · On Monday 17 February 2014 15:35:10 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Remove __init from rcar_gen2_read_mode_pins() to allow it to be used after boot. For instance the R-Car Gen2 MD21 check is needed even in the case of CPU Hotplug.

---

Written against renesas-devel-v3.14-rc2-20140213

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0

15:02:48.000000000 +0900 @@ -28,7 +28,7 @@

#define MODEMR 0xe6160060

Quoted 7 lines

arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17

Quoted 5 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
-u32 __init rcar_gen2_read_mode_pins(void)
+u32 rcar_gen2_read_mode_pins(void)
 {
      void __iomem *modemr = ioremap_nocache(MODEMR, 4);
      u32 mode;

Should we read the value once at boot time and cache it ?

Seems a bit of a micro-optimization to me, but sure, it can't hurt.

Care to cook up an incremental patch implementing that? =)

Cheers,

/ magnus

#5 lore raw

PATCH 1/1 ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()

Quoted 37 lines · Magnus Damm

Hi Laurent,

Quoted 25 lines · Laurent Pinchart

Hi Magnus,

Thank you for the patch.

Quoted 20 lines · On Monday 17 February 2014 15:35:10 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Remove __init from rcar_gen2_read_mode_pins() to allow it to be used after boot. For instance the R-Car Gen2 MD21 check is needed even in the case of CPU Hotplug.

---

Written against renesas-devel-v3.14-rc2-20140213

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0

15:02:48.000000000 +0900 @@ -28,7 +28,7 @@

#define MODEMR 0xe6160060

Quoted 7 lines

arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17

Quoted 5 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-02-17 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
-u32 __init rcar_gen2_read_mode_pins(void)
+u32 rcar_gen2_read_mode_pins(void)
 {
      void __iomem *modemr = ioremap_nocache(MODEMR, 4);
      u32 mode;

Should we read the value once at boot time and cache it ?

Quoted 3 lines

Seems a bit of a micro-optimization to me, but sure, it can't hurt.

Care to cook up an incremental patch implementing that? =)

I have decided to take this patch as-is. Feel free to make incremental changes on top of it.