From: Abel Vesa <abel.vesa@linaro.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Johan Hovold <johan+linaro@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Marijn Suijten <marijn.suijten@somainline.org>,
linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1
Date: Fri, 1 Sep 2023 20:30:15 +0300 [thread overview]
Message-ID: <ZPIfpyghcS3kS7Fb@linaro.org> (raw)
In-Reply-To: <20230829-topic-8550_usbphy-v1-1-599ddbfa094a@linaro.org>
On 23-08-29 22:59:04, Konrad Dybcio wrote:
> There are two instances of the POWER_STATE_CONFIG1 register: one in
> the PCS space and another one in PCS_USB.
>
> The downstream init sequence pokes the latter one while we've been poking
> the former one (and misnamed it as the latter one, impostor!). Fix that
> up to avoid UB.
>
> Fixes: 49742e9edab3 ("phy: qcom-qmp-combo: Add support for SM8550")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 2 +-
> drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h | 3 ++-
> 2 files 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 cbb28afce135..843099d314bf 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -859,10 +859,10 @@ static const struct qmp_phy_init_tbl sm8550_usb3_pcs_tbl[] = {
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG, 0x0c),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG1, 0x4b),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG5, 0x10),
> - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
> };
>
> static const struct qmp_phy_init_tbl sm8550_usb3_pcs_usb_tbl[] = {
> + QMP_PHY_INIT_CFG(QPHY_USB_Q6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40),
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> index 9510e63ba9d8..b9060c242fd2 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> @@ -12,7 +12,7 @@
> #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG3 0xcc
> #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG6 0xd8
> #define QPHY_USB_V6_PCS_REFGEN_REQ_CONFIG1 0xdc
> -#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x90
> +#define QPHY_USB_V6_PCS_POWER_STATE_CONFIG1 0x90
> #define QPHY_USB_V6_PCS_RX_SIGDET_LVL 0x188
> #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_L 0x190
> #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_H 0x194
> @@ -23,6 +23,7 @@
> #define QPHY_USB_V6_PCS_EQ_CONFIG1 0x1dc
> #define QPHY_USB_V6_PCS_EQ_CONFIG5 0x1ec
>
> +#define QPHY_USB_Q6_PCS_USB3_POWER_STATE_CONFIG1 0x00
> #define QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18
> #define QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c
> #define QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40
>
> --
> 2.42.0
>
WARNING: multiple messages have this Message-ID (diff)
From: Abel Vesa <abel.vesa@linaro.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Johan Hovold <johan+linaro@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Marijn Suijten <marijn.suijten@somainline.org>,
linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1
Date: Fri, 1 Sep 2023 20:30:15 +0300 [thread overview]
Message-ID: <ZPIfpyghcS3kS7Fb@linaro.org> (raw)
In-Reply-To: <20230829-topic-8550_usbphy-v1-1-599ddbfa094a@linaro.org>
On 23-08-29 22:59:04, Konrad Dybcio wrote:
> There are two instances of the POWER_STATE_CONFIG1 register: one in
> the PCS space and another one in PCS_USB.
>
> The downstream init sequence pokes the latter one while we've been poking
> the former one (and misnamed it as the latter one, impostor!). Fix that
> up to avoid UB.
>
> Fixes: 49742e9edab3 ("phy: qcom-qmp-combo: Add support for SM8550")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 2 +-
> drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h | 3 ++-
> 2 files 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 cbb28afce135..843099d314bf 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -859,10 +859,10 @@ static const struct qmp_phy_init_tbl sm8550_usb3_pcs_tbl[] = {
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG, 0x0c),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG1, 0x4b),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG5, 0x10),
> - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
> };
>
> static const struct qmp_phy_init_tbl sm8550_usb3_pcs_usb_tbl[] = {
> + QMP_PHY_INIT_CFG(QPHY_USB_Q6_PCS_USB3_POWER_STATE_CONFIG1, 0x68),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
> QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40),
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> index 9510e63ba9d8..b9060c242fd2 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
> @@ -12,7 +12,7 @@
> #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG3 0xcc
> #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG6 0xd8
> #define QPHY_USB_V6_PCS_REFGEN_REQ_CONFIG1 0xdc
> -#define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x90
> +#define QPHY_USB_V6_PCS_POWER_STATE_CONFIG1 0x90
> #define QPHY_USB_V6_PCS_RX_SIGDET_LVL 0x188
> #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_L 0x190
> #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_H 0x194
> @@ -23,6 +23,7 @@
> #define QPHY_USB_V6_PCS_EQ_CONFIG1 0x1dc
> #define QPHY_USB_V6_PCS_EQ_CONFIG5 0x1ec
>
> +#define QPHY_USB_Q6_PCS_USB3_POWER_STATE_CONFIG1 0x00
> #define QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18
> #define QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c
> #define QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40
>
> --
> 2.42.0
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2023-09-01 17:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-29 20:59 [PATCH 0/2] 8550 USB QMPPHY fixups Konrad Dybcio
2023-08-29 20:59 ` Konrad Dybcio
2023-08-29 20:59 ` [PATCH 1/2] phy: qcom-qmp-combo: Square out 8550 POWER_STATE_CONFIG1 Konrad Dybcio
2023-08-29 20:59 ` Konrad Dybcio
2023-08-29 22:55 ` Dmitry Baryshkov
2023-08-29 22:55 ` Dmitry Baryshkov
2023-09-01 17:30 ` Abel Vesa [this message]
2023-09-01 17:30 ` Abel Vesa
2023-09-11 19:03 ` Dmitry Baryshkov
2023-09-11 19:03 ` Dmitry Baryshkov
2023-08-29 20:59 ` [PATCH 2/2] phy: qcom-qmp-combo: initialize PCS_USB registers Konrad Dybcio
2023-08-29 20:59 ` Konrad Dybcio
2023-08-29 22:55 ` Dmitry Baryshkov
2023-08-29 22:55 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZPIfpyghcS3kS7Fb@linaro.org \
--to=abel.vesa@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=johan+linaro@kernel.org \
--cc=kishon@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=marijn.suijten@somainline.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.