From: sashiko-bot@kernel.org
To: "Alex Elder" <elder@riscstar.com>
Cc: robh@kernel.org, bpf@vger.kernel.org, devicetree@vger.kernel.org,
conor+dt@kernel.org
Subject: Re: [PATCH net-next v2 12/14] gpio: tc956x: add TC956x/QPS615 support
Date: Sat, 06 Jun 2026 01:01:25 +0000 [thread overview]
Message-ID: <20260606010125.F1D381F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260605010022.968612-13-elder@riscstar.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] API Misuse: `fixed_direction_output` completely breaks direction querying and fails to enforce input-only pins.
- [Low] Build failure due to assignment to non-existent member `fixed_direction_mask` in `struct gpio_regmap_config`.
--
commit 5da78e90b4b1867131b8f557ae59d72ce4db9776
Author: Alex Elder <elder@riscstar.com>
gpio: tc956x: add TC956x/QPS615 support
This commit adds a generic regmap-based GPIO driver for the Toshiba TC956x
Ethernet-AVB/TSN bridge. The device acts as an auxiliary device to the PCIe
endpoint function driver.
> diff --git a/drivers/gpio/gpio-tc956x.c b/drivers/gpio/gpio-tc956x.c
> new file mode 100644
> index 0000000000000..0dc6b1028d970
> --- /dev/null
> +++ b/drivers/gpio/gpio-tc956x.c
[ ... ]
> +static int tc956x_gpio_probe(struct auxiliary_device *adev,
> + const struct auxiliary_device_id *id)
> +{
[ ... ]
> + config.reg_stride = GPIO_REG_STRIDE;
> + config.ngpio_per_reg = GPIO_PER_REG;
> + config.init_valid_mask = tc956x_gpio_init_valid_mask;
> + config.fixed_direction_mask = fixed;
[Severity: Low]
Is fixed_direction_mask a valid member of struct gpio_regmap_config?
It does not appear to be defined in include/linux/gpio/regmap.h, which
could lead to a build failure here.
> + config.fixed_direction_output = zeroes;
[Severity: High]
Does providing an all-zeroes bitmap to fixed_direction_output achieve the
intended input-only constraints?
Looking at gpio_regmap_get_direction() in drivers/gpio/gpio-regmap.c:
if (gpio->fixed_direction_output) {
if (test_bit(offset, gpio->fixed_direction_output))
return GPIO_LINE_DIRECTION_OUT;
else
return GPIO_LINE_DIRECTION_IN;
}
Providing a non-NULL fixed_direction_output causes the API to bypass
hardware direction queries for all pins, unconditionally reporting all
37 pins as inputs.
Furthermore, since reg_dir_in_base is also provided, the API will still
allow users to configure these supposedly input-only pins as outputs
because it does not check fixed_direction_output during set_direction
operations.
> +
> + gpio_regmap = devm_gpio_regmap_register(dev, &config);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605010022.968612-1-elder@riscstar.com?part=12
next prev parent reply other threads:[~2026-06-06 1:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 1:00 [PATCH net-next v2 00/14] net: enable TC956x support Alex Elder
2026-06-05 1:00 ` [PATCH net-next v2 01/14] dt-bindings: net: qca,qca808x: Add regulator properties Alex Elder
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 02/14] net: phy: qcom: qca808x: Add regulator management Alex Elder
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 03/14] net: pcs: pcs-xpcs-regmap: support XPCS memory-mapped MDIO bus via regmap Alex Elder
2026-06-05 15:35 ` Maxime Chevallier
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 04/14] net: pcs: xpcs: re-order xpcs_pre_config() to update after the reset Alex Elder
2026-06-05 1:00 ` [PATCH net-next v2 05/14] net: pcs: pcs-xpcs: select operating mode for 10G-baseR capable PCS Alex Elder
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 06/14] net: stmmac: dma: create a separate dma_device pointer Alex Elder
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 07/14] net: stmmac: dwxgmac2: Add multi MSI interrupt mode Alex Elder
2026-06-05 1:00 ` [PATCH net-next v2 08/14] net: stmmac: dwxgmac2: Add XGMAC 3.01a support Alex Elder
2026-06-05 1:00 ` [PATCH net-next v2 09/14] net: stmmac: dwxgmac2: export symbols for XGMAC 3.01a DMA Alex Elder
2026-06-05 1:00 ` [PATCH net-next v2 10/14] dt-bindings: net: toshiba,tc9654-dwmac: add TC9564 Ethernet bridge Alex Elder
2026-06-05 2:40 ` Rob Herring (Arm)
2026-06-05 12:24 ` Alex Elder
2026-06-05 14:40 ` Rob Herring
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 11/14] misc: tc956x_pci: add TC956x/QPS615 support Alex Elder
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 12/14] gpio: tc956x: " Alex Elder
2026-06-06 1:01 ` sashiko-bot [this message]
2026-06-05 1:00 ` [PATCH net-next v2 13/14] net: stmmac: " Alex Elder
2026-06-05 14:47 ` Rob Herring
2026-06-05 16:05 ` Maxime Chevallier
2026-06-06 1:01 ` sashiko-bot
2026-06-05 1:00 ` [PATCH net-next v2 14/14] arm64: dts: qcom: qcs6490-rb3gen2: enable TC9564 with a single QCA8081 phy Alex Elder
2026-06-06 1:01 ` sashiko-bot
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=20260606010125.F1D381F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=elder@riscstar.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox