[PATCH] phy: qcom: edp: Fix NULL pointer dereference for phy v6 (x1e80100)

Val Packett posted 1 patch 4 weeks, 1 day ago
There is a newer version of this series
drivers/phy/qualcomm/phy-qcom-edp.c | 6 ++++++
1 file changed, 6 insertions(+)
[PATCH] phy: qcom: edp: Fix NULL pointer dereference for phy v6 (x1e80100)
Posted by Val Packett 4 weeks, 1 day ago
For Glymur SoC support, the com_clk_fwd_cfg callback was added, and a
stub implementation was added for the v4 of the hardware. However it
was omitted for the v6, causing a NULL pointer dereference oops on
Hamoa/Purwa (X1E/X1P) SoC devices. Fix by adding the appropriate stub.

Fixes: add66a6673bc ("phy: qcom: edp: Add Glymur platform support")
Signed-off-by: Val Packett <val@packett.cool>
---
 drivers/phy/qualcomm/phy-qcom-edp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c
index 13feab99feec..a17492db21d8 100644
--- a/drivers/phy/qualcomm/phy-qcom-edp.c
+++ b/drivers/phy/qualcomm/phy-qcom-edp.c
@@ -613,6 +613,11 @@ static int qcom_edp_phy_com_resetsm_cntrl_v6(const struct qcom_edp *edp)
 				     val, val & BIT(0), 500, 10000);
 }
 
+static int qcom_edp_com_clk_fwd_cfg_v6(const struct qcom_edp *edp)
+{
+	return 0;
+}
+
 static int qcom_edp_com_bias_en_clkbuflr_v6(const struct qcom_edp *edp)
 {
 	/* Turn on BIAS current for PHY/PLL */
@@ -758,6 +763,7 @@ static const struct phy_ver_ops qcom_edp_phy_ops_v6 = {
 	.com_power_on		= qcom_edp_phy_power_on_v6,
 	.com_resetsm_cntrl	= qcom_edp_phy_com_resetsm_cntrl_v6,
 	.com_bias_en_clkbuflr	= qcom_edp_com_bias_en_clkbuflr_v6,
+	.com_clk_fwd_cfg	= qcom_edp_com_clk_fwd_cfg_v6,
 	.com_configure_pll	= qcom_edp_com_configure_pll_v6,
 	.com_configure_ssc	= qcom_edp_com_configure_ssc_v6,
 };
-- 
2.51.2
Re: [PATCH] phy: qcom: edp: Fix NULL pointer dereference for phy v6 (x1e80100)
Posted by Konrad Dybcio 4 weeks, 1 day ago
On 1/9/26 5:50 AM, Val Packett wrote:
> For Glymur SoC support, the com_clk_fwd_cfg callback was added, and a
> stub implementation was added for the v4 of the hardware. However it
> was omitted for the v6, causing a NULL pointer dereference oops on
> Hamoa/Purwa (X1E/X1P) SoC devices. Fix by adding the appropriate stub.
> 
> Fixes: add66a6673bc ("phy: qcom: edp: Add Glymur platform support")
> Signed-off-by: Val Packett <val@packett.cool>
> ---
>  drivers/phy/qualcomm/phy-qcom-edp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c
> index 13feab99feec..a17492db21d8 100644
> --- a/drivers/phy/qualcomm/phy-qcom-edp.c
> +++ b/drivers/phy/qualcomm/phy-qcom-edp.c
> @@ -613,6 +613,11 @@ static int qcom_edp_phy_com_resetsm_cntrl_v6(const struct qcom_edp *edp)
>  				     val, val & BIT(0), 500, 10000);
>  }
>  
> +static int qcom_edp_com_clk_fwd_cfg_v6(const struct qcom_edp *edp)
> +{
> +	return 0;
> +}
> +
>  static int qcom_edp_com_bias_en_clkbuflr_v6(const struct qcom_edp *edp)
>  {
>  	/* Turn on BIAS current for PHY/PLL */
> @@ -758,6 +763,7 @@ static const struct phy_ver_ops qcom_edp_phy_ops_v6 = {
>  	.com_power_on		= qcom_edp_phy_power_on_v6,
>  	.com_resetsm_cntrl	= qcom_edp_phy_com_resetsm_cntrl_v6,
>  	.com_bias_en_clkbuflr	= qcom_edp_com_bias_en_clkbuflr_v6,
> +	.com_clk_fwd_cfg	= qcom_edp_com_clk_fwd_cfg_v6,

Let's just point it to the existing qcom_edp_com_clk_fwd_cfg_v4

Konrad
Re: [PATCH] phy: qcom: edp: Fix NULL pointer dereference for phy v6 (x1e80100)
Posted by Neil Armstrong 3 weeks, 4 days ago
On 1/9/26 11:49, Konrad Dybcio wrote:
> On 1/9/26 5:50 AM, Val Packett wrote:
>> For Glymur SoC support, the com_clk_fwd_cfg callback was added, and a
>> stub implementation was added for the v4 of the hardware. However it
>> was omitted for the v6, causing a NULL pointer dereference oops on
>> Hamoa/Purwa (X1E/X1P) SoC devices. Fix by adding the appropriate stub.
>>
>> Fixes: add66a6673bc ("phy: qcom: edp: Add Glymur platform support")
>> Signed-off-by: Val Packett <val@packett.cool>
>> ---
>>   drivers/phy/qualcomm/phy-qcom-edp.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c
>> index 13feab99feec..a17492db21d8 100644
>> --- a/drivers/phy/qualcomm/phy-qcom-edp.c
>> +++ b/drivers/phy/qualcomm/phy-qcom-edp.c
>> @@ -613,6 +613,11 @@ static int qcom_edp_phy_com_resetsm_cntrl_v6(const struct qcom_edp *edp)
>>   				     val, val & BIT(0), 500, 10000);
>>   }
>>   
>> +static int qcom_edp_com_clk_fwd_cfg_v6(const struct qcom_edp *edp)
>> +{
>> +	return 0;
>> +}
>> +
>>   static int qcom_edp_com_bias_en_clkbuflr_v6(const struct qcom_edp *edp)
>>   {
>>   	/* Turn on BIAS current for PHY/PLL */
>> @@ -758,6 +763,7 @@ static const struct phy_ver_ops qcom_edp_phy_ops_v6 = {
>>   	.com_power_on		= qcom_edp_phy_power_on_v6,
>>   	.com_resetsm_cntrl	= qcom_edp_phy_com_resetsm_cntrl_v6,
>>   	.com_bias_en_clkbuflr	= qcom_edp_com_bias_en_clkbuflr_v6,
>> +	.com_clk_fwd_cfg	= qcom_edp_com_clk_fwd_cfg_v6,
> 
> Let's just point it to the existing qcom_edp_com_clk_fwd_cfg_v4

Yes

Neil

> 
> Konrad
Re: [PATCH] phy: qcom: edp: Fix NULL pointer dereference for phy v6 (x1e80100)
Posted by Abel Vesa 4 weeks, 1 day ago
On 26-01-09 01:50:28, Val Packett wrote:
> For Glymur SoC support, the com_clk_fwd_cfg callback was added, and a
> stub implementation was added for the v4 of the hardware. However it
> was omitted for the v6, causing a NULL pointer dereference oops on
> Hamoa/Purwa (X1E/X1P) SoC devices. Fix by adding the appropriate stub.
> 
> Fixes: add66a6673bc ("phy: qcom: edp: Add Glymur platform support")
> Signed-off-by: Val Packett <val@packett.cool>

Thanks for catching this.

Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>