Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbdINQZq (ORCPT ); Thu, 14 Sep 2017 12:25:46 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:21814 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751517AbdINPwJ (ORCPT ); Thu, 14 Sep 2017 11:52:09 -0400 From: "Levin, Alexander (Sasha Levin)" Cc: Nicholas Mc Guire , Stephen Boyd , "Levin, Alexander (Sasha Levin)" X-Host: viking.odc.vzwcorp.com To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH for 4.9 23/59] clk: wm831x: fix usleep_range with bad range Thread-Topic: [PATCH for 4.9 23/59] clk: wm831x: fix usleep_range with bad range Thread-Index: AQHTLXFKOr3pUHfcCUe7FkSVcrz22A== Date: Thu, 14 Sep 2017 15:51:12 +0000 Message-ID: <20170914155051.8289-23-alexander.levin@verizon.com> References: <20170914155051.8289-1-alexander.levin@verizon.com> In-Reply-To: <20170914155051.8289-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8EGPprH014807 Content-Length: 1202 Lines: 34 From: Nicholas Mc Guire [ Upstream commit ed784c532a3d0959db488f40a96c5127f63d42dc ] The delay here is not in atomic context and does not seem critical with respect to precision, but usleep_range(min,max) with min==max results in giving the timer subsystem no room to optimize uncritical delays. Fix this by setting the range to 2000,3000 us. Fixes: commit f05259a6ffa4 ("clk: wm831x: Add initial WM831x clock driver") Signed-off-by: Nicholas Mc Guire Acked-by: Charles Keepax Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-wm831x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c index 0621fbfb4beb..a47960aacfa5 100644 --- a/drivers/clk/clk-wm831x.c +++ b/drivers/clk/clk-wm831x.c @@ -97,7 +97,8 @@ static int wm831x_fll_prepare(struct clk_hw *hw) if (ret != 0) dev_crit(wm831x->dev, "Failed to enable FLL: %d\n", ret); - usleep_range(2000, 2000); + /* wait 2-3 ms for new frequency taking effect */ + usleep_range(2000, 3000); return ret; } -- 2.11.0