From patchwork Sun Dec 7 23:46:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 5453501 Return-Path: X-Original-To: patchwork-linux-rockchip@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 7669C9F1D4 for ; Sun, 7 Dec 2014 23:47:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8882B2012B for ; Sun, 7 Dec 2014 23:47:44 +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 9A89520123 for ; Sun, 7 Dec 2014 23:47:43 +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 1XxlYE-0006Ci-Bg; Sun, 07 Dec 2014 23:47:42 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XxlYB-0005kX-DD; Sun, 07 Dec 2014 23:47:40 +0000 Received: from ip545477c2.speed.planet.nl ([84.84.119.194] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XxlXW-0007qi-GW; Mon, 08 Dec 2014 00:46:58 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Kevin Hilman , Chris Zhong Subject: Re: [PATCH v10 0/4] This suspend patch is only support cut off the power of cpu and some external Date: Mon, 08 Dec 2014 00:46:47 +0100 Message-ID: <2362255.5fGiDIoeyd@phil> User-Agent: KMail/4.14.2 (Linux/3.16-3-amd64; KDE/4.14.1; x86_64; ; ) In-Reply-To: <7hiohszgep.fsf@deeprootsystems.com> References: <1417423940-1669-1-git-send-email-zyw@rock-chips.com> <547F1639.3030102@rock-chips.com> <7hiohszgep.fsf@deeprootsystems.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141207_154739_612100_BE6D6675 X-CRM114-Status: GOOD ( 24.06 ) X-Spam-Score: -0.0 (/) Cc: Mark Rutland , "devicetree@vger.kernel.org" , Russell King , Pawel Moll , Ian Campbell , Linus Walleij , Doug Anderson , "linux-kernel@vger.kernel.org" , "open list:ARM/Rockchip SoC..." , Rob Herring , Kumar Gala , Mike Turquette , Tony Xie , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, 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 Hi, Am Mittwoch, 3. Dezember 2014, 11:23:26 schrieb Kevin Hilman: > Chris Zhong writes: > > [...] > > > I have test these patches on evb board base on next-20141128 with a > > defconfig[0], and with u-boot[1]. > > As Doug said, we need below 3 patches for resume. > > > > 1.https://patchwork.kernel.org/patch/5051881/ - clocksource: > > arch_timer: Allow the device tree to specify uninitialized timer > > registers > > > > 2.https://patchwork.kernel.org/patch/5363671/ - clocksource: > > arch_timer: Fix code to use physical timers when requested > > > > 3.https://patchwork.kernel.org/patch/5382141/ - ARM: dts: rk3288: add > > > > arm,cpu-registers-not-fw-configured > > > > And it will auto wakeup, as Heiko said in v8. > > OK, with your series plus those 3 patches on top of next-20141128, I'm > now seeing it auto-wakeup, either with multi_v7_defconfig or Heiko's > rk3288_defconfig. > > > But I have never notice before, since the u-boot never enable edp, and > > I use the coreboot with edp display. Actually it is a bug in rk3288, > > the rk3288 have not 27Mhz clock source, but the edp initially set to > > this non-existent clock. At this time, edp is working on a unknown > > state, and it always bring a interrupt, this interrupt avoid system > > enter suspend. > > I see, good find! I think the "problem" might be a different one. With Chris' short patch [0] enabling a bit of gic debug output on resume I was able to track down where my wakeup comes from and it seems to be the sdmmc_detect_n interrupt. When I have a sd card inserted it wakes up again directly and when I remove it it stays asleep till I wake it with the power- button. Relevant output would be: gic_cpu_restore add = f0000000, 0, 0, 0, 0, 8 I have verified that at least for me the sclk_edp_24m has no influence on this, by using an uboot that does not reparent the edp clock (it stays an orphan) and an uboot that reparents it to xin24m. In both cases the system wakes up directly when I have a sd card in the slot and stays asleep (till pressing the power-key) when I remove the card. So the auto-wakeup is not the fault of the new suspend-code, but we should find a way to tame sdmmc_detect_n :-) Now I only need to check why I get a rk3288_suspend_finish: Suspend finish failed on every resume [1], but that is something for tomorrow. Heiko [0] [1] Disabling non-boot CPUs ... CPU1: shutdown CPU2: shutdown CPU3: shutdown gic_cpu_restore add = f0000000, 0, 0, 0, 20000, 0 Enabling non-boot CPUs ... CPU1 is up CPU2 is up CPU3 is up PM: noirq resume of devices complete after 0.892 msecs PM: early resume of devices complete after 0.991 msecs rk3288_suspend_finish: Suspend finish failed PM: resume of devices complete after 2.496 msecs diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index d617ee5..37d5ce0 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -538,6 +538,7 @@ static void gic_cpu_restore(unsigned int gic_nr) u32 *ptr; void __iomem *dist_base; void __iomem *cpu_base; + u32 reg[5]; if (gic_nr >= MAX_GIC_NR) BUG(); @@ -562,6 +563,10 @@ static void gic_cpu_restore(unsigned int gic_nr) writel_relaxed(GICC_INT_PRI_THRESHOLD, cpu_base + GIC_CPU_PRIMASK); gic_cpu_if_up(); + + for (i = 0; i < 5; i++) + reg[i] = readl_relaxed(dist_base + 0x200 + i * 4); + printk("%s add = %x, %x, %x, %x, %x, %x\n",__func__, dist_base, reg[0], reg[1], reg[2], reg[3], reg[4]); } static int gic_notifier(struct notifier_block *self, unsigned long cmd, void *v)