From patchwork Tue May 7 21:39:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 2536811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 44751DF215 for ; Tue, 7 May 2013 21:40:02 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZpc5-0002vB-BC; Tue, 07 May 2013 21:39:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZpc2-00053v-Dl; Tue, 07 May 2013 21:39:54 +0000 Received: from mail-pb0-x22e.google.com ([2607:f8b0:400e:c01::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZpbz-00052N-IC for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2013 21:39:52 +0000 Received: by mail-pb0-f46.google.com with SMTP id rq8so715955pbb.19 for ; Tue, 07 May 2013 14:39:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=f0acyKjpdy7yNW2SF2V/PRvVUXf0ZZ8UHTKALmCJsAU=; b=hiUA2XiNqICSbiUI9zOcNwocX7XSkMLKAz1TNI3mIkK3Ere0wyN6Iv9uKQ74bWV+31 0FOtXuEUuZIg4Hh5Ndr1tFmigJkXGnlF+WmrryKBJmiNvlLxTR0t0AGzNoYYyzmWk7b+ XpQlZ2WLd7e9T9OCTuIHFW+S3Cd+ll9K5pUqz6JcmZNYWXHBCXYMMjCAVGs60QSs0XZS IIcl0WrVepqe9r7UPrPkS/Gwh74oWT/ZrHkiZuIDHrPXX+URp2fY9+io9xvGvuT4GgAk a7qrJeqVCFezbAkhWKlbBveFyL3QKa/objDZCzA6ijmQZeIzJWdeDiZQGNq0i3YnN+tx iR6Q== X-Received: by 10.66.27.36 with SMTP id q4mr3539714pag.174.1367962768591; Tue, 07 May 2013 14:39:28 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPSA id uf2sm29620493pbc.41.2013.05.07.14.39.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 07 May 2013 14:39:27 -0700 (PDT) From: Kevin Hilman To: Tony Lindgren Subject: [PATCH] ARM: OMAP2+: omap_device: use late_initcall_sync Date: Tue, 7 May 2013 14:39:25 -0700 Message-Id: <1367962765-13912-1-git-send-email-khilman@linaro.org> X-Mailer: git-send-email 1.8.2 X-Gm-Message-State: ALoCoQmfPyGiMdY99HEaVZ64ZXOpNLifIVFIveq2eAX4jrjCDLWTVGqsgJB1oA6bU0exBI0f6LcJ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130507_173951_711346_110559CB X-CRM114-Status: GOOD ( 12.75 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If DEBUG_LL and earlyprintk are enabled, and omap-serial.c is compiled as a module, the kernel boot hangs early as the clocks for serial port are cut while earlyprintk still uses the port. The problem is a race between the late_initcall for omap_device (which idles devices that have no drivers) and the late_initcall in kernel/printk.c which turns off the earlyconsole. Any printks that happen between this omap_device late initcall and the earlyconsole late initcall will crash when accessing the UART. The fix is to ensure the omap_device initcall happens after the earlyconsole initcall. Reported-by: Tony Lindgren Signed-off-by: Kevin Hilman --- Based on v3.9-rc8 arch/arm/mach-omap2/omap_device.c | 2 +- arch/arm/mach-omap2/soc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 381be7a..2d20d69 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -879,4 +879,4 @@ static int __init omap_device_late_init(void) bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle); return 0; } -omap_late_initcall(omap_device_late_init); +omap_late_initcall_sync(omap_device_late_init); diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h index c62116b..de88611 100644 --- a/arch/arm/mach-omap2/soc.h +++ b/arch/arm/mach-omap2/soc.h @@ -494,6 +494,7 @@ level(__##fn); #define omap_subsys_initcall(fn) omap_initcall(subsys_initcall, fn) #define omap_device_initcall(fn) omap_initcall(device_initcall, fn) #define omap_late_initcall(fn) omap_initcall(late_initcall, fn) +#define omap_late_initcall_sync(fn) omap_initcall(late_initcall_sync, fn) #endif /* __ASSEMBLY__ */