Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4184337imm; Mon, 20 Aug 2018 11:14:06 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzIxyjZjjsS3aY2QtLBhr2PdiXXXfKJygMGuyGJ5ft7IEJsMkyeNO/TZzemYSWAtq6LOT3J X-Received: by 2002:a17:902:d881:: with SMTP id b1-v6mr17192769plz.191.1534788846225; Mon, 20 Aug 2018 11:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534788846; cv=none; d=google.com; s=arc-20160816; b=iYiRqNzdmWwrEaS4CN/3WiyKYNWoBGTew33GMaHnVT5pBjFSnt/L2xeGbD6u0HtoeG 3+iiCsyH+9e00+/n23Eop9PedGM1u8JpFyFy6U6kRRurQqxpgEv27/308CxkAMVYTBqp hhes/Bjl22n9q8z0gQ24dMATKvhEXeXTFIGdfmJI/x5zrJMLQze31B0HaSXoE91VoiL4 NH0xvpoE2tTaEsWqfbaoFlYO5xaUdAgi3gY2Cir4Dhy38KnyaAZcutSCcyIB0jN76Ib7 YPfKhhoi7XpnNYl7j2RxU2K0sxC6DwhHTR62K6sHnF9Z54j1/sur7yQCx81uJc/Km+Hx PMKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3dosDfoX2lLtKRM7stKlq06j/xqPONJf6rhUbBAZA3A=; b=VKEdDMWic0weK4j+aOa9APycElPVelen0iDhMYBeFXtts9TDbXzJ4Xq9YXhn/y5SIC PBXCbb9eMFjYhGMj58F34kZNKeURvQNkmsGO861fZ2Suc2ux6qBtXY1Jr27Hot4AY9ta RI74bLvsf1eOOM3ywuzFb5ZpHU5kVEzCIxAR4IT6wbdTVUde9ATXC1jPBFM6kckM7hmz nwz7Y5owQsaIqtZCjYtpkyqSkDfb8RM1Rstin8vv4ZNN2sOrRtZAuBs1q4z82722K/KY 8OcLKrzPX63vVdS3MTe+EVXtgzQJsKlhGLLMyhnUy1AgzJc9KucNJ/YMI7Vyt/Fzbs1Y dQlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lYt7kJyS; 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 d12-v6si10214692pla.421.2018.08.20.11.13.49; Mon, 20 Aug 2018 11:14:06 -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=lYt7kJyS; 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 S1726659AbeHTV3X (ORCPT + 99 others); Mon, 20 Aug 2018 17:29:23 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:39089 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbeHTV3W (ORCPT ); Mon, 20 Aug 2018 17:29:22 -0400 Received: by mail-lf1-f67.google.com with SMTP id j201-v6so345525lfg.6; Mon, 20 Aug 2018 11:12:40 -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:in-reply-to:references; bh=3dosDfoX2lLtKRM7stKlq06j/xqPONJf6rhUbBAZA3A=; b=lYt7kJySiIkQG5dCEZZYyHekHe1WO3mA42KOewv7dTKhwxPZZV9YL129N8DbJTEn2y IAXptQODRZ9bNzaoreSBu5Q0MWCgb+DA771iZTtiaNNXBKixt3yWs8WSx5CZ6OwgUne1 MJHFcaeYt28Jmm/0fXRcj5iiVqqQyMwdZheHeQ0rpXKMj3aWmlop88lKYExjVaC9iCZ9 gCYc9DXOMj/mpht1B5ZC3m3TlEti9qEZX4t9uhfIyZkAiXJL0dCzMTDEfrSUTw7qa/kT ZbK4zPosEultQpbvhOaILKOhfeqXKpC3gO5dMqIuWBvQmsfTpt0yM12fcHUuZsxLO7k+ w3eA== 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:in-reply-to :references; bh=3dosDfoX2lLtKRM7stKlq06j/xqPONJf6rhUbBAZA3A=; b=qfeULCaSIwGporgMCdjipE2q2b3c0zRanYVTjrcB0aMGKWRVrlW2hEhdPzjXrjtUue KJ7g/fPcrQL3gax+63Tcb60HPoYrn5e3UKXbuTDUUdOex/0FF4PlWWD3b4RJRI8hv9Ps 9qmeTeT74DmKtOiMGdVAGYwGNAYAw/nnuuLCaOnJ8mDC+4x+vXCkeUGk/SfBZV8W8Ow8 mq+TdJDrtCK8C/HmwDiWVn72kNmRYuvLt1JIke1eKicqgtVrmjHfKJMtjwNI1oYNapuv KUsQ5vazZ4sViAwh9RUVNYgYOi1nR8WeWij3TqfYtNuuE2yltWWO2eRGlv5vxwl4zHnf AeaA== X-Gm-Message-State: AOUpUlGRFU1NdVqDHun+zyp2mjrJ+tLRwkxY0q7loMP21b3KEqUM7x4/ DA9EYzmZNSrVlOsWISIMBCA= X-Received: by 2002:a19:5353:: with SMTP id h80-v6mr15760581lfb.9.1534788759832; Mon, 20 Aug 2018 11:12:39 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id g16-v6sm379918lfb.5.2018.08.20.11.12.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 11:12:39 -0700 (PDT) From: Janusz Krzysztofik To: Tony Lindgren Cc: Aaro Koskinen , Linus Walleij , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-serial@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik Subject: [PATCH 3/3] ARM: OMAP1: ams-delta: register MODEM device earlier Date: Mon, 20 Aug 2018 20:13:33 +0200 Message-Id: <20180820181333.2527-4-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180820181333.2527-1-jmkrzyszt@gmail.com> References: <20180820181333.2527-1-jmkrzyszt@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Amstrad Delta MODEM device used to be initialized at arch_initcall before it was once moved to late_initcall by commit f7519d8c8290 ("ARM: OMAP1: ams-delta: register latch dependent devices later"). The purpose of that change was to postpone initialization of devices which depended on latch2 pins until latch2 converted to GPIO device was ready. After recent fixes to GPIO handling, it was possible to moove registration of most of those device back to where they were before. The same can be safely done with the MODEM device as initialization of GPIO pins it depends on was moved to machine_init by preceding patch. Move registration of the MODEM device to arch_initcall_sync, not to arch_initcall, so it is never exposed to potential conflictinh registration order hazard against OMAP serial ports. Signed-off-by: Janusz Krzysztofik --- arch/arm/mach-omap1/board-ams-delta.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index c865c6921af8..a98783f98f3a 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -896,11 +896,28 @@ static int __init modem_nreset_init(void) /* * This function expects MODEM IRQ number already assigned to the port * and fails if it's not. + * The MODEM device requires its RESET# pin kept high during probe. + * That requirement can be fulfilled in several ways: + * - with a descriptor of already functional modem_nreset regulator + * assigned to the MODEM private data, + * - with the regulator not yet controlled by modem_pm function but + * already enabled by default on probe, + * - before the modem_nreset regulator is probed, with the pin already + * set high explicitly. + * The last one is already guaranteed by ams_delta_latch2_init() called + * from machine_init. + * In order to avoid taking over ttyS0 device slot, the MODEM device + * should be registered after OMAP serial ports. Since those ports + * are registered at arch_initcall, this function can be called safely + * at arch_initcall_sync earliest. */ static int __init ams_delta_modem_init(void) { int err; + if (!machine_is_ams_delta()) + return -ENODEV; + if (ams_delta_modem_ports[0].irq < 0) return ams_delta_modem_ports[0].irq; @@ -913,6 +930,7 @@ static int __init ams_delta_modem_init(void) return err; } +arch_initcall_sync(ams_delta_modem_init); static int __init late_init(void) { @@ -922,10 +940,6 @@ static int __init late_init(void) if (err) return err; - err = ams_delta_modem_init(); - if (err) - return err; - /* * Once the modem device is registered, the modem_nreset * regulator can be requested on behalf of that device. -- 2.16.4