* [PATCH v1 1/6] dt-bindings: display: rockchip: analogix-dp: Add support for RK3568
2026-10-13 12:49 [PATCH v1 0/6] Add eDP support for RK3568 Damon Ding
@ 2026-10-13 12:49 ` Damon Ding
2026-10-13 12:49 ` [PATCH v1 2/6] dt-bindings: phy: Add rockchip,rk3568-edp-phy Damon Ding
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Damon Ding @ 2026-10-13 12:49 UTC (permalink / raw)
To: Sandy Huang, Heiko Stuebner, Andy Yan, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Vinod Koul, Andrzej Hajda, Robert Foss
Cc: Neil Armstrong, Manivannan Sadhasivam, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Dave Jones,
dri-devel, linux-rockchip, devicetree, linux-arm-kernel,
linux-kernel, linux-phy, Damon Ding
Document the "rockchip,rk3568-edp" compatible. Like RK3576/RK3588,
the RK3568 eDP controller has the dp/pclk/hclk clocks and dp/apb
resets, but unlike them it does not use GRF registers, so make the
"rockchip,grf" property conditional on the SoC.
Also document the optional avdd-0v9 and avdd-1v8 supplies, which are
needed by the RK3568 eDP controller.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
.../rockchip/rockchip,analogix-dp.yaml | 25 ++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
index 39dafe75a680..f8670a4e0430 100644
--- a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
+++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
@@ -15,6 +15,7 @@ properties:
enum:
- rockchip,rk3288-dp
- rockchip,rk3399-edp
+ - rockchip,rk3568-edp
- rockchip,rk3576-edp
- rockchip,rk3588-edp
@@ -47,6 +48,16 @@ properties:
- const: dp
- const: apb
+ avdd-0v9-supply:
+ description:
+ A 0.9V supply that powers up the SoC internal circuitry. The actual
+ supply source varies between different boards.
+
+ avdd-1v8-supply:
+ description:
+ A 1.8V supply that powers up the SoC internal circuitry. The actual
+ supply source varies between different boards.
+
rockchip,grf:
$ref: /schemas/types.yaml#/definitions/phandle
description:
@@ -61,11 +72,22 @@ required:
- clock-names
- resets
- reset-names
- - rockchip,grf
allOf:
- $ref: /schemas/display/bridge/analogix,dp.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: rockchip,rk3568-edp
+ then:
+ properties:
+ rockchip,grf: false
+ else:
+ required:
+ - rockchip,grf
+
- if:
properties:
compatible:
@@ -100,6 +122,7 @@ allOf:
compatible:
contains:
enum:
+ - rockchip,rk3568-edp
- rockchip,rk3576-edp
- rockchip,rk3588-edp
then:
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v1 2/6] dt-bindings: phy: Add rockchip,rk3568-edp-phy
2026-10-13 12:49 [PATCH v1 0/6] Add eDP support for RK3568 Damon Ding
2026-10-13 12:49 ` [PATCH v1 1/6] dt-bindings: display: rockchip: analogix-dp: Add " Damon Ding
@ 2026-10-13 12:49 ` Damon Ding
2026-10-13 12:49 ` [PATCH v1 3/6] drm/bridge: analogix_dp: Add support for RK3568 Damon Ding
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Damon Ding @ 2026-10-13 12:49 UTC (permalink / raw)
To: Sandy Huang, Heiko Stuebner, Andy Yan, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Vinod Koul, Andrzej Hajda, Robert Foss
Cc: Neil Armstrong, Manivannan Sadhasivam, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Dave Jones,
dri-devel, linux-rockchip, devicetree, linux-arm-kernel,
linux-kernel, linux-phy, Damon Ding
Document the eDP transmitter PHY with NaNeng IP block found on the
RK3568 SoC. The PHY is controlled through the eDP PHY GRF registers,
so its node is modeled as a child of the eDP PHY GRF syscon. Also
add the "rockchip,rk3568-edp-phy-grf" compatible and the "edp-phy"
child node reference to the Rockchip GRF schema.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
.../bindings/phy/rockchip,rk3568-edp-phy.yaml | 59 +++++++++++++++++++
.../devicetree/bindings/soc/rockchip/grf.yaml | 15 +++++
2 files changed, 74 insertions(+)
create mode 100644 Documentation/devicetree/bindings/phy/rockchip,rk3568-edp-phy.yaml
diff --git a/Documentation/devicetree/bindings/phy/rockchip,rk3568-edp-phy.yaml b/Documentation/devicetree/bindings/phy/rockchip,rk3568-edp-phy.yaml
new file mode 100644
index 000000000000..afe7bc3d839e
--- /dev/null
+++ b/Documentation/devicetree/bindings/phy/rockchip,rk3568-edp-phy.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/rockchip,rk3568-edp-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip eDP Transmitter PHY with NaNeng IP block
+
+maintainers:
+ - Damon Ding <damon.ding@rock-chips.com>
+ - Heiko Stuebner <heiko@sntech.de>
+
+description:
+ On the RK3568 SoC the eDP PHY is controlled through the eDP PHY GRF
+ registers, therefore the PHY node is expected to be a child of the
+ eDP PHY GRF syscon node.
+
+properties:
+ compatible:
+ const: rockchip,rk3568-edp-phy
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ const: refclk
+
+ "#phy-cells":
+ const: 0
+
+required:
+ - compatible
+ - clocks
+ - clock-names
+ - "#phy-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/rk3568-cru.h>
+
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ edp_phy_grf: syscon@fdcb0000 {
+ compatible = "rockchip,rk3568-edp-phy-grf", "syscon", "simple-mfd";
+ reg = <0x0 0xfdcb0000 0x0 0x100>;
+ clocks = <&cru PCLK_EDPPHY_GRF>;
+
+ edp_phy: edp-phy {
+ compatible = "rockchip,rk3568-edp-phy";
+ clocks = <&pmucru XIN_OSC0_EDPPHY_G>;
+ clock-names = "refclk";
+ #phy-cells = <0>;
+ };
+ };
+ };
diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
index 7bcb4e2f47ec..8d4ced0145b8 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml
@@ -93,6 +93,7 @@ properties:
- rockchip,rk3399-grf
- rockchip,rk3399-pmugrf
- rockchip,rk3562-pmu-grf
+ - rockchip,rk3568-edp-phy-grf
- rockchip,rk3568-grf
- rockchip,rk3568-pmugrf
- rockchip,rk3576-ioc-grf
@@ -156,6 +157,19 @@ allOf:
$ref: /schemas/phy/rockchip,rk3288-dp-phy.yaml#
unevaluatedProperties: false
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: rockchip,rk3568-edp-phy-grf
+
+ then:
+ properties:
+ edp-phy:
+ type: object
+ $ref: /schemas/phy/rockchip,rk3568-edp-phy.yaml#
+ unevaluatedProperties: false
+
- if:
properties:
compatible:
@@ -309,6 +323,7 @@ allOf:
compatible:
contains:
enum:
+ - rockchip,rk3568-edp-phy-grf
- rockchip,rk3576-dcphy-grf
- rockchip,rk3576-vo1-grf
- rockchip,rk3588-vo-grf
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v1 3/6] drm/bridge: analogix_dp: Add support for RK3568
2026-10-13 12:49 [PATCH v1 0/6] Add eDP support for RK3568 Damon Ding
2026-10-13 12:49 ` [PATCH v1 1/6] dt-bindings: display: rockchip: analogix-dp: Add " Damon Ding
2026-10-13 12:49 ` [PATCH v1 2/6] dt-bindings: phy: Add rockchip,rk3568-edp-phy Damon Ding
@ 2026-10-13 12:49 ` Damon Ding
2026-10-13 12:49 ` [PATCH v1 6/6] arm64: dts: rockchip: rk356x: Add eDP controller and phy nodes Damon Ding
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Damon Ding @ 2026-10-13 12:49 UTC (permalink / raw)
To: Sandy Huang, Heiko Stuebner, Andy Yan, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Vinod Koul, Andrzej Hajda, Robert Foss
Cc: Neil Armstrong, Manivannan Sadhasivam, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Dave Jones,
dri-devel, linux-rockchip, devicetree, linux-arm-kernel,
linux-kernel, linux-phy, Damon Ding
The RK3568 SoC integrates an eDP transmitter based on the Analogix
DisplayPort core. Like RK3288 and RK3399, its main link consists of
4 physical lanes running at 1.62/2.7 Gbps per lane.
Add a new RK3568_EDP device type and let it share the link rate and
lane count limits of the RK3288/RK3399 variants.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 +
include/drm/bridge/analogix_dp.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 90245d55d1d2..2aefb4615a4f 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1375,6 +1375,7 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp)
switch (dp->plat_data->dev_type) {
case RK3288_DP:
case RK3399_EDP:
+ case RK3568_EDP:
/*
* Like Rk3288 DisplayPort TRM indicate that "Main link
* containing 4 physical lanes of 2.7/1.62 Gbps/lane".
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index f152ca8c3218..7b5615ae0dc1 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -16,6 +16,7 @@ enum analogix_dp_devtype {
EXYNOS_DP,
RK3288_DP,
RK3399_EDP,
+ RK3568_EDP,
RK3576_EDP,
RK3588_EDP,
};
@@ -25,6 +26,7 @@ static inline bool analogix_dp_is_rockchip(enum analogix_dp_devtype type)
switch (type) {
case RK3288_DP:
case RK3399_EDP:
+ case RK3568_EDP:
case RK3576_EDP:
case RK3588_EDP:
return true;
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v1 6/6] arm64: dts: rockchip: rk356x: Add eDP controller and phy nodes
2026-10-13 12:49 [PATCH v1 0/6] Add eDP support for RK3568 Damon Ding
` (2 preceding siblings ...)
2026-10-13 12:49 ` [PATCH v1 3/6] drm/bridge: analogix_dp: Add support for RK3568 Damon Ding
@ 2026-10-13 12:49 ` Damon Ding
[not found] ` <20261013124946.1807886-6-damon.ding@rock-chips.com>
[not found] ` <20261013124946.1807886-5-damon.ding@rock-chips.com>
5 siblings, 0 replies; 7+ messages in thread
From: Damon Ding @ 2026-10-13 12:49 UTC (permalink / raw)
To: Sandy Huang, Heiko Stuebner, Andy Yan, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Vinod Koul, Andrzej Hajda, Robert Foss
Cc: Neil Armstrong, Manivannan Sadhasivam, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Luca Ceresoli, Dave Jones,
dri-devel, linux-rockchip, devicetree, linux-arm-kernel,
linux-kernel, linux-phy, Damon Ding
Add the eDP PHY GRF (with the eDP PHY child node) and the eDP
controller nodes for the RK3568/RK3566 SoCs.
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
---
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
index a5832895bd39..3b60e4355ad8 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
@@ -403,6 +403,20 @@ usb2phy1_grf: syscon@fdca8000 {
reg = <0x0 0xfdca8000 0x0 0x8000>;
};
+ edp_phy_grf: syscon@fdcb0000 {
+ compatible = "rockchip,rk3568-edp-phy-grf", "syscon", "simple-mfd";
+ reg = <0x0 0xfdcb0000 0x0 0x100>;
+ clocks = <&cru PCLK_EDPPHY_GRF>;
+
+ edp_phy: edp-phy {
+ compatible = "rockchip,rk3568-edp-phy";
+ clocks = <&pmucru XIN_OSC0_EDPPHY_G>;
+ clock-names = "refclk";
+ #phy-cells = <0>;
+ status = "disabled";
+ };
+ };
+
pmucru: clock-controller@fdd00000 {
compatible = "rockchip,rk3568-pmucru";
reg = <0x0 0xfdd00000 0x0 0x1000>;
@@ -879,6 +893,33 @@ hdmi_out: port@1 {
};
};
+ edp: edp@fe0c0000 {
+ compatible = "rockchip,rk3568-edp";
+ reg = <0x0 0xfe0c0000 0x0 0x10000>;
+ clocks = <&pmucru XIN_OSC0_EDPPHY_G>, <&cru PCLK_EDP_CTRL>, <&cru HCLK_VO>;
+ clock-names = "dp", "pclk", "hclk";
+ interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+ phys = <&edp_phy>;
+ phy-names = "dp";
+ power-domains = <&power RK3568_PD_VO>;
+ resets = <&cru SRST_EDP_24M>, <&cru SRST_P_EDP_CTRL>;
+ reset-names = "dp", "apb";
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ edp_in: port@0 {
+ reg = <0>;
+ };
+
+ edp_out: port@1 {
+ reg = <1>;
+ };
+ };
+ };
+
qos_gpu: qos@fe128000 {
compatible = "rockchip,rk3568-qos", "syscon";
reg = <0x0 0xfe128000 0x0 0x20>;
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread[parent not found: <20261013124946.1807886-6-damon.ding@rock-chips.com>]
* Re: [PATCH v1 5/6] drm/rockchip: analogix_dp: Add support for RK3568
[not found] ` <20261013124946.1807886-6-damon.ding@rock-chips.com>
@ 2026-10-13 13:00 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-10-13 13:00 UTC (permalink / raw)
To: Damon Ding
Cc: dri-devel, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] rockchip/dp: unchecked NULL pointer dereference on missing GRF property
--
commit 9a6e6f45c854c22f24d403cf8bdab7a0504199b6
Author: Damon Ding <damon.ding@rock-chips.com>
drm/rockchip: analogix_dp: Add support for RK3568
The RK3568 eDP controller does not require any GRF configurations,
so make the "rockchip,grf" property optional. Also enable the
optional avdd-0v9 and avdd-1v8 supplies which power the eDP PHY.
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -320,8 +320,9 @@ static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)
> struct device *dev = dp->dev;
> struct device_node *np = dev->of_node;
> struct clk *clk;
> + int ret;
>
> - dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
> + dp->grf = syscon_regmap_lookup_by_phandle_optional(np, "rockchip,grf");
> if (IS_ERR(dp->grf))
> return dev_err_probe(dev, PTR_ERR(dp->grf),
> "failed to get rockchip,grf property\n");
[Severity: High]
Since this changes the lookup to syscon_regmap_lookup_by_phandle_optional(),
dp->grf will be NULL when the property is absent, and the IS_ERR() check will
pass.
Can this cause a NULL pointer dereference for legacy SoCs (like RK3288, RK3399,
or RK3588) if the device tree is missing the property?
For those older SoCs, the chip_data specifies valid GRF fields. During display
initialization, the driver calls rockchip_grf_field_write():
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c:rockchip_grf_field_write() {
if (!field->valid)
return 0;
mask = GENMASK(field->msb, field->lsb);
val <<= field->lsb;
return rockchip_grf_write(grf, field->reg, mask, val);
}
This forwards the potentially NULL grf pointer to rockchip_grf_write() and
eventually to regmap_write(), which dereferences it:
drivers/base/regmap/regmap.c:regmap_write() {
...
if (!IS_ALIGNED(reg, map->reg_stride))
return -EINVAL;
...
}
Should probe validate that dp->grf != NULL if the chip type requires it,
rather than allowing probe to succeed and causing a kernel oops later?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013124946.1807886-1-damon.ding@rock-chips.com?part=5
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20261013124946.1807886-5-damon.ding@rock-chips.com>]
* Re: [PATCH v1 4/6] phy: rockchip: Add support for Naneng eDP phy
[not found] ` <20261013124946.1807886-5-damon.ding@rock-chips.com>
@ 2026-10-13 13:02 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-10-13 13:02 UTC (permalink / raw)
To: Damon Ding
Cc: dri-devel, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] phy: rockchip: Missing set_lanes configuration and UB on unverified dp->lanes
- [Medium] Uninitialized variable val used if regmap_read fails
--
commit be568cbd60b1a73a69ea7b9233f6bd9cf9a8b067
Author: Damon Ding <damon.ding@rock-chips.com>
phy: rockchip: Add support for Naneng eDP phy
Add a driver for the Rockchip eDP transmitter PHY with NaNeng IP
block, as found on the RK3568 SoC.
> diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-edp.c b/drivers/phy/rockchip/phy-rockchip-naneng-edp.c
> new file mode 100644
> index 0000000000000..a407714f639a7
> --- /dev/null
> +++ b/drivers/phy/rockchip/phy-rockchip-naneng-edp.c
[ ... ]
> +static int rockchip_edp_phy_set_rate(struct rockchip_edp_phy *edpphy,
> + struct phy_configure_opts_dp *dp)
> +{
[ ... ]
> + regmap_write(edpphy->grf, EDP_PHY_GRF_CON0, FIELD_PREP_WM16(EDP_PHY_PD_PLL_MASK, 0));
> + regmap_write(edpphy->grf, EDP_PHY_GRF_CON0,
> + FIELD_PREP_WM16(EDP_PHY_TX_PD_MASK, ~GENMASK(dp->lanes - 1, 0)));
[Severity: High]
If a caller passes a struct where dp->lanes is 0, will this trigger undefined
behavior?
If dp->lanes is 0, ~GENMASK(dp->lanes - 1, 0) evaluates to
GENMASK(UINT_MAX, 0), triggering a negative right-shift count in C. This can
occur if a caller invokes phy_configure() with opts->dp.set_rate = 1 without
having first configured the lane count.
[ ... ]
> +static int rockchip_edp_phy_verify_config(struct rockchip_edp_phy *edpphy,
> + struct phy_configure_opts_dp *dp)
> +{
[ ... ]
> + if (dp->set_lanes) {
> + /* Verify lane count. */
> + switch (dp->lanes) {
> + case 1:
> + case 2:
> + case 4:
> + /* valid lane count. */
> + break;
> + default:
> + return -EINVAL;
> + }
> + }
> +
> + /*
> + * If changing voltages is required, check swing and pre-emphasis
> + * levels, per-lane.
> + */
> + if (dp->set_voltages) {
> + /* Lane count verified previously. */
> + for (i = 0; i < dp->lanes; i++) {
> + if (dp->voltage[i] > 3 || dp->pre[i] > 3)
> + return -EINVAL;
[Severity: High]
Is it possible for dp->lanes to be used unvalidated here?
The comment says "Lane count verified previously", but the validation of
dp->lanes is bypassed if dp->set_lanes is false. If a driver calls
phy_configure() with opts->dp.set_voltages = 1 and opts->dp.set_lanes = 0,
an uninitialized or invalid dp->lanes value could lead to out-of-bounds array
reads.
[ ... ]
> +static int rockchip_edp_phy_configure(struct phy *phy, union phy_configure_opts *opts)
> +{
> + struct rockchip_edp_phy *edpphy = phy_get_drvdata(phy);
> + int ret;
> +
> + ret = rockchip_edp_phy_verify_config(edpphy, &opts->dp);
> + if (ret) {
> + dev_err(edpphy->dev, "Invalid params for phy configure\n");
> + return ret;
> + }
> +
> + if (opts->dp.set_rate) {
> + ret = rockchip_edp_phy_set_rate(edpphy, &opts->dp);
> + if (ret) {
> + dev_err(edpphy->dev, "Failed to set rate\n");
> + return ret;
> + }
> + }
> +
> + if (opts->dp.set_voltages) {
> + ret = rockchip_edp_phy_set_voltages(edpphy, &opts->dp);
> + if (ret) {
> + dev_err(edpphy->dev, "Failed to set voltages\n");
> + return ret;
> + }
> + }
> +
> + return 0;
> +}
[Severity: High]
Is opts->dp.set_lanes intentionally ignored when configuring the PHY?
The opts->dp.set_lanes flag isn't handled here, meaning the hardware lane
count is never configured. This missing state also causes the uninitialized
dp->lanes issues in rockchip_edp_phy_set_rate() and
rockchip_edp_phy_set_voltages().
[ ... ]
> +static bool rockchip_edp_phy_enabled(struct rockchip_edp_phy *edpphy)
> +{
> + u32 val;
> +
> + regmap_read(edpphy->grf, EDP_PHY_GRF_STATUS0, &val);
> +
> + return FIELD_GET(PLL_RDY, val);
[Severity: Medium]
If regmap_read() fails, does this return stack garbage?
A failure in regmap_read() leaves val uninitialized. Using the uninitialized
stack variable could cause the driver to incorrectly assume the PHY is already
enabled.
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013124946.1807886-1-damon.ding@rock-chips.com?part=4
^ permalink raw reply [flat|nested] 7+ messages in thread