lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a3a50cf5-083a-5aa8-e77c-6feb2f2fd866@codeaurora.org>
Date:   Fri, 14 Jun 2019 15:20:07 +0530
From:   Vivek Gautam <vivek.gautam@...eaurora.org>
To:     Marc Gonzalez <marc.w.gonzalez@...e.fr>,
        Kishon Vijay Abraham <kishon@...com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     MSM <linux-arm-msm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] phy: qcom-qmp: Raise qcom_qmp_phy_enable() polling
 delay

Hi Marc,

On 6/13/2019 5:02 PM, Marc Gonzalez wrote:
> readl_poll_timeout() calls usleep_range() to sleep between reads.
> usleep_range() doesn't work efficiently for tiny values.
>
> Raise the polling delay in qcom_qmp_phy_enable() to bring it in line
> with the delay in qcom_qmp_phy_com_init().
>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@...e.fr>
> ---
> Vivek, do you remember why you didn't use the same delay value in
> qcom_qmp_phy_enable) and qcom_qmp_phy_com_init() ?

phy_qcom_init() thingy came from the PCIE phy driver from downstream 
msm-3.18
PCIE did something as below:

-----
do {
         if (pcie_phy_is_ready(dev))
                 break;
         retries++;
         usleep_range(REFCLK_STABILIZATION_DELAY_US_MIN,
                                  REFCLK_STABILIZATION_DELAY_US_MAX);
} while (retries < PHY_READY_TIMEOUT_COUNT);

REFCLK_STABILIZATION_DELAY_US_MIN/MAX ==> 1000/1005
PHY_READY_TIMEOUT_COUNT ==> 10
-----


phy_enable() from the usb phy driver from downstream.
  /* Wait for PHY initialization to be done */
  do {
          if (readl_relaxed(phy->base +
                  phy->phy_reg[USB3_PHY_PCS_STATUS]) & PHYSTATUS)
                  usleep_range(1, 2);
else
break;
  } while (--init_timeout_usec);

init_timeout_usec ==> 1000
-----
USB never had a COM_PHY status bit.

So clearly the resolutions were different.

Does this change solves an issue at hand?

> ---
>   drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
> index bb522b915fa9..34ff6434da8f 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
> @@ -1548,7 +1548,7 @@ static int qcom_qmp_phy_enable(struct phy *phy)
>   	status = pcs + cfg->regs[QPHY_PCS_READY_STATUS];
>   	mask = cfg->mask_pcs_ready;
>   
> -	ret = readl_poll_timeout(status, val, val & mask, 1,
> +	ret = readl_poll_timeout(status, val, val & mask, 10,
>   				 PHY_INIT_COMPLETE_TIMEOUT);
>   	if (ret) {
>   		dev_err(qmp->dev, "phy initialization timed-out\n");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ