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: <2024100943-gallantly-animosity-2822@gregkh>
Date: Wed, 9 Oct 2024 14:45:42 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Guan-Yu Lin <guanyulin@...gle.com>
Cc: Thinh.Nguyen@...opsys.com, mathias.nyman@...el.com,
	stern@...land.harvard.edu, elder@...nel.org, oneukum@...e.com,
	yajun.deng@...ux.dev, dianders@...omium.org, kekrby@...il.com,
	perex@...ex.cz, tiwai@...e.com, tj@...nel.org,
	stanley_chang@...ltek.com, andreyknvl@...il.com,
	christophe.jaillet@...adoo.fr, quic_jjohnson@...cinc.com,
	ricardo@...liere.net, grundler@...omium.org, niko.mauno@...sala.com,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-sound@...r.kernel.org, badhri@...gle.com,
	albertccwang@...gle.com, quic_wcheng@...cinc.com,
	pumahsu@...gle.com
Subject: Re: [PATCH v4 1/5] usb: dwc3: separate dev_pm_ops for each pm_event

On Wed, Oct 09, 2024 at 05:42:55AM +0000, Guan-Yu Lin wrote:
> Separate dev_pm_ops for different power events such as suspend, thaw,
> and hibernation. This is crucial when dwc3 driver needs to adapt its
> behavior based on different power state changes.
> 
> Signed-off-by: Guan-Yu Lin <guanyulin@...gle.com>
> ---
>  drivers/usb/dwc3/core.c | 77 ++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 76 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index b25d80f318a9..2fdafbcbe44c 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -2582,6 +2582,76 @@ static int dwc3_resume(struct device *dev)
>  	return 0;
>  }
>  
> +static int dwc3_freeze(struct device *dev)
> +{
> +	struct dwc3	*dwc = dev_get_drvdata(dev);
> +	int		ret;
> +
> +	ret = dwc3_suspend_common(dwc, PMSG_FREEZE);
> +	if (ret)
> +		return ret;
> +
> +	pinctrl_pm_select_sleep_state(dev);
> +
> +	return 0;
> +}
> +
> +static int dwc3_thaw(struct device *dev)
> +{
> +	struct dwc3	*dwc = dev_get_drvdata(dev);
> +	int		ret;
> +
> +	pinctrl_pm_select_default_state(dev);
> +
> +	pm_runtime_disable(dev);
> +	pm_runtime_set_active(dev);
> +
> +	ret = dwc3_resume_common(dwc, PMSG_THAW);
> +	if (ret) {
> +		pm_runtime_set_suspended(dev);
> +		return ret;
> +	}
> +
> +	pm_runtime_enable(dev);
> +
> +	return 0;
> +}
> +
> +static int dwc3_poweroff(struct device *dev)
> +{
> +	struct dwc3	*dwc = dev_get_drvdata(dev);
> +	int		ret;
> +
> +	ret = dwc3_suspend_common(dwc, PMSG_HIBERNATE);

Why is power off hibernate?

This needs an ack from the dwc3 maintainer as I can't determine if it's
correct at all...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ