From patchwork Fri Oct 24 19:55:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 5149421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DBEC89F349 for ; Fri, 24 Oct 2014 20:01:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC07820251 for ; Fri, 24 Oct 2014 20:01:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 14A2120165 for ; Fri, 24 Oct 2014 20:01:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xhl0k-0004P3-Ld; Fri, 24 Oct 2014 19:58:58 +0000 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xhl0h-0004JM-Ha for linux-arm-kernel@lists.infradead.org; Fri, 24 Oct 2014 19:58:56 +0000 Received: by mail-la0-f41.google.com with SMTP id pn19so3482694lab.0 for ; Fri, 24 Oct 2014 12:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ez3ggEmkO9e88y6Rjl/k05WsCxcb97MnBl/+GjyjsaE=; b=kU7pX597qmlRevlWYFK5VMoVrlSb4z+ePcl9Tm23z73r6bfQ1M/V+Opx2rY0trD2Ij hVrxM6sCJaffND0KTffE3LdWSY/28dwlmPhFWPVa3EjUUcpDwKssYQboLO+TXYjrRNcO tE1hSlBdvHVezmWWbr6S4QSGFulgxfgQOq6sG8DtPseX8L6/Z4/lBI7b4t4X0LLmXvTm Gcj/HZqlbPM3T8CRG/gYw/6jY/+hxmVeiY+bUCziyO86XTpqWBkbhEAXSKiAw15bXNlL K4nicUoiTzYIrilMAohNt1Std+zvFsOVCPAelE6E3wb8jZxapAVxWzfWmVlPb8WaaUg8 3kUQ== X-Received: by 10.112.221.226 with SMTP id qh2mr6719793lbc.5.1414180712738; Fri, 24 Oct 2014 12:58:32 -0700 (PDT) Received: from xi.terra (s83-177-171-8.cust.tele2.se. [83.177.171.8]) by mx.google.com with ESMTPSA id u14sm2177353laz.13.2014.10.24.12.58.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Oct 2014 12:58:31 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.84) (envelope-from ) id 1XhkxQ-0007kt-4G; Fri, 24 Oct 2014 21:55:32 +0200 Date: Fri, 24 Oct 2014 21:55:32 +0200 From: Johan Hovold To: Felipe Balbi Subject: Re: [PATCH v2 00/20] rtc: omap: fixes and power-off feature Message-ID: <20141024195532.GF19377@localhost> References: <1412881594-25678-1-git-send-email-johan@kernel.org> <1413913086-12730-1-git-send-email-johan@kernel.org> <20141024160845.GM26941@saruman> <20141024190251.GB19377@localhost> <20141024192540.GD11455@saruman> <20141024192948.GE11455@saruman> <20141024193655.GD19377@localhost> <20141024194442.GG11455@saruman> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141024194442.GG11455@saruman> User-Agent: Mutt/1.5.22 (2013-10-16) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141024_125855_841714_8CD2257F X-CRM114-Status: GOOD ( 23.42 ) X-Spam-Score: -0.7 (/) Cc: Alessandro Zummo , rtc-linux@googlegroups.com, devicetree@vger.kernel.org, Tony Lindgren , j-keerthy@ti.com, nsekhar@ti.com, Johan Hovold , linux-kernel@vger.kernel.org, t-kristo@ti.com, Lokesh Vutla , linux-arm-kernel@lists.infradead.org, =?iso-8859-1?Q?Beno=EEt?= Cousson , Russell King , Andrew Morton , linux-omap@vger.kernel.org, Guenter Roeck X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Oct 24, 2014 at 02:44:42PM -0500, Felipe Balbi wrote: > On Fri, Oct 24, 2014 at 09:36:55PM +0200, Johan Hovold wrote: > > On Fri, Oct 24, 2014 at 02:29:48PM -0500, Felipe Balbi wrote: > > > Hi, > > > > > > On Fri, Oct 24, 2014 at 02:25:40PM -0500, Felipe Balbi wrote: > > > > with this I always get to "Power off failed -- system halted". If I > > > > switch to v3.18-rc1 vanilla, then it works. So it's definitely caused by > > > > your rtc-only patches. > > > > That's expected (see below). It works with v3.18-rc1 vanilla because > > machine_halt is called instead of machine_power_off as there is no > > registered power-off handler. > > yeah, that much I figured :-) > > > > ok, so it seems like it takes more than 1 second for things to > > > propagate. If I increase that mdelay() to 3000, then everything works > > > fine on my end. I think we should get RMK's input on this 3000ms delay > > > to machine_power_off(). Should it be generic, or should we add it to our > > > rtc pm_power_off implementation ? > > > > As I wrote above, we still need a 2-second mdelay in rtc-omap, which I > > intend to add to the pmic_power_en patch. > > oh, alright then. If you can Cc me, I'll make sure to test that too ;-) I will. :) Just wanted to see whether Andrew preferred I resend the whole series or just that one patch first. The diff is minimal: > > which wouldn't take nearly as long as rtc-omap and hence wouldn't be > > adding an explicit delay in the driver power-off handler. > > alright. I'll call it a day now. Will keep you posted. Thanks, Johan Tested-by: Felipe Balbi diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index e74750f00b18..e4f97ad9eb21 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -423,6 +423,8 @@ static void omap_rtc_power_off(void) val = rtc_read(rtc, OMAP_RTC_INTERRUPTS_REG); rtc_writel(rtc, OMAP_RTC_INTERRUPTS_REG, val | OMAP_RTC_INTERRUPTS_IT_ALARM2); + + mdelay(2000); } > > The one-second delay is there in machine_power_off to catch most cases