[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f224fc29-4954-60f0-3eea-0973a94b29f4@linaro.org>
Date: Tue, 14 Feb 2023 10:54:25 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Sergio Paracuellos <sergio.paracuellos@...il.com>
Cc: linux-watchdog@...r.kernel.org, wim@...ux-watchdog.org,
linux@...ck-us.net, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, matthias.bgg@...il.com,
arinc.unal@...nc9.com, tsbogend@...ha.franken.de,
p.zabel@...gutronix.de, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-mips@...r.kernel.org
Subject: Re: [PATCH v6 3/3] watchdog: mt7621-wdt: avoid ralink architecture
dependent code
On 14/02/2023 10:50, Sergio Paracuellos wrote:
> On Tue, Feb 14, 2023 at 10:33 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@...aro.org> wrote:
>>
>> On 14/02/2023 09:54, Sergio Paracuellos wrote:
>>>>> return 0;
>>>>> @@ -143,6 +147,10 @@ static int mt7621_wdt_probe(struct platform_device *pdev)
>>>>> if (!drvdata)
>>>>> return -ENOMEM;
>>>>>
>>>>> + drvdata->sysc = syscon_regmap_lookup_by_compatible("mediatek,mt7621-sysc");
>>>>> + if (IS_ERR(drvdata->sysc))
>>>>> + return PTR_ERR(drvdata->sysc);
>>>>
>>>> This should be the backup/error path for original code using syscon
>>>> property. Looking up by compatible is really not portable/re-usable.
>>>
>>> I can change the code in the way you are pointing out here but...
>>> Why is it not re-usable? Compatible is not supposed to be changed
>>> since in other cases the DTB ABI will be broken. I am totally lost
>>> about what is an ABI breakage, then.
>>
>> How do you use it on other platform?
>
> I see, thanks.
>
> So if I am understanding you correctly I have to maintain the
> 'mediatek,sysctl' phandle and use it in the first instance and if it
> fails I have to use regmap_loopup_by_compatible() stuff, right?
> Something like:
>
> ...
>
> drvdata->sysc = syscon_regmap_lookup_by_phandle(np, "mediatek,sysctl");
> if (IS_ERR(drvdata->sysc)) {
> drvdata->sysc =
> syscon_regmap_lookup_by_compatible("mediatek,mt7621-sysc");
> if (IS_ERR(drvdata->sysc))
> return PTR_ERR(drvdata->sysc);
> }
>
> ....
>
> So in that case, we can add the new phandle to the bindings without
> any kind of ABI breakage and we can use old dtbs using new watchdog
> driver code.
>
Yes.
Best regards,
Krzysztof
Powered by blists - more mailing lists