Archive-only list for patches
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Ayushi Makhija <quic_amakhija@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Sasha Levin <sashal@kernel.org>,
	andrzej.hajda@intel.com, neil.armstrong@linaro.org,
	rfoss@kernel.org, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, lumag@kernel.org, dianders@chromium.org,
	nichen@iscas.ac.cn, robh@kernel.org, xji@analogixsemi.com,
	wenst@chromium.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH AUTOSEL 6.6 10/66] drm/bridge: anx7625: change the gpiod_set_value API
Date: Sun,  1 Jun 2025 19:36:47 -0400	[thread overview]
Message-ID: <20250601233744.3514795-10-sashal@kernel.org> (raw)
In-Reply-To: <20250601233744.3514795-1-sashal@kernel.org>

From: Ayushi Makhija <quic_amakhija@quicinc.com>

[ Upstream commit 50935044e58e563cdcfd556d62f27bc8744dd64e ]

Use gpiod_set_value_cansleep() instead of gpiod_set_value()
to fix the below call trace in the boot log:

[    5.690534] Call trace:
[    5.690536]  gpiod_set_value+0x40/0xa4
[    5.690540]  anx7625_runtime_pm_resume+0xa0/0x324 [anx7625]
[    5.690545]  __rpm_callback+0x48/0x1d8
[    5.690549]  rpm_callback+0x6c/0x78

Certain GPIO controllers require access via message-based buses
such as I2C or SPI, which may cause the GPIOs to enter a sleep
state. Therefore, use the gpiod_set_value_cansleep().

Signed-off-by: Ayushi Makhija <quic_amakhija@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250505094245.2660750-7-quic_amakhija@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

**YES** This commit should be backported to stable kernel trees.
**Detailed Analysis:** **1. Bug Fix Nature:** The commit fixes a real
runtime issue that produces call traces in the boot log. The commit
message clearly shows a call trace stack: ``` [ 5.690534] Call trace: [
5.690536] gpiod_set_value+0x40/0xa4 [ 5.690540]
anx7625_runtime_pm_resume+0xa0/0x324 [anx7625] ``` This indicates users
are experiencing actual crashes or warnings when using this driver with
certain GPIO controllers. **2. Small, Contained Fix:** The code changes
are minimal and surgical - only 4 lines changed, replacing
`gpiod_set_value()` with `gpiod_set_value_cansleep()` in the
`anx7625_power_on()` and `anx7625_power_standby()` functions: - Line
1260: `gpiod_set_value(ctx->pdata.gpio_p_on, 1)` →
`gpiod_set_value_cansleep(ctx->pdata.gpio_p_on, 1)` - Line 1263:
`gpiod_set_value(ctx->pdata.gpio_reset, 1)` →
`gpiod_set_value_cansleep(ctx->pdata.gpio_reset, 1)` - Line 1283:
`gpiod_set_value(ctx->pdata.gpio_reset, 0)` →
`gpiod_set_value_cansleep(ctx->pdata.gpio_reset, 0)` - Line 1285:
`gpiod_set_value(ctx->pdata.gpio_p_on, 0)` →
`gpiod_set_value_cansleep(ctx->pdata.gpio_p_on, 0)` **3. Well-
Established Pattern:** Looking at the similar commits provided as
reference, this exact type of GPIO API fix is common and consistently
handles the same underlying issue. All 5 similar commits (marked as "NO"
for backport) show the same pattern of switching from
`gpiod_set_value()` to `gpiod_set_value_cansleep()` to handle GPIO
controllers on message-based buses (I2C/SPI). **4. Technical
Correctness:** The fix is technically sound. These functions are called
during power management operations (`anx7625_power_on()` and
`anx7625_power_standby()`) where sleeping is acceptable and expected.
The `_cansleep` variant is the correct API when GPIO controllers might
be accessed via slow buses like I2C or SPI. **5. Low Risk:** The change
has minimal risk of regression. The `gpiod_set_value_cansleep()`
function provides the same functionality as `gpiod_set_value()` but
allows sleeping, making it safe to use in contexts where the original
was used incorrectly. **6. Critical Subsystem Impact:** This affects the
DRM bridge subsystem and display functionality. Users with anx7625
bridge chips connected to I2C GPIO expanders would experience boot-time
call traces, which is a user-visible issue that should be fixed in
stable kernels. **7. Real Hardware Impact:** The commit specifically
mentions "Certain GPIO controllers require access via message-based
buses such as I2C or SPI" - this is a real hardware configuration that
users deploy, not an edge case. This commit meets all the criteria for
stable backporting: it fixes a user-visible bug, has minimal risk, is
contained to a single driver, and follows an established pattern for
this type of GPIO API fix.

 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index ddf944651c55a..fdf55d46abf52 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1255,10 +1255,10 @@ static void anx7625_power_on(struct anx7625_data *ctx)
 	usleep_range(11000, 12000);
 
 	/* Power on pin enable */
-	gpiod_set_value(ctx->pdata.gpio_p_on, 1);
+	gpiod_set_value_cansleep(ctx->pdata.gpio_p_on, 1);
 	usleep_range(10000, 11000);
 	/* Power reset pin enable */
-	gpiod_set_value(ctx->pdata.gpio_reset, 1);
+	gpiod_set_value_cansleep(ctx->pdata.gpio_reset, 1);
 	usleep_range(10000, 11000);
 
 	DRM_DEV_DEBUG_DRIVER(dev, "power on !\n");
@@ -1278,9 +1278,9 @@ static void anx7625_power_standby(struct anx7625_data *ctx)
 		return;
 	}
 
-	gpiod_set_value(ctx->pdata.gpio_reset, 0);
+	gpiod_set_value_cansleep(ctx->pdata.gpio_reset, 0);
 	usleep_range(1000, 1100);
-	gpiod_set_value(ctx->pdata.gpio_p_on, 0);
+	gpiod_set_value_cansleep(ctx->pdata.gpio_p_on, 0);
 	usleep_range(1000, 1100);
 
 	ret = regulator_bulk_disable(ARRAY_SIZE(ctx->pdata.supplies),
-- 
2.39.5


  parent reply	other threads:[~2025-06-01 23:38 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-01 23:36 [PATCH AUTOSEL 6.6 01/66] drm/amdgpu/gfx6: fix CSIB handling Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 02/66] media: imx-jpeg: Check decoding is ongoing for motion-jpeg Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 03/66] drm/dp: add option to disable zero sized address only transactions Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 04/66] sunrpc: update nextcheck time when adding new cache entries Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 05/66] drm/amd/display: DCN32 null data check Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 06/66] drm/bridge: analogix_dp: Add irq flag IRQF_NO_AUTOEN instead of calling disable_irq() Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 07/66] workqueue: Fix race condition in wq->stats incrementation Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 08/66] exfat: fix double free in delayed_free Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 09/66] arm64/cpuinfo: only show one cpu's info in c_show() Sasha Levin
2025-06-01 23:36 ` Sasha Levin [this message]
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 11/66] drm/amdgpu/gfx11: fix CSIB handling Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 12/66] media: i2c: imx334: Enable runtime PM before sub-device registration Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 13/66] drm/msm/hdmi: add runtime PM calls to DDC transfer function Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 14/66] media: uapi: v4l: Fix V4L2_TYPE_IS_OUTPUT condition Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 15/66] drm/amd/display: Add NULL pointer checks in dm_force_atomic_commit() Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 16/66] media: verisilicon: Enable wide 4K in AV1 decoder Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 17/66] drm/amd/display: Skip to enable dsc if it has been off Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 18/66] drm/msm/a6xx: Increase HFI response timeout Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 19/66] drm/amd/display: Do Not Consider DSC if Valid Config Not Found Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 20/66] media: i2c: imx334: Fix runtime PM handling in remove function Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 21/66] drm/amdgpu/gfx10: fix CSIB handling Sasha Levin
2025-06-01 23:36 ` [PATCH AUTOSEL 6.6 22/66] drm: panel-orientation-quirks: Add ZOTAC Gaming Zone Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 23/66] media: ccs-pll: Better validate VT PLL branch Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 24/66] media: uapi: v4l: Change V4L2_TYPE_IS_CAPTURE condition Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 25/66] drm/amdgpu/gfx7: fix CSIB handling Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 26/66] ext4: ext4: unify EXT4_EX_NOCACHE|NOFAIL flags in ext4_ext_remove_space() Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 27/66] jfs: fix array-index-out-of-bounds read in add_missing_indices Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 28/66] media: ti: cal: Fix wrong goto on error path Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 29/66] media: rkvdec: h264: Use bytesperline and buffer height as virstride Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 30/66] media: rkvdec: Initialize the m2m context before the controls Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 31/66] sunrpc: fix race in cache cleanup causing stale nextcheck time Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 32/66] ext4: prevent stale extent cache entries caused by concurrent get es_cache Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 33/66] drm/amdgpu/gfx8: fix CSIB handling Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 34/66] drm/amdgpu/gfx9: " Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 35/66] jfs: Fix null-ptr-deref in jfs_ioc_trim Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 36/66] drm/amd/display: Correct prefetch calculation Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 37/66] drm/msm/dpu: don't select single flush for active CTL blocks Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 38/66] drm/amdkfd: Set SDMA_RLCx_IB_CNTL/SWITCH_INSIDE_IB Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 39/66] media: tc358743: ignore video while HPD is low Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 40/66] media: platform: exynos4-is: Add hardware sync wait to fimc_is_hw_change_mode() Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 41/66] media: i2c: imx334: update mode_3840x2160_regs array Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 42/66] nios2: force update_mmu_cache on spurious tlb-permission--related pagefaults Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 43/66] media: rcar-vin: Fix stride setting for RAW8 formats Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 44/66] media: qcom: venus: Fix uninitialized variable warning Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 45/66] ACPI: bus: Bail out if acpi_kobj registration fails Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 46/66] pmdomain: ti: Fix STANDBY handling of PER power domain Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 47/66] PM: runtime: fix denying of auto suspend in pm_suspend_timer_fn() Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 48/66] ASoC: amd: yc: Add quirk for Lenovo Yoga Pro 7 14ASP9 Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 49/66] thermal/drivers/qcom/tsens: Update conditions to strictly evaluate for IP v2+ Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 50/66] clocksource/drivers/timer-tegra186: Fix watchdog self-pinging Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 51/66] gpio: pxa: Make irq_chip immutable Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 52/66] gpio: grgpio: " Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 53/66] gpio: xgene-sb: " Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 54/66] genirq: Retain disable depth for managed interrupts across CPU hotplug Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 55/66] mmc: sdhci-esdhc-imx: Save tuning value when card stays powered in suspend Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 56/66] mmc: Add quirk to disable DDR50 tuning Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 57/66] clocksource: Fix the CPUs' choice in the watchdog per CPU verification Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 58/66] ACPICA: Avoid sequence overread in call to strncmp() Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 59/66] ACPICA: utilities: Fix overflow check in vsnprintf() Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 60/66] ACPI: EC: Add device to acpi_ec_no_wakeup[] qurik list Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 61/66] ALSA: seq: Remove unused snd_seq_queue_client_leave_cells Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 62/66] cpufreq: Force sync policy boost with global boost on sysfs update Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 63/66] power: supply: bq27xxx: Retrieve again when busy Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 64/66] tools/nolibc: use intmax definitions from compiler Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 65/66] gpio: ds4520: don't check the 'ngpios' property in the driver Sasha Levin
2025-06-01 23:37 ` [PATCH AUTOSEL 6.6 66/66] ASoC: tas2770: Power cycle amp on ISENSE/VSENSE change Sasha Levin

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=20250601233744.3514795-10-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nichen@iscas.ac.cn \
    --cc=patches@lists.linux.dev \
    --cc=quic_amakhija@quicinc.com \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=wenst@chromium.org \
    --cc=xji@analogixsemi.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