Received: by 10.223.164.202 with SMTP id h10csp193378wrb; Mon, 13 Nov 2017 05:04:32 -0800 (PST) X-Google-Smtp-Source: AGs4zMasbShbTSK+hUKLYS6Ja2JU+Tue3vYFVtEYzEiHne3Jl9mTPVjuvO+hZFXRafLzCJer8xG/ X-Received: by 10.98.159.210 with SMTP id v79mr9715261pfk.162.1510578272617; Mon, 13 Nov 2017 05:04:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510578272; cv=none; d=google.com; s=arc-20160816; b=wS4+LoIRt7imSwPGhuG7ugEKR2/RM8HSyU6jR/+CXtOFOeEI8KJJmBwj7Ap7E1Dsyy K9+l9c4XzKda3yuBoORDV4fNJz+lM6476CGnwtSVESXqzIDak4g0tzgK5JlcQvwoakvF tazfTzBP3cbJTS/TptZAacSh04iVtPi194tCQgAjvZL+ZYNL3nvOdKiuJRuZHkBuBg6T PK0eFh9TDL2j90wuPLs55jEJykOHchMWLCEshpG8m4f89JKaX9hi/griD2gzQzGoKFIv gtzpY4/jpfOlumN7xL+8ZXRHdE1S6QOHwzZk2R1Pua/E1/c8lhyyPdNV7ejRfC0HIPo8 xJUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=oHN5R3kSl9may+fCeeK8Y0lhlktYjWsbhY4O625zzjE=; b=LqgSKYzprjKvS566Ztnbe4fqCuBcUiSx6luo4YJ53y6QWI4N8xkKhSdTgCFsQN6mdL D+taTjnjJaSgUosrwYbiSzD4h8LnkzOrgKdmlDbtMk3/dnXemQCzMp5FWptfHNjXw9Yu hJLOffEBkw+MqkX/W4EbsRUHaovRVmYjNFrzRHxx3bi7T783JSUGe1r/Meuj9M2MQqx/ YkWJAFj3QEFsk6SGKD6sZwucXWZzhuchyUJT1bcGuRAvjUqBvJLvDC4eUfJrVttnUPOu 0rtu+0yOJIsgC3IIZLHo2tGY7WvdAhUDIPgVM0i5RZTzi07euM82sF5Tg50dJ9fLPtIe Mo1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si13656030plo.425.2017.11.13.05.04.18; Mon, 13 Nov 2017 05:04:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754861AbdKMNCZ (ORCPT + 95 others); Mon, 13 Nov 2017 08:02:25 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51012 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754844AbdKMNCW (ORCPT ); Mon, 13 Nov 2017 08:02:22 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9889B9C; Mon, 13 Nov 2017 13:02:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonas Gorski , Florian Fainelli , Ralf Baechle , Yoshihiro YUNOMAE , Nicolas Schichan , linux-mips@linux-mips.org, linux-serial@vger.kernel.org, James Hogan Subject: [PATCH 4.9 74/87] MIPS: AR7: Defer registration of GPIO Date: Mon, 13 Nov 2017 13:56:31 +0100 Message-Id: <20171113125621.897389572@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonas Gorski 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") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli Cc: Ralf Baechle Cc: Greg Kroah-Hartman Cc: Yoshihiro YUNOMAE Cc: Nicolas Schichan Cc: linux-mips@linux-mips.org Cc: linux-serial@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/17542/ Signed-off-by: James Hogan Signed-off-by: Greg Kroah-Hartman --- arch/mips/ar7/platform.c | 4 ++++ arch/mips/ar7/prom.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c @@ -654,6 +654,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); --- a/arch/mips/ar7/prom.c +++ b/arch/mips/ar7/prom.c @@ -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))) From 1583957283675025800@xxx Mon Nov 13 13:22:59 +0000 2017 X-GM-THRID: 1583957283675025800 X-Gmail-Labels: Inbox,Category Promotions,HistoricalUnread