From patchwork Tue Jun 9 09:49:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 6570681 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 48B01C0020 for ; Tue, 9 Jun 2015 09:51:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E6FD204AB for ; Tue, 9 Jun 2015 09:51:07 +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 A0DA42046F for ; Tue, 9 Jun 2015 09:51:06 +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 1Z2GBV-0005OV-Qt; Tue, 09 Jun 2015 09:51:05 +0000 Received: from mail-pd0-f180.google.com ([209.85.192.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z2GB5-0005Ak-D2; Tue, 09 Jun 2015 09:50:39 +0000 Received: by pdbnf5 with SMTP id nf5so11394199pdb.2; Tue, 09 Jun 2015 02:50:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oE7WDTvYtzZP37/1clHAWcJpCiRuizbGg7c1jpianmk=; b=AmDV2ptCjFl9zfFIy9w3kctZuUuQMJHOTVwbMvm+9mKgiIUiI+CfYgEOZ392XrdkA4 HF/zFUztnzM04IHBSL9FSdn11jPjuPUS51+U5s1IIbB2jnX4fGpVOa2Z/S7z43RQlIsV UZnZNRHwP/Cw5/Zl19VnxpuyiWimYt7NL9Fg87G4u5/0v6VGrb/FNwf70NnSKvoIPqqx RouzrUh0pERx8AEwnweQCbiKBosaT9ky8XWrwS740gD3Rc0roBbVNfh/SWgZm+cXwCZ9 87R8t10rjPeJpLVLvrX7CZaCEsfGvwCNDoN40vtihu2k7JmYfZB9Qk0ff1ANYNo+YMyo kGuA== X-Received: by 10.66.230.168 with SMTP id sz8mr38392913pac.4.1433843418336; Tue, 09 Jun 2015 02:50:18 -0700 (PDT) Received: from localhost.localdomain ([191.101.57.10]) by mx.google.com with ESMTPSA id sc1sm5090052pac.36.2015.06.09.02.50.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jun 2015 02:50:17 -0700 (PDT) From: Caesar Wang To: Heiko Stuebner Subject: [PATCH v6 2/3] ARM: rockchip: ensure CPU to enter WFI/WFE state Date: Tue, 9 Jun 2015 17:49:58 +0800 Message-Id: <1433843400-24831-3-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433843400-24831-1-git-send-email-wxt@rock-chips.com> References: <1433843400-24831-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150609_025039_515921_E695C638 X-CRM114-Status: UNSURE ( 9.78 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) Cc: Russell King , Dmitry Torokhov , dianders@chromium.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Caesar Wang 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: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The patch can ensure that v7_exit_coherency_flush() in rockchip_cpu_die() executed in time. The mdelay(1) has enough time to fix the problem of CPU offlining. That's a workaround way in rockchip hotplug code, At least, we haven't a better way to solve it. Who know, that maybe fixed by chip (hardware) in the future. Signed-off-by: Caesar Wang Reviewed-by: Douglas Anderson Reviewed-by: Kever Yang --- Changes in v6: - Fix the delay 1ms describing. Series-changes: 5 - Fix the patch decription. - Add the changelog. Series-changes: 2 - As Kever points out, Fix the subject typo WFI/WFE. arch/arm/mach-rockchip/platsmp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index b379cc8..d629206 100644 --- a/arch/arm/mach-rockchip/platsmp.c +++ b/arch/arm/mach-rockchip/platsmp.c @@ -322,6 +322,13 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) #ifdef CONFIG_HOTPLUG_CPU static int rockchip_cpu_kill(unsigned int cpu) { + /* + * We need a delay here to ensure that the dying CPU can finish + * executing v7_coherency_exit() and reach the WFI/WFE state + * prior to having the power domain disabled. + */ + mdelay(1); + pmu_set_power_domain(0 + cpu, false); return 1; }