Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1930927ybl; Tue, 3 Dec 2019 15:12:20 -0800 (PST) X-Google-Smtp-Source: APXvYqye8beUiLYlXRFWn0ZHE6QoUnVFpXk6Zd3l3Yc55sTPRbgajQNWeL8VLi0AeNReeNDp2Dmp X-Received: by 2002:aca:dd43:: with SMTP id u64mr82300oig.101.1575414739895; Tue, 03 Dec 2019 15:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575414739; cv=none; d=google.com; s=arc-20160816; b=bF26CFEcGI0tcf0f5hDQlQXlLVLBqxdHOzrQSGxEUDARZE4P967G7HS9avyXSs6Y86 nnJxaYaLMCMC1x/CMYRqc0VRclTOT1ved6icKvQwQ+KakV1j8V7n2xN9Bpl5QMLdlv99 kNWgfQQlNH97w4N7iqRPHhCQS7UpZ1350OVSJ9dr4T3WS4LDmoQqTrupxaN8Rms3fH+V vsAoNSeUNEr2xbvjCuDo325EWWS0S4wozIn/hcMA3o9rGrKLJk+zbQo77Fng1r5tAV3q eYYlYptfyHODjqQEiK8EV844v+OuCAed+R5FGwj5fw/YEYhZYSxdY6ssR4xlXbJridAE RR4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nGkamoKbZWpvWtFflfU3zDCZgGZ/psqHzmcpnhLq+wM=; b=J13i3OB0DE8m/RR64DF4jcHtNHradYpLNVeDLm/b6ZtiDWn2Z9rs2Bg7FR+gAxDUdD SXlhqCKga0Db7urGxulb7Nap/OVlJXcPngitj0Gr5F10+vq0GqNm7IDpXfEFXQQ/OZDi V3BlLflxt791KeSuIcpvGPjUbDa48Rr5t0qAeSNcEBnwatZBq5FsSlSgSro89MRDnc5W hY8wJzq7zkMN+GFUTIQdwa1vyyYcj32RQXEqzlWx0DmQLhRmwu/k2eI57QD3SjehH3G9 EWlkfM++atickkG+DU5AiQDzdamUwxXeN5C4ZBavbL9/L39QooTM9gf3fmCxdomyc4oq 8smA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CtCk79TN; 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 r65si2148997oig.69.2019.12.03.15.12.07; Tue, 03 Dec 2019 15:12:19 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CtCk79TN; 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 S1728697AbfLCWmr (ORCPT + 99 others); Tue, 3 Dec 2019 17:42:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:57752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728686AbfLCWmn (ORCPT ); Tue, 3 Dec 2019 17:42:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0402220684; Tue, 3 Dec 2019 22:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575412962; bh=t0sLogmBCCcptSxQbwL7O2wFcSPZZcIJVbZOHokkq8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CtCk79TNxx0Z5pne34mrVE1Wn4uJEPJl3msoiSyASvdf82sFMhtt0WXRSIO3gWPiS JgpWKKuuRTE41DOB3wUVerHZiBwGDTg9Dx46fhyIpn3VqmY6ctucFr0vALLM5B1BvO KTcTXhQs6RtmZQmJgpXt7yWooxfcOhVHn4O6EqWU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keerthy , Tero Kristo , Tony Lindgren , Stephen Boyd , Sasha Levin Subject: [PATCH 5.3 044/135] clk: ti: clkctrl: Fix failed to enable error with double udelay timeout Date: Tue, 3 Dec 2019 23:34:44 +0100 Message-Id: <20191203213017.974005977@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203213005.828543156@linuxfoundation.org> References: <20191203213005.828543156@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren [ Upstream commit 81a41901ffd46bac6df4c95b8290ac259e0feda8 ] Commit 3d8598fb9c5a ("clk: ti: clkctrl: use fallback udelay approach if timekeeping is suspended") added handling for cases when timekeeping is suspended. But looks like we can still get occasional "failed to enable" errors on the PM runtime resume path with udelay() returning faster than expected. With ti-sysc interconnect target module driver this leads into device failure with PM runtime failing with "failed to enable" clkctrl error. Let's fix the issue with a delay of two times the desired delay as in often done for udelay() to account for the inaccuracy. Fixes: 3d8598fb9c5a ("clk: ti: clkctrl: use fallback udelay approach if timekeeping is suspended") Cc: Keerthy Cc: Tero Kristo Signed-off-by: Tony Lindgren Link: https://lkml.kernel.org/r/20190930154001.46581-1-tony@atomide.com Tested-by: Keerthy Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/ti/clkctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 975995eea15cb..b0c0690a5a121 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -100,11 +100,12 @@ static bool _omap4_is_timeout(union omap4_timeout *time, u32 timeout) * can be from a timer that requires pm_runtime access, which * will eventually bring us here with timekeeping_suspended, * during both suspend entry and resume paths. This happens - * at least on am43xx platform. + * at least on am43xx platform. Account for flakeyness + * with udelay() by multiplying the timeout value by 2. */ if (unlikely(_early_timeout || timekeeping_suspended)) { if (time->cycles++ < timeout) { - udelay(1); + udelay(1 * 2); return false; } } else { -- 2.20.1