From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: sashiko-reviews@lists.linux.dev
Cc: Xianwei Zhao <xianwei.zhao@amlogic.com>,
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: Mon, 30 Nov 2026 14:42:07 +0100 [thread overview]
Message-ID: <aw18Za1zi5XLNV4r@monoceros> (raw)
In-Reply-To: <sashiko-outbox-241019@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2896 bytes --]
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 :-)
> > 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?
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-11-30 13:42 UTC|newest]
Thread overview: 8+ 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 [this message]
2026-11-30 13:45 ` Uwe Kleine-König
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=aw18Za1zi5XLNV4r@monoceros \
--to=u.kleine-koenig@baylibre.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=xianwei.zhao@amlogic.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