From patchwork Mon Oct 15 22:37:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1597071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E03B83FD86 for ; Mon, 15 Oct 2012 22:39:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TNtHd-0005qQ-Jh; Mon, 15 Oct 2012 22:37:13 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TNtHa-0005q0-5D for linux-arm-kernel@lists.infradead.org; Mon, 15 Oct 2012 22:37:10 +0000 Received: by mail-pa0-f49.google.com with SMTP id bi5so5527320pad.36 for ; Mon, 15 Oct 2012 15:37:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type:x-gm-message-state; bh=mpUQeJmvVq8328E9I6wSt1Yjma3RgsvAw/dn3WFLHks=; b=d8C7T3yIgUtovrwWDkQbJVzGvLpXERTPiY2hprIXjVtOdjk0qzlPohrL7Yk4i+DhDu 5nzMQipxHE+7sHzps/DJZYViLfhTh0FcASspN2Wgy/h9Vyf4B/rikKKWvvefdNuaLeI1 losxs/Ddaze0p62T6a7EjcSVIzxR10dNR5Yeu7rpv8hOkDreHHLJU+75040KYt+l9RO5 1hftSUzqrV5nfh0BLZg3iQwQhxiImevuroCpOxkBoTp6cPTsbHCD4tidkSNEgmFnK6Ww FRcoHm7ZPXDub5WDVdQDbcczIvlL71Lbze91W8cSvENcZISPvzPBFuJbi9XCdXQ0M6Wm OAzg== Received: by 10.68.129.5 with SMTP id ns5mr40919694pbb.103.1350340627653; Mon, 15 Oct 2012 15:37:07 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id jw14sm9671350pbb.36.2012.10.15.15.37.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 15:37:05 -0700 (PDT) From: Kevin Hilman To: Tony Lindgren Subject: Re: [RFT/PATCH] serial: omap: prevent resume if device is not suspended. Organization: Deep Root Systems, LLC References: <20120925092118.GJ31374@n2100.arm.linux.org.uk> <87ipas2y4h.fsf@deeprootsystems.com> <50784458.9080806@ti.com> <877gqv7imt.fsf@deeprootsystems.com> <20121012164202.GQ28061@n2100.arm.linux.org.uk> <877gqv4lmt.fsf@deeprootsystems.com> <20121012185426.GS28061@n2100.arm.linux.org.uk> <87lifbwhwd.fsf@deeprootsystems.com> <20121012215156.GL30339@atomide.com> Date: Mon, 15 Oct 2012 15:37:17 -0700 In-Reply-To: <20121012215156.GL30339@atomide.com> (Tony Lindgren's message of "Fri, 12 Oct 2012 14:51:56 -0700") Message-ID: <87391fs6oy.fsf@deeprootsystems.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkfkAgvtlI2B69AsU/1Li2LE6Qr3svrs0iUY+1GrNXeTXic9ZboZsvkVoC9fO/4bAr5M7le X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Paul Walmsley , Russell King - ARM Linux , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Felipe Balbi , santosh.shilimkar@ti.com, linux-serial@vger.kernel.org, Sourav , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alan@linux.intel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Tony Lindgren writes: > * Kevin Hilman [121012 13:34]: >> >> I'm not conviced (yet) that a mismatch is the root cause. Yes, that's >> what the author of $SUBJECT patch assumed and stated, but I'm not >> pursuaded. >> >> If it's an improperly configured mux issue, then the UART will break >> whenever the device is actually omap_device_enable'd, whether in the >> driver or in the bus layer. > > I tried booting n800 here with CONFIG_OMAP_MUX disabled, and no > change. Serial console output stops right when the console initializes. OK, since it's not mux, and since those who actually maintain this driver don't seem to be taking care of this, I did some digging today. Russell is right. It's a mismatch between assumed runtime PM state (disabled) and actual HW state. During init, all omap_devices are idled by default, so that they are correctly in the state that the runtime PM framework will later expect them to be. That is, all devices *except* the console UART. For that one, we use the special hwmod flag to not idle/reset the UART since that will cause problems during earlyprintk usage, and the switch between the earlyprintk console and the real console driver. Since the console uart was left enabled during init, it needs to be fully enabled and the runtime PM status set accordingly. The patch below does this, and works fine on 2420/n810, as well as on 3530/Overo, 3730/OveroSTORM, 3730/Beagle-XM and 4430/PandaES. Will send patch with a proper changelog shortly, Kevin diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 0405c81..37b5dbe 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -327,6 +327,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, if ((console_uart_id == bdata->id) && no_console_suspend) omap_device_disable_idle_on_suspend(pdev); + if (console_uart_id == bdata->id) { + omap_device_enable(pdev); + pm_runtime_set_active(&pdev->dev); + } + oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); oh->dev_attr = uart;