From patchwork Tue Feb 11 17:10:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 24486 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CA351203F3 for ; Tue, 11 Feb 2014 17:16:02 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id i4sf34795495oah.7 for ; Tue, 11 Feb 2014 09:16:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=M3fD9NoZC+WhNPFYhGtrwzG1c/OJBGQm3Qe0Bv75M2E=; b=l18Xd9qVDLBJGrArtDE21Agg6OSNoUBf3QLKE+e9sGqI+Eh2T994IxqX/v6DvrXaqn 32IqODD6fMhfZRa/vHExlGQAU2Kh7Fobk9RyzkE/gOyy/cdxDNbRnrrPPJDmxsuND6OS SN/Be33anFTHS30DfJLNCRZ24PI/dkPHYCJgWeu0nqmF0h1mooaNhh8yvjOol4t7fTXX yIUj47kUnpAt6LNSZSHYAOVNHX5uGCK5RxIM4VPt8MRZjZLC5PI2qEL2c2Y7pesr1AXx AkJhKOjHOSCvCjdnm152RGYi3LhHZxhE1dpi2NE0JqCRKndhg4konscrloj2tMqu0cFx 19wg== X-Gm-Message-State: ALoCoQntkcINA8q3b7TLg53Y5gaJXeC0KiEBabs0y37VZFl601P5i16zFgYkyP+044aQ5EhxCUfo X-Received: by 10.42.35.75 with SMTP id p11mr182637icd.16.1392138961830; Tue, 11 Feb 2014 09:16:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.165 with SMTP id e34ls993986qgf.29.gmail; Tue, 11 Feb 2014 09:16:01 -0800 (PST) X-Received: by 10.52.248.138 with SMTP id ym10mr24585411vdc.18.1392138961674; Tue, 11 Feb 2014 09:16:01 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id fo2si6150988vcb.12.2014.02.11.09.16.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 09:16:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so6306368vcb.28 for ; Tue, 11 Feb 2014 09:16:01 -0800 (PST) X-Received: by 10.58.4.138 with SMTP id k10mr29296316vek.8.1392138961392; Tue, 11 Feb 2014 09:16:01 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp262566vcz; Tue, 11 Feb 2014 09:16:00 -0800 (PST) X-Received: by 10.66.246.229 with SMTP id xz5mr34070903pac.119.1392138960385; Tue, 11 Feb 2014 09:16:00 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si19663957pae.69.2014.02.11.09.15.59; Tue, 11 Feb 2014 09:15:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753086AbaBKRPx (ORCPT + 27 others); Tue, 11 Feb 2014 12:15:53 -0500 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:25121 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752043AbaBKRKq (ORCPT ); Tue, 11 Feb 2014 12:10:46 -0500 Received: from hornet.Cambridge.Arm.com (hornet.cambridge.arm.com [10.2.201.45]) by collaborate-mta1.arm.com (Postfix) with ESMTP id DBE35140087; Tue, 11 Feb 2014 11:10:44 -0600 (CST) From: Pawel Moll To: arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Pawel Moll , Dmitry Eremin-Solenikov , David Woodhouse Subject: [PATCH 02/12] power/reset: vexpress: Use udelay instead of timers Date: Tue, 11 Feb 2014 17:10:26 +0000 Message-Id: <1392138636-29240-3-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392138636-29240-1-git-send-email-pawel.moll@arm.com> References: <1392138636-29240-1-git-send-email-pawel.moll@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pawel.moll@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , At this stage of system shutdown procedure the jiffies may not be updated anymore, so just use udelay instead. Cc: Dmitry Eremin-Solenikov Cc: David Woodhouse Signed-off-by: Pawel Moll --- drivers/power/reset/vexpress-poweroff.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/power/reset/vexpress-poweroff.c b/drivers/power/reset/vexpress-poweroff.c index 37e7799..195235c 100644 --- a/drivers/power/reset/vexpress-poweroff.c +++ b/drivers/power/reset/vexpress-poweroff.c @@ -11,7 +11,7 @@ * Copyright (C) 2012 ARM Limited */ -#include +#include #include #include #include @@ -26,13 +26,9 @@ static void vexpress_reset_do(struct device *dev, const char *what) struct regmap *reg = dev_get_drvdata(dev); if (reg) { - unsigned long timeout; - err = regmap_write(reg, 0, 0); - - timeout = jiffies + HZ; - while (time_before(jiffies, timeout)) - cpu_relax(); + if (!err) + mdelay(1000); } dev_emerg(dev, "Unable to %s (%d)\n", what, err);