Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1720120ybt; Thu, 18 Jun 2020 15:50:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOsOpz8lwEf9T6H7y1X3jFjkPgBhzgeb3blt2X5CVbEx5Ul6yBZ/Zbp/gv9A1tVoKaDkVv X-Received: by 2002:a17:906:b7cd:: with SMTP id fy13mr854112ejb.443.1592520606292; Thu, 18 Jun 2020 15:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592520606; cv=none; d=google.com; s=arc-20160816; b=yIB8SSzgDTcNOpghzqqX/M1GbGCp80ag+c61qp5DmAZRx+wH2kambqL3nB6bRvOW9t Pl0arwzC7MCgUJ0Hbiuclik6uUiOCfGQmNyxOtxvKYhmMoPXekpDUxt88ZelsAbrek7p pCAPuUdNq/ltM3s9BZuP/kFubg5+iiEKq8jVmSs50wDgSvfvVzsu5OUWb2Kt2NiYG9T1 lvpfazUaJOfrm5rgcdXwi+m8i5GD/7rLuTti/FKSD7a7Lb58OVKulGEip4eRNOwu84xz E0v1/k//bbasjbKmBcu3kmX/l7Y5ZclvSLIra0IQiw9MBNOBbbGFUuu68VzVAlbTQu19 +c/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ew2PN/4JsZ1wOw/upw7XfR2Cn0MqAYGwSv+ArwTNfmg=; b=D6KtRqLcQ3GznGqjEJLDU09TFa4RfgmD2/7xe9oA8jo7QbZIN7nI7Eu1llDrUJ4R7U RYSmjoXBBaDMwa7oF0yQd+bB8gu+yaWyUUl8J6pTD5KlcWWmAfnJ8Fz06pndK83rISX5 F99xjKlpzsKHmo9F1IkDuI+gTSXenlXFobzqFa3TLkkQjVELIpR1meJx7aa3WUi5qxt+ xyobUTmkAr5OrFJmWZtT66iEBDYzrmugwCoju5VRKXHlfz+jfS+b48/5+I5JOMHwf3zZ WwkMJ6D35mD+r4OYQqXuqoAiWV46RhN9sQBbX4q8qSxcf8+sKwuJfGWtqCcCquBb6mGU kWvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GtNFZSwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do15si4163818ejc.430.2020.06.18.15.49.42; Thu, 18 Jun 2020 15:50:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GtNFZSwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731463AbgFRVws (ORCPT + 99 others); Thu, 18 Jun 2020 17:52:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728484AbgFRVws (ORCPT ); Thu, 18 Jun 2020 17:52:48 -0400 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D294DC0613EE for ; Thu, 18 Jun 2020 14:52:46 -0700 (PDT) Received: by mail-vk1-xa43.google.com with SMTP id s192so1824975vkh.3 for ; Thu, 18 Jun 2020 14:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ew2PN/4JsZ1wOw/upw7XfR2Cn0MqAYGwSv+ArwTNfmg=; b=GtNFZSwLjEFMtYwi0oRZBt+nZLXjddEbJRtWA3O3P8yrVdh+hvhXAdHuvsPbpWO8ii fsmwrUcikBj2TG5ojkCPeDiL3xc/s/V4bO+dGxXHxeRVhRsVyZQYCRDJxzgKi/eUdOZp RqD7kWnJQgaLxxyMkLKR8Yju/2pQXlPg+7ivc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ew2PN/4JsZ1wOw/upw7XfR2Cn0MqAYGwSv+ArwTNfmg=; b=CBizPAd8PM57fOhWMGTzKiwt/wnQtb6CB7VOWw4bcOp310J/xh32I8saZthnQ5po5H Y5kNjlXpKgCz0ab5cQoEhWWxI2D0C34YQNPedJrR7X600BF1nZHw2UMxMqr7bmjy57Na 9huPgTnJd8MT8W6OXv39RQG9NWyU6bsIcvJmkh5BIQEoH6f74Ht/fXX6ao0U25ruOJ5Z rQkIeWRKHGMluvPXEl+iU4Jmg9SA6TVhHPKxc4dFYOwh9PkwnP0Sad6ueZzFrP2WCMu9 EbmhMklj9fDdoDBPUlZCb4Jby6AxZqQ5FoWcBNNnkp19exHVVq0xd4xkap7K19Dv6rBQ Bb+w== X-Gm-Message-State: AOAM531svmG829YYUOCLfoxSn9V3vTqRE2FR1NjsLZmy53XaAftff4Oy 6fY0xiTEF8SvhzdBkCPLJAHfxoiyjzg= X-Received: by 2002:a05:6122:302:: with SMTP id c2mr5243685vko.42.1592517165651; Thu, 18 Jun 2020 14:52:45 -0700 (PDT) Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com. [209.85.222.45]) by smtp.gmail.com with ESMTPSA id v26sm492176vsa.10.2020.06.18.14.52.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2020 14:52:44 -0700 (PDT) Received: by mail-ua1-f45.google.com with SMTP id c9so2496423uao.11 for ; Thu, 18 Jun 2020 14:52:44 -0700 (PDT) X-Received: by 2002:ab0:29c1:: with SMTP id i1mr451761uaq.120.1592517164088; Thu, 18 Jun 2020 14:52:44 -0700 (PDT) MIME-Version: 1.0 References: <20200528074530.1.Ib86e5b406fe7d16575ae1bb276d650faa144b63c@changeid> In-Reply-To: <20200528074530.1.Ib86e5b406fe7d16575ae1bb276d650faa144b63c@changeid> From: Doug Anderson Date: Thu, 18 Jun 2020 14:52:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] soc: qcom: rpmh-rsc: Don't use ktime for timeout in write_tcs_reg_sync() To: Andy Gross , Bjorn Andersson Cc: Maulik Shah , Stephen Boyd , linux-arm-msm , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bjorn and Andy, On Thu, May 28, 2020 at 7:48 AM Douglas Anderson wrote: > > The write_tcs_reg_sync() may be called after timekeeping is suspended > so it's not OK to use ktime. The readl_poll_timeout_atomic() macro > implicitly uses ktime. This was causing a warning at suspend time. > > Change to just loop 1000000 times with a delay of 1 us between loops. > This may give a timeout of more than 1 second but never less and is > safe even if timekeeping is suspended. > > NOTE: I don't have any actual evidence that we need to loop here. > It's possibly that all we really need to do is just read the value > back to ensure that the pipes are cleaned and the looping/comparing is > totally not needed. I never saw the loop being needed in my tests. > However, the loop shouldn't hurt. > > Fixes: 91160150aba0 ("soc: qcom: rpmh-rsc: Timeout after 1 second in write_tcs_reg_sync()") > Reported-by: Maulik Shah > Signed-off-by: Douglas Anderson > --- > > drivers/soc/qcom/rpmh-rsc.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) Is it a good time to land this change now that -rc1 has come out? It'd be nice to get this resolved. Thanks! -Doug