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: <d84e400d-7f76-4b4d-8960-f1338f37b8ac@linaro.org>
Date:   Mon, 20 Nov 2023 18:31:36 +0100
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Théo Lebrun <theo.lebrun@...tlin.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Roger Quadros <rogerq@...nel.org>,
        Peter Chen <peter.chen@...nel.org>,
        Pawel Laszczak <pawell@...ence.com>,
        Nishanth Menon <nm@...com>,
        Vignesh Raghavendra <vigneshr@...com>,
        Tero Kristo <kristo@...nel.org>
Cc:     linux-usb@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Grégory Clement <gregory.clement@...tlin.com>
Subject: Re: [PATCH v2 4/7] usb: cdns3-ti: add suspend/resume procedures for
 J7200

On 20/11/2023 18:06, Théo Lebrun wrote:
> Hardware initialisation is only done at probe. The J7200 USB controller
> is reset at resume because of power-domains toggling off & on. We
> therefore reconfigure the hardware at resume.
> 
> Reuse the newly extracted cdns_ti_init_hw() function that contains the
> register write sequence.
> 
> Only focus J7200 as other SoC are untested. If the controller does not
> reset we do not want to redo reg writes.
> 
> Signed-off-by: Théo Lebrun <theo.lebrun@...tlin.com>
> ---
>  drivers/usb/cdns3/cdns3-ti.c | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c
> index d4232b440e4e..84f93c2fcd5c 100644
> --- a/drivers/usb/cdns3/cdns3-ti.c
> +++ b/drivers/usb/cdns3/cdns3-ti.c
> @@ -58,6 +58,7 @@ struct cdns_ti {
>  	struct clk *usb2_refclk;
>  	struct clk *lpm_clk;
>  	int usb2_refclk_rate_code;
> +	bool reset_on_resume;
>  };
>  
>  static const int cdns_ti_rate_table[] = {	/* in KHZ */
> @@ -172,6 +173,7 @@ static int cdns_ti_probe(struct platform_device *pdev)
>  	data->usb2_refclk_rate_code = i;
>  	data->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider");
>  	data->usb2_only = device_property_read_bool(dev, "ti,usb2-only");
> +	data->reset_on_resume = of_device_is_compatible(node, "ti,j7200-usb");

No, use driver data for this. Don't put compatibles in the code. It
makes it unmanageable soon.

I am repeating this issue from time to time :/

Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ