Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1967638imm; Thu, 2 Aug 2018 04:13:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcO/7yNHBXTVjVFdFXm5pYjmKPJ+NzekmUraE8fYJgwNnNXZdtGpZTZq7Uo/jU6d/C392mZ X-Received: by 2002:a63:e914:: with SMTP id i20-v6mr2356399pgh.10.1533208408665; Thu, 02 Aug 2018 04:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533208408; cv=none; d=google.com; s=arc-20160816; b=I/edC6TC/HDhCv0OoYLhMPC/QOnMAQfDC9FHaWtH4rl5a6uWwZhdK4mimhYb+X5HtF Kh5SlWz1qASf2YIwoDm+jjhCHeIl3t2vdCM/wiLd/NH5eKdlBxWD2zxFqzXa4qn4g0NH TFsrWBArsiNhn6uLNjDJJ/Xb3mJogSXcKCZ55j5tPLC0uTKKWHriicmyZvrCaLCtSDkS q8G4kv8bpBHZXMHhEyiGnCNI8Hsl9k7upetFWKCH2VDp6fc29RJO02rW+3eRKzSUUezV DsY1maUmDRliwZzB0eFEk3wSKODsjetnKF+S7A+V+gyGGyX/RbncxZunt8PR185KmEct /Urg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=0ynkw2hB14rcQY1Mb1ryHXQyygRwuaPP/EG0/OxRpQM=; b=MuLv/ZFIXM35Ny8XN16euXY1x+6jAlZ0NK+KjoaXlrIHBL/1OOd5/Vf7xJEShu9nEr H7Xpdu2Cqk66knELR9pISj/fDhxfnQICMhzTXBirEz01pIQI0p/+JcyVYbSbMbLwTPZy HPIL0g+0MHkzV4nZHHR6gKxlBiGd1DfYlYn9iz64JR6zidlztX6zOH3tYDEs5XLyRgQj DOjLfQV2rR/BXaAqBh415BpKjvNe+4LktPqufuyRrmRxHYpghMaUz3UmvicuvJF1/9MT j3GcwSHtccGeSG2qPumo0uX5pSYaJgne+p2g9YrCxHvQ8krWP8vw8/Oh9t6+lH2jxoqZ FMKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sHGcoVtH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2-v6si1823779pgq.479.2018.08.02.04.13.14; Thu, 02 Aug 2018 04:13:28 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sHGcoVtH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732141AbeHBNDC (ORCPT + 99 others); Thu, 2 Aug 2018 09:03:02 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44139 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729592AbeHBNDC (ORCPT ); Thu, 2 Aug 2018 09:03:02 -0400 Received: by mail-ed1-f67.google.com with SMTP id f23-v6so788020edr.11; Thu, 02 Aug 2018 04:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0ynkw2hB14rcQY1Mb1ryHXQyygRwuaPP/EG0/OxRpQM=; b=sHGcoVtHuofzVa966cvlYe5Ex0esvthdgCeut5cB8Nlq3IDMPxPYzhikpJ/EUq6pk/ D/gkpc5vgRz0EPBDA9LEymN/y+gHgOiCJY6d05vRp0If0HkewysUsl0xi1/yMxDO5ZJt G+EIgp6un0VauCd8KERT9cLNsCVmebBCJGvfGEzxX9vjYN/me+RA/8SMrpHfgrnfndVP e2E22jYM396tF6cq/GuR5q+dcuL5efOniPDw2+qvS7/iK1jv1iENDW/7w7aUp6jixxQy /t7oVD0QHO/TlkiBeJcPJYbzAO6AGRNElMYaTi0Bt3bAAKzPB0kx8imjZDZIs3VW45sd 1CHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0ynkw2hB14rcQY1Mb1ryHXQyygRwuaPP/EG0/OxRpQM=; b=fi+48gTIHeX0EwH2v3H667oL4YhByE9cjBhLAoCmyLU1uwodvviaulkJvU7OsBUSSu DWomr9HXKnKRZZRzrJZ8+B9IkCaZf45hSL7iCzvdPkOlsX9ocwC2C7QAGKzblip/zkAZ owFQlsdRhmchGHt6ISL9MEpNQLNTDg18Is17bearWfVzWw/17d01SaOzme9hg5rW/KBE 1zOwxNu9pnLTOKljcgNygy0Ex5OijsUv8UbY3DdGubhg2FktQOFfIPTVwGOIqvowF80F O3Y8mBGl5pbT7PaoMGFxpQZcXqNsY2q4poN6MBDN5ptuEJpu1hL1mlI3VOjCRDXPNqyQ sdBw== X-Gm-Message-State: AOUpUlGp4rdrHyil0EA6ymRVDA+aipXtZ5Xqsxq4slE7HWQ0t4E0AGqk bh2agmZtGrTR+bo1861dPoWQOKJ2 X-Received: by 2002:a50:955e:: with SMTP id v30-v6mr2978557eda.268.1533208340396; Thu, 02 Aug 2018 04:12:20 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id c21-v6sm886933eda.21.2018.08.02.04.12.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Aug 2018 04:12:19 -0700 (PDT) From: Dmitry Osipenko To: Linus Walleij , Thierry Reding , Jonathan Hunter , Stefan Agner , Marcel Ziswiler Cc: linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/2] pinctrl: tegra: Move drivers registration to arch_init level Date: Thu, 2 Aug 2018 14:11:43 +0300 Message-Id: <20180802111144.12512-1-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a bug in regards to deferred probing within the drivers core that causes GPIO-driver to suspend after its users. The bug appears if GPIO-driver probe is getting deferred, which happens after introducing dependency on PINCTRL-driver for the GPIO-driver by defining "gpio-ranges" property in device-tree. The bug in the drivers core is old (more than 4 years now) and is well known, unfortunately there is no easy fix for it. The good news is that we can workaround the deferred probe issue by changing GPIO / PINCTRL drivers registration order and hence by moving PINCTRL driver registration to the arch_init level and GPIO to the subsys_init. Signed-off-by: Dmitry Osipenko --- drivers/pinctrl/tegra/pinctrl-tegra114.c | 7 ++++++- drivers/pinctrl/tegra/pinctrl-tegra124.c | 7 ++++++- drivers/pinctrl/tegra/pinctrl-tegra20.c | 7 ++++++- drivers/pinctrl/tegra/pinctrl-tegra210.c | 7 ++++++- drivers/pinctrl/tegra/pinctrl-tegra30.c | 7 ++++++- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/tegra/pinctrl-tegra114.c b/drivers/pinctrl/tegra/pinctrl-tegra114.c index 511a8774fd8d..d43c209e9c30 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra114.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra114.c @@ -1868,4 +1868,9 @@ static struct platform_driver tegra114_pinctrl_driver = { }, .probe = tegra114_pinctrl_probe, }; -builtin_platform_driver(tegra114_pinctrl_driver); + +static int __init tegra114_pinctrl_init(void) +{ + return platform_driver_register(&tegra114_pinctrl_driver); +} +arch_initcall(tegra114_pinctrl_init); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra124.c b/drivers/pinctrl/tegra/pinctrl-tegra124.c index 57e3cdcf4503..5b07a5834d15 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra124.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra124.c @@ -2080,4 +2080,9 @@ static struct platform_driver tegra124_pinctrl_driver = { }, .probe = tegra124_pinctrl_probe, }; -builtin_platform_driver(tegra124_pinctrl_driver); + +static int __init tegra124_pinctrl_init(void) +{ + return platform_driver_register(&tegra124_pinctrl_driver); +} +arch_initcall(tegra124_pinctrl_init); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra20.c b/drivers/pinctrl/tegra/pinctrl-tegra20.c index 624889ed3a9d..1fc82a9576e0 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra20.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra20.c @@ -2277,4 +2277,9 @@ static struct platform_driver tegra20_pinctrl_driver = { }, .probe = tegra20_pinctrl_probe, }; -builtin_platform_driver(tegra20_pinctrl_driver); + +static int __init tegra20_pinctrl_init(void) +{ + return platform_driver_register(&tegra20_pinctrl_driver); +} +arch_initcall(tegra20_pinctrl_init); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra210.c b/drivers/pinctrl/tegra/pinctrl-tegra210.c index 0956a1c73391..3e77f5474dd8 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra210.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra210.c @@ -1582,4 +1582,9 @@ static struct platform_driver tegra210_pinctrl_driver = { }, .probe = tegra210_pinctrl_probe, }; -builtin_platform_driver(tegra210_pinctrl_driver); + +static int __init tegra210_pinctrl_init(void) +{ + return platform_driver_register(&tegra210_pinctrl_driver); +} +arch_initcall(tegra210_pinctrl_init); diff --git a/drivers/pinctrl/tegra/pinctrl-tegra30.c b/drivers/pinctrl/tegra/pinctrl-tegra30.c index c923ad58af84..10e617003e9c 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra30.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra30.c @@ -2503,4 +2503,9 @@ static struct platform_driver tegra30_pinctrl_driver = { }, .probe = tegra30_pinctrl_probe, }; -builtin_platform_driver(tegra30_pinctrl_driver); + +static int __init tegra30_pinctrl_init(void) +{ + return platform_driver_register(&tegra30_pinctrl_driver); +} +arch_initcall(tegra30_pinctrl_init); -- 2.18.0