From: sashiko-bot@kernel.org
To: "Petar Stepanovic" <pstepanovic@axiado.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/2] gpio: axiado: add AX3005 SGPIO controller support
Date: Mon, 21 Sep 2026 07:30:55 +0000 [thread overview]
Message-ID: <20260921073056.108E31F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260921-axiado-ax3000-sgpio-controller-v4-2-79c444be7faf@axiado.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] gpio: axiado: SGPIO_POS macro sets identical first and last positions
- [Medium] gpio: axiado: spurious interrupts due to unsynchronized input cache initialization
--
commit 19833b35bd592291102f572f7810cdc59b72089f
Author: Petar Stepanovic <pstepanovic@axiado.com>
gpio: axiado: add AX3005 SGPIO controller support
This commit adds support for the Axiado AX3005 SGPIO controller. It provides
a serialized interface for controlling multiple GPIO signals over limited
physical lines, registering the controller as a standard gpio_chip with
interrupt support.
> diff --git a/drivers/gpio/gpio-axiado-sgpio.c b/drivers/gpio/gpio-axiado-sgpio.c
> new file mode 100644
> index 0000000000000..b57a5074ccef3
> --- /dev/null
> +++ b/drivers/gpio/gpio-axiado-sgpio.c
[ ... ]
> +/* A POS register holds the first and the last position driven by the slice. */
> +#define SGPIO_POS_FIRST GENMASK(31, 16)
> +#define SGPIO_POS_LAST GENMASK(15, 0)
> +#define SGPIO_POS(pos) (FIELD_PREP(SGPIO_POS_FIRST, (pos)) | \
> + FIELD_PREP(SGPIO_POS_LAST, (pos)))
[Severity: High]
Does this macro intentionally set both the start and end positions to the
identical value?
When using SGPIO_POS_FULL_BANK, this populates both the first and last
bitfields with the same position, reducing the active slice range to a single
position rather than the full range from 0 to 31. Will this prevent the
hardware from shifting out the required number of signals per bank and break
the serialized data exchange?
[ ... ]
> +static int axiado_sgpio_probe(struct platform_device *pdev)
> +{
> + struct gpio_regmap_config config = { };
[ ... ]
> + /*
> + * From here on the hardware may be running, so the shutdown action has
> + * to be in place before the first register is programmed. It only ever
> + * writes zeroes, which is harmless if initialisation never got that
> + * far, and it runs before the APB clock is disabled because that was
> + * requested earlier.
> + */
> + rc = devm_add_action_or_reset(&pdev->dev, axiado_sgpio_disable, sgpio);
> + if (rc)
> + return rc;
> +
> + rc = axiado_sgpio_hw_init(sgpio);
> + if (rc)
> + return dev_err_probe(&pdev->dev, rc,
> + "Failed to initialize hardware\n");
> +
> + rc = axiado_sgpio_init_input_cache(sgpio);
> + if (rc)
> + return dev_err_probe(&pdev->dev, rc,
> + "Failed to initialize input cache\n");
[Severity: Medium]
Is there a race condition between initializing the hardware and reading
the input cache here?
axiado_sgpio_hw_init() enables the background shift engine, but
axiado_sgpio_init_input_cache() immediately reads the din_ss registers to
populate din_shadow. If the first serial hardware exchange has not yet
completed, won't din_shadow be initialized with stale or uninitialized zero
values?
Could this cause consumers to receive a spurious edge interrupt during
initialization if a signal is physically high, as the parent handler will later
observe a transition from the zeroed cache to the true physical level?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921-axiado-ax3000-sgpio-controller-v4-0-79c444be7faf@axiado.com?part=2
next prev parent reply other threads:[~2026-09-21 7:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 7:20 [PATCH v4 0/2] gpio: Add support for Axiado AX3005 SGPIO controller Petar Stepanovic
2026-09-21 7:20 ` [PATCH v4 1/2] dt-bindings: gpio: add " Petar Stepanovic
2026-09-21 7:20 ` [PATCH v4 2/2] gpio: axiado: add AX3005 SGPIO controller support Petar Stepanovic
2026-09-21 7:30 ` sashiko-bot [this message]
2026-09-24 12:06 ` [PATCH v4 0/2] gpio: Add support for Axiado AX3005 SGPIO controller Bartosz Golaszewski
2026-09-28 8:26 ` Bartosz Golaszewski
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=20260921073056.108E31F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=pstepanovic@axiado.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.