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: <20210612073450.GB4580@Peter>
Date:   Sat, 12 Jun 2021 15:34:50 +0800
From:   Peter Chen <peter.chen@...nel.org>
To:     Dmitry Osipenko <digetx@...il.com>
Cc:     Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Peter Chen <Peter.Chen@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alan Stern <stern@...land.harvard.edu>,
        Felipe Balbi <balbi@...nel.org>,
        Maxim Schwalm <maxim.schwalm@...il.com>,
        linux-tegra@...r.kernel.org, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] usb: chipidea: tegra: Delay PHY suspending

On 21-06-09 15:04:04, Dmitry Osipenko wrote:
> The ChipIdea driver enters into suspend immediately after seeing a
> VBUS disconnection. Some devices need an extra delay after losing
> VBUS, otherwise VBUS may be floating, preventing the PHY's suspending
> by the VBUS detection sensors. This problem was found on Tegra30 Asus
> Transformer TF700T tablet device, where the USB PHY wakes up immediately
> from suspend because VBUS sensor continues to detect VBUS as active after
> disconnection. A minimum delay of 20ms is needed in order to fix this
> issue, hence add 25ms delay before suspending the PHY.
> 
> Reported-by: Maxim Schwalm <maxim.schwalm@...il.com> # Asus TF700T
> Tested-by: Maxim Schwalm <maxim.schwalm@...il.com> # Asus TF700T
> Signed-off-by: Dmitry Osipenko <digetx@...il.com>
> ---
>  drivers/usb/chipidea/ci_hdrc_tegra.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c
> index 60361141ac04..d1359b76a0e8 100644
> --- a/drivers/usb/chipidea/ci_hdrc_tegra.c
> +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c
> @@ -4,6 +4,7 @@
>   */
>  
>  #include <linux/clk.h>
> +#include <linux/delay.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
>  #include <linux/of_device.h>
> @@ -255,6 +256,13 @@ static int tegra_ehci_hub_control(struct ci_hdrc *ci, u16 typeReq, u16 wValue,
>  
>  static void tegra_usb_enter_lpm(struct ci_hdrc *ci, bool enable)
>  {
> +	/*
> +	 * Give hardware time to settle down after VBUS disconnection,
> +	 * otherwise PHY may wake up from suspend immediately.
> +	 */
> +	if (enable)
> +		msleep(25);
> +

How could you know 25ms is enough for other Tegra designs?
Could you poll VBUS wakeup threshold register to ensure the
wakeup will not occur? The similar design exists at function:
hw_wait_vbus_lower_bsv.

-- 

Thanks,
Peter Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ