Skip to contentSkip to conversation

Patch "MIPS: AR7: Defer registration of GPIO" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Nov 11, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

MIPS: AR7: Defer registration of GPIO

to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mips-ar7-defer-registration-of-gpio.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From e6b03ab63b4d270e0249f96536fde632409dc1dc Mon Sep 17 00:00:00 2001

From: Jonas Gorski <[email protected]>
Date: Sun, 29 Oct 2017 16:27:19 +0100
Subject: MIPS: AR7: Defer registration of GPIO

From: Jonas Gorski <[email protected]>

commit e6b03ab63b4d270e0249f96536fde632409dc1dc upstream.

When called from prom init code, ar7_gpio_init() will fail as it will call gpiochip_add() which relies on a working kmalloc() to alloc the gpio_desc array and kmalloc is not useable yet at prom init time.

Move ar7_gpio_init() to ar7_register_devices() (a device_initcall) where kmalloc works.

Fixes 14e85c0e69d5 ("gpio: remove gpio_descs global array")
Cc Ralf Baechle <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Yoshihiro YUNOMAE <[email protected]>
Cc Nicolas Schichan <[email protected]>

Patchwork: https://patchwork.linux-mips.org/patch/17542/

---
 arch/mips/ar7/platform.c |    4 ++++
 arch/mips/ar7/prom.c     |    2 --
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/mips/ar7/platform.c +4 -0
@@ -653,6 +653,10 @@ static int __init ar7_register_devices(v
 	u32 val;
 	int res;
 
+	res = ar7_gpio_init();
+	if (res)
+		pr_warn("unable to register gpios: %d\n", res);
+
 	res = ar7_register_uarts();
 	if (res)
 		pr_err("unable to setup uart(s): %d\n", res);
arch/mips/ar7/prom.c +0 -2
@@ -246,8 +246,6 @@ void __init prom_init(void)
 	ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
 	ar7_init_env((struct env_var *)fw_arg2);
 	console_config();
-
-	ar7_gpio_init();
 }
 
 #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/mips-ar7-ensure-that-serial-ports-are-properly-set-up.patch queue-4.13/mips-ar7-defer-registration-of-gpio.patch