Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2235537imm; Sun, 9 Sep 2018 19:46:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaTbJj1QdyRVSGESSRnm2V7Rtxfo0AijQaEqw9e+oeA3Rby2kRXLNwj58pcgtSqO1wl93a3 X-Received: by 2002:a63:e0e:: with SMTP id d14-v6mr20299091pgl.38.1536547575527; Sun, 09 Sep 2018 19:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536547575; cv=none; d=google.com; s=arc-20160816; b=mn80qyy4TbwtTxtkZy1/6wYHamTbF93bRca3Qf3/HRAkNnRmbyVoM0Szbal/BFeJ4I uJEIeeKZMn/y0Asc0wg735J3bGKuKDbNPcCU4UN0oqzLjrZ9SkAp7VxpJYIdJY8HrjSc b7Hu9kTSM771kmeOWS5I5ctLOCr8b+NW6AthKAFZXD0/cicQy8qar73aDCZBrJ6AdNUj PjqgYYNoTvw3kkdp+a5HOlFoJLeT5SMkPpiKCJpI7kKIP7h0vO1QgUgpjH6d+9b3Ix54 sWZV8PvYoVKIS0fpMzN8CM+OLhMzw35dcnGGaHMHNg+/1AJW2dOLVNZSMugP6i+9PjY6 jUZg== 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; bh=M/QBgS5czV0iRAtflFDT2zvaSpvt1iMlKHvBYDahNH0=; b=PaRk3N3VTiGRNggclGB1QUAKezltXo+Qef/LnTzHdUEjhOx9pDuRI26/IrZAwnh/jF g1IKS2eYm6Egi2amlMyAji55fqndQji53PpYk/mHpzoOzkMXw6BP28blB6aORQODWrrg hOzOM5AhwNY+VXLtOlTWPeyjpA3FFaGF3Ezf/EhSfr0gZfRXmQPE4GWByeiwJl+Fw9AS zNcbMj03WNLpodBrRYircmqAnnyEhDlQ9mWCiNHAo2SI89h2a2s7+2Anc/uwlfN2VmXr Oyn7PzHboDcjSGVA8oDlZ4m116fHd8KcYX/nZdK1dMRR6JzHQnGuU/IH/pCStCPw8ZVg vaMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BK2PipI6; 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 3-v6si15220614plz.351.2018.09.09.19.46.00; Sun, 09 Sep 2018 19:46:15 -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=BK2PipI6; 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 S1726405AbeIJHga (ORCPT + 99 others); Mon, 10 Sep 2018 03:36:30 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46387 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725960AbeIJHg3 (ORCPT ); Mon, 10 Sep 2018 03:36:29 -0400 Received: by mail-lj1-f193.google.com with SMTP id 203-v6so16511940ljj.13; Sun, 09 Sep 2018 19:44:45 -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=M/QBgS5czV0iRAtflFDT2zvaSpvt1iMlKHvBYDahNH0=; b=BK2PipI63jK7bS8duqrxQsgUHGioMSIyS5BZ8q/FtzxBqKAzTQPvA4fibDXK3RAXm0 kdGJRtV/g5EO5ghMNB2VciyH765nIMOZYu936OMMptNgnWc96jJJc4Y3tt4s+qtA8yOp pfuI0Gl9T/bIikxE9K6BuXk8Y0ipRdSo6WT9qorVXH/hWFY2cfvYSNDrX4Evu0XFQje3 OUcdWzQYC0M5AdqkLxpVHls/XKGBxc3t8GpGuMaDWt/4NxwBPXbm/Pb2jNFfHQh/a7/f zVCe+5UZRlcGg8hRjI76+Ig81ROc0/tA8NZwwXL2V1cw+3s0GB5Qs880PRpEWDXjuvW1 bfBA== 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=M/QBgS5czV0iRAtflFDT2zvaSpvt1iMlKHvBYDahNH0=; b=cUTi9LipbmEryBDYZSyesfwMJWw3F0cEDU6xSP4sidGUq3hl5fuvTeh7uYNACR9r3Z SZ+zeo5pWZcJmp6IA7eNApm6Yie2sWvHXEndULTdjTnew4Blec47xDEkLiKcZ7in9tTX jrm0c7Dma5TIA2ICcfiwNZWvW83ARfPoPOFzfaLWM2Jb+jTYyePDIVh9MQe96EYftAub 96kK+xGfHKlWJcUstOCwEHOs/iiHsVkS9bRBpTb1nojahRSSi+54uG6HoMMoexs9s/3V TwbY5u+hJFLy6xuk3aDBDatYx62+FQ4b8+Owgi6vwY45rAaSyHXLYhae3J8U9qEE/bTx s6jw== X-Gm-Message-State: APzg51BwAT3pbft8pW2JKPv32jWMyOrein1ju+jC120nTu+QJ74olCQk 7ui8oh0i9HfZ9loIlHPYNhiVeOhk X-Received: by 2002:a2e:6a04:: with SMTP id f4-v6mr11225686ljc.109.1536536597340; Sun, 09 Sep 2018 16:43:17 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id h4-v6sm2355373lfj.69.2018.09.09.16.43.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Sep 2018 16:43:16 -0700 (PDT) From: Janusz Krzysztofik To: Tony Lindgren Cc: Linus Walleij , Aaro Koskinen , Janusz Krzysztofik , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] ARM: OMAP1: ams-delta: register MODEM device earlier Date: Mon, 10 Sep 2018 01:44:19 +0200 Message-Id: <20180909234419.31261-4-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180909234419.31261-1-jmkrzyszt@gmail.com> References: <20180820181333.2527-1-jmkrzyszt@gmail.com> <20180909234419.31261-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 conflict in registration order hazard against OMAP serial ports. Signed-off-by: Janusz Krzysztofik Reviewed-by: Linus Walleij --- 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 1d451142248c..667c3c1f05f5 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