cix/sky1: multi-subsystem driver fixes, DP/USB/PCIe enhancements and defconfig updates - #2086
Conversation
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>
Reviewer's GuideUpdates 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 handlingsequenceDiagram
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)
Sequence diagram for Sky1 PCIe endpoint power cycle and x8 GPU resume delaysequenceDiagram
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)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In trilin_dp_hpd_event_work_func() a direct
returnis taken whenold_status == dp->statuswithout releasingdp->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 whenre_pwron_delay_msis 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>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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
| 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); |
| 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)); |
| 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; |
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:
Bug Fixes:
Enhancements:
Documentation:
Chores: