Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2838439ybh; Mon, 9 Mar 2020 14:12:18 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvN+RvvCpuyzX+YKg+5cpN6ZFrSocz9/rr/a4IF97KoQ8gzgwS6t49NLwWjxXCeQad4H7Xx X-Received: by 2002:aca:b70a:: with SMTP id h10mr921106oif.20.1583788338240; Mon, 09 Mar 2020 14:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583788338; cv=none; d=google.com; s=arc-20160816; b=LpCC7BVVJ7yQvtKNkMFBSQ2QEnSutdDPodW3b+q4X8faSe38COAidwPZt/+RidH7Bn LV42SrMuksjLAfvJnbYiE40U29+aQpZ7Jf61RLm5CdtQjbSMAy0u+Rdn+tQmDX5ZHiEV /Ga8vFfNeuThFRxco6HMls2YhEvx3uGwA/b3o/afylpKW0lP8+r8w01M3U6vWMYcOu2D oyvPuUtTTqBo7pJSqtt92xOn4xINdzV3nAA89PdqyI2pS0Amr4ApU5lYcG4FBhagrn20 NqhO33q/1YRyl2FFAx3fOTm1Tqf/FBZmCXw3FQDo40qDDpnmH76Kfpp5Mw1utD3G17iL Eyrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=yU68s5HuqYhNTYUkzjC1U86mJUMTG72xWa99BdXa1bY=; b=gy3PH0YUDuLXeXNljfKy+bByx1Nj57fUFaT779NtgaT4119AGhSpjE6xE2LAUDmXSv tljDG7fhVUWpjM6S2hpsWqa3DKRRYUzxpjC7EW00NoZeX+WyEdGsZiCEmmm/tNGY6Qne hNWbagxQsstx64PhvoB59f5BsoUkXf1VaPNkvXNHnlKr16Oz55Zo/PqGiBCEfImDK8vo nh4z+JQTXZb36hWFK8yQn4ihw5Wv8OIkw5XUWHww5CPDaohbrJVTb3C/9dZVneLfbA7w PhY+Z1OfUrxMu+CcTvxsd33Zy9c9MwBc1fmSoRXHoVIgqZo59IIgxDY7eszvg4NCSlG3 4Rwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZiHtmQcj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si6827484oto.305.2020.03.09.14.12.06; Mon, 09 Mar 2020 14:12:18 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ZiHtmQcj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726682AbgCIVKz (ORCPT + 99 others); Mon, 9 Mar 2020 17:10:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:33978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgCIVKz (ORCPT ); Mon, 9 Mar 2020 17:10:55 -0400 Received: from kernel.org (unknown [104.132.0.74]) (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 D84DF2146E; Mon, 9 Mar 2020 21:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583788255; bh=yU68s5HuqYhNTYUkzjC1U86mJUMTG72xWa99BdXa1bY=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=ZiHtmQcjssp3eqcwno/Z5O1qOGfIC18fPg9z1OUcICEZI42NWDZ6K1K5BWNv+P1uM USxqOOwfqAdf8EDqwM8vqAoxXEWc6UQFXWyXUQsDR8/im7LeR09i+cT5LHc9fwoy4S EkSQNZCoVaFh0602XoLwEmox69k44dEIyZshMPNk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20200215021232.1149-1-mdtipton@codeaurora.org> References: <20200215021232.1149-1-mdtipton@codeaurora.org> Subject: Re: [PATCH] clk: qcom: clk-rpmh: Wait for completion when enabling clocks From: Stephen Boyd Cc: bjorn.andersson@linaro.org, mturquette@baylibre.com, agross@kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Tipton To: Mike Tipton , tdas@codeaurora.org Date: Mon, 09 Mar 2020 14:10:54 -0700 Message-ID: <158378825407.66766.14135857856613969751@swboyd.mtv.corp.google.com> User-Agent: alot/0.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Mike Tipton (2020-02-14 18:12:32) > The current implementation always uses rpmh_write_async, which doesn't > wait for completion. That's fine for disable requests since there's no > immediate need for the clocks and they can be disabled in the > background. However, for enable requests we need to ensure the clocks > are actually enabled before returning to the client. Otherwise, clients > can end up accessing their HW before the necessary clocks are enabled, > which can lead to bus errors. >=20 > Use the synchronous version of this API (rpmh_write) for enable requests > in the active set to ensure completion. >=20 > Completion isn't required for sleep/wake sets, since they don't take > effect until after we enter sleep. All rpmh requests are automatically > flushed prior to entering sleep. >=20 > Fixes: 9c7e47025a6b ("clk: qcom: clk-rpmh: Add QCOM RPMh clock driver") > Signed-off-by: Mike Tipton > --- Applied to clk-next but I squashed in some changes to make it easier for me to read.