Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Cody Kang" <codykang.hk@gmail.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-phy@lists.infradead.org, linux-clk@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org,
	neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v4 11/16] drm/spacemit: add Innosilicon DP/eDP controller bridge driver
Date: Sun, 29 Nov 2026 13:01:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-239616@kernel.org> (raw)
In-Reply-To: <20261129-k3-display-v4-11-ce6cf7988202@gmail.com>

Thank you for your contribution! Sashiko AI review found 11 potential
issues to consider:
- [High] drm/spacemit: clk_set_parent() fails in spacemit_dp_probe() due
  to ccu-k3 mux
- [High] drm/spacemit: DP_PHY_RESET in spacemit_dp_dev_init() desyncs
  PREPLL clk rate
- [Medium] drm/spacemit: sink count and cap retry bugs in
  spacemit_dp_bridge_detect()
- [Medium] drm/spacemit: missing 1-lane HBR2 config and eDP sink_rates
  filter
- [Medium] drm/spacemit: skipped PLL check and stale DPCD in
  mode_valid()
- [Medium] drm/spacemit: phy_exit() in spacemit_dp_shutdown() while DRM
  device is active
- [Medium] drm/spacemit: spacemit_dp_remove() runs before devm DP AUX
  bus depopulation
- [Medium] drm/spacemit: AUX registered before init and MPLL reset
  without hw_mutex
- [Medium] drm/spacemit: unlocked dp->link and dp->dpcd reads in
  mode_valid() and check
- [Medium] drm/spacemit: multi-second AUX timeout stalls and ignored D0
  timeout
- [Medium] drm/spacemit: redundant init and unguarded eDP HPD check in
  spacemit_dp_bind()
--

commit 35a58c12d01e7fe94c01dcd449a9206872d617e4
Author: Cody Kang <codykang@vsit.ai>

drm/spacemit: add Innosilicon DP/eDP controller bridge driver

This commit adds the DRM bridge driver for the Innosilicon DisplayPort and
embedded DisplayPort controller downstream of the Saturn DPU on SpacemiT
SoCs.

> diff --git a/drivers/gpu/drm/spacemit/spacemit_inno_dp.c b/drivers/gpu/drm/spacemit/spacemit_inno_dp.c
> new file mode 100644
> index 0000000000000..c4d4e2aec5fdd
> --- /dev/null
> +++ b/drivers/gpu/drm/spacemit/spacemit_inno_dp.c

[ ... ]

> +static const struct spacemit_dp_link_config {
> +	enum spacemit_dp_link_rate rate;
> +	enum spacemit_dp_lane_count lanes;
> +} spacemit_dp_link_priority_table[] = {
> +	{SPACEMIT_DP_LINK_RATE_1_62, SPACEMIT_DP_LANE_1}, /* 1.62 Gbps */
> +	{SPACEMIT_DP_LINK_RATE_2_70, SPACEMIT_DP_LANE_1}, /* 2.70 Gbps */
> +	{SPACEMIT_DP_LINK_RATE_1_62, SPACEMIT_DP_LANE_2}, /* 3.24 Gbps */
> +
> +	{SPACEMIT_DP_LINK_RATE_2_70, SPACEMIT_DP_LANE_2}, /* 5.40 Gbps */
> +	{SPACEMIT_DP_LINK_RATE_1_62, SPACEMIT_DP_LANE_4}, /* 6.48 Gbps */
> +
> +	{SPACEMIT_DP_LINK_RATE_2_70, SPACEMIT_DP_LANE_4}, /* 10.8 Gbps */
> +	{SPACEMIT_DP_LINK_RATE_5_40, SPACEMIT_DP_LANE_2}, /* 10.8 Gbps */
> +
> +	{SPACEMIT_DP_LINK_RATE_5_40, SPACEMIT_DP_LANE_4}, /* 21.6 Gbps */
> +};

[Severity: Medium]
Should spacemit_dp_link_priority_table[] also include
{SPACEMIT_DP_LINK_RATE_5_40, SPACEMIT_DP_LANE_1}?

Both the DisplayPort specification and phy-k3-inno-dp support 1-lane HBR2
(4.32 Gbps usable capacity), and spacemit_dp_bridge_mode_valid() accepts
1-lane HBR2 modes up to 4.32 Gbps, but spacemit_dp_bridge_atomic_check()
and spacemit_dp_bridge_atomic_enable() reject any 1-lane mode above 2.16
Gbps because that entry is missing from the table.

In addition, when dp->link.use_rate_select is true on eDP 1.4, neither
spacemit_dp_bridge_atomic_check() nor the loop filter in
spacemit_dp_bridge_atomic_enable() verifies that cfg->rate is listed in
dp->link.sink_rates[].  If a panel lists 2.70 Gbps in
DP_SUPPORTED_LINK_RATES without 1.62 Gbps, atomic_check() picks 1.62 Gbps
and atomic_enable() power-cycles the link, programs the PLLs, powers on
the PHY, and writes DP_EDP_CONFIGURATION_SET before
spacemit_dp_link_train() rejects the rate with -EINVAL.

[ ... ]

> +	ret = regmap_read_poll_timeout(dp->regs, DP_GENERAL_INTERRUPT, val,
> +				       val & DP_AUX_REPLY_EVENT_INT_STA,
> +				       SPACEMIT_DP_AUX_POLL_US,
> +				       SPACEMIT_DP_AUX_TIMEOUT_US);
> +	if (ret) {
> +		spacemit_dp_aux_hw_reset(dp);
> +		dev_dbg_ratelimited(dp->dev,
> +				    "AUX transfer timeout, req: 0x%x, cmd: 0x%x, addr: 0x%x, size %zu\n",
> +				    msg->request, cmd, msg->address, msg->size);
> +		return ret;
> +	}

[ ... ]

> +	/* A sink left in D3 need not answer the training writes. */
> +	if (drm_dp_link_power_up(&dp->aux, dp->link.revision) < 0)
> +		drm_dbg(dp->drm, "failed to set the sink to D0\n");
> +
> +	/*
> +	 * A sink may act on the DP_LINK_BW_SET write, so set the lane count
> +	 * first.
> +	 */
> +	link_config[0] = lanes;
> +	if (dp->link.enhanced_framing)
> +		link_config[0] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
> +	regmap_write_bits(dp->regs, DP_CORE_CONTROL, DP_ENHANCE_FRAMING_EN,
> +			  FIELD_PREP(DP_ENHANCE_FRAMING_EN,
> +				     dp->link.enhanced_framing));
> +
> +	ret = drm_dp_dpcd_write_byte(&dp->aux, DP_LANE_COUNT_SET,
> +				     link_config[0]);

[Severity: Medium]
Does a single timed-out DPCD access stall for 6.5 seconds, and does
spacemit_dp_link_train() double that stall by ignoring -ETIMEDOUT from
drm_dp_link_power_up()?

SPACEMIT_DP_AUX_TIMEOUT_US is 200 ms plus 4-5 ms in
spacemit_dp_aux_hw_reset(), and drm_dp_dpcd_access() retries all 32 times
even on -ETIMEDOUT, so each unresponsive DPCD access blocks for 6.54
seconds while holding aux.hw_mutex and dp->mode_lock.  Because
spacemit_dp_link_train() only logs a failure from drm_dp_link_power_up()
and proceeds to drm_dp_dpcd_write_byte(DP_LANE_COUNT_SET), an
unresponsive sink stalls for 13.1 seconds before returning -ETIMEDOUT to
spacemit_dp_bridge_atomic_enable().

[ ... ]

> +static enum drm_connector_status
> +spacemit_dp_bridge_detect(struct drm_bridge *bridge, struct drm_connector *connector)
> +{
> +	struct spacemit_dp_dev *dp = container_of_const(bridge,
> +							struct spacemit_dp_dev,
> +							bridge);
> +	enum drm_connector_status status;
> +
> +	guard(mutex)(&dp->mode_lock);
> +	status = spacemit_dp_hw_detect_hpd(dp);
> +
> +	/*
> +	 * The bind-time cap read only covers a sink that was already there.
> +	 * Without a re-read here, link.max_rate stays 0 and every link config
> +	 * is filtered out.
> +	 */
> +	if (status == connector_status_connected &&
> +	    dp->connector_status != connector_status_connected)
> +		spacemit_dp_hw_read_sink_caps(dp);
> +
> +	/* A branch device holds HPD up with no sink behind it. */
> +	if (status == connector_status_connected &&
> +	    drm_dp_is_branch(dp->dpcd) && !drm_dp_read_sink_count(&dp->aux))
> +		status = connector_status_disconnected;
> +
> +	dp->connector_status = status;
> +
> +	return status;
> +}

[Severity: Medium]
Does !drm_dp_read_sink_count(&dp->aux) treat negative error returns as a
connected sink?

drm_dp_read_sink_count() returns a negative errno when reading
DP_SINK_COUNT fails, so !drm_dp_read_sink_count(&dp->aux) evaluates to
false on error and reports the branch device as connected; checking
drm_dp_read_sink_count(&dp->aux) <= 0 would avoid that.

Also, if spacemit_dp_hw_read_sink_caps() fails (or if
spacemit_dp_bridge_atomic_enable() clears dp->link.max_rate and
dp->link.max_num_lanes after sink_lost), dp->dpcd is zeroed while
dp->connector_status is still latched to connector_status_connected.
Later detect polls while HPD stays high see dp->connector_status ==
connector_status_connected and never retry spacemit_dp_hw_read_sink_caps()
even though dp->link.max_rate is 0.

[ ... ]

> +static enum drm_mode_status
> +spacemit_dp_bridge_mode_valid(struct drm_bridge *bridge,
> +			      const struct drm_display_info *info,
> +			 const struct drm_display_mode *mode)
> +{
> +	struct spacemit_dp_dev *dp = container_of_const(bridge,
> +							struct spacemit_dp_dev,
> +							bridge);
> +	unsigned int max_link_rate, max_lanes;
> +	u64 max_bw, req_bw;
> +
> +	/*
> +	 * Prefer the link limits the driver maintains: they start as the
> +	 * sink's capabilities clamped to the PHY and are narrowed after a
> +	 * failed training. drm_dp_max_link_rate() is in 10 kbit/s.
> +	 */
> +	if (dp->link.max_rate && dp->link.max_num_lanes) {
> +		max_link_rate = dp->link.max_rate / 10;
> +		max_lanes = dp->link.max_num_lanes;
> +	} else {
> +		max_link_rate = min_t(unsigned int,
> +				      drm_dp_max_link_rate(dp->dpcd),
> +				      SPACEMIT_DP_SOURCE_MAX_RATE / 10);
> +		max_lanes = drm_dp_max_lane_count(dp->dpcd);
> +	}
> +	if (!max_link_rate || !max_lanes) {
> +		/* Sink not enumerated yet: accept and re-check at modeset. */
> +		return MODE_OK;
> +	}
> +
> +	/*
> +	 * max_link_rate is per lane in 10 kbit/s. The x10 to reach kbit/s and
> +	 * the 8b/10b coding overhead cancel down to a plain "* 8".
> +	 */
> +	max_bw = (u64)max_link_rate * max_lanes * 8;
> +
> +	/* Required bandwidth: pixel clock (kHz) * bits per pixel. */
> +	req_bw = (u64)mode->clock * SPACEMIT_DP_BPP;
> +
> +	if (req_bw > max_bw) {
> +		drm_dbg(bridge->dev,
> +			"rejecting %dx%d@%d: %llu > %llu kbit/s (%u kbit/s x%u lanes)\n",
> +			mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode),
> +			req_bw, max_bw, max_link_rate * 10, max_lanes);
> +		return MODE_CLOCK_HIGH;
> +	}
> +
> +	/* The pixel clock is made by the PHY PLL, which cannot hit every rate. */
> +	if (clk_round_rate(dp->pll_clk, mode->clock * 1000UL) <= 0)
> +		return MODE_NOCLOCK;
> +
> +	return MODE_OK;
> +}

[Severity: Medium]
Does returning MODE_OK when !max_link_rate || !max_lanes bypass the
clk_round_rate(dp->pll_clk, ...) check, and does the else branch fall back
to un-narrowed dp->dpcd values?

Before an eDP panel is enabled for the first time, its DPCD limits are 0,
so spacemit_dp_bridge_mode_valid() returns early before checking whether
dp->pll_clk can synthesize mode->clock.  If the PHY PLL rejects the rate,
spacemit_dp_set_plls() later fails in spacemit_dp_bridge_atomic_enable()
(including in the !dp->phy_powered fallback), leaving the pixel clock off
and wedging the CRTC commit.

Also, when spacemit_dp_bridge_atomic_enable() zeroes dp->link.max_rate and
dp->link.max_num_lanes after link narrowing is exhausted or the sink is
lost, dp->dpcd is not cleared, so the else branch here reverts to the
full un-narrowed capabilities from dp->dpcd.

[ ... ]

> +static int spacemit_dp_bridge_atomic_check(struct drm_bridge *bridge,
> +					   struct drm_bridge_state *bridge_state,
> +				      struct drm_crtc_state *crtc_state,
> +				      struct drm_connector_state *conn_state)
> +{
> +	struct spacemit_dp_dev *dp = container_of_const(bridge,
> +							struct spacemit_dp_dev,
> +							bridge);
> +	struct spacemit_dp_bridge_state *st =
> +			to_spacemit_dp_bridge_state(bridge_state);
> +	const struct drm_display_mode *mode = &crtc_state->adjusted_mode;
> +	u32 req_bw;
> +	int i;
> +
> +	req_bw = spacemit_dp_calc_required_bw(mode, SPACEMIT_DP_BPP);
> +
> +	/* No caps yet: leave idx unset and let ->atomic_enable() retry. */
> +	if (!dp->link.max_rate || !dp->link.max_num_lanes) {
> +		st->link_cfg_idx = -1;
> +		return 0;
> +	}
> +
> +	for (i = 0; i < ARRAY_SIZE(spacemit_dp_link_priority_table); i++) {
> +		const struct spacemit_dp_link_config *cfg =
> +				&spacemit_dp_link_priority_table[i];
> +
> +		if (cfg->rate > dp->link.max_rate ||
> +		    cfg->lanes > dp->link.max_num_lanes)
> +			continue;
> +		if (spacemit_dp_calc_link_capacity(cfg->rate, cfg->lanes) < req_bw)
> +			continue;
> +
> +		st->link_cfg_idx = i;
> +		return 0;
> +	}
> +
> +	drm_dbg(bridge->dev,
> +		"no DP link cfg fits %dx%d@%d (need %u kbit/s; sink %u kbit/s x %u lanes)\n",
> +		mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode),
> +		req_bw, dp->link.max_rate, dp->link.max_num_lanes);
> +	return -EINVAL;
> +}

[Severity: Medium]
Can spacemit_dp_bridge_atomic_check() and spacemit_dp_bridge_mode_valid()
race with concurrent updates to dp->link and dp->dpcd because neither
acquires dp->mode_lock?

output_poll_execute() runs spacemit_dp_bridge_detect() under
mode_config.mutex (without connection_mutex), and non-blocking commits run
spacemit_dp_bridge_atomic_enable() on a workqueue without modeset locks:

CPU0                                  CPU1 (kworker)
spacemit_dp_bridge_atomic_check()     spacemit_dp_bridge_atomic_enable()
  if (!dp->link.max_rate || ...)
                                        guard(mutex)(&dp->mode_lock);
                                        dp->link.max_rate = 0;
                                        dp->link.max_num_lanes = 0;
  for (i = 0; ...; i++)
    if (cfg->rate > dp->link.max_rate)
      continue;
  return -EINVAL;  <-- commit fails instead of returning 0 with idx = -1

If dp->link.max_rate or dp->link.max_num_lanes is cleared after the
initial check in spacemit_dp_bridge_atomic_check(), the loop filters out
every table entry and fails the atomic check with -EINVAL.

[ ... ]

> +static int spacemit_dp_dev_init(struct spacemit_dp_dev *dp)
> +{
> +	int ret;
> +
> +	/* The PHY parks its lanes and PLLs for the reset below. */
> +	ret = phy_reset(dp->phy);
> +	if (ret)
> +		return ret;
> +
> +	/* Reset Controller and PHY */
> +	regmap_write_bits(dp->regs, DP_SOFT_RESET, DP_CONTROLLER_RESET,
> +			  FIELD_PREP(DP_CONTROLLER_RESET, 0x1));
> +	regmap_write_bits(dp->regs, DP_SOFT_RESET, DP_PHY_RESET,
> +			  FIELD_PREP(DP_PHY_RESET, 0x1));

[ ... ]

> +	ret = spacemit_dp_set_plls(dp, SPACEMIT_DP_LINK_RATE_2_70, 148500);
> +	if (ret)
> +		return ret;
> +
> +	ret = spacemit_dp_phy_set_lanes(dp, SPACEMIT_DP_LANE_2);
> +	if (ret)
> +		return ret;
> +
> +	ret = spacemit_dp_phy_on(dp);
> +	if (ret)
> +		return ret;
> +
> +	return phy_calibrate(dp->phy);
> +}

[Severity: High]
Does pulsing DP_PHY_RESET in spacemit_dp_dev_init() wipe the PHY PREPLL
registers while the clock framework still caches 148500000 Hz?

On eDP, spacemit_dp_probe() calls spacemit_dp_dev_init(), which calls
clk_set_rate(dp->pll_clk, 148500000) to program the PREPLL registers and
cache p->pxclk_rate = 148500000 in phy-k3-inno-dp.  When
spacemit_dp_bind() calls spacemit_dp_dev_init() a second time (or on a
component rebind), DP_PHY_RESET resets the PREPLL registers to their
hardware defaults, but clk_set_rate(dp->pll_clk, 148500000) sees the
rate unchanged and returns 0 without calling k3_inno_dp_pxclk_set_rate().
spacemit_dp_phy_on() and any subsequent 148.5 MHz modeset then power on
PREPLL with its post-reset register defaults.

> +static int spacemit_dp_bind(struct device *dev, struct device *master,
> +			    void *data)
> +{
> +	struct spacemit_dp_dev *dp = dev_get_drvdata(dev);
> +	struct drm_device *drm = data;
> +	struct device_node *ep;
> +	int ret;
> +
> +	dp->drm = drm;
> +	dp->aux.drm_dev = drm;
> +	ret = drm_dp_aux_register(&dp->aux);
> +	if (ret) {
> +		dev_err_probe(dev, ret, "failed to register DP AUX\n");
> +		goto err_drm;
> +	}

[Severity: Medium]
Does registering dp->aux before spacemit_dp_dev_init() expose the AUX
device and I2C adapter while the controller and MPLL are uninitialized or
being reset without dp->aux.hw_mutex?

drm_dp_aux_register() publishes /dev/drm_dp_aux* and the I2C-over-AUX
adapter before spacemit_dp_dev_init() runs below.  Neither
spacemit_dp_dev_init() (which powers down MPLL via phy_reset() and asserts
DP_CONTROLLER_RESET and DP_AUX_RESET) nor spacemit_dp_set_plls() in
spacemit_dp_bridge_atomic_enable() (which power-cycles the MPLL supplying
the 16 MHz AUX clock after spacemit_dp_link_disable() releases
dp->aux.hw_mutex) holds dp->aux.hw_mutex, racing with concurrent userspace
AUX or DDC transfers.

[ ... ]

> +	ret = spacemit_dp_dev_init(dp);
> +
> +	/*
> +	 * Also after a failed bring-up, which may have left the PHY on. Not
> +	 * spacemit_dp_hw_disable(): see spacemit_dp_unbind().
> +	 */
> +	spacemit_dp_link_disable(dp);
> +	if (ret)
> +		goto err_encoder;
> +
> +	dp->connector_status = spacemit_dp_hw_detect_hpd(dp);
> +
> +	if (dp->connector_status == connector_status_connected)
> +		spacemit_dp_hw_read_sink_caps(dp);

[Severity: Medium]
Should spacemit_dp_bind() skip spacemit_dp_hw_detect_hpd() and the second
spacemit_dp_dev_init() on eDP?

On eDP, spacemit_dp_probe() has just run spacemit_dp_dev_init() and
spacemit_dp_link_disable() before populating the AUX bus, so repeating
them in spacemit_dp_bind() adds another ~150 ms of synchronous reset and
PHY calibration delay.  spacemit_dp_bind() then checks
spacemit_dp_hw_detect_hpd() and calls spacemit_dp_hw_read_sink_caps()
without checking !dp->edp_mode, even though DP_HPD_IN_STATUS is noisy on
eDP and an unpowered panel with a non-AUX backlight can time out on those
DPCD reads.

[ ... ]

> +/* Leave the DRM device, or power down a controller that never joined one. */
> +static void spacemit_dp_unregister(struct spacemit_dp_dev *dp)
> +{
> +	if (dp->component_added)
> +		component_del(dp->dev, &spacemit_dp_ops);
> +
> +	/* The device is going away; its next probe resets the block. */
> +	spacemit_dp_hw_disable(dp);
> +}

[Severity: Medium]
During driver unbind on eDP, does spacemit_dp_remove() ->
spacemit_dp_unregister() tear down the component and PHY before devres
depopulates the DP AUX bus?

spacemit_dp_probe() registers AUX bus depopulation via
devm_of_dp_aux_populate_bus(), which runs during devres_release_all()
after spacemit_dp_remove() returns:

CPU0                                  CPU1 (deferred probe work)
spacemit_dp_remove()
  spacemit_dp_unregister()
    if (dp->component_added)
    spacemit_dp_hw_disable()
      phy_exit(dp->phy)
                                      dp_aux_ep_probe()
                                        spacemit_dp_edp_link_panel()
                                          component_add(dp->dev, ...)
                                          dp->component_added = true;
devres_release_all()
  of_dp_aux_depopulate_bus_void()
  /* dp is freed with component still on component_list */

Even without a racing deferred panel probe, spacemit_dp_hw_disable() exits
the PHY and stops the MPLL AUX clock while the AUX child panel device is
still bound.

[ ... ]

> +	/*
> +	 * The PHY exposes its PLL as the APMU pixel-clock mux's external
> +	 * parent.
> +	 */
> +	dp->pll_clk = devm_clk_get(dev, "pll");
> +	if (IS_ERR(dp->pll_clk))
> +		return dev_err_probe(dev, PTR_ERR(dp->pll_clk),
> +				     "failed to get PHY pixel clock\n");
> +
> +	ret = clk_set_parent(dp->pxclk, dp->pll_clk);
> +	if (ret)
> +		return dev_err_probe(dev, ret,
> +				     "failed to route the pixel mux to the PHY PLL\n");

[Severity: High]
Does clk_set_parent(dp->pxclk, dp->pll_clk) always fail with -EINVAL on
K3?

In drivers/clk/spacemit/ccu-k3.c, both edp0_pclk_parents[] and
edp1_pclk_parents[] declare their second parent with
CCU_PARENT_NAME(external_clk) (.fw_name = "external_clk"), whereas the
spacemit,k3-syscon-apmu binding and DT node name those clock inputs
"edp0_pll_pxclk" and "edp1_pll_pxclk":

drivers/clk/spacemit/ccu-k3.c:
static const struct clk_parent_data edp0_pclk_parents[] = {
	CCU_PARENT_HW(lcd_pxclk),
	CCU_PARENT_NAME(external_clk),
};

When clk_set_parent() resolves edp0_pxclk or edp1_pxclk's external parent
via clk_core_get(), of_parse_clkspec() looks up "external_clk" in the
APMU node's clock-names, fails to match dp->pll_clk, and aborts
spacemit_dp_probe() with -EINVAL.

[ ... ]

> +static void spacemit_dp_shutdown(struct platform_device *pdev)
> +{
> +	struct spacemit_dp_dev *dp = platform_get_drvdata(pdev);
> +
> +	/* Not under mode_lock: the modeset that the work starts takes it. */
> +	disable_work_sync(&dp->modeset_retry_work);
> +
> +	/* The DRM device may still be there and enabling the output. */
> +	guard(mutex)(&dp->mode_lock);
> +	spacemit_dp_hw_disable(dp);
> +}

[Severity: Medium]
Can calling spacemit_dp_hw_disable() in spacemit_dp_shutdown() run
phy_exit() before the DPU master device shuts down its KMS pipeline?

Because the DP/eDP platform devices are registered after the DPU devices,
device_shutdown() runs spacemit_dp_shutdown() before
spacemit_dpu_shutdown() runs drm_atomic_helper_shutdown().
spacemit_dp_hw_disable() calls phy_exit(dp->phy), which powers down the
PHY bandgap, LDOs, and MPLL (stopping the 16 MHz AUX clock) and drops
phy->init_count to 0.  Any subsequent AUX transfer during panel disable in
drm_atomic_helper_shutdown() will time out, and any in-flight
spacemit_dp_bridge_atomic_enable() that acquires dp->mode_lock after
spacemit_dp_shutdown() will call phy_power_on() with phy->init_count == 0.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261129-k3-display-v4-0-ce6cf7988202@gmail.com?part=11

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-11-29 13:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 12:32 [PATCH v4 00/16] drm/spacemit: add SpacemiT K3 display support Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 01/16] dt-bindings: display: spacemit: add K3 Saturn DPU controller Cody Kang via B4 Relay
2026-11-29 12:36   ` sashiko-bot
2026-11-29 12:32 ` [PATCH v4 02/16] dt-bindings: phy: add SpacemiT K3 Innosilicon DP PHY Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 03/16] dt-bindings: display: spacemit: add K3 Innosilicon DP/eDP controller Cody Kang via B4 Relay
2026-11-29 12:38   ` sashiko-bot
2026-11-29 12:32 ` [PATCH v4 04/16] dt-bindings: soc: spacemit: allow eDP/DP PHY PLL pixel clocks on K3 APMU Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 05/16] phy: spacemit: add Innosilicon DP TX PHY driver Cody Kang via B4 Relay
2026-11-29 12:48   ` sashiko-bot
2026-11-29 12:32 ` [PATCH v4 06/16] drm/spacemit: add Saturn DPU register model Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 07/16] drm/spacemit: add Saturn DPU core types, cmdlist and display MMU Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 08/16] drm/spacemit: add Saturn DPU hardware backend Cody Kang via B4 Relay
2026-11-29 12:49   ` sashiko-bot
2026-11-29 12:32 ` [PATCH v4 09/16] drm/spacemit: add Saturn DPU KMS pipeline Cody Kang via B4 Relay
2026-11-29 12:54   ` sashiko-bot
2026-11-29 12:32 ` [PATCH v4 10/16] drm/spacemit: add Saturn DPU DRM device driver Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 11/16] drm/spacemit: add Innosilicon DP/eDP controller bridge driver Cody Kang via B4 Relay
2026-11-29 13:01   ` sashiko-bot [this message]
2026-11-29 12:32 ` [PATCH v4 12/16] MAINTAINERS: add SpacemiT K3 display driver entry Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 13/16] riscv: dts: spacemit: k3: add display nodes Cody Kang via B4 Relay
2026-11-29 12:48   ` sashiko-bot
2026-11-29 12:32 ` [PATCH v4 14/16] riscv: dts: spacemit: k3-pico-itx: enable the DisplayPort output Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 15/16] riscv: dts: spacemit: k3-com260-ifx: " Cody Kang via B4 Relay
2026-11-29 12:32 ` [PATCH v4 16/16] riscv: defconfig: spacemit: k3: enable display driver Cody Kang via B4 Relay

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=sashiko-outbox-239616@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=codykang.hk@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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