Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5704490yba; Thu, 11 Apr 2019 04:06:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVEV4qI2/b8Ams3uuppHfKapvhIo99MUEwOAuuNGWMhBAjPt/4XWViY0+iGrSKvhzBbJQA X-Received: by 2002:a65:5682:: with SMTP id v2mr47156078pgs.100.1554980816187; Thu, 11 Apr 2019 04:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554980816; cv=none; d=google.com; s=arc-20160816; b=ONL0IXopXixFwEFBkgMR+t6NRz1426VkYgZVdLT3HZnlRb0FLvq3yTKd9IK0ANJpR3 qtcltEanW5nVtJG/nOArZ4TTTlstDs4vbpkEXcGYmC03UBGND/gOH2C9iiygDEaJ5460 VRrI360TeLtdRtNyeLJjDodf6SRjW/1dmKosKUicPeAipz8GjKQD60o066LxpxHC4B+6 8yqsspJwXlDYBnEuDY7O+iip5u+abu1OP0t1AQs1KWiakBjvlPikDCXB4Le/f1bNiKPA dwMngVmMoVh3bstYnO3VSiBMg9XsE+VLeMFhBAkhvHTqX5ypMbSKPa3Yo/Ysx3uQvExN q2fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4ry4yYvuia1B0qcnqa+sQdGxCyq4ID22m9EB2mqrb9c=; b=tVeympBh1N06yLEuh/3QluCX7DKKquC81jzDqHMzIR7tKVg0gYrRGjP+j+mAxsHE/s oqLJ1btw4RgnqZ2H7it2hol1ISlnLBqUf0jEHljb3QFceLq+0r+WsGrqqDNyqkDfa96d +fUwgyyJSk2HgFTDpevW8t1eefOV83qitogOboyGcwMCAxLUPJzSUNnTaiBOfHA4Dmze b7zHThD9769mCHtGtyY9HwWEu43KvTx42wne7T0DvIw5VWv4C5Gu3df7MqsFE5B+HIhs fo47Ny34lqUhcD74qY6duVsX0Vw8Vjg0JEdyfpbev3w2gdfuDQ4ixg0EW5RhS6jveivb gntA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23si30935522pgv.471.2019.04.11.04.06.40; Thu, 11 Apr 2019 04:06:56 -0700 (PDT) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726655AbfDKLEs (ORCPT + 99 others); Thu, 11 Apr 2019 07:04:48 -0400 Received: from www.osadl.org ([62.245.132.105]:39967 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfDKLEs (ORCPT ); Thu, 11 Apr 2019 07:04:48 -0400 Received: from localhost.localdomain (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3BB4Ikm015352; Thu, 11 Apr 2019 13:04:18 +0200 From: Nicholas Mc Guire To: Ulf Hansson Cc: Michael Turquette , Stephen Boyd , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH V2] clk: ux500: add range to usleep_range Date: Thu, 11 Apr 2019 13:04:11 +0200 Message-Id: <1554980651-54136-1-git-send-email-hofrat@opentech.at> X-Mailer: git-send-email 2.1.4 X-Spam-Status: No, score=-1.9 required=6.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Providing a range for usleep_range() allows the hrtimer subsystem to coalesce timers - the delay is runtime configurable so a factor 2 is taken to provide the range. With the expected range for enable_delay_us being milliseconds, the range should lie in the 250us range which is sufficient for hrtimer optimization. Signed-off-by: Nicholas Mc Guire --- Problem located with an experimental coccinelle script V2: As clarified by Ulf Hansson the delays here are typically in the millisecond range - so as proposed replace the factor 2 by a 25% increase of max. Patch was compile tested with: u8500_defconfig (implies COMMON_CLK=y) (with some unrelated sparse warnings about not implemented system calls) Patch is against 5.1-rc4 (localversion-next is next=20190410) drivers/clk/ux500/clk-sysctrl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c index 7c0403b..698306f 100644 --- a/drivers/clk/ux500/clk-sysctrl.c +++ b/drivers/clk/ux500/clk-sysctrl.c @@ -42,7 +42,8 @@ static int clk_sysctrl_prepare(struct clk_hw *hw) clk->reg_bits[0]); if (!ret && clk->enable_delay_us) - usleep_range(clk->enable_delay_us, clk->enable_delay_us); + usleep_range(clk->enable_delay_us, clk->enable_delay_us + + (clk->enable_delay_us >> 2)); return ret; } -- 2.1.4