Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp561342pxa; Tue, 11 Aug 2020 09:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxXq1fu99cfUswATNP7/srPdTICBua3Qd+KR6jEqvWf1zeZl8ZYwB+mwcrgd/2FF+RKpug X-Received: by 2002:a17:906:2cc2:: with SMTP id r2mr26723590ejr.482.1597163221268; Tue, 11 Aug 2020 09:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597163221; cv=none; d=google.com; s=arc-20160816; b=VzRBPjAW0CWUXp7hvUfwUMbansvlRKKxOCeE9J22SYgn3pBd/a7ADRpz4h31RFlHUO 82ODHPNC1imOQrq6P+sPO+7q7WZJ4ma7CDAE/gY0Vw+tQb39aNgfwz1cktAJnw0adx9C 0+7mFpMY+NkpOL51Xlrlmthl62jXwyi8DDHcAgtlDbZGm08GQljEeIFWhAwi5ARlmDCi R56fqM+++VeHIS2fQMoLfA25m+s29Q1L3pwv+cx0wB9HMN5JT8Qpw/HykEpzI7R0vjK2 4DgvDBP/8M+LUd3CCewm9Q2vh6WQPlq3Lcfd9bR5YSjH9vtzASB8oInLOyaOf7dLLY4D feYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Iuqv7eIHYfXgK19qe41RWiBOyrd4XMzCh2PQNRNcYJI=; b=qZMDzs8ppTe3/hK47+2U0cHWO4oQB8afg0aUReV7W1morvSuEFf8GdoI1yoqmSN2xw mgKMdeuzYVu08UI+T04qXWkDUVNeHPlDavsNpIFaY+jSamy9Kkf7d6rJV2jzkL9+BP0R uXwmwNVsBaO8T1+2jBz1HTlmB7z7/yky7b/SaVb5f/TeoTtWGrCnX/ZkPftEmKPh9RmU ILBhAjy9i74Gbl0cgrWVyE/akalg6d+LLhQ1iE2I0Az9sMejwmAvKMMsWzbjl5OUhNzv g269Tnlj4v7VYKfY7RhsyWwK8AaM5eRAN3kgYAQ8HgMjJSHXO//lZw/gY69ZSo1pcigF jrvg== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si12575422edn.499.2020.08.11.09.26.38; Tue, 11 Aug 2020 09:27:01 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729111AbgHKQYE convert rfc822-to-8bit (ORCPT + 99 others); Tue, 11 Aug 2020 12:24:04 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35731 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728947AbgHKQYE (ORCPT ); Tue, 11 Aug 2020 12:24:04 -0400 Received: by mail-wr1-f67.google.com with SMTP id f1so12053255wro.2; Tue, 11 Aug 2020 09:24:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=DtpRyILKzc0LouHDjzEvI9K36MDUnhjMvK2V986wT4M=; b=LdqvsTagJF3aA/dh6RRzmlDxpTlHXdx1v0klsu34KdMhRvgXnM7lJgQPYsNYeA1MRj nQ6ZcHJrHaahIT47DSQtixqag/fwVKtmQwWk6yTPYxbI/VFZRJ17pzYp2aM1RAykTD79 4uodZYP/AVS/pB5H9CAWm3fBi6v8o0NO1B73OTqrDPIFDmbxaz0ADDT+i4ybB4GNy2Kf +/bN1/WiO4Eu5ONB2oHUHbl9ZfGrlDSWhofqYuqLm4A+6YxHlCdGSqFmSE7InCE2zN+q DLOZ7BmWeHpDNlyFtxaQDtC3FNKZ4s2W2ZXHG3UVGo2D0ERZeuJOjXipyO16Oeqp+iym +LLg== X-Gm-Message-State: AOAM533oWhuJvlVuj97VRseDsCqBp000nMknCiCBwlQBOXEZqezMNo90 I4YGkWR2te+iOA0ZEM1xblw= X-Received: by 2002:adf:fdce:: with SMTP id i14mr29548489wrs.273.1597163041912; Tue, 11 Aug 2020 09:24:01 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id g8sm6017509wme.13.2020.08.11.09.24.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Aug 2020 09:24:01 -0700 (PDT) Date: Tue, 11 Aug 2020 18:23:58 +0200 From: Krzysztof Kozlowski To: Tomasz Figa Cc: Sylwester Nawrocki , "open list:COMMON CLK FRAMEWORK" , Chanwoo Choi , Stephen Boyd , Mike Turquette , "moderated list:SAMSUNG SOC CLOCK DRIVERS" , linux-kernel , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: Re: [PATCH v2] clk: samsung: Prevent potential endless loop in the PLL set_rate ops Message-ID: <20200811162358.GA7169@kozik-lap> References: <20200811112507.24418-1-s.nawrocki@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 02:59:07PM +0200, Tomasz Figa wrote: > Hi Sylwester, > > 2020年8月11日(火) 13:25 Sylwester Nawrocki : > > > > In the .set_rate callback for some PLLs there is a loop polling state > > of the PLL lock bit and it may become an endless loop when something > > goes wrong with the PLL. For some PLLs there is already (a duplicated) > > code for polling with timeout. This patch replaces that code with > > the readl_relaxed_poll_timeout_atomic() macro and moves it to a common > > helper function, which is then used for all the PLLs. The downside > > of switching to the common macro is that we drop the cpu_relax() call. > > Tbh. I'm not sure what effect was exactly expected from cpu_relax() in > the functions which already had timeout handling. Could someone shed > some light on this? For us, it should not matter much, except: 1. when on A9 with ARM_ERRATA_754327, but we do not enable it on our platforms, 2. it is a generic pattern for busy loops. On other architectures it could mean something (e.g. yield to other hyper-threading CPU). Looks good. Acked-by: Krzysztof Kozlowski Best regards, Krzysztof