* [PATCH] phy: qcom: qmp: Add debug prints for register writes
@ 2024-07-30 10:03 Manivannan Sadhasivam
2024-07-31 10:58 ` Vinod Koul
0 siblings, 1 reply; 5+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-30 10:03 UTC (permalink / raw)
To: vkoul; +Cc: kishon, linux-arm-msm, linux-phy, linux-kernel,
Manivannan Sadhasivam
These register prints are useful to validate the init sequence against the
Qcom internal documentation and also to share with the Qcom hw engineers to
debug issues related to PHY.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/phy/qualcomm/phy-qcom-qmp-common.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
index 799384210509..e6a6bcfcac28 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
@@ -9,6 +9,7 @@
struct qmp_phy_init_tbl {
unsigned int offset;
unsigned int val;
+ char *name;
/*
* mask of lanes for which this register is written
* for cases when second lane needs different values
@@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
{ \
.offset = o, \
.val = v, \
+ .name = #o, \
.lane_mask = 0xff, \
}
@@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
{ \
.offset = o, \
.val = v, \
+ .name = #o, \
.lane_mask = l, \
}
@@ -45,6 +48,7 @@ static inline void qmp_configure_lane(void __iomem *base,
if (!(t->lane_mask & lane_mask))
continue;
+ pr_debug("QMP PHY: Writing: %s --> 0x%02x\n", t->name, t->val);
writel(t->val, base + t->offset);
}
}
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] phy: qcom: qmp: Add debug prints for register writes
2024-07-30 10:03 [PATCH] phy: qcom: qmp: Add debug prints for register writes Manivannan Sadhasivam
@ 2024-07-31 10:58 ` Vinod Koul
2024-07-31 12:18 ` Dmitry Baryshkov
0 siblings, 1 reply; 5+ messages in thread
From: Vinod Koul @ 2024-07-31 10:58 UTC (permalink / raw)
To: Manivannan Sadhasivam; +Cc: kishon, linux-arm-msm, linux-phy, linux-kernel
On 30-07-24, 15:33, Manivannan Sadhasivam wrote:
> These register prints are useful to validate the init sequence against the
> Qcom internal documentation and also to share with the Qcom hw engineers to
> debug issues related to PHY.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> drivers/phy/qualcomm/phy-qcom-qmp-common.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> index 799384210509..e6a6bcfcac28 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> @@ -9,6 +9,7 @@
> struct qmp_phy_init_tbl {
> unsigned int offset;
> unsigned int val;
> + char *name;
> /*
> * mask of lanes for which this register is written
> * for cases when second lane needs different values
> @@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
> { \
> .offset = o, \
> .val = v, \
> + .name = #o, \
> .lane_mask = 0xff, \
> }
>
> @@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
> { \
> .offset = o, \
> .val = v, \
> + .name = #o, \
> .lane_mask = l, \
> }
>
> @@ -45,6 +48,7 @@ static inline void qmp_configure_lane(void __iomem *base,
> if (!(t->lane_mask & lane_mask))
> continue;
>
> + pr_debug("QMP PHY: Writing: %s --> 0x%02x\n", t->name, t->val);
This lgtm, but fails to help when offset _might_ be incorrect, including
the offset value as well (not just the name) would be better imo...
> writel(t->val, base + t->offset);
> }
> }
> --
> 2.25.1
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] phy: qcom: qmp: Add debug prints for register writes
2024-07-31 10:58 ` Vinod Koul
@ 2024-07-31 12:18 ` Dmitry Baryshkov
2024-07-31 12:19 ` Dmitry Baryshkov
2024-07-31 15:29 ` Manivannan Sadhasivam
0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2024-07-31 12:18 UTC (permalink / raw)
To: Vinod Koul
Cc: Manivannan Sadhasivam, kishon, linux-arm-msm, linux-phy,
linux-kernel
On Wed, Jul 31, 2024 at 04:28:46PM GMT, Vinod Koul wrote:
> On 30-07-24, 15:33, Manivannan Sadhasivam wrote:
> > These register prints are useful to validate the init sequence against the
> > Qcom internal documentation and also to share with the Qcom hw engineers to
> > debug issues related to PHY.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> > drivers/phy/qualcomm/phy-qcom-qmp-common.h | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > index 799384210509..e6a6bcfcac28 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > @@ -9,6 +9,7 @@
> > struct qmp_phy_init_tbl {
> > unsigned int offset;
> > unsigned int val;
> > + char *name;
> > /*
> > * mask of lanes for which this register is written
> > * for cases when second lane needs different values
> > @@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
> > { \
> > .offset = o, \
> > .val = v, \
> > + .name = #o, \
> > .lane_mask = 0xff, \
> > }
> >
> > @@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
> > { \
> > .offset = o, \
> > .val = v, \
> > + .name = #o, \
> > .lane_mask = l, \
> > }
> >
> > @@ -45,6 +48,7 @@ static inline void qmp_configure_lane(void __iomem *base,
> > if (!(t->lane_mask & lane_mask))
> > continue;
> >
> > + pr_debug("QMP PHY: Writing: %s --> 0x%02x\n", t->name, t->val);
>
> This lgtm, but fails to help when offset _might_ be incorrect, including
> the offset value as well (not just the name) would be better imo...
Can we please use dev_vdbg instead? Having dev_ part makes sure that we
can not mismatch PHYs and the sequences. _vdbg is less important, but
I don't think we want this in the log messages unless absolutely
required.
Also, could you possibly apply this to all other QMP drivers?
>
> > writel(t->val, base + t->offset);
> > }
> > }
> > --
> > 2.25.1
>
> --
> ~Vinod
>
> --
> linux-phy mailing list
> linux-phy@lists.infradead.org
> https://lists.infradead.org/mailman/listinfo/linux-phy
--
With best wishes
Dmitry
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] phy: qcom: qmp: Add debug prints for register writes
2024-07-31 12:18 ` Dmitry Baryshkov
@ 2024-07-31 12:19 ` Dmitry Baryshkov
2024-07-31 15:29 ` Manivannan Sadhasivam
1 sibling, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2024-07-31 12:19 UTC (permalink / raw)
To: Vinod Koul
Cc: Manivannan Sadhasivam, kishon, linux-arm-msm, linux-phy,
linux-kernel
On Wed, Jul 31, 2024 at 03:18:34PM GMT, Dmitry Baryshkov wrote:
> On Wed, Jul 31, 2024 at 04:28:46PM GMT, Vinod Koul wrote:
> > On 30-07-24, 15:33, Manivannan Sadhasivam wrote:
> > > These register prints are useful to validate the init sequence against the
> > > Qcom internal documentation and also to share with the Qcom hw engineers to
> > > debug issues related to PHY.
> > >
> > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > ---
> > > drivers/phy/qualcomm/phy-qcom-qmp-common.h | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > > index 799384210509..e6a6bcfcac28 100644
> > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > > @@ -9,6 +9,7 @@
> > > struct qmp_phy_init_tbl {
> > > unsigned int offset;
> > > unsigned int val;
> > > + char *name;
> > > /*
> > > * mask of lanes for which this register is written
> > > * for cases when second lane needs different values
> > > @@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
> > > { \
> > > .offset = o, \
> > > .val = v, \
> > > + .name = #o, \
> > > .lane_mask = 0xff, \
> > > }
> > >
> > > @@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
> > > { \
> > > .offset = o, \
> > > .val = v, \
> > > + .name = #o, \
> > > .lane_mask = l, \
> > > }
> > >
> > > @@ -45,6 +48,7 @@ static inline void qmp_configure_lane(void __iomem *base,
> > > if (!(t->lane_mask & lane_mask))
> > > continue;
> > >
> > > + pr_debug("QMP PHY: Writing: %s --> 0x%02x\n", t->name, t->val);
> >
> > This lgtm, but fails to help when offset _might_ be incorrect, including
> > the offset value as well (not just the name) would be better imo...
>
> Can we please use dev_vdbg instead? Having dev_ part makes sure that we
> can not mismatch PHYs and the sequences. _vdbg is less important, but
> I don't think we want this in the log messages unless absolutely
> required.
>
> Also, could you possibly apply this to all other QMP drivers?
Please ignore the last phrase, it is used by all QMP drivers.
--
With best wishes
Dmitry
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] phy: qcom: qmp: Add debug prints for register writes
2024-07-31 12:18 ` Dmitry Baryshkov
2024-07-31 12:19 ` Dmitry Baryshkov
@ 2024-07-31 15:29 ` Manivannan Sadhasivam
1 sibling, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-31 15:29 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Vinod Koul, kishon, linux-arm-msm, linux-phy, linux-kernel
On Wed, Jul 31, 2024 at 03:18:31PM +0300, Dmitry Baryshkov wrote:
> On Wed, Jul 31, 2024 at 04:28:46PM GMT, Vinod Koul wrote:
> > On 30-07-24, 15:33, Manivannan Sadhasivam wrote:
> > > These register prints are useful to validate the init sequence against the
> > > Qcom internal documentation and also to share with the Qcom hw engineers to
> > > debug issues related to PHY.
> > >
> > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > ---
> > > drivers/phy/qualcomm/phy-qcom-qmp-common.h | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > > index 799384210509..e6a6bcfcac28 100644
> > > --- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > > @@ -9,6 +9,7 @@
> > > struct qmp_phy_init_tbl {
> > > unsigned int offset;
> > > unsigned int val;
> > > + char *name;
> > > /*
> > > * mask of lanes for which this register is written
> > > * for cases when second lane needs different values
> > > @@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
> > > { \
> > > .offset = o, \
> > > .val = v, \
> > > + .name = #o, \
> > > .lane_mask = 0xff, \
> > > }
> > >
> > > @@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
> > > { \
> > > .offset = o, \
> > > .val = v, \
> > > + .name = #o, \
> > > .lane_mask = l, \
> > > }
> > >
> > > @@ -45,6 +48,7 @@ static inline void qmp_configure_lane(void __iomem *base,
> > > if (!(t->lane_mask & lane_mask))
> > > continue;
> > >
> > > + pr_debug("QMP PHY: Writing: %s --> 0x%02x\n", t->name, t->val);
> >
> > This lgtm, but fails to help when offset _might_ be incorrect, including
> > the offset value as well (not just the name) would be better imo...
>
> Can we please use dev_vdbg instead? Having dev_ part makes sure that we
> can not mismatch PHYs and the sequences. _vdbg is less important, but
> I don't think we want this in the log messages unless absolutely
> required.
>
I'm not a big fan of _vdbg(). IMO, all debug messages are verbose and if
enabled, user intend to see it. So I don't like one more level of
comparmentalization. Also it requires us to feed -DVERBOSE_DEBUG...
But I agree with dev_dbg(). Initially, I thought about it but forgot the fact
that we now have async probe, so there is no guaranteee that these debug prints
will get printed in order.
Sent v3 with dev_dbg(), thanks!
- Mani
--
மணிவண்ணன் சதாசிவம்
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-31 15:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 10:03 [PATCH] phy: qcom: qmp: Add debug prints for register writes Manivannan Sadhasivam
2024-07-31 10:58 ` Vinod Koul
2024-07-31 12:18 ` Dmitry Baryshkov
2024-07-31 12:19 ` Dmitry Baryshkov
2024-07-31 15:29 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).