mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org,
	robh@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v5 2/3] pwm: meson: add the PWM count driver data
Date: Tue, 1 Dec 2026 11:15:48 +0800	[thread overview]
Message-ID: <0ca7f8db-1c03-4559-b6a2-bcfc11cd0fe8@amlogic.com> (raw)
In-Reply-To: <aw18Za1zi5XLNV4r@monoceros>

Hi Uwe,
    Thanks for your review.

On 2026/11/30 21:42, Uwe Kleine-König wrote:
> 
> On Mon, Nov 30, 2026 at 12:06:44PM +0000,sashiko-bot@kernel.org  wrote:
>> Thank you for your contribution! Sashiko AI review found 2 potential
>> issues to consider:
>> - [Low] pwm: meson: unreplaced XYZ placeholder and incomplete commit
>>    message
>> - [Low] pwm: meson: unaddressed v4 feedback on MESON_NUM_PWMS and XYZ
>>    placeholder
>> --
>>
>> commit dc63cdb88cc6bfabf5cc70eb8f664cded9a113d3
>> Author: Xianwei Zhao<xianwei.zhao@amlogic.com>
>>
>>> pwm: meson: add the PWM count driver data
>>>
>>> To prepare adding support for XYZ which doesn't have 2 but 1
>>> PWM outputs, make the various loops iterater using chip->npwm
>>> instead of the constant MESON_NUM_PWMS.
>>>
>>> Reviewed-by: Alexandre Mergnat<amergnat@baylibre.com>
>>> Signed-off-by: Xianwei Zhao<xianwei.zhao@amlogic.com>
>> [Severity: Low]
>> The commit message still contains the literal placeholder "XYZ" instead of
>> naming the target Amlogic SoCs (S6, S7 and S7D) and has a typo in
>> "iterater".  It also omits that this patch adds npwm to struct
>> meson_pwm_data, sets .npwm = 2 for existing variants, and passes
>> pdata->npwm to devm_pwmchip_alloc() in meson_pwm_probe().
> The typo is mine, please still fix it 🙂
> 

Will do.

>>> diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
>>> index 3a28c853089f8..422aa8bb20b44 100644
>>> --- a/drivers/pwm/pwm-meson.c
>>> +++ b/drivers/pwm/pwm-meson.c
>>> @@ -108,6 +108,7 @@ struct meson_pwm_data {
>>>   	int (*channels_init)(struct pwm_chip *chip);
>>>   	bool has_constant;
>>>   	bool has_polarity;
>>> +	u8 npwm;
>>>   };
>>>   
>>>   struct meson_pwm {
>>> @@ -440,7 +441,7 @@ static int meson_pwm_init_clocks_meson8b(struct pwm_chip *chip,
>>>   	char name[255];
>>>   	int err;
>>>   
>>> -	for (i = 0; i < MESON_NUM_PWMS; i++) {
>>> +	for (i = 0; i < chip->npwm; i++) {
>> [ ... ]
>>
>>> @@ -699,9 +710,10 @@ static int meson_pwm_probe(struct platform_device *pdev)
>>>   {
>>>   	struct pwm_chip *chip;
>>>   	struct meson_pwm *meson;
>>> +	const struct meson_pwm_data *pdata = of_device_get_match_data(&pdev->dev);
>>>   	int err;
>>>   
>>> -	chip = devm_pwmchip_alloc(&pdev->dev, MESON_NUM_PWMS, sizeof(*meson));
>>> +	chip = devm_pwmchip_alloc(&pdev->dev, pdata->npwm, sizeof(*meson));
>> [Severity: Low]
>> As reported by Uwe Kleine-König on v4 [1], can MESON_NUM_PWMS be dropped in
>> this commit now that the channel count comes from pdata->npwm?
>> drivers/pwm/pwm-meson.c still defines MESON_NUM_PWMS to size
>> meson_pwm_per_channel_data[] and meson->channels[].
>>
>> [1]https://lore.kernel.org/r/aw01OAIy4gGjXvDI@monoceros
> Oh wow, I didn't know that Sashiko refers to other reviews. That's
> strong. I guess that means trouble if npwm > 2, this is exactly the
> failure I had in mind when I asked for dropping MESON_NUM_PWMS. Maybe
> add an assert (BUG_ON?) to catch that?
> 
I will add if (npwm > 2) return -EINVAL,  BUG_ON is too heavy.
> Best regards
> Uwe

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

  parent reply	other threads:[~2026-12-01  3:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 11:59 [PATCH v5 0/3] Add PWM support Amlogic S7 S7D S6 Xianwei Zhao via B4 Relay
2026-11-30 11:59 ` [PATCH v5 1/3] dt-bindings: pwm: amlogic: Add new bindings for S6 S7 S7D Xianwei Zhao via B4 Relay
2026-11-30 12:03   ` sashiko-bot
2026-11-30 11:59 ` [PATCH v5 2/3] pwm: meson: add the PWM count driver data Xianwei Zhao via B4 Relay
2026-11-30 12:06   ` sashiko-bot
2026-11-30 13:42     ` Uwe Kleine-König
2026-11-30 13:45       ` Uwe Kleine-König
2026-12-01  3:07         ` Xianwei Zhao
2026-12-01  3:15       ` Xianwei Zhao [this message]
2026-11-30 11:59 ` [PATCH v5 3/3] pwm: meson: Add support for Amlogic S7 Xianwei Zhao via B4 Relay

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=0ca7f8db-1c03-4559-b6a2-bcfc11cd0fe8@amlogic.com \
    --to=xianwei.zhao@amlogic.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=u.kleine-koenig@baylibre.com \
    /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

all inboxes | Powered by JetHome®