From: sashiko-bot@kernel.org
To: "Abdurrahman Hussain" <abdurrahman@nexthop.ai>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 2/2] hwmon: (pmbus/adm1266) don't clobber GPIO bits before PDIO read in get_multiple
Date: Sat, 16 May 2026 21:36:51 +0000 [thread overview]
Message-ID: <20260516213652.BC4E6C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260516-adm1266-gpio-fixes-v1-2-38d9dd39b905@nexthop.ai>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The GPIO attribute callback performs I2C bus operations without acquiring the required hardware monitoring subsystem lock.
--
commit d1b12bbfe7f9af4177e43676d5e90231b39df296
Author: Abdurrahman Hussain <abdurrahman@nexthop.ai>
hwmon: (pmbus/adm1266) don't clobber GPIO bits before PDIO read in get_multiple
This commit removes a redundant clearing of the bitmask in the GPIO
get_multiple callback, ensuring that both GPIO and PDIO bits are preserved
in the result.
> diff --git a/drivers/hwmon/pmbus/adm1266.c b/drivers/hwmon/pmbus/adm1266.c
> index 11f9a44f4361a..4dd67c02b412e 100644
> --- a/drivers/hwmon/pmbus/adm1266.c
> +++ b/drivers/hwmon/pmbus/adm1266.c
> @@ -210,7 +210,6 @@ static int adm1266_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask
Does this GPIO attribute callback need to acquire the hardware monitoring
subsystem lock?
The hardware monitoring subsystem guidelines require that drivers implement
locking for attributes registered outside the core, to serialize with thermal
and sysfs operations.
Looking at adm1266_gpio_get_multiple(), it issues i2c_smbus_read_block_data()
without acquiring a lock. Could this cause a race condition against concurrent
PMBus accesses from the core?
>
> status = read_buf[0] + (read_buf[1] << 8);
>
> - *bits = 0;
> for_each_set_bit_from(gpio_nr, mask, ADM1266_GPIO_NR + ADM1266_PDIO_NR) {
> if (test_bit(gpio_nr - ADM1266_GPIO_NR, &status))
> set_bit(gpio_nr, bits);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260516-adm1266-gpio-fixes-v1-0-38d9dd39b905@nexthop.ai?part=2
next prev parent reply other threads:[~2026-05-16 21:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 20:45 [PATCH 0/2] hwmon: (pmbus/adm1266) adm1266_gpio_get_multiple() fixes Abdurrahman Hussain
2026-05-16 20:45 ` [PATCH 1/2] hwmon: (pmbus/adm1266) cap PDIO scan in get_multiple at ADM1266_PDIO_NR Abdurrahman Hussain
2026-05-16 21:11 ` sashiko-bot
2026-05-16 20:45 ` [PATCH 2/2] hwmon: (pmbus/adm1266) don't clobber GPIO bits before PDIO read in get_multiple Abdurrahman Hussain
2026-05-16 21:36 ` sashiko-bot [this message]
2026-05-17 10:44 ` [PATCH 0/2] hwmon: (pmbus/adm1266) adm1266_gpio_get_multiple() fixes Linus Walleij
2026-05-18 22:25 ` Guenter Roeck
2026-05-25 8:36 ` Linus Walleij
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=20260516213652.BC4E6C19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=abdurrahman@nexthop.ai \
--cc=linux-hwmon@vger.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