Devicetree
 help / color / mirror / Atom feed
* Re: [PATCH v4 11/18] ASoC: mediatek: Add common mtk_afe_component_probe callback
From: Alexandre Mergnat @ 2024-04-10 15:13 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-12-angelogioacchino.delregno@collabora.com>

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

On 09/04/2024 13:33, AngeloGioacchino Del Regno wrote:
> Multiple MediaTek AFE PCM component drivers are using their own .probe()
> callback, but most of those are simply duplicated functions as they are
> doing exactly the same thing over and over.
> 
> Add a common probe callback for this component to reduce duplication.

-- 
Regards,
Alexandre

^ permalink raw reply

* Re: [PATCH v4 10/18] ASoC: mediatek: mt8186-rt1019: Migrate to the common mtk_soundcard_startup
From: Alexandre Mergnat @ 2024-04-10 15:07 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-11-angelogioacchino.delregno@collabora.com>

What is the purpose of these change ? I don't see the link with the 
migration to the common mtk_soundcard_startup.

On 09/04/2024 13:33, AngeloGioacchino Del Regno wrote:
> diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
> index bfcfc68ac64d..dbe5afa0e9ee 100644
> --- a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
> +++ b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
> @@ -2729,7 +2729,7 @@ static int mt8186_afe_runtime_resume(struct device *dev)
>   	struct mtk_base_afe *afe = dev_get_drvdata(dev);
>   	struct mt8186_afe_private *afe_priv = afe->platform_priv;
>   	int ret;
> -
> +pr_err("mt8186 afe runtime_resume\n");

Forgot to remove this print ?

>   	ret = mt8186_afe_enable_clock(afe);
>   	if (ret)
>   		return ret;
> @@ -2739,7 +2739,7 @@ static int mt8186_afe_runtime_resume(struct device *dev)
>   		return ret;
>   
>   	if (!afe->regmap || afe_priv->pm_runtime_bypass_reg_ctl)
> -		goto skip_regmap;
> +		return 0;
>   
>   	regcache_cache_only(afe->regmap, false);
>   	regcache_sync(afe->regmap);
> @@ -2758,13 +2758,20 @@ static int mt8186_afe_runtime_resume(struct device *dev)
>   	/* enable AFE */
>   	regmap_update_bits(afe->regmap, AFE_DAC_CON0, AUDIO_AFE_ON_MASK_SFT, BIT(0));
>   
> -skip_regmap:
>   	return 0;
>   }
>   
>   static int mt8186_afe_component_probe(struct snd_soc_component *component)
>   {
> -	mtk_afe_add_sub_dai_control(component);
> +	struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
> +	int ret;
> +
> +	snd_soc_component_init_regmap(component, afe->regmap);
> +
> +	ret = mtk_afe_add_sub_dai_control(component);
> +	if (ret)
> +		return ret;
> +
>   	mt8186_add_misc_control(component);
>   
>   	return 0;
> @@ -2929,6 +2936,10 @@ static int mt8186_afe_pcm_dev_probe(struct platform_device *pdev)
>   		goto err_pm_disable;
>   	}
>   
> +	ret = regmap_reinit_cache(afe->regmap, &mt8186_afe_regmap_config);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "regmap_reinit_cache fail\n");
> +
>   	/* others */
>   	afe->mtk_afe_hardware = &mt8186_afe_hardware;
>   	afe->memif_fs = mt8186_memif_fs;
> diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-adda.c b/sound/soc/mediatek/mt8186/mt8186-dai-adda.c
> index dbd157d1a1ea..b87b04928678 100644
> --- a/sound/soc/mediatek/mt8186/mt8186-dai-adda.c
> +++ b/sound/soc/mediatek/mt8186/mt8186-dai-adda.c
> @@ -413,7 +413,7 @@ static const struct snd_soc_dapm_widget mtk_dai_adda_widgets[] = {
>   			      SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
>   
>   	SND_SOC_DAPM_SUPPLY_S("AUD_PAD_TOP", SUPPLY_SEQ_ADDA_AUD_PAD_TOP,
> -			      AFE_AUD_PAD_TOP, RG_RX_FIFO_ON_SFT, 0,
> +			      SND_SOC_NOPM, 0, 0,

Is it related to the regmap init function added in the AFE PCM probe ?

>   			      mtk_adda_pad_top_event,
>   			      SND_SOC_DAPM_PRE_PMU),
>   	SND_SOC_DAPM_SUPPLY_S("ADDA_MTKAIF_CFG", SUPPLY_SEQ_ADDA_MTKAIF_CFG,

-- 
Regards,
Alexandre

^ permalink raw reply

* Re: [PATCH v3 1/2] dt-bindings: mtd: amlogic,meson-nand: support fields for boot ROM code
From: Arseniy Krasnov @ 2024-04-10 14:51 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-mtd, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel, oxffffaa, kernel
In-Reply-To: <20240410170040.37a59ff6@xps-13>



On 10.04.2024 18:00, Miquel Raynal wrote:
> Hi Arseniy,
> 
> avkrasnov@salutedevices.com wrote on Wed, 10 Apr 2024 17:48:02 +0300:
> 
>> Hi,
>>
>> On 10.04.2024 13:23, Miquel Raynal wrote:
>>> Hi Arseniy,
>>>
>>> avkrasnov@salutedevices.com wrote on Tue, 9 Apr 2024 21:10:24 +0300:
>>>   
>>>> Boot ROM code on Meson requires that some pages on NAND must be written
>>>> in special mode: "short" ECC mode where each block is 384 bytes and
>>>> scrambling mode is on. Such pages located with the specified interval
>>>> within specified offset. Both interval and offset are located in the
>>>> device tree and used by driver if 'nand-is-boot-medium' is set for
>>>> NAND chip.
>>>>
>>>> Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
>>>> ---
>>>>  .../bindings/mtd/amlogic,meson-nand.yaml           | 14 ++++++++++++++
>>>>  1 file changed, 14 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>>>> index 57b6957c8415..b86a1953056b 100644
>>>> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>>>> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>>>> @@ -64,11 +64,25 @@ patternProperties:
>>>>          items:
>>>>            maximum: 0
>>>>  
>>>> +      amlogic,boot-page-last:
>>>> +        $ref: /schemas/types.yaml#/definitions/uint32
>>>> +        description:
>>>> +          The NFC driver needs this information to select ECC
>>>> +          algorithms supported by the boot ROM.  
>>>
>>> Shall we have a length rather than the last page?  
>>
>> You mean rename it to "amlogic,boot-pages-length" or something like that ? But I think
>> length in bytes is useless here:
>> 1) boot rom needs that only some single pages are written in special mode (and as I see in
>>    vendor's driver it also works in pages).
>> 2) NAND driver operates in pages during write/read such pages.
>>
>> So length in bytes will be converted to pages anyway.
>>
>> What do You think ?
> 
> I didn't talk about units :-)
> 
> Maybe: amlogic,boot-pages would make sense? But pointing at the last
> page seems weird.

Ah ok I see. Got it!

Thanks, Arseniy

> 
> Miquèl

^ permalink raw reply

* Re: [PATCH v3 1/2] dt-bindings: mtd: amlogic,meson-nand: support fields for boot ROM code
From: Miquel Raynal @ 2024-04-10 15:00 UTC (permalink / raw)
  To: Arseniy Krasnov
  Cc: Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-mtd, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel, oxffffaa, kernel
In-Reply-To: <588551c9-3426-e623-e2aa-70b040c9324a@salutedevices.com>

Hi Arseniy,

avkrasnov@salutedevices.com wrote on Wed, 10 Apr 2024 17:48:02 +0300:

> Hi,
> 
> On 10.04.2024 13:23, Miquel Raynal wrote:
> > Hi Arseniy,
> > 
> > avkrasnov@salutedevices.com wrote on Tue, 9 Apr 2024 21:10:24 +0300:
> >   
> >> Boot ROM code on Meson requires that some pages on NAND must be written
> >> in special mode: "short" ECC mode where each block is 384 bytes and
> >> scrambling mode is on. Such pages located with the specified interval
> >> within specified offset. Both interval and offset are located in the
> >> device tree and used by driver if 'nand-is-boot-medium' is set for
> >> NAND chip.
> >>
> >> Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
> >> ---
> >>  .../bindings/mtd/amlogic,meson-nand.yaml           | 14 ++++++++++++++
> >>  1 file changed, 14 insertions(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> >> index 57b6957c8415..b86a1953056b 100644
> >> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> >> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
> >> @@ -64,11 +64,25 @@ patternProperties:
> >>          items:
> >>            maximum: 0
> >>  
> >> +      amlogic,boot-page-last:
> >> +        $ref: /schemas/types.yaml#/definitions/uint32
> >> +        description:
> >> +          The NFC driver needs this information to select ECC
> >> +          algorithms supported by the boot ROM.  
> > 
> > Shall we have a length rather than the last page?  
> 
> You mean rename it to "amlogic,boot-pages-length" or something like that ? But I think
> length in bytes is useless here:
> 1) boot rom needs that only some single pages are written in special mode (and as I see in
>    vendor's driver it also works in pages).
> 2) NAND driver operates in pages during write/read such pages.
> 
> So length in bytes will be converted to pages anyway.
> 
> What do You think ?

I didn't talk about units :-)

Maybe: amlogic,boot-pages would make sense? But pointing at the last
page seems weird.

Miquèl

^ permalink raw reply

* Re: [PATCH v3 1/2] dt-bindings: mtd: amlogic,meson-nand: support fields for boot ROM code
From: Arseniy Krasnov @ 2024-04-10 14:48 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-mtd, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel, oxffffaa, kernel
In-Reply-To: <20240410122356.30852b3c@xps-13>

Hi,

On 10.04.2024 13:23, Miquel Raynal wrote:
> Hi Arseniy,
> 
> avkrasnov@salutedevices.com wrote on Tue, 9 Apr 2024 21:10:24 +0300:
> 
>> Boot ROM code on Meson requires that some pages on NAND must be written
>> in special mode: "short" ECC mode where each block is 384 bytes and
>> scrambling mode is on. Such pages located with the specified interval
>> within specified offset. Both interval and offset are located in the
>> device tree and used by driver if 'nand-is-boot-medium' is set for
>> NAND chip.
>>
>> Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
>> ---
>>  .../bindings/mtd/amlogic,meson-nand.yaml           | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>> index 57b6957c8415..b86a1953056b 100644
>> --- a/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>> +++ b/Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
>> @@ -64,11 +64,25 @@ patternProperties:
>>          items:
>>            maximum: 0
>>  
>> +      amlogic,boot-page-last:
>> +        $ref: /schemas/types.yaml#/definitions/uint32
>> +        description:
>> +          The NFC driver needs this information to select ECC
>> +          algorithms supported by the boot ROM.
> 
> Shall we have a length rather than the last page?

You mean rename it to "amlogic,boot-pages-length" or something like that ? But I think
length in bytes is useless here:
1) boot rom needs that only some single pages are written in special mode (and as I see in
   vendor's driver it also works in pages).
2) NAND driver operates in pages during write/read such pages.

So length in bytes will be converted to pages anyway.

What do You think ?

Thanks, Arseniy

> 
>> +
>> +      amlogic,boot-page-step:
>> +        $ref: /schemas/types.yaml#/definitions/uint32
>> +        description:
>> +          The NFC driver needs this information to select ECC
>> +          algorithms supported by the boot ROM (in pages).
>> +
>>      unevaluatedProperties: false
>>  
>>      dependencies:
>>        nand-ecc-strength: [nand-ecc-step-size]
>>        nand-ecc-step-size: [nand-ecc-strength]
>> +      amlogic,boot-page-last: [nand-is-boot-medium, "amlogic,boot-page-step"]
>> +      amlogic,boot-page-step: [nand-is-boot-medium, "amlogic,boot-page-last"]
>>  
>>  
>>  required:
> 
> 
> Thanks,
> Miquèl

^ permalink raw reply

* Re: [PATCH v4 09/18] ASoC: mediatek: mt8192: Migrate to the common mtk_soundcard_startup
From: Alexandre Mergnat @ 2024-04-10 14:55 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-10-angelogioacchino.delregno@collabora.com>

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

On 09/04/2024 13:33, AngeloGioacchino Del Regno wrote:
> Add a const mtk_pcm_constraints_data struct array with all of the
> (again, constant) constraints for all of the supported usecases,
> remove the duplicated functions and call mtk_soundcard_startup()
> instead in all of the .startup() callbacks.

-- 
Regards,
Alexandre

^ permalink raw reply

* RE: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
From: Biju Das @ 2024-04-10 14:54 UTC (permalink / raw)
  To: Claudiu.Beznea, wim@linux-watchdog.org, linux@roeck-us.net,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	p.zabel@pengutronix.de, geert+renesas@glider.be,
	magnus.damm@gmail.com
  Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Claudiu Beznea
In-Reply-To: <4bbddd59-0bb4-4084-9968-139b88dc2c86@tuxon.dev>

Hi Claudiu,

> -----Original Message-----
> From: claudiu beznea <claudiu.beznea@tuxon.dev>
> Sent: Wednesday, April 10, 2024 3:49 PM
> Subject: Re: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
> 
> 
> 
> On 10.04.2024 17:13, Biju Das wrote:
> > Hi Claudiu,
> >
> >> -----Original Message-----
> >> From: Claudiu <claudiu.beznea@tuxon.dev>
> >> Sent: Wednesday, April 10, 2024 2:41 PM
> >> Subject: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use
> >> pm_runtime_resume_and_get()
> >>
> >> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >>
> >> pm_runtime_get_sync() may return with error. In case it returns with
> >> error
> >> dev->power.usage_count needs to be decremented.
> >> dev->pm_runtime_resume_and_get()
> >> takes care of this. Thus use it.
> >>
> >> Along with it the rzg2l_wdt_set_timeout() function was updated to
> >> propagate the result of
> >> rzg2l_wdt_start() to its caller.
> >>
> >> Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for
> >> RZ/G2L")
> >> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >> ---
> >>
> >> Changes in v8:
> >> - none
> >>
> >> Changes in v7:
> >> - none
> >>
> >> Changes in v6:
> >> - none
> >>
> >> Changes in v5:
> >> - none
> >>
> >> Changes in v4:
> >> - none
> >>
> >> Changes in v3:
> >> - none
> >>
> >> Changes in v2:
> >> - propagate the return code of rzg2l_wdt_start() to it's callers
> >>
> >>
> >>  drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
> >>  1 file changed, 8 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/watchdog/rzg2l_wdt.c
> >> b/drivers/watchdog/rzg2l_wdt.c index 1741f98ca67c..d87d4f50180c
> >> 100644
> >> --- a/drivers/watchdog/rzg2l_wdt.c
> >> +++ b/drivers/watchdog/rzg2l_wdt.c
> >> @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct
> >> watchdog_device *wdev)  static int rzg2l_wdt_start(struct watchdog_device *wdev)  {
> >>  	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
> >> +	int ret;
> >>
> >> -	pm_runtime_get_sync(wdev->parent);
> >> +	ret = pm_runtime_resume_and_get(wdev->parent);
> >
> > Do we need this change at all?
> 
> I haven't encountered issues w/o this patch, though I've did all my testing (including suspend to
> RAM) with this patch on my tree.
> 
> > If we have balanced usage then
> > this won't be a issue.
> 
> I think we should just use the proper APIs w/o making assumptions.

Currently many subsystems in linux kernel use pm_runtime_get_sync() 
without any error checks and it is fine to use as long as the usage is balanced.

Moreover, currently you are not able to reproduce an error condition
hence checking do we need this change?

Cheers,
Biju

> 
> > Did any unbalanced usage count popup
> > during the testing?
> >
> > Cheers,
> > Biju
> >
> >> +	if (ret)
> >> +		return ret;
> >>
> >>  	/* Initialize time out */
> >>  	rzg2l_wdt_init_timeout(wdev);
> >> @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device
> >> *wdev)
> >>
> >>  static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev,
> >> unsigned int timeout)  {
> >> +	int ret = 0;
> >> +
> >>  	wdev->timeout = timeout;
> >>
> >>  	/*
> >> @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct
> >> watchdog_device *wdev, unsigned int time
> >>  	 */
> >>  	if (watchdog_active(wdev)) {
> >>  		rzg2l_wdt_stop(wdev);
> >> -		rzg2l_wdt_start(wdev);
> >> +		ret = rzg2l_wdt_start(wdev);
> >>  	}
> >>
> >> -	return 0;
> >> +	return ret;
> >>  }
> >>
> >>  static int rzg2l_wdt_restart(struct watchdog_device *wdev,
> >> --
> >> 2.39.2
> >

^ permalink raw reply

* Re: [PATCH v4 08/18] ASoC: mediatek: mt8195: Migrate to the common mtk_soundcard_startup
From: Alexandre Mergnat @ 2024-04-10 14:54 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-9-angelogioacchino.delregno@collabora.com>

Way better with common stuff ! :p

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

On 09/04/2024 13:33, AngeloGioacchino Del Regno wrote:
> Add a const mtk_pcm_constraints_data struct array with all of the
> (again, constant) constraints for all of the supported usecases,
> remove the duplicated functions and call mtk_soundcard_startup()
> instead in all of the .startup() callbacks.

-- 
Regards,
Alexandre

^ permalink raw reply

* [PATCH] arm64: dts: qcom: sa8155p-adp: use correct gpio for SDHC2 CD
From: Volodymyr Babchuk @ 2024-04-10 13:41 UTC (permalink / raw)
  Cc: Volodymyr Babchuk, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org

Card Detect pin for SHDC2 on SA8155P-ADP is connected to GPIO4 of
PMM8155AU_1, not to internal TLMM. This change fixes two issues at
once: not working ethernet (because GPIO4 is used for MAC TX) and SD
detection.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
index 5e4287f8c8cd1..6b08ce246b78c 100644
--- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
@@ -384,7 +384,7 @@ &remoteproc_cdsp {
 &sdhc_2 {
 	status = "okay";
 
-	cd-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
+	cd-gpios = <&pmm8155au_1_gpios 4 GPIO_ACTIVE_LOW>;
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&sdc2_on>;
 	pinctrl-1 = <&sdc2_off>;
-- 
2.44.0

^ permalink raw reply related

* Re: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
From: claudiu beznea @ 2024-04-10 14:48 UTC (permalink / raw)
  To: Biju Das, wim@linux-watchdog.org, linux@roeck-us.net,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	p.zabel@pengutronix.de, geert+renesas@glider.be,
	magnus.damm@gmail.com
  Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Claudiu Beznea
In-Reply-To: <OSAPR01MB158744E15B527496A8ABA4CE86062@OSAPR01MB1587.jpnprd01.prod.outlook.com>



On 10.04.2024 17:13, Biju Das wrote:
> Hi Claudiu,
> 
>> -----Original Message-----
>> From: Claudiu <claudiu.beznea@tuxon.dev>
>> Sent: Wednesday, April 10, 2024 2:41 PM
>> Subject: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
>>
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> pm_runtime_get_sync() may return with error. In case it returns with error
>> dev->power.usage_count needs to be decremented.
>> dev->pm_runtime_resume_and_get()
>> takes care of this. Thus use it.
>>
>> Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of
>> rzg2l_wdt_start() to its caller.
>>
>> Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L")
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>> ---
>>
>> Changes in v8:
>> - none
>>
>> Changes in v7:
>> - none
>>
>> Changes in v6:
>> - none
>>
>> Changes in v5:
>> - none
>>
>> Changes in v4:
>> - none
>>
>> Changes in v3:
>> - none
>>
>> Changes in v2:
>> - propagate the return code of rzg2l_wdt_start() to it's callers
>>
>>
>>  drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
>>  1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index
>> 1741f98ca67c..d87d4f50180c 100644
>> --- a/drivers/watchdog/rzg2l_wdt.c
>> +++ b/drivers/watchdog/rzg2l_wdt.c
>> @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct watchdog_device *wdev)  static int
>> rzg2l_wdt_start(struct watchdog_device *wdev)  {
>>  	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
>> +	int ret;
>>
>> -	pm_runtime_get_sync(wdev->parent);
>> +	ret = pm_runtime_resume_and_get(wdev->parent);
> 
> Do we need this change at all? 

I haven't encountered issues w/o this patch, though I've did all my testing
(including suspend to RAM) with this patch on my tree.

> If we have balanced usage then
> this won't be a issue.

I think we should just use the proper APIs w/o making assumptions.

> Did any unbalanced usage count popup
> during the testing?
> 
> Cheers,
> Biju
> 
>> +	if (ret)
>> +		return ret;
>>
>>  	/* Initialize time out */
>>  	rzg2l_wdt_init_timeout(wdev);
>> @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev)
>>
>>  static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout)  {
>> +	int ret = 0;
>> +
>>  	wdev->timeout = timeout;
>>
>>  	/*
>> @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int
>> time
>>  	 */
>>  	if (watchdog_active(wdev)) {
>>  		rzg2l_wdt_stop(wdev);
>> -		rzg2l_wdt_start(wdev);
>> +		ret = rzg2l_wdt_start(wdev);
>>  	}
>>
>> -	return 0;
>> +	return ret;
>>  }
>>
>>  static int rzg2l_wdt_restart(struct watchdog_device *wdev,
>> --
>> 2.39.2
> 

^ permalink raw reply

* Re: [PATCH] arm64: dts: rockchip: remove startup-delay-us from vcc3v3_pcie2x1l0 on rock-5b
From: Shawn Lin @ 2024-04-10  6:30 UTC (permalink / raw)
  To: Jianfeng Liu
  Cc: shawn.lin, robh, krzysztof.kozlowski+dt, conor+dt, heiko, sfr,
	devicetree, linux-kernel, linux-rockchip, linux-arm-kernel
In-Reply-To: <20240401081302.942742-1-liujianfeng1994@gmail.com>

Hi Jianfeng,

On 2024/4/1 16:13, Jianfeng Liu wrote:
> Property startup-delay-us is copied from vendor dts and it will
> make kernel not detect pcie wifi device. If I run command:
> "echo 1 > /sys/bus/pci/rescan", pcie wifi device is detected, but
> my wifi device RTL8822CE failed to load driver. Another device
> RTL8723BE can load driver but no wifi signal is detected.
> 
> Removing this property will fix issues above.
> 
> Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>

startup-delay-us just make sure the power rail is stable before
any action is taken to start the link, preventing the device from
unable to work stably. So it shouldn't be the root cause I think.

Could you help try this patch to checkout if it works for you?

diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c 
b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
index d684214..df30127 100644
--- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
+++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
@@ -167,7 +167,7 @@ static int rockchip_pcie_start_link(struct dw_pcie *pci)
         struct rockchip_pcie *rockchip = to_rockchip_pcie(pci);

         /* Reset device */
-       gpiod_set_value_cansleep(rockchip->rst_gpio, 0);
+       //gpiod_set_value_cansleep(rockchip->rst_gpio, 0);

         rockchip_pcie_enable_ltssm(rockchip);

@@ -180,7 +180,7 @@ static int rockchip_pcie_start_link(struct dw_pcie *pci)
          * We need more extra time as before, rather than setting just
          * 100us as we don't know how long should the device need to reset.
          */
-       msleep(100);
+       msleep(300);
         gpiod_set_value_cansleep(rockchip->rst_gpio, 1);

         return 0;
@@ -311,6 +311,8 @@ static int rockchip_pcie_probe(struct 
platform_device *pdev)
         if (ret)
                 return ret;

+       gpiod_set_value_cansleep(rockchip->rst_gpio, 0);
+
         /* DON'T MOVE ME: must be enable before PHY init */
         rockchip->vpcie3v3 = devm_regulator_get_optional(dev, "vpcie3v3");



> ---
>   arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
> index d6bf2ee07..a9af654a0 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
> @@ -76,7 +76,6 @@ vcc3v3_pcie2x1l0: vcc3v3-pcie2x1l0-regulator {
>   		regulator-boot-on;
>   		regulator-min-microvolt = <3300000>;
>   		regulator-max-microvolt = <3300000>;
> -		startup-delay-us = <50000>;
>   		vin-supply = <&vcc5v0_sys>;
>   	};
> 
> --
> 2.34.1
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related

* RE: EXTERNAL: Re: [PATCH 1/6] dt-bindings: net: snps,dwmac: remove tx-sched-sp property
From: FLAVIO SULIGOI @ 2024-04-10 14:46 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski', Alexandre Torgue, Jose Abreu,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Maxime Coquelin, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Bjorn Andersson, Konrad Dybcio, Giuseppe Cavallaro
  Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <c599d2cd-2871-4f84-94bb-00656c1a9395@kernel.org>

Hi Krzysztof,

...

> On 05/04/2024 17:27, Flavio Suligoi wrote:
> > The property "tx-sched-sp" no longer exists, as it was removed from
> the
> > file:
> >
> > drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >
> > by the commit:
> >
> > commit aed6864035b1 ("net: stmmac: platform: Delete a redundant
> condition
> > branch")
> >
> > Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
> > ---
> >  .../devicetree/bindings/net/snps,dwmac.yaml        | 14 -------------
> -
> >  1 file changed, 14 deletions(-)
> 
> One more thought though:
> 1. Missing net-next patch annotation,
> 2. Please split DTS from net. DTS goes via separate trees.

Thanks for all your suggestions.
I'll resend the patches, with your suggested changes and
splitting the DTS-related patches in a separate series.

> 
> Best regards,
> Krzysztof

Best regards,
Flavio


^ permalink raw reply

* [PATCH] media: dt-bindings: media: add access-controllers to STM32MP25 video codecs
From: Hugues Fruchet @ 2024-04-10 14:42 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
	Maxime Coquelin, Alexandre Torgue, linux-media, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Hugues Fruchet

access-controllers is an optional property that allows a peripheral to
refer to one or more domain access controller(s).

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
---
 .../devicetree/bindings/media/st,stm32mp25-video-codec.yaml   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/st,stm32mp25-video-codec.yaml b/Documentation/devicetree/bindings/media/st,stm32mp25-video-codec.yaml
index b8611bc8756c..73726c65cfb9 100644
--- a/Documentation/devicetree/bindings/media/st,stm32mp25-video-codec.yaml
+++ b/Documentation/devicetree/bindings/media/st,stm32mp25-video-codec.yaml
@@ -30,6 +30,10 @@ properties:
   clocks:
     maxItems: 1
 
+  access-controllers:
+    minItems: 1
+    maxItems: 2
+
 required:
   - compatible
   - reg
-- 
2.25.1


^ permalink raw reply related

* Re: [PATCH v4 07/18] ASoC: mediatek: Add common snd_soc_ops .startup() callback
From: Alexandre Mergnat @ 2024-04-10 14:27 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-8-angelogioacchino.delregno@collabora.com>

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

On 09/04/2024 13:32, AngeloGioacchino Del Regno wrote:
> MediaTek platforms are typically setting PCM rate and channels
> constraints for playback, capture and HDMI/DisplayPort playback:
> commonize the startup callback by adding the PCM constraints data
> to the mtk_platform_card_data structure and by reusing the common
> mtk_soundcard_startup() function for all of them by getting back
> the parameters from the aforementioned struct.

-- 
Regards,
Alexandre

^ permalink raw reply

* RE: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
From: Biju Das @ 2024-04-10 14:13 UTC (permalink / raw)
  To: Claudiu.Beznea, wim@linux-watchdog.org, linux@roeck-us.net,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	p.zabel@pengutronix.de, geert+renesas@glider.be,
	magnus.damm@gmail.com
  Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Claudiu.Beznea, Claudiu Beznea
In-Reply-To: <20240410134044.2138310-4-claudiu.beznea.uj@bp.renesas.com>

Hi Claudiu,

> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: Wednesday, April 10, 2024 2:41 PM
> Subject: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
> 
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> pm_runtime_get_sync() may return with error. In case it returns with error
> dev->power.usage_count needs to be decremented.
> dev->pm_runtime_resume_and_get()
> takes care of this. Thus use it.
> 
> Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of
> rzg2l_wdt_start() to its caller.
> 
> Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L")
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
> 
> Changes in v8:
> - none
> 
> Changes in v7:
> - none
> 
> Changes in v6:
> - none
> 
> Changes in v5:
> - none
> 
> Changes in v4:
> - none
> 
> Changes in v3:
> - none
> 
> Changes in v2:
> - propagate the return code of rzg2l_wdt_start() to it's callers
> 
> 
>  drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index
> 1741f98ca67c..d87d4f50180c 100644
> --- a/drivers/watchdog/rzg2l_wdt.c
> +++ b/drivers/watchdog/rzg2l_wdt.c
> @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct watchdog_device *wdev)  static int
> rzg2l_wdt_start(struct watchdog_device *wdev)  {
>  	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
> +	int ret;
> 
> -	pm_runtime_get_sync(wdev->parent);
> +	ret = pm_runtime_resume_and_get(wdev->parent);

Do we need this change at all? If we have balanced usage then
this won't be a issue. Did any unbalanced usage count popup
during the testing?

Cheers,
Biju

> +	if (ret)
> +		return ret;
> 
>  	/* Initialize time out */
>  	rzg2l_wdt_init_timeout(wdev);
> @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev)
> 
>  static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout)  {
> +	int ret = 0;
> +
>  	wdev->timeout = timeout;
> 
>  	/*
> @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int
> time
>  	 */
>  	if (watchdog_active(wdev)) {
>  		rzg2l_wdt_stop(wdev);
> -		rzg2l_wdt_start(wdev);
> +		ret = rzg2l_wdt_start(wdev);
>  	}
> 
> -	return 0;
> +	return ret;
>  }
> 
>  static int rzg2l_wdt_restart(struct watchdog_device *wdev,
> --
> 2.39.2


^ permalink raw reply

* RE: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
From: Biju Das @ 2024-04-10 14:05 UTC (permalink / raw)
  To: Claudiu.Beznea, wim@linux-watchdog.org, linux@roeck-us.net,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	p.zabel@pengutronix.de, geert+renesas@glider.be,
	magnus.damm@gmail.com
  Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Claudiu Beznea
In-Reply-To: <11a371b5-f649-4dfb-94d1-9a01b15d5993@tuxon.dev>

Hi Claudiu,

> -----Original Message-----
> From: claudiu beznea <claudiu.beznea@tuxon.dev>
> Sent: Wednesday, April 10, 2024 3:02 PM
> Subject: Re: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
> 
> 
> 
> On 10.04.2024 16:51, Biju Das wrote:
> > Hi Claudiu,
> >
> >> -----Original Message-----
> >> From: Claudiu <claudiu.beznea@tuxon.dev>
> >> Sent: Wednesday, April 10, 2024 2:41 PM
> >> Subject: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use
> >> pm_runtime_resume_and_get()
> >>
> >> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >>
> >> pm_runtime_get_sync() may return with error. In case it returns with
> >> error
> >> dev->power.usage_count needs to be decremented.
> >> dev->pm_runtime_resume_and_get()
> >> takes care of this. Thus use it.
> >>
> >> Along with it the rzg2l_wdt_set_timeout() function was updated to
> >> propagate the result of
> >> rzg2l_wdt_start() to its caller.
> >>
> >> Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for
> >> RZ/G2L")
> >> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >> ---
> >>
> >> Changes in v8:
> >> - none
> >>
> >> Changes in v7:
> >> - none
> >>
> >> Changes in v6:
> >> - none
> >>
> >> Changes in v5:
> >> - none
> >>
> >> Changes in v4:
> >> - none
> >>
> >> Changes in v3:
> >> - none
> >>
> >> Changes in v2:
> >> - propagate the return code of rzg2l_wdt_start() to it's callers
> >>
> >>
> >>  drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
> >>  1 file changed, 8 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/watchdog/rzg2l_wdt.c
> >> b/drivers/watchdog/rzg2l_wdt.c index 1741f98ca67c..d87d4f50180c
> >> 100644
> >> --- a/drivers/watchdog/rzg2l_wdt.c
> >> +++ b/drivers/watchdog/rzg2l_wdt.c
> >> @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct
> >> watchdog_device *wdev)  static int rzg2l_wdt_start(struct watchdog_device *wdev)  {
> >>  	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
> >> +	int ret;
> >>
> >> -	pm_runtime_get_sync(wdev->parent);
> >> +	ret = pm_runtime_resume_and_get(wdev->parent);
> >> +	if (ret)
> >> +		return ret;
> >>
> >>  	/* Initialize time out */
> >>  	rzg2l_wdt_init_timeout(wdev);
> >> @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device
> >> *wdev)
> >>
> >>  static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev,
> >> unsigned int timeout)  {
> >> +	int ret = 0;
> >> +
> >>  	wdev->timeout = timeout;
> >>
> >>  	/*
> >> @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct
> >> watchdog_device *wdev, unsigned int time
> >>  	 */
> >>  	if (watchdog_active(wdev)) {
> >>  		rzg2l_wdt_stop(wdev);
> >> -		rzg2l_wdt_start(wdev);
> >> +		ret = rzg2l_wdt_start(wdev);
> >
> > This IP won't be able to update WDT settings once you have set it.
> >
> > But we can update it, if we do a reset assert followed by deassert.
> > So the previous code looks correct to me.
> >
> > Current case is if the WDT is active, then start it. Maybe I ma missing something here.
> >
> 
> I'm not sure I got you correctly.
> 
> This patch keeps the previous functionality, thus, if the watchdog is active rzg2l_wdt_stop() is
> called which does a reset assert. Then
> rzg2l_wdt_start() is called which does the reset deassert.

You are correct. I overlooked and thought you have removed *_stop() as well.
Sorry for the noise.

Cheers,
Biju


> >>  	}
> >>
> >> -	return 0;
> >> +	return ret;
> >>  }
> >>
> >>  static int rzg2l_wdt_restart(struct watchdog_device *wdev,
> >> --
> >> 2.39.2
> >

^ permalink raw reply

* Re: [PATCH v4 06/18] ASoC: mediatek: mt8186: Migrate to mtk_soundcard_common_probe
From: Alexandre Mergnat @ 2024-04-10 14:02 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-7-angelogioacchino.delregno@collabora.com>

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

On 09/04/2024 13:32, AngeloGioacchino Del Regno wrote:
> Add mtk_soundcard_pdata platform data for the MediaTek common sound card
> probe mechanism, including a driver/soc-specific probe extension (used
> for bits that cannot be commonized  hence specific to this driver), and
> change the probe function to mtk_soundcard_common_probe.
> 
> This is also adding the possibility of specifying the links and routing
> with the audio-routing property and (x)-dai-link nodes in device trees
> to stop hardcoding machine specific links in the card driver assupported
> by the common probe function, but support for legacy device trees is
> retained with a legacy_probe function, which is used only in case the
> new properties are not found.

-- 
Regards,
Alexandre

^ permalink raw reply

* Re: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
From: claudiu beznea @ 2024-04-10 14:01 UTC (permalink / raw)
  To: Biju Das, wim@linux-watchdog.org, linux@roeck-us.net,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	p.zabel@pengutronix.de, geert+renesas@glider.be,
	magnus.damm@gmail.com
  Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Claudiu Beznea
In-Reply-To: <OSAPR01MB15874891F67AAFAA955A186886062@OSAPR01MB1587.jpnprd01.prod.outlook.com>



On 10.04.2024 16:51, Biju Das wrote:
> Hi Claudiu,
> 
>> -----Original Message-----
>> From: Claudiu <claudiu.beznea@tuxon.dev>
>> Sent: Wednesday, April 10, 2024 2:41 PM
>> Subject: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
>>
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> pm_runtime_get_sync() may return with error. In case it returns with error
>> dev->power.usage_count needs to be decremented.
>> dev->pm_runtime_resume_and_get()
>> takes care of this. Thus use it.
>>
>> Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of
>> rzg2l_wdt_start() to its caller.
>>
>> Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L")
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>> ---
>>
>> Changes in v8:
>> - none
>>
>> Changes in v7:
>> - none
>>
>> Changes in v6:
>> - none
>>
>> Changes in v5:
>> - none
>>
>> Changes in v4:
>> - none
>>
>> Changes in v3:
>> - none
>>
>> Changes in v2:
>> - propagate the return code of rzg2l_wdt_start() to it's callers
>>
>>
>>  drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
>>  1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index
>> 1741f98ca67c..d87d4f50180c 100644
>> --- a/drivers/watchdog/rzg2l_wdt.c
>> +++ b/drivers/watchdog/rzg2l_wdt.c
>> @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct watchdog_device *wdev)  static int
>> rzg2l_wdt_start(struct watchdog_device *wdev)  {
>>  	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
>> +	int ret;
>>
>> -	pm_runtime_get_sync(wdev->parent);
>> +	ret = pm_runtime_resume_and_get(wdev->parent);
>> +	if (ret)
>> +		return ret;
>>
>>  	/* Initialize time out */
>>  	rzg2l_wdt_init_timeout(wdev);
>> @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev)
>>
>>  static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout)  {
>> +	int ret = 0;
>> +
>>  	wdev->timeout = timeout;
>>
>>  	/*
>> @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int
>> time
>>  	 */
>>  	if (watchdog_active(wdev)) {
>>  		rzg2l_wdt_stop(wdev);
>> -		rzg2l_wdt_start(wdev);
>> +		ret = rzg2l_wdt_start(wdev);
> 
> This IP won't be able to update WDT settings once you have set it.
> 
> But we can update it, if we do a reset assert followed by deassert.
> So the previous code looks correct to me.
> 
> Current case is if the WDT is active, then start it. Maybe I ma missing something here.
> 

I'm not sure I got you correctly.

This patch keeps the previous functionality, thus, if the watchdog is
active rzg2l_wdt_stop() is called which does a reset assert. Then
rzg2l_wdt_start() is called which does the reset deassert.

Thank you,
Claudiu Beznea

> Cheers,
> Biju
> 
>>  	}
>>
>> -	return 0;
>> +	return ret;
>>  }
>>
>>  static int rzg2l_wdt_restart(struct watchdog_device *wdev,
>> --
>> 2.39.2
> 

^ permalink raw reply

* Re: [PATCH v4 05/18] ASoC: mediatek: mt8192: Migrate to mtk_soundcard_common_probe
From: Alexandre Mergnat @ 2024-04-10 13:59 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-6-angelogioacchino.delregno@collabora.com>



On 09/04/2024 13:32, AngeloGioacchino Del Regno wrote:
> @@ -1211,52 +1196,85 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev)
>   		if (dai_link->num_codecs && dai_link->codecs[0].dai_name &&
>   		    strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0)
>   			dai_link->ops = &mt8192_rt1015_i2s_ops;
> -
> -		if (!dai_link->platforms->name)
> -			dai_link->platforms->of_node = platform_node;
> -	}
> -
> -	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> -	if (!priv) {
> -		ret = -ENOMEM;
> -		goto err_probe;
> -	}
> -	snd_soc_card_set_drvdata(card, priv);
> -
> -	ret = mt8192_afe_gpio_init(&pdev->dev);
> -	if (ret) {
> -		dev_err_probe(&pdev->dev, ret, "%s init gpio error\n", __func__);

I don't think __func__ is necessary.

> -		goto err_probe;
>   	}
>   
> -	ret = devm_snd_soc_register_card(&pdev->dev, card);
> -	if (ret)
> -		dev_err_probe(&pdev->dev, ret, "%s snd_soc_register_card fail\n", __func__);

I don't think __func__ is necessary.

> -
> -err_probe:
>   	of_node_put(headset_codec);
>   err_headset_codec:
>   	of_node_put(speaker_codec);
>   err_speaker_codec:
> -	of_node_put(platform_node);
> -err_platform_node:
> -	of_node_put(hdmi_codec);
> +	if (hdmi_codec)
> +		of_node_put(hdmi_codec);
> +
>   	return ret;
>   }
>   
> +static int mt8192_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data, bool legacy)
> +{
> +	struct mtk_platform_card_data *card_data = soc_card_data->card_data;
> +	struct snd_soc_card *card = card_data->card;
> +	int ret;
> +
> +	if (legacy) {
> +		ret = mt8192_mt6359_legacy_probe(soc_card_data);
> +		if (ret)
> +			return ret;
> +	} else {
> +		struct snd_soc_dai_link *dai_link;
> +		int i;
> +
> +		for_each_card_prelinks(card, i, dai_link)
> +			if (dai_link->num_codecs && dai_link->codecs[0].dai_name &&
> +			    strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0)
> +				dai_link->ops = &mt8192_rt1015_i2s_ops;
> +	}
> +
> +	ret = mt8192_afe_gpio_init(card->dev);
> +	if (ret)
> +		return dev_err_probe(card->dev, ret, "%s init gpio error\n", __func__);

I don't think __func__ is necessary.

> +
> +	return 0;
> +}

Beside that,
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

-- 
Regards,
Alexandre

^ permalink raw reply

* RE: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
From: Biju Das @ 2024-04-10 13:51 UTC (permalink / raw)
  To: Claudiu.Beznea, wim@linux-watchdog.org, linux@roeck-us.net,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	p.zabel@pengutronix.de, geert+renesas@glider.be,
	magnus.damm@gmail.com
  Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Claudiu.Beznea, Claudiu Beznea
In-Reply-To: <20240410134044.2138310-4-claudiu.beznea.uj@bp.renesas.com>

Hi Claudiu,

> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: Wednesday, April 10, 2024 2:41 PM
> Subject: [PATCH RESEND v8 03/10] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()
> 
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> pm_runtime_get_sync() may return with error. In case it returns with error
> dev->power.usage_count needs to be decremented.
> dev->pm_runtime_resume_and_get()
> takes care of this. Thus use it.
> 
> Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of
> rzg2l_wdt_start() to its caller.
> 
> Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L")
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> ---
> 
> Changes in v8:
> - none
> 
> Changes in v7:
> - none
> 
> Changes in v6:
> - none
> 
> Changes in v5:
> - none
> 
> Changes in v4:
> - none
> 
> Changes in v3:
> - none
> 
> Changes in v2:
> - propagate the return code of rzg2l_wdt_start() to it's callers
> 
> 
>  drivers/watchdog/rzg2l_wdt.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index
> 1741f98ca67c..d87d4f50180c 100644
> --- a/drivers/watchdog/rzg2l_wdt.c
> +++ b/drivers/watchdog/rzg2l_wdt.c
> @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct watchdog_device *wdev)  static int
> rzg2l_wdt_start(struct watchdog_device *wdev)  {
>  	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
> +	int ret;
> 
> -	pm_runtime_get_sync(wdev->parent);
> +	ret = pm_runtime_resume_and_get(wdev->parent);
> +	if (ret)
> +		return ret;
> 
>  	/* Initialize time out */
>  	rzg2l_wdt_init_timeout(wdev);
> @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev)
> 
>  static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout)  {
> +	int ret = 0;
> +
>  	wdev->timeout = timeout;
> 
>  	/*
> @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int
> time
>  	 */
>  	if (watchdog_active(wdev)) {
>  		rzg2l_wdt_stop(wdev);
> -		rzg2l_wdt_start(wdev);
> +		ret = rzg2l_wdt_start(wdev);

This IP won't be able to update WDT settings once you have set it.

But we can update it, if we do a reset assert followed by deassert.
So the previous code looks correct to me.

Current case is if the WDT is active, then start it. Maybe I ma missing something here.

Cheers,
Biju

>  	}
> 
> -	return 0;
> +	return ret;
>  }
> 
>  static int rzg2l_wdt_restart(struct watchdog_device *wdev,
> --
> 2.39.2


^ permalink raw reply

* Re: [PATCH] arm64: dts: qcom: sm8650: add description of CCI controllers
From: neil.armstrong @ 2024-04-10 13:50 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Bjorn Andersson, Konrad Dybcio,
	Jagadeesh Kona
  Cc: Krzysztof Kozlowski, linux-arm-msm, devicetree
In-Reply-To: <b5f81ed2-d2d9-4c48-8feb-d78bfd714a40@linaro.org>

On 10/04/2024 15:11, Vladimir Zapolskiy wrote:
> On 4/10/24 10:52, Neil Armstrong wrote:
>> Hi,
>>
>> On 10/04/2024 09:49, Vladimir Zapolskiy wrote:
>>> Qualcomm SM8650 SoC has three CCI controllers with two I2C busses
>>> connected to each of them.
>>>
>>> The CCI controllers on SM8650 are compatible with the ones found on
>>> many other older generations of Qualcomm SoCs.
>>>
>>> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
>>> ---
>>> The change is based and depends on a patch series from Jagadeesh Kona:
>>>
>>>     https://lore.kernel.org/linux-arm-msm/20240321092529.13362-1-quic_jkona@quicinc.com/
>>>
>>> It might be an option to add this change right to the series,
>>> since it anyway requires a respin.
>>>
>>> A new compatible value "qcom,sm8650-cci" is NOT added to
>>> Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml , because
>>> the controller IP description and selection is covered by a generic
>>> compatible value "qcom,msm8996-cci".
>>
>> You'll still need to add qcom,sm8650-cci to the "CCI v2" list in qcom,i2c-cci.yaml,
>> otherwise the DTBS check fail, even if the fallback is already present.
> 
> I do recognize the problem related to a build time warning, my motivation was
> to follow the rationale described in commit 3e383dce513f
> ("Revert "dt-bindings: i2c: qcom-cci: Document sc8280xp compatible"").
> 
> For a similar sc8280xp-cci case it was asked by Konrad to drop a new
> compatible, I kindly ask the reviewers and maintainers to stick to one
> of the two contradicting asks.

This is totally different, this commit added a new compatible that is used in the driver,
while here, you use a per-soc compatible that is (for now), only used in DT and uses
the generic "qcom,msm8996-cci" as a fallback because it is considered as beeing 99%
compatible and no software change is needed.

But having a per-soc compatible can help adding software support later in the case you
want to implement sm8650 specific features or add bug fixes.

It avoids changing the driver for no reason, and provides a backup in case there's
a driver change needed in the future that can be backported safely and still work
with older DT without changing the DT.

Neil

> 
> -- 
> Best wishes,
> Vladimir


^ permalink raw reply

* Re: [PATCH v4 04/18] ASoC: mediatek: mt8195: Migrate to mtk_soundcard_common_probe
From: Alexandre Mergnat @ 2024-04-10 13:46 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, broonie
  Cc: wenst, lgirdwood, robh, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, perex, tiwai, trevor.wu, maso.huang, xiazhengqiao,
	arnd, kuninori.morimoto.gx, shraash, nicolas.ferre,
	u.kleine-koenig, dianders, frank.li, allen-kh.cheng,
	eugen.hristev, claudiu.beznea, jarkko.nikula, jiaxin.yu,
	alpernebiyasak, ckeepax, zhourui, nfraprado, alsa-devel,
	shane.chien, linux-sound, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel
In-Reply-To: <20240409113310.303261-5-angelogioacchino.delregno@collabora.com>



On 09/04/2024 13:32, AngeloGioacchino Del Regno wrote:
> @@ -29,6 +30,13 @@
>   #define RT1019_SPEAKER_AMP_PRESENT		BIT(1)
>   #define MAX98390_SPEAKER_AMP_PRESENT		BIT(2)
>   
> +#define DUMB_CODEC_INIT				BIT(0)
> +#define MT6359_CODEC_INIT			BIT(1)
> +#define RT1011_CODEC_INIT			BIT(2)
> +#define RT1019_CODEC_INIT			BIT(3)
> +#define MAX98390_CODEC_INIT			BIT(4)
> +#define RT5682_CODEC_INIT			BIT(5)
> +

Why are you using defines+single variable to track inited parts in the 
probe function but do it in the different way for legacy_probe using 
bool: is5682s, init6359 ? AFAII, both can use the same method with the 
defines above.

>   #define RT1011_CODEC_DAI	"rt1011-aif"
>   #define RT1011_DEV0_NAME	"rt1011.2-0038"
>   #define RT1011_DEV1_NAME	"rt1011.2-0039"

-- 
Regards,
Alexandre

^ permalink raw reply

* Re: [PATCH] arm64: dts: qcom: sa8155p-adp: use correct gpio for SDHC2 CD
From: Krzysztof Kozlowski @ 2024-04-10 13:45 UTC (permalink / raw)
  To: Volodymyr Babchuk
  Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <8927d1c6-73b8-4f6a-815c-aaa6da8ea90b@linaro.org>

On 10/04/2024 15:44, Krzysztof Kozlowski wrote:
> On 10/04/2024 15:41, Volodymyr Babchuk wrote:
>> Card Detect pin for SHDC2 on SA8155P-ADP is connected to GPIO4 of
>> PMM8155AU_1, not to internal TLMM. This change fixes two issues at
>> once: not working ethernet (because GPIO4 is used for MAC TX) and SD
>> detection.
>>
>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> 
> Please provide Fixes tag.

Ah, and Cc stable one.

Best regards,
Krzysztof


^ permalink raw reply

* Re: [PATCH] arm64: dts: qcom: sa8155p-adp: use correct gpio for SDHC2 CD
From: Krzysztof Kozlowski @ 2024-04-10 13:44 UTC (permalink / raw)
  To: Volodymyr Babchuk
  Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20240410134022.732767-1-volodymyr_babchuk@epam.com>

On 10/04/2024 15:41, Volodymyr Babchuk wrote:
> Card Detect pin for SHDC2 on SA8155P-ADP is connected to GPIO4 of
> PMM8155AU_1, not to internal TLMM. This change fixes two issues at
> once: not working ethernet (because GPIO4 is used for MAC TX) and SD
> detection.
> 
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

Please provide Fixes tag.

Best regards,
Krzysztof


^ permalink raw reply

* [PATCH RESEND v8 10/10] dt-bindings: watchdog: renesas,wdt: Document RZ/G3S support
From: Claudiu @ 2024-04-10 13:40 UTC (permalink / raw)
  To: wim, linux, robh, krzk+dt, conor+dt, p.zabel, geert+renesas,
	magnus.damm, biju.das.jz
  Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
	claudiu.beznea, Claudiu Beznea, Conor Dooley
In-Reply-To: <20240410134044.2138310-1-claudiu.beznea.uj@bp.renesas.com>

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

Document the support for the watchdog IP available on RZ/G3S SoC. The
watchdog IP available on RZ/G3S SoC is identical to the one found on
RZ/G2L SoC.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---

Changes in v8:
- none

Changes in v7:
- none

Changes in v6:
- none

Changes in v5:
- none

Changes in v4:
- none

Changes in v3:
- re-arranged the tags as my b4 am/shazam placed previously the
  Ab, Rb tags before the author's Sob

Changes in v2:
- collected tags
- s/G2UL/G2L in patch description

 Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
index ffb17add491a..eba454d1680f 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -29,6 +29,7 @@ properties:
               - renesas,r9a07g043-wdt    # RZ/G2UL and RZ/Five
               - renesas,r9a07g044-wdt    # RZ/G2{L,LC}
               - renesas,r9a07g054-wdt    # RZ/V2L
+              - renesas,r9a08g045-wdt    # RZ/G3S
           - const: renesas,rzg2l-wdt
 
       - items:
-- 
2.39.2


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox