Skip to content

cix/sky1: multi-subsystem driver fixes, DP/USB/PCIe enhancements and defconfig updates - #2086

Merged
opsiff merged 15 commits into
deepin-community:linux-6.6.yfrom
cyh429:linux-6.6.y
Aug 14, 2026
Merged

cix/sky1: multi-subsystem driver fixes, DP/USB/PCIe enhancements and defconfig updates#2086
opsiff merged 15 commits into
deepin-community:linux-6.6.yfrom
cyh429:linux-6.6.y

Conversation

@cyh429

@cyh429 cyh429 commented Aug 13, 2026

Copy link
Copy Markdown

This PR provides comprehensive updates to CIX Sky1 platform drivers and arm64 defconfig. Changes span multiple core subsystems including display (DRM), USB, PCIe, audio, clock, and DMA, focusing on bug fixes and feature enhancements.

Summary by Sourcery

Update CIX Sky1 platform drivers and arm64 defconfig to improve DisplayPort/eDP handling, PCIe and USB robustness, audio/I2S behavior, power-domain/devfreq integration, and various suspend/resume, reset, and error-handling paths across subsystems.

New Features:

  • Expose DP MST, PSR, and fast-training defaults via device properties and debugfs, including optional MST enable and PSR configuration toggles.
  • Add DP PSR force-off and link-status helpers, plus HDMI TMDS-aware bandwidth selection and eDP panel capability detection to better support diverse sinks.
  • Introduce PCIe endpoint safe power-cycle sequencing with configurable re-power delay and downstream display-class GPU resume delay support on x8 controllers.
  • Add pre-blank atomic state capture and inactive suspend-state fixup in Linlon DP KMS to preserve display configuration across STR.
  • Provide additional USB cdns3 shutdown handling to cleanly detach gadget/host and quiesce IRQs before controller reset and clock gating.
  • Add new I2S/TDM audio interface naming and default TDM channel configuration for stereo operation.
  • Allow PCIe PHY configuration for varied lane counts (including non-x4/x8) using shared register sequences.

Bug Fixes:

  • Prevent DP PSR timeouts and invalid transitions by tightening entry timing, handling sink inactivity, retraining where required, and resetting video stream state in eDP/DP suspend, unplug, and shutdown flows.
  • Fix DP state-machine races by renaming and extending state flags, guarding hpd work with status changes, and aligning suspend/resume/host-init paths with core readiness and training state.
  • Ensure DP audio only configures and enables when the connector is actually plugged in, and reconfigure audio on stream re-enable after resume or re-plug.
  • Avoid GPU perf/power genpd and NPU/VPU devfreq crashes when ACPI or SCMI power domains are absent by treating missing domains as optional and skipping device_link/devfreq setup safely.
  • Make PCIe controller ASPM and AXI error-response configuration deterministic via a max-aspm-support property, and reduce spurious SLVERRs by mapping completion-status errors to OKAY.
  • Fix GPIO Cadence PM by converting to NOIRQ sleep ops and only resetting when a reset control is present, preventing resume-time faults.
  • Avoid I2C div-by-zero and invalid bus-speed configuration by defaulting to standard mode when properties or ACPI speeds are missing or out of range.
  • Ensure DMA350 terminate-all correctly finalizes and clears an in-flight descriptor, preventing use-after-free on subsequent transfers.
  • Correct I2S clock polarity programming and stereo/TDM slot handling, and convert unsupported channel-count cases to ENOTSUPP rather than hard errors in both single- and multi-channel drivers.
  • Prevent Linlon DP plane cleanup from operating on a partially-initialized plane with a NULL dev pointer, and fix scaling/splitting calculations for multi-pixel-per-cycle modes.
  • Avoid NULL derefs in Linlon DP pipeline color management when old component state is absent.
  • Guard USB runtime suspend/resume and shutdown paths when xHCI or HCD structures are not yet created, and keep HCD_FLAG_HW_ACCESSIBLE consistent with IRQ enablement.
  • Remove DSP remoteproc BBOX/coredump integration that could interact badly with updated firmware handling.

Enhancements:

  • Refine DP PSR policy to respect sink fast-training capabilities, add link-retrain flags, and manage power-on delays for improved panel stability.
  • Improve DP eDP-panel lifecycle by preparing/unpreparing only when a true eDP sink is detected via DPCD, dropping DT edp-panel bindings for standard DP ports, and refactoring reset/host-init into reusable helpers.
  • Enhance DP MST init to always clear sink MST state before capability checks, and adjust MST resume/suspend behavior to be driven by DP suspend state.
  • Extend Linlon DP flip timeout handling to perform a DPU software reset and optionally send pending vblank events manually to avoid client hangs.
  • Add Linlon DP pipeline and scaler data-flow adjustments for 2ppc modes, including correct out-width calculations and PSR disablement when 2ppc is active.
  • Integrate aperture conflict removal for Linlon DP so the driver can own framebuffer memory on probe without clashes with firmware or other drivers.
  • Improve ACPI clock parsing by adding device links between consumers and clock providers, ensuring providers resume before consumers for runtime PM.
  • Refine Mali GPU power-model initialization to only start sampling timers when an IPA model is present, and gate perf opp-table setup on a valid perf domain.
  • Adjust Sky1 NPU core power-domain handling to work with ACPI-only cores lacking platform bus devices, and make devfreq teardown resilient to missing perf domains.
  • Tighten DP HDCP and audio plug-state handling through shared plug-status helpers and consistent hpd-event reporting.
  • Change several error logs to dev_err_probe or dev_warn for better diagnostics without spurious failures (e.g., USB Type-C role-switch acquisition, missing perf PDs).

Documentation:

  • Update multiple CIX and Trilinear DP/eDP driver files to add or refresh 2024–2025 Cix Technology Group copyright notices.

Chores:

  • Adjust Sky1 GPT timer probe to avoid redundant reset when already initialized by firmware.
  • Clean up unused platform/bbox integration in DSP remoteproc and related headers.

Yuhang.Chen and others added 15 commits August 13, 2026 10:56
Enable regulator-fixed-voltage=y: 26Q2 BIOS adds a regulator-fixed
supplier to the PCIe device; =m is unavailable before rootfs mount,
causing silent defer and boot deadlock.

Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
…vider

Create a device link between clock consumer and provider so the provider
(with runtime PM) resumes first, avoiding prepare_lock deadlocks. Use
acpi_get_first_physical_node() to update existing fw_devlink links.

Signed-off-by: Devin Li <Devin.Li@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
Remove the probe-time reset_control_reset() called when UEFI had not
initialized the framebuffer (!screen_info.lfb_linelength); no longer
needed.

Signed-off-by: jerry.zhu <jerry.zhu@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
Clear p->ds_run = NULL in the DMA_DEV_TO_MEM path; otherwise it retains
a pointer to freed state, causing a use-after-free when checked later.

Signed-off-by: Jelly.Jia <Jelly.Jia@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
- Add apb_reset NULL check in resume path.
- Change SYSTEM_SLEEP_PM_OPS from LATE to NOIRQ.

Signed-off-by: Feng.Wang <Feng.Wang@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
- phy-cix-pcie: refactor num_lanes handling into switch statement
  (case 8/4/3/2/1).
- pci-sky1: add ASPM linkage (sky1_pcie_set_l1_disable + max_aspm_support
  bit0 L0s/bit1 L1); wakeup (device_init_wakeup + enable_irq_wake);
  safe_power_cycle with discharge delay; x8 resume delay for GPU; AXI
  slave response control; S3/S55 power optimization; L0s enable/revert.

Signed-off-by: jun.guo <jun.guo@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
Remove CONFIG_PLAT_BBOX code (rdr_pub.h/mntn_public_interface.h includes,
coredump hook, rdr register/unregister) from cix_dsp_rproc.c; supporting
headers unavailable, remove to keep the driver compilable.

Signed-off-by: Joakim Zhang <joakim.zhang@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
- Restore 192K/176.4K mclk_fs to 256: card-utils.c configured mclk_fs=128
  for rt5682s, causing "sysclk rate too low" and audio noise (violates
  256FS/512FS). 192000: mclk_fs 128->256; 176400: mclk_fs 128->256,
  mclk_div 2->0.
- cdns_i2s: switch to raw_spinlock_t and clear I2S_CTRL_WS_POLAR bit
  (cdns_i2s_sc.c); update cdns_i2s_mc.c.

Signed-off-by: Joakim Zhang <joakim.zhang@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
…p driver

- rts5453: convert probe error paths to dev_err_probe for consistent
  error reporting and deferred probe.
- cdns3: cdnsp-cix.c add acpi_irq_get + fix cdns_resume lock ordering +
  hcd NULL checks; cdnsp-sky1.c add shutdown path and register .shutdown;
  cdnsp-sky1.h update.

Co-developed-by: hongliang.yang <hongliang.yang@cixtech.com>
Signed-off-by: Gary Yang <gary.yang@cixtech.com>
Signed-off-by: hongliang.yang <hongliang.yang@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
- genpd oops: the perf/power pm domain attach returns ERR_PTR when the
  genpd bus is unavailable or the ACPI _DSD lacks power-domain-name,
  causing a NULL-deref oops in device_link_add()->__pm_runtime_resume().
  Guard device_link_add(), detach and opp table init with IS_ERR_OR_NULL.
- power model oops: when the perf pd is not attached, devfreq init aborts
  before kbase_ipa_init(), leaving kbdev->ipa.fallback_model NULL; the
  sky1_power_model hrtimer still fires and dereferences the NULL model.
  Guard the hrtimer start with a fallback_model check.

Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
…o acpi_device for _ADR-only cores

- probe failure: the perf pm domain attach returns ERR_PTR(-EINVAL)
  because the CIX private genpd_bus_type is never registered, and
  mainline 88fb756 (backported to 6.6.145) made bus_add_device
  reject unregistered buses. Skip devfreq init on attach failure and
  NULL-guard the remove path so probe continues without frequency
  scaling, matching the mali_kbase workaround.
- Allow building as module: ARMCHINA_NPU_ARCH_V3 (default y) selects
  ARMCHINA_NPU, forcing =y; drop the select so default m takes effect.
  DEVFREQ_GOV_USERSPACE must be =y (governor has no modalias, =m fails
  probe with -ENOENT).
- Fall back to acpi_device for _ADR-only cores: sky1_npu_probe() looks
  up cores via bus_find_device_by_fwnode; on _ADR-only boards (no _HID)
  the lookup returns NULL -> pm_runtime_enable(NULL) NULL-deref oops.
  Fall back to the acpi_device's embedded device (acpi_bind_one()) as
  the per-core PM handle.

Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
The perf pm domain attach returns ERR_PTR(-EINVAL) because the CIX
private genpd_bus_type is never registered, and mainline 88fb756
(backported to 6.6.145) made bus_add_device reject unregistered buses.
Skip devfreq init on attach failure and NULL-guard the remove path and
update_load() (called from register_session at stream on) so probe and
stream on continue without frequency scaling, matching the mali_kbase
workaround.

Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
- Update driver across dp_dev, linlondp_crtc/dev/drv/kms, plane,
  pipeline_state.
- Add WARN_ON_ONCE + -EINVAL null-dev guard in linlondp_dev.c.

Signed-off-by: eastlake.yang <eastlake.yang@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
- Update dptx driver: add PSR, eDP panel handling, link-training
  helpers, reworked host init/deinit and HPD handling, PM resume/shutdown
  paths; update trilin_dptx/drm/drm_mst/infoframe/*_phy/cix_edp_panel/
  dptx_audio/dptx_cix.
- Fix hotplug: trilin_dptx.c track DPTX_STATE_INIT_TRAIN + usleep on
  re-init + drop redundant host_init in trilin_dp_prepare; trilin_drm.c
  count probed modes into my_copied_modes; trilin_dptx_cix.c NULL-check
  device_link_del on unbind.

Co-developed-by: eastlake.yang <eastlake.yang@cixtech.com>
Signed-off-by: Evan.Guo <Evan.Guo@cixtech.com>
Signed-off-by: eastlake.yang <eastlake.yang@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
- cdns_i2c_calc_divs: return -EINVAL if fscl is zero to prevent
  division by zero in `22 * fscl`.
- cdns_i2c_probe: return the error if clk_prepare_enable fails instead
  of continuing with an unprepared clock.
- cdns_i2c_probe: read acpi_speed via i2c_acpi_find_bus_speed and use
  the lower of it and clock-frequency; default to standard-mode when
  clock-frequency is absent, zero, or above fast-mode-plus.

Signed-off-by: hongliang.yang <hongliang.yang@cixtech.com>
Co-developed-by: Yuhang.Chen <yuhang.chen@cixtech.com>
Signed-off-by: Yuhang.Chen <yuhang.chen@cixtech.com>
@sourcery-ai

sourcery-ai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates the CIX Sky1 platform’s DisplayPort/DRM stack, PCIe, USB, audio (I2S), DMA, clocks, GPIO, and several SoC IPs to improve suspend/resume robustness, power‑domain handling, link training/PSR behavior, audio handling, and devfreq/init flows, plus various bug fixes and debug improvements.

Sequence diagram for Sky1 DisplayPort suspend/resume and PSR/atomic state handling

sequenceDiagram
    actor System
    participant trilin_dptx as trilin_dptx_cix_dev
    participant dp as trilin_dp
    participant kms as linlondp_kms_dev

    System->>trilin_dptx: trilin_dptx_pm_prepare(dev)
    trilin_dptx->>dp: trilin_dp_pm_prepare(dp)
    dp->>dp: trilin_dp_mst_suspend(dp)
    dp->>dp: disable_irq(dp->irq)
    dp->>dp: cancel_delayed_work_sync(hpd_irq_work)
    dp->>dp: cancel_delayed_work_sync(hpd_event_work)
    dp->>dp: trilin_dp_host_deinit(dp)
    dp->>dp: dp->state |= DPTX_STATE_SUSPENDED

    System->>trilin_dptx: trilin_dptx_pm_resume_early(dev)
    trilin_dptx->>dp: trilin_dp_pm_resume_early(dp)
    dp->>dp: drm_atomic_helper_duplicate_state(dev, ctx)
    dp->>dp: drm_atomic_set_crtc_for_connector(conn_state, NULL)
    dp->>dp: conn->status = connector_status_disconnected
    dp->>dp: dev->mode_config.suspend_state = new_state

    System->>trilin_dptx: trilin_dptx_pm_complete(dev)
    trilin_dptx->>dp: trilin_dp_pm_complete(dp)
    dp->>dp: trilin_dp_host_init(dp)
    dp->>dp: enable_irq(dp->irq)
    dp->>dp: trilin_dp_mst_resume(dp)
    dp->>dp: dp->state &= ~DPTX_STATE_SUSPENDED

    System->>kms: linlondp_pm_resume(dev)
    kms->>kms: linlondp_dev_resume(mdev)
    kms->>kms: linlondp_kms_fixup_inactive_suspend_state(&kms->base)
    kms->>kms: drm_mode_config_helper_resume(&kms->base)
Loading

Sequence diagram for Sky1 PCIe endpoint power cycle and x8 GPU resume delay

sequenceDiagram
    actor System
    participant pcie as sky1_pcie
    participant bridge as pci_host_bridge

    System->>pcie: sky1_pcie_probe(pdev)
    pcie->>pcie: sky1_pcie_parse_property(pdev, pcie)
    pcie->>pcie: sky1_pcie_safe_power_cycle(pcie)
    pcie->>pcie: sky1_pcie_en_ep_on(pcie, true)

    System->>pcie: sky1_pcie_suspend_noirq(dev)
    pcie->>pcie: sky1_pcie_refresh_x8_gpu_resume_delay(pcie)
    pcie->>bridge: pci_host_bridge_from_priv(pcie->cdns_pcie_rc)
    bridge->>bridge: sky1_pcie_bus_subtree_has_display(bridge->bus)
    bridge-->>pcie: display device present?
    pcie->>pcie: pcie->x8_vga_resume_delay = result
    pcie->>pcie: sky1_pcie_pme_turn_off(pcie)
    pcie->>pcie: sky1_pcie_stop_link(pcie->cdns_pcie)

    System->>pcie: sky1_pcie_resume_noirq(dev)
    alt x8_vga_resume_delay
        pcie->>pcie: msleep(SKY1_PCIE_X8_GPU_RESUME_MS)
    end
    pcie->>pcie: sky1_pcie_en_ep_power(pcie, true)
    pcie->>pcie: sky1_pcie_start_link(pcie->cdns_pcie)
Loading

File-Level Changes

Change Details Files
Refactor DP transmitter state handling, PSR control, eDP panel management, and suspend/resume paths to make link training and power sequencing more reliable, including new helpers and flags.
  • Introduce DPTX_STATE_* bitfield (replacing DP_STATE_*) and add DPTX_STATE_INIT_TRAIN to track link-training state
  • Add trilin_dp_link_trained(), lane-count validation, and enhanced link status debugfs reporting
  • Rework PSR init/enable/disable to use psr_config_on, link_retrain, allow_after hold-off, and new trilin_dp_psr_force_off() helper
  • Add eDP panel prepare/unprepare helpers, detect real eDP via DPCD[0x07], and drop bogus DT eDP panels
  • Split out reset_dp_and_reinit(), harden trilin_dp_host_init/deinit, and adjust bootloader init and HPD work handling
  • Wire new PM helpers trilin_dp_pm_prepare/pm_resume_early/pm_complete/pm_shutdown into platform driver
drivers/gpu/drm/cix/dptx/trilin_dptx.c
drivers/gpu/drm/cix/dptx/trilin_drm.c
drivers/gpu/drm/cix/dptx/trilin_dptx_cix.c
drivers/gpu/drm/cix/dptx/trilin_dptx.h
drivers/gpu/drm/cix/dptx/trilin_edp_phy.c
drivers/gpu/drm/cix/dptx/trilin_drm_mst.c
drivers/gpu/drm/cix/dptx/trilin_drm.h
drivers/gpu/drm/cix/dptx/trilin_drm_mst.h
drivers/gpu/drm/cix/dptx/dptx_infoframe.c
drivers/gpu/drm/cix/dptx/dptx_infoframe.h
drivers/gpu/drm/cix/dptx/cix_edp_panel.c
Improve DP encoder/KMS integration, PSR self-refresh behavior, and linlon-dp KMS/CRTC/pipeline handling, including STR suspend fixes and DPU reset on flip timeouts.
  • Make connector self_refresh_aware depend on psr_config_on and pixel_per_cycle; adjust PSR behavior in 2ppc mode
  • Improve HDMI/DP mode selection: respect YUV420-only modes and EDID max_tmds_clock via trilin_dp_hdmi_max_pixel_clock_khz()
  • Enhance eDP atomic_check to pick a better preferred_mode based on resolution/refresh lists
  • Add PSR entry delay (psr.allow_after), and reconfigure dptx audio on stream resume
  • Track and snapshot pre-blank atomic state in linlondp_kms for STR, fixup inactive suspend_state on resume, and clear on detach
  • Reset DPU on flip timeout and optionally send pending vblank events; add dpu_reset hook in linlondp_dev_funcs
  • Adjust data-flow scaling for pixel_per_cycle>1 and guard scaler state lookup
  • Fix linlondp_plane_destroy to avoid drm_plane_cleanup on planes without dev
drivers/gpu/drm/cix/dptx/trilin_drm.c
drivers/gpu/drm/cix/linlon-dp/linlondp_kms.c
drivers/gpu/drm/cix/linlon-dp/linlondp_kms.h
drivers/gpu/drm/cix/linlon-dp/linlondp_crtc.c
drivers/gpu/drm/cix/linlon-dp/linlondp_plane.c
drivers/gpu/drm/cix/linlon-dp/linlondp_pipeline_state.c
drivers/gpu/drm/cix/linlon-dp/hw/dp_dev.c
drivers/gpu/drm/cix/linlon-dp/linlondp_dev.c
drivers/gpu/drm/cix/linlon-dp/linlondp_drv.c
Enhance PCIe controller and PHY behavior: safe endpoint power-cycling, ASPM/L0s/L1 control, display-class GPU resume delay, message filtering, AXI response tweaks, and PHY lane config coverage.
  • Add safe endpoint power cycle helper using regulator and re_pwron_delay_ms DT property
  • Parse max-aspm-support DT property and selectively disable L0s/L1; remove hardcoded aspm-no-l0s behavior
  • Filter LTR/PTM TLPs via HAL CTRL DEC TLP FILTER register
  • Set AXI slave response control to return OKAY instead of SLVERR for completion status errors
  • Change probe to use safe power cycle instead of simple power-on, propagate real error codes
  • Implement x8 GPU resume delay: detect downstream display-class devices and delay resume_noirq on x8 RCs
  • Extend PCIe PHY init to support 8-, 4-, 3/2/1-lane combos using appropriate register sequences and improve error logging
drivers/soc/cix/pcie/pci-sky1.c
drivers/soc/cix/pcie/pci-sky1.h
drivers/phy/cix/phy-cix-pcie.c
Improve USB DRD controller shutdown, APB timeout handling, IRQ flags, and runtime PM safety for cdns3 sky1 platform integration.
  • Disable APB timeout PSLVERR signaling and set FPGA-specific timeout bits conditionally
  • Add platform shutdown that unbinds gadget driver, disables host IRQ, clears HCD_FLAG_HW_ACCESSIBLE, resets controller, and disables clocks
  • Make host suspend/resume paths resilient to absent hcd and ensure controller_suspend call when hcd isn’t created
  • On resume, respect ACPI IRQ flags when present via acpi_irq_get and set xhci_res[0].flags accordingly
  • Guard runtime resume HW_ACCESSIBLE bit setting with NULL hcd checks
drivers/usb/cdns3/cdnsp-sky1.c
drivers/usb/cdns3/cdnsp-sky1.h
drivers/usb/cdns3/cdnsp-cix.c
Fix and harden I2S (single/multi-channel) audio drivers and card-utils: TDM enable paths, TX underrun handling, clock polarity, prepare callback, FIFO register mapping, and sysclk ratios.
  • Refine TDM enable/disable sequences, default 2-channel TDM masks when not in explicit TDM mode, and always clear TDM_CTRL fields on shutdown
  • Add TX FIFO drain and underrun generation on stop in cdns_i2s_sc to avoid stale samples on next start, with timeout and warnings
  • Introduce raw_spinlock in cdns_i2s_sc trigger to serialize TX/RX config updates
  • Switch dai .startup to .prepare in cdns_i2s_sc and cdns_i2s_mc; initialize rx_start/tx_start and lock in probe
  • Relax stereo-only checks in I2S mode by returning -ENOTSUPP instead of -EINVAL, similarly for mc TX/RX slot limits
  • Adjust clock polarity programming for NB/IB modes to correct SCK/WS inversion logic
  • Extend regmap to include FIFO_ADDRESS and update max_register and defaults
  • Fix sysclk MCLK ratios/dividers in card-utils for 192k/176.4kHz
sound/soc/cix/cdns_i2s_sc.c
sound/soc/cix/cdns_i2s_mc.c
sound/soc/cix/card-utils.c
Adjust DP audio codec integration to be plug-status aware using connector status instead of a dedicated plugin flag, and simplify audio reconfig paths.
  • Introduce trilin_dp_plugged_status() and use it for all audio codec ops (startup/shutdown/hw_params) rather than dp->plugin
  • Rename dptx_setup_audio() to dptx_audio_setup() and reuse in reconfig path
  • Simplify dptx_audio_reconfig_and_enable() to reprogram audio and enable SEC0_AUDIO directly, leaving startup to ALSA
drivers/gpu/drm/cix/dptx/trilin_dptx_audio.c
drivers/gpu/drm/cix/dptx/trilin_dptx.h
Improve SoC GPU, NPU, VPU devfreq and power-domain handling when SCMI or perf domains are missing, avoiding crashes and skipping devfreq/power model when unsupported.
  • Guard GPU perf/power PD device_link_add() calls with IS_ERR_OR_NULL checks; skip links and log warnings if PD attach fails
  • Ensure IPA power model sampling hrtimer only starts when fallback_model is initialized
  • Require valid sky1_perf_dev before initializing GPU OPP table, returning -ENODEV otherwise
  • For NPU and VPU, treat missing perf PD as non-fatal: log warnings, set PD pointers to NULL, and skip devfreq init/usage
  • Guard PD detach calls in remove paths with NULL checks and adapt opp_count logic when PD is NULL
  • Handle ACPI-only core power domains by binding ACPI child devices to the platform bus fallback
drivers/soc/cix/gpu/arm/midgard/platform/sky1/mali_kbase_config_sky1.c
drivers/soc/cix/npu/driver/armchina-npu/sky1/sky1.c
drivers/soc/cix/vpu/driver/dev/mvx_dev.c
Tighten I2C bus timing and probe behavior by preventing division-by-zero, honoring ACPI bus speed, and handling clock/clk errors correctly.
  • Add guards in cdns_i2c_calc_divs and probe to prevent division by zero and invalid fscl/i2c_clk values
  • Default clock-frequency to 100kHz when DT property is missing, and cap to FAST_MODE_PLUS max
  • Query ACPI bus speed via i2c_acpi_find_bus_speed() and choose the lower of DT vs ACPI
  • Improve clock enable error handling by returning clk_prepare_enable result immediately
drivers/i2c/busses/i2c-cix.c
Refine GPIO, timer, DMA, and clock PM behavior and error paths to avoid crashes on resume/shutdown and improve dependency ordering.
  • Change Cadence GPIO dev_pm_ops to NOIRQ_SYSTEM_SLEEP_PM_OPS and gate reset_control_reset() on non-NULL apb_reset
  • Drop unconditional GPT reset on probe for already-initialized UEFI screen setups
  • Fix DMA350 terminate_all to finalize vdesc and clear ds_run for DEV_TO_MEM non-cyclic channels
  • Create device_links from ACPI clock consumers to clock providers with DL_FLAG_PM_RUNTIME, updating fw_devlink-generated links as needed
drivers/gpio/gpio-cadence.c
drivers/clocksource/timer-sky1-gpt.c
drivers/dma/arm_dma350.c
drivers/clk/cix/acpi_clk.c
Simplify DSP remoteproc integration by removing platform-specific BBOX/RDR coredump hooks and exception registration.
  • Drop CONFIG_PLAT_BBOX-specific includes and rproc coredump callback
  • Remove BBOX/RDR registration and unregister calls in DSP rproc probe/remove
drivers/remoteproc/cix_dsp_rproc.c
Improve USB Type-C RTS5453 driver error handling around role switch and mux acquisition.
  • Use dev_err_probe for role switch/mux handle failures and propagate error codes, making probe deferral clearer
  • Update error messages for missing switch control to use dev_err_probe
drivers/usb/typec/rts5453.c
Adjust linlon-dp driver integration with framebuffer/aperture and ACPI power management, including conflict removal and NO_DIRECT_COMPLETE.
  • Call aperture_remove_all_conflicting_devices("linlondp") during bind to reclaim framebuffer memory
  • Set DPM_FLAG_NO_DIRECT_COMPLETE for linlondp ACPI platform devices to ensure PM callbacks run correctly
  • On resume, call linlondp_kms_fixup_inactive_suspend_state before mode_config_helper_resume to restore active pipelines
drivers/gpu/drm/cix/linlon-dp/linlondp_drv.c
drivers/gpu/drm/cix/linlon-dp/linlondp_kms.c
drivers/gpu/drm/cix/linlon-dp/linlondp_kms.h
Minor cleanups and copyright updates across DP/eDP-related files and defconfig/Kconfig.
  • Add Cix Technology Group copyright notices to multiple DP-related source/headers
  • Change trilin_edp_phy_register log level from INFO to DEBUG
  • Touch arm64 defconfig and NPU Kconfig (likely enabling/adjusting Sky1 platform options)
drivers/gpu/drm/cix/dptx/trilin_dptx.c
drivers/gpu/drm/cix/dptx/trilin_drm.c
drivers/gpu/drm/cix/dptx/trilin_dptx_cix.c
drivers/gpu/drm/cix/dptx/trilin_edp_phy.c
drivers/gpu/drm/cix/dptx/trilin_usbdp_phy.c
drivers/gpu/drm/cix/dptx/trilin_drm_mst.c
drivers/gpu/drm/cix/dptx/trilin_drm.h
drivers/gpu/drm/cix/dptx/trilin_drm_mst.h
drivers/gpu/drm/cix/dptx/trilin_phy.h
drivers/gpu/drm/cix/dptx/dptx_infoframe.c
drivers/gpu/drm/cix/dptx/dptx_infoframe.h
drivers/gpu/drm/cix/dptx/cix_edp_panel.c
arch/arm64/configs/deepin_arm64_desktop_defconfig
drivers/soc/cix/npu/driver/armchina-npu/Kconfig

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign dongert for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

Hi @cyh429. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • In trilin_dp_hpd_event_work_func() a direct return is taken when old_status == dp->status without releasing dp->session_lock, which will leave the mutex locked and can deadlock subsequent users of the session_lock.
  • cdns_i2s_sc_trigger() now uses raw_spin_lock around calls to regmap_* and udelay/dev_warn, but regmap access may sleep; consider using a normal spinlock or another synchronization primitive that is safe with these operations.
  • The new sky1_pcie_safe_power_cycle() can early-return after the initial power-on when re_pwron_delay_ms is zero, skipping the actual power-cycle; if the intention is always to perform on->off->on when vsupply exists, you may want to restructure the logic so the off/on sequence is not silently bypassed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In trilin_dp_hpd_event_work_func() a direct `return` is taken when `old_status == dp->status` without releasing `dp->session_lock`, which will leave the mutex locked and can deadlock subsequent users of the session_lock.
- cdns_i2s_sc_trigger() now uses raw_spin_lock around calls to regmap_* and udelay/dev_warn, but regmap access may sleep; consider using a normal spinlock or another synchronization primitive that is safe with these operations.
- The new `sky1_pcie_safe_power_cycle()` can early-return after the initial power-on when `re_pwron_delay_ms` is zero, skipping the actual power-cycle; if the intention is always to perform on->off->on when vsupply exists, you may want to restructure the logic so the off/on sequence is not silently bypassed.

## Individual Comments

### Comment 1
<location path="drivers/gpu/drm/cix/dptx/trilin_dptx_audio.c" line_range="90" />
<code_context>
+	if (!trilin_dp_plugged_status(dp))
 		return 0;

 	trilin_dp_write(dp, TRILIN_DPTX_SEC0_AUDIO_ENABLE, 1);
</code_context>
<issue_to_address>
**issue (bug_risk):** dptx_audio_reconfig_and_enable no longer checks plug status before re-enabling audio

Given that other audio callbacks still gate on trilin_dp_plugged_status(), this path should also avoid reconfiguring or enabling audio when the sink is disconnected or during transient HPD changes. Please keep a plugged-status check here (e.g. trilin_dp_plugged_status(dp)) and return early if the connector is not plugged, so the transmitter is not re-enabled in those cases.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

if (!trilin_dp_plugged_status(dp))
return 0;

trilin_dp_write(dp, TRILIN_DPTX_SEC0_AUDIO_ENABLE, 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): dptx_audio_reconfig_and_enable no longer checks plug status before re-enabling audio

Given that other audio callbacks still gate on trilin_dp_plugged_status(), this path should also avoid reconfiguring or enabling audio when the sink is disconnected or during transient HPD changes. Please keep a plugged-status check here (e.g. trilin_dp_plugged_status(dp)) and return early if the connector is not plugged, so the transmitter is not re-enabled in those cases.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates CIX Sky1 platform support across display, USB, PCIe, audio, power management, DMA, clocks, and configuration.

Changes:

  • Expands DP/eDP, PCIe, USB, and audio capabilities.
  • Improves suspend/resume, power-domain, reset, and error handling.
  • Updates arm64 defaults and driver integration.

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
sound/soc/cix/cdns_i2s_sc.c Updates I2S/TDM configuration and synchronization.
sound/soc/cix/cdns_i2s_mc.c Adjusts stream preparation and channel errors.
sound/soc/cix/card-utils.c Updates high-rate audio clocks.
drivers/usb/typec/rts5453.c Improves probe error reporting.
drivers/usb/cdns3/cdnsp-sky1.h Adds APB error-control bits.
drivers/usb/cdns3/cdnsp-sky1.c Adds USB shutdown sequencing.
drivers/usb/cdns3/cdnsp-cix.c Hardens USB PM and IRQ setup.
drivers/soc/cix/vpu/driver/dev/mvx_dev.c Makes VPU devfreq optional.
drivers/soc/cix/pcie/pci-sky1.h Adds PCIe policy state.
drivers/soc/cix/pcie/pci-sky1.c Enhances PCIe power, ASPM, and resume.
drivers/soc/cix/npu/driver/armchina-npu/sky1/sky1.c Handles optional NPU domains.
drivers/soc/cix/npu/driver/armchina-npu/Kconfig Changes V3 driver selection.
drivers/soc/cix/gpu/arm/midgard/platform/sky1/mali_kbase_config_sky1.c Hardens GPU power-model initialization.
drivers/remoteproc/cix_dsp_rproc.c Removes DSP BBOX integration.
drivers/phy/cix/phy-cix-pcie.c Supports additional lane configurations.
drivers/i2c/busses/i2c-cix.c Validates I2C bus frequency.
drivers/gpu/drm/cix/linlon-dp/linlondp_plane.c Fixes plane flow and cleanup.
drivers/gpu/drm/cix/linlon-dp/linlondp_pipeline_state.c Adjusts 2ppc pipeline calculations.
drivers/gpu/drm/cix/linlon-dp/linlondp_kms.h Adds pre-blank state storage.
drivers/gpu/drm/cix/linlon-dp/linlondp_kms.c Implements suspend-state fallback.
drivers/gpu/drm/cix/linlon-dp/linlondp_drv.c Adds aperture and resume handling.
drivers/gpu/drm/cix/linlon-dp/linlondp_dev.h Adds DPU reset callback.
drivers/gpu/drm/cix/linlon-dp/linlondp_dev.c Validates suspend/resume inputs.
drivers/gpu/drm/cix/linlon-dp/linlondp_crtc.c Improves flip-timeout recovery.
drivers/gpu/drm/cix/linlon-dp/hw/dp_dev.c Implements DPU software reset.
drivers/gpu/drm/cix/dptx/trilin_usbdp_phy.c Updates copyright notice.
drivers/gpu/drm/cix/dptx/trilin_phy.h Updates copyright notice.
drivers/gpu/drm/cix/dptx/trilin_edp_phy.c Reduces PHY logging verbosity.
drivers/gpu/drm/cix/dptx/trilin_drm.h Updates copyright notice.
drivers/gpu/drm/cix/dptx/trilin_drm.c Enhances modes, PSR, MST, and bandwidth selection.
drivers/gpu/drm/cix/dptx/trilin_drm_mst.h Updates copyright notice.
drivers/gpu/drm/cix/dptx/trilin_drm_mst.c Updates MST state handling.
drivers/gpu/drm/cix/dptx/trilin_dptx.h Extends DP state and capability data.
drivers/gpu/drm/cix/dptx/trilin_dptx.c Refactors DP lifecycle, PSR, and PM.
drivers/gpu/drm/cix/dptx/trilin_dptx_cix.c Revises DP platform PM callbacks.
drivers/gpu/drm/cix/dptx/trilin_dptx_audio.c Uses shared plug status for audio.
drivers/gpu/drm/cix/dptx/dptx_infoframe.h Updates copyright notice.
drivers/gpu/drm/cix/dptx/dptx_infoframe.c Updates copyright notice.
drivers/gpu/drm/cix/dptx/cix_edp_panel.c Updates copyright notice.
drivers/gpio/gpio-cadence.c Moves GPIO PM to noirq.
drivers/dma/arm_dma350.c Clears terminated active descriptors.
drivers/clocksource/timer-sky1-gpt.c Removes redundant timer reset.
drivers/clk/cix/acpi_clk.c Adds ACPI clock device links.
arch/arm64/configs/deepin_arm64_desktop_defconfig Updates regulator and devfreq defaults.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

break;
udelay(125);
}
if (!timeout)
Comment on lines +325 to +328
mutex_lock(&kms->pre_blank_lock);
fallback = kms->pre_blank_state;
kms->pre_blank_state = NULL;
mutex_unlock(&kms->pre_blank_lock);
struct trilin_dpsub *dpsub = &cix_dptx->dpsub;
struct trilin_dp *dp = dpsub->dp;

trilin_dp_pm_complete(dp);
Comment on lines +931 to +934
if (info->max_tmds_clock > 0)
max_pixel_clock = min(max_pixel_clock,
trilin_dp_hdmi_max_pixel_clock_khz(
info->max_tmds_clock, bpp));
Comment on lines +1255 to +1257
drm_dp_dpcd_readb(&dp->aux, DP_PSR_CAPS, &psr_caps);
if (!(psr_caps & DP_PSR_NO_TRAIN_ON_EXIT) && !dp->caps.psr2_sink_support)
dp->psr.link_retrain = true;

@opsiff opsiff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@opsiff
opsiff merged commit db64b05 into deepin-community:linux-6.6.y Aug 14, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants