All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] phy/qcom-qmp-combo: propagate correct return value at phy_power_on()
@ 2024-03-28 21:07 Kuogee Hsieh
  2024-03-28 21:36 ` Abhinav Kumar
  2024-03-29  0:24 ` Stephen Boyd
  0 siblings, 2 replies; 4+ messages in thread
From: Kuogee Hsieh @ 2024-03-28 21:07 UTC (permalink / raw)
  To: dri-devel, robdclark, sean, swboyd, dianders, vkoul, daniel,
	airlied, agross, dmitry.baryshkov, abel.vesa, andersson
  Cc: Kuogee Hsieh, quic_abhinavk, quic_jesszhan, quic_sbillaka,
	marijn.suijten, freedreno, linux-arm-msm, linux-kernel

Currently qmp_combo_dp_power_on() always return 0 in regardless of
return value of cfg->configure_dp_phy(). This patch propagate
return value of cfg->configure_dp_phy() all the way back to caller.

Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 36632fa..884973a 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -2754,6 +2754,7 @@ static int qmp_combo_dp_power_on(struct phy *phy)
 	const struct qmp_phy_cfg *cfg = qmp->cfg;
 	void __iomem *tx = qmp->dp_tx;
 	void __iomem *tx2 = qmp->dp_tx2;
+	int ret = 0;
 
 	mutex_lock(&qmp->phy_mutex);
 
@@ -2766,11 +2767,11 @@ static int qmp_combo_dp_power_on(struct phy *phy)
 	cfg->configure_dp_tx(qmp);
 
 	/* Configure link rate, swing, etc. */
-	cfg->configure_dp_phy(qmp);
+	ret = cfg->configure_dp_phy(qmp);
 
 	mutex_unlock(&qmp->phy_mutex);
 
-	return 0;
+	return ret;
 }
 
 static int qmp_combo_dp_power_off(struct phy *phy)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] phy/qcom-qmp-combo: propagate correct return value at phy_power_on()
  2024-03-28 21:07 [PATCH v1] phy/qcom-qmp-combo: propagate correct return value at phy_power_on() Kuogee Hsieh
@ 2024-03-28 21:36 ` Abhinav Kumar
  2024-03-28 22:36   ` Dmitry Baryshkov
  2024-03-29  0:24 ` Stephen Boyd
  1 sibling, 1 reply; 4+ messages in thread
From: Abhinav Kumar @ 2024-03-28 21:36 UTC (permalink / raw)
  To: Kuogee Hsieh, dri-devel, robdclark, sean, swboyd, dianders,
	vkoul, daniel, airlied, agross, dmitry.baryshkov, abel.vesa,
	andersson
  Cc: quic_jesszhan, quic_sbillaka, marijn.suijten, freedreno,
	linux-arm-msm, linux-kernel



On 3/28/2024 2:07 PM, Kuogee Hsieh wrote:
> Currently qmp_combo_dp_power_on() always return 0 in regardless of
> return value of cfg->configure_dp_phy(). This patch propagate
> return value of cfg->configure_dp_phy() all the way back to caller.
> 

This is good. But I am also thinking if we should add some prints in 
this driver like it doesnt even tell where it failed like here


         ret = qmp_v456_configure_dp_phy(qmp);
         if (ret < 0)
                 return ret;

> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---
>   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 

Also, I think we should have

Fixes: 94a407cc17a4 ("phy: qcom-qmp: create copies of QMP PHY driver")

If there is a better fixes tag for this, please let me know.

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index 36632fa..884973a 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -2754,6 +2754,7 @@ static int qmp_combo_dp_power_on(struct phy *phy)
>   	const struct qmp_phy_cfg *cfg = qmp->cfg;
>   	void __iomem *tx = qmp->dp_tx;
>   	void __iomem *tx2 = qmp->dp_tx2;
> +	int ret = 0;
>   
>   	mutex_lock(&qmp->phy_mutex);
>   
> @@ -2766,11 +2767,11 @@ static int qmp_combo_dp_power_on(struct phy *phy)
>   	cfg->configure_dp_tx(qmp);
>   
>   	/* Configure link rate, swing, etc. */
> -	cfg->configure_dp_phy(qmp);
> +	ret = cfg->configure_dp_phy(qmp);
>   
>   	mutex_unlock(&qmp->phy_mutex);
>   
> -	return 0;
> +	return ret;
>   }
>   
>   static int qmp_combo_dp_power_off(struct phy *phy)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] phy/qcom-qmp-combo: propagate correct return value at phy_power_on()
  2024-03-28 21:36 ` Abhinav Kumar
@ 2024-03-28 22:36   ` Dmitry Baryshkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2024-03-28 22:36 UTC (permalink / raw)
  To: Abhinav Kumar
  Cc: Kuogee Hsieh, dri-devel, robdclark, sean, swboyd, dianders,
	vkoul, daniel, airlied, agross, abel.vesa, andersson,
	quic_jesszhan, quic_sbillaka, marijn.suijten, freedreno,
	linux-arm-msm, linux-kernel

On Thu, 28 Mar 2024 at 23:36, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>
>
>
> On 3/28/2024 2:07 PM, Kuogee Hsieh wrote:
> > Currently qmp_combo_dp_power_on() always return 0 in regardless of
> > return value of cfg->configure_dp_phy(). This patch propagate
> > return value of cfg->configure_dp_phy() all the way back to caller.
> >
>
> This is good. But I am also thinking if we should add some prints in
> this driver like it doesnt even tell where it failed like here
>
>
>          ret = qmp_v456_configure_dp_phy(qmp);
>          if (ret < 0)
>                  return ret;
>
> > Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> > ---
> >   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
>
> Also, I think we should have
>
> Fixes: 94a407cc17a4 ("phy: qcom-qmp: create copies of QMP PHY driver")
>
> If there is a better fixes tag for this, please let me know.

Fixes: 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy")

Otherwise LGTM

>
> > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > index 36632fa..884973a 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > @@ -2754,6 +2754,7 @@ static int qmp_combo_dp_power_on(struct phy *phy)
> >       const struct qmp_phy_cfg *cfg = qmp->cfg;
> >       void __iomem *tx = qmp->dp_tx;
> >       void __iomem *tx2 = qmp->dp_tx2;
> > +     int ret = 0;
> >
> >       mutex_lock(&qmp->phy_mutex);
> >
> > @@ -2766,11 +2767,11 @@ static int qmp_combo_dp_power_on(struct phy *phy)
> >       cfg->configure_dp_tx(qmp);
> >
> >       /* Configure link rate, swing, etc. */
> > -     cfg->configure_dp_phy(qmp);
> > +     ret = cfg->configure_dp_phy(qmp);
> >
> >       mutex_unlock(&qmp->phy_mutex);
> >
> > -     return 0;
> > +     return ret;
> >   }
> >
> >   static int qmp_combo_dp_power_off(struct phy *phy)



-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] phy/qcom-qmp-combo: propagate correct return value at phy_power_on()
  2024-03-28 21:07 [PATCH v1] phy/qcom-qmp-combo: propagate correct return value at phy_power_on() Kuogee Hsieh
  2024-03-28 21:36 ` Abhinav Kumar
@ 2024-03-29  0:24 ` Stephen Boyd
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2024-03-29  0:24 UTC (permalink / raw)
  To: Kuogee Hsieh, abel.vesa, agross, airlied, andersson, daniel,
	dianders, dmitry.baryshkov, dri-devel, robdclark, sean, vkoul
  Cc: quic_abhinavk, quic_jesszhan, quic_sbillaka, marijn.suijten,
	freedreno, linux-arm-msm, linux-kernel

Quoting Kuogee Hsieh (2024-03-28 14:07:15)
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index 36632fa..884973a 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -2754,6 +2754,7 @@ static int qmp_combo_dp_power_on(struct phy *phy)
>         const struct qmp_phy_cfg *cfg = qmp->cfg;
>         void __iomem *tx = qmp->dp_tx;
>         void __iomem *tx2 = qmp->dp_tx2;
> +       int ret = 0;

Please don't initialize locals that are unused before being assigned
unconditionally.

>
>         mutex_lock(&qmp->phy_mutex);
>
> @@ -2766,11 +2767,11 @@ static int qmp_combo_dp_power_on(struct phy *phy)
>         cfg->configure_dp_tx(qmp);
>
>         /* Configure link rate, swing, etc. */
> -       cfg->configure_dp_phy(qmp);
> +       ret = cfg->configure_dp_phy(qmp);
>
>         mutex_unlock(&qmp->phy_mutex);
>
> -       return 0;
> +       return ret;
>  }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-29  0:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 21:07 [PATCH v1] phy/qcom-qmp-combo: propagate correct return value at phy_power_on() Kuogee Hsieh
2024-03-28 21:36 ` Abhinav Kumar
2024-03-28 22:36   ` Dmitry Baryshkov
2024-03-29  0:24 ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.