Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	dmitry.torokhov@gmail.com
Subject: Re: [PATCH v3 03/10] ARM: s3c: register and attach software nodes for Samsung gpio_chips
Date: Sun, 12 Jul 2026 02:24:37 +0000	[thread overview]
Message-ID: <20260712022438.B7A511F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260711-samsung-kp-v3-3-b2fcaba77aff@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The 4-bit and 4-bit2 GPIO direction configuration functions perform read-modify-write operations on shared configuration registers without holding the chip's spinlock, leading to race conditions.
--

--- Patch [3]: [PATCH v3 03/10] ARM: s3c: register and attach software nodes for Samsung gpio_chips ---
commit 8053fb79cb15e3c5c2e66691008b5adc30b3e152
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>

ARM: s3c: register and attach software nodes for Samsung gpio_chips

This commit defines and registers software nodes for the Samsung GPIO chips on
legacy platforms. It attaches the matching software node to each gpio_chip's
fwnode during registration, providing the infrastructure to convert board files
and drivers to use software nodes instead of legacy platform data.

> diff --git a/arch/arm/mach-s3c/gpio-samsung.c b/arch/arm/mach-s3c/gpio-samsung.c
> --- a/arch/arm/mach-s3c/gpio-samsung.c
> +++ b/arch/arm/mach-s3c/gpio-samsung.c

[ ... ]

> @@ -659,49 +695,49 @@ static struct samsung_gpio_chip s3c64xx_gpios_4bit[] = {
>  		.chip	= {
>  			.base	= S3C64XX_GPA(0),
>  			.ngpio	= S3C64XX_GPIO_A_NR,
> -			.label	= "GPA",
>  		},
> +		.swnode	= SAMSUNG_GPIO_NODE('A'),

[Severity: High]
This is a pre-existing issue, but since we are updating the 4-bit GPIO chip
registrations here, should the underlying 4-bit configuration functions be
updated to use the chip->lock?

Currently, functions like samsung_gpiolib_4bit_input() perform
read-modify-write operations on shared configuration registers without locking:

samsung_gpiolib_4bit_input() {
    ...
    con = __raw_readl(base + GPIOCON_OFF);
    if (ourchip->bitmap_gpio_int & BIT(offset))
        con |= 0xf << con_4bit_shift(offset);
    else
        con &= ~(0xf << con_4bit_shift(offset));
    __raw_writel(con, base + GPIOCON_OFF);
    ...
}

Similar unprotected read-modify-write sequences exist in
samsung_gpiolib_4bit_output() (for both GPIOCON and GPIODAT) and
samsung_gpiolib_4bit2_input().

If two threads concurrently attempt to change the direction of different
GPIO pins in the same bank, could this lead to lost or corrupted
configuration updates?

>  	}, {

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260711-samsung-kp-v3-0-b2fcaba77aff@gmail.com?part=3

  reply	other threads:[~2026-07-12  2:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12  2:12 [PATCH v3 00/10] Remove support for platform data from samsung keypad Dmitry Torokhov
2026-07-12  2:12 ` [PATCH v3 01/10] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding Dmitry Torokhov
2026-07-12  2:22   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 02/10] Input: samsung-keypad - handle " Dmitry Torokhov
2026-07-12  2:24   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 03/10] ARM: s3c: register and attach software nodes for Samsung gpio_chips Dmitry Torokhov
2026-07-12  2:24   ` sashiko-bot [this message]
2026-07-12  2:12 ` [PATCH v3 04/10] ARM: s3c: crag6410: switch keypad device to software properties Dmitry Torokhov
2026-07-12  2:12 ` [PATCH v3 05/10] Input: samsung-keypad - remove support for platform data Dmitry Torokhov
2026-07-12  2:22   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 06/10] ARM: s3c: crag6410: use software nodes/properties to set up GPIO keys Dmitry Torokhov
2026-07-12  2:21   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 07/10] mfd: wm831x: support software nodes for DCDC regulators Dmitry Torokhov
2026-07-12  2:20   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 08/10] ARM: s3c: crag6410: convert PMIC DVS GPIO to software properties Dmitry Torokhov
2026-07-12  2:32   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 09/10] ARM: s3c: crag6410: convert basic-mmio-gpio and LEDs " Dmitry Torokhov
2026-07-12  2:12 ` [PATCH v3 10/10] ARM: s3c: crag6410: convert remaining GPIO lookup tables to property entries Dmitry Torokhov
2026-07-12 12:30 ` [PATCH v3 00/10] Remove support for platform data from samsung keypad Krzysztof Kozlowski

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=20260712022438.B7A511F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --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