Skip to contentSkip to conversation

Second round of Renesas ARM based SoC fixes for v3.11

PATCH New Simon Horman 2 participants 6 messages Jul 31, 2013 – Aug 4, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Second round of Renesas ARM based SoC fixes for v3.11

Hi Olof, Hi Arnd,

please consider the following Renesas ARM based SoC fixes for v3.11.

The following changes since commit ad81f0545ef01ea651886dddac4bef6cec930092:

Linux 3.11-rc1 (2013-07-14 15:18:27 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-fixes2-for-v3.11

for you to fetch changes up to a601469386b543df2a4d97ad7d524716945278a3:

ARM: shmobile: lager: do not annotate gpio_buttons as __initdata (2013-07-31 10:11:17 +0900)

----------------------------------------------------------------
Second round of Renesas ARM based SoC fixes for v3.11

* Lager board: do not annotate gpio_buttons as __initdata
- This avoids accessing uninitialised memory if keys are pressed after kernel initialisation completes.
- Bug introduced in gpio-keys were enabled in v3.11-rc1

* Bock-W board: fix SDHI0 PFC settings
- Allow detection of SD card
- Bug introduced in SDHI support was added in v3.11-rc1

* shdma: fixup sh_dmae_get_partial() calculation error
- Bug introduced in 2.6.34-rc1.

* armadillo800eva board: Don't request GPIO 166 in board code
- Allow use of touchscreen
- Bug introduced in v3.11-rc1

----------------------------------------------------------------
Kuninori Morimoto (2):
ARM: shmobile: armadillo800eva: Don't request GPIO 166 in board code
shdma: fixup sh_dmae_get_partial() calculation error

Sergei Shtylyov (1):
ARM: shmobile: BOCK-W: fix SDHI0 PFC settings

Simon Horman (1):
ARM: shmobile: lager: do not annotate gpio_buttons as __initdata

 arch/arm/mach-shmobile/board-armadillo800eva.c | 3 ---
 arch/arm/mach-shmobile/board-bockw.c           | 8 +++++++-
 arch/arm/mach-shmobile/board-lager.c           | 2 +-
 drivers/dma/sh/shdma.c                         | 4 ++--
 4 files changed, 10 insertions(+), 7 deletions(-)
#1 lore raw

PATCH 1/4 ARM: shmobile: armadillo800eva: Don't request GPIO 166 in board code

From: Kuninori Morimoto <[email protected]>

89ae7b5bbd3e65bc6ab7a577ca5ec18569589c8c
(ARM: shmobile: armadillo800eva: Register pinctrl mapping for INTC) mistakenly requests GPIO 166 in board code,
most probably due to a wrong merge conflict resolution. As the GPIO is passed to the st1232 driver through platform data and requested by the driver,
there's no need to request it in board code. Fix it.

Tested by: Cao Minh Hiep <[email protected]>

---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 3 ---
 1 file changed, 3 deletions(-)
arch/arm/mach-shmobile/board-armadillo800eva.c +0 -3
index e115f67..c5be60d 100644
@@ -1162,9 +1162,6 @@ static void __init eva_init(void)
 	gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
 	gpio_request_one(202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
 
-	/* Touchscreen */
-	gpio_request_one(166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */
-
 	/* GETHER */
 	gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */
 
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 2/4 shdma: fixup sh_dmae_get_partial() calculation error

In reply to Simon Horman

From: Kuninori Morimoto <[email protected]>

sh_desc->hw.tcr is controlling real data size,
and, register TCR is controlling data transfer count which was xmit_shifted value of hw.tcr.
Current sh_dmae_get_partial() is calculating in different unit. This patch fixes it.

This bug has been present since c014906a870ce70e009def0c9d170ccabeb0be63 ("dmaengine: shdma: extend .device_terminate_all() to record partial transfer"), which was added in 2.6.34-rc1.

---
 drivers/dma/sh/shdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/sh/shdma.c +2 -2
index b67f45f..5039fbc 100644
@@ -400,8 +400,8 @@ static size_t sh_dmae_get_partial(struct shdma_chan *schan,
 						    shdma_chan);
 	struct sh_dmae_desc *sh_desc = container_of(sdesc,
 					struct sh_dmae_desc, shdma_desc);
-	return (sh_desc->hw.tcr - sh_dmae_readl(sh_chan, TCR)) <<
-		sh_chan->xmit_shift;
+	return sh_desc->hw.tcr -
+		(sh_dmae_readl(sh_chan, TCR) << sh_chan->xmit_shift);
 }
 
 /* Called from error IRQ or NMI */
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH 3/4 ARM: shmobile: BOCK-W: fix SDHI0 PFC settings

In reply to Simon Horman

From: Sergei Shtylyov <[email protected]>

The following message is printed on the BOCK-W kernel bootup:

sh-pfc pfc-r8a7778: invalid group "sdhi0" for function "sdhi0"

In addition, SD card cannot be detected. The reason is apparently that commit ca7bb309485e4ec89a9addd47bea (ARM: shmobile: bockw: add SDHI0 support) matched the previous version of commit 564617d2f92473031d035deb273da5 (sh-pfc: r8a7778:
add SDHI support).

Add the missing pin groups according to the BOCK-W board schematics.

---
 arch/arm/mach-shmobile/board-bockw.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/board-bockw.c +7 -1
index d555464..3354a85 100644
@@ -167,7 +167,13 @@ static const struct pinctrl_map bockw_pinctrl_map[] = {
 				  "usb1", "usb1"),
 	/* SDHI0 */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
-				  "sdhi0", "sdhi0"),
+				  "sdhi0_data4", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
+				  "sdhi0_ctrl", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
+				  "sdhi0_cd", "sdhi0"),
+	PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
+				  "sdhi0_wp", "sdhi0"),
 };
 
 #define FPGA	0x18200000
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 4/4 ARM: shmobile: lager: do not annotate gpio_buttons as __initdata

In reply to Simon Horman

When the gpio-keys device is registered using platform_device_register_data() the platform data argument, lager_keys_pdata is duplicated and thus should be marked as __initdata to avoid wasting memory. However, this is not true of gpio_buttons, a reference to it rather than its value is duplicated when lager_keys_pdata is duplicated.

This avoids accessing freed memory if gpio-key events occur after unused kernel memory is freed late in the kernel's boot.

This but was added when support for gpio-keys was added to lager in c3842e4fcbb7664276443b79187b7808c2e80a35
("ARM: shmobile: lager: support GPIO switches") which was included in v3.11-rc1.

---
 arch/arm/mach-shmobile/board-lager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/board-lager.c +1 -1
index d73e21d..8d6bd5c 100644
@@ -59,7 +59,7 @@ static __initdata struct gpio_led_platform_data lager_leds_pdata = {
 #define GPIO_KEY(c, g, d, ...) \
 	{ .code = c, .gpio = g, .desc = d, .active_low = 1 }
 
-static __initdata struct gpio_keys_button gpio_buttons[] = {
+static struct gpio_keys_button gpio_buttons[] = {
 	GPIO_KEY(KEY_4,		RCAR_GP_PIN(1, 28),	"SW2-pin4"),
 	GPIO_KEY(KEY_3,		RCAR_GP_PIN(1, 26),	"SW2-pin3"),
 	GPIO_KEY(KEY_2,		RCAR_GP_PIN(1, 24),	"SW2-pin2"),
Signature · 1 line
1.8.3.2
#5 lore raw

cover Second round of Renesas ARM based SoC fixes for v3.11

In reply to Simon Horman
Quoted 28 lines · Simon Horman

Hi Olof, Hi Arnd,

please consider the following Renesas ARM based SoC fixes for v3.11.

The following changes since commit ad81f0545ef01ea651886dddac4bef6cec930092:

Linux 3.11-rc1 (2013-07-14 15:18:27 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-fixes2-for-v3.11

for you to fetch changes up to a601469386b543df2a4d97ad7d524716945278a3:

ARM: shmobile: lager: do not annotate gpio_buttons as __initdata (2013-07-31 10:11:17 +0900)

----------------------------------------------------------------
Second round of Renesas ARM based SoC fixes for v3.11

* Lager board: do not annotate gpio_buttons as __initdata
- This avoids accessing uninitialised memory if keys are pressed after kernel initialisation completes.
- Bug introduced in gpio-keys were enabled in v3.11-rc1

* Bock-W board: fix SDHI0 PFC settings
- Allow detection of SD card
- Bug introduced in SDHI support was added in v3.11-rc1

Quoted 6 lines

* shdma: fixup sh_dmae_get_partial() calculation error
- Bug introduced in 2.6.34-rc1.

* armadillo800eva board: Don't request GPIO 166 in board code
- Allow use of touchscreen
- Bug introduced in v3.11-rc1

Pulled, thanks for the excellent tag description.

-Olof