linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Yu Tu <yu.tu@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jianxin Pan <jianxin.pan@amlogic.com>
Cc: "open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>, <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH RESEND] clk: meson: pll: copy retry workaround from vendor driver
Date: Tue, 30 Aug 2022 14:33:30 +0800	[thread overview]
Message-ID: <09befaaf-b34a-aeda-5dd6-6bfae4b01163@amlogic.com> (raw)
In-Reply-To: <1jk06rtlrv.fsf@starbuckisacylon.baylibre.com>



On 2022/8/29 17:54, Jerome Brunet wrote:
> [ EXTERNAL EMAIL ]
> 
> 
> On Sun 14 Aug 2022 at 23:25, Heiner Kallweit <hkallweit1@gmail.com> wrote:
> 
>> On a S905X4-based system this call fails randomly.
>> The vendor driver has a retry mechanism and on my system
>> the second attempt is successful always.
>>
> 
> This reason looks a bit weak to me.
> I'd like AML team to comment on this PLL problem as I suspect it might
> relate to other PLL we have been seeing

First of all, we've had this problem before. But the probability is very 
low, most of the PLL will not lock when the chip is tested at high and 
low temperature.

Our actual code has retry mechanism to solve the above problem.

> 
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>   drivers/clk/meson/clk-pll.c | 12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c
>> index 9e55617bc..daa025b6d 100644
>> --- a/drivers/clk/meson/clk-pll.c
>> +++ b/drivers/clk/meson/clk-pll.c
>> @@ -320,12 +320,16 @@ static int meson_clk_pll_is_enabled(struct clk_hw *hw)
>>   
>>   static int meson_clk_pcie_pll_enable(struct clk_hw *hw)
>>   {
>> -	meson_clk_pll_init(hw);
>> +	int retries = 10;
>>   
>> -	if (meson_clk_pll_wait_lock(hw))
>> -		return -EIO;
>> +	do {
>> +		meson_clk_pll_init(hw);
>> +		if (!meson_clk_pll_wait_lock(hw))
>> +			return 0;
>> +		pr_info("Retry enabling PCIe PLL clock\n");
>> +	} while (--retries);
>>   
>> -	return 0;
>> +	return -EIO;
>>   }
>>   
>>   static int meson_clk_pll_enable(struct clk_hw *hw)
> 
> .

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-08-30  6:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-14 21:25 [PATCH RESEND] clk: meson: pll: copy retry workaround from vendor driver Heiner Kallweit
2022-08-29  9:54 ` Jerome Brunet
2022-08-30  6:33   ` Yu Tu [this message]
2022-09-06 15:21     ` Jerome Brunet
2022-09-06 18:29       ` Heiner Kallweit
2022-09-13  8:42         ` Jerome Brunet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09befaaf-b34a-aeda-5dd6-6bfae4b01163@amlogic.com \
    --to=yu.tu@amlogic.com \
    --cc=hkallweit1@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=jianxin.pan@amlogic.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=narmstrong@baylibre.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).