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: 2536801 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 407323FCA5 for ; Tue, 7 May 2013 21:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759431Ab3EGVj3 (ORCPT ); Tue, 7 May 2013 17:39:29 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:52502 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759421Ab3EGVj3 (ORCPT ); Tue, 7 May 2013 17:39:29 -0400 Received: by mail-pb0-f41.google.com with SMTP id mc17so719044pbc.14 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=SlbIBqiPaPGLaeLOStoG2W+cGhlsi1bP6qgINuzII4Wi/9nb/esE7RYxL1wsJJE5lw Mz5mrOOZKFjN74iiCHQhZw/83sXggrsF4muGPajSbRMiwRw0A/agDS54ukG1UXQJ5GYb 2xegDqqr/AZZeTEe8OyrPalsoNMcdHUGza81iFyMcrI6dawmb7gwBkB/GxM3fgBG5J3F nAQcOBDIKEVMLh0D01UJlogkNJLKMmz4MuT4CcbUXLrkdl5Q9I0MZin403zmIeDFjf+4 utJas8VFAcAydH6DSJk8Sd4unKxTmTtUpNyP0PLG5Fk5TA+YytJoZKTZ7NNRoA9KEabR 95Mg== 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 Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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: ALoCoQlb9tZk6ZcZ44MJO+tbqcAoyBQfIh64E0LukGdbprMc5uLJgxoNfmGQP6wPmGSGrkUWl3SL Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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__ */