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]
Date:   Thu, 8 Apr 2021 13:39:13 +0000
From:   Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
To:     Artur Petrosyan <Arthur.Petrosyan@...opsys.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     John Youn <John.Youn@...opsys.com>
Subject: Re: [PATCH v3 05/14] usb: dwc2: Update port suspend/resume function
 definitions.

On 4/8/2021 1:45 PM, Artur Petrosyan wrote:
> Earlier "dwc2_port_suspend()" and "dwc2_port_resume()" functions
> were implemented without proper description and host or device mode
> difference.
> 
> - Added "dwc2_port_suspend" and "dwc2_port_resume" functions to
>    "core.h" header file.
> 
> - Updated function description in documentation.
> 
> Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@...opsys.com>

Acked-by: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>

> ---
>   Changes in v3:
>   - None
>   Changes in v2:
>   - None
> 
>   drivers/usb/dwc2/core.h |  4 ++++
>   drivers/usb/dwc2/hcd.c  | 25 +++++++++++++++++++------
>   2 files changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
> index 39037709a2ad..b7d99cf9e84c 100644
> --- a/drivers/usb/dwc2/core.h
> +++ b/drivers/usb/dwc2/core.h
> @@ -1470,6 +1470,8 @@ void dwc2_hcd_connect(struct dwc2_hsotg *hsotg);
>   void dwc2_hcd_disconnect(struct dwc2_hsotg *hsotg, bool force);
>   void dwc2_hcd_start(struct dwc2_hsotg *hsotg);
>   int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup);
> +void dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex);
> +void dwc2_port_resume(struct dwc2_hsotg *hsotg);
>   int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg);
>   int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg);
>   int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg);
> @@ -1493,6 +1495,8 @@ static inline void dwc2_hcd_start(struct dwc2_hsotg *hsotg) {}
>   static inline void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) {}
>   static inline int dwc2_core_init(struct dwc2_hsotg *hsotg, bool initial_setup)
>   { return 0; }
> +static inline void dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex) {}
> +static inline void dwc2_port_resume(struct dwc2_hsotg *hsotg) {}
>   static inline int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
>   { return 0; }
>   static inline int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg)
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index dd0362e07444..f4247a66c2b2 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -56,8 +56,6 @@
>   #include "core.h"
>   #include "hcd.h"
>   
> -static void dwc2_port_resume(struct dwc2_hsotg *hsotg);
> -
>   /*
>    * =========================================================================
>    *  Host Core Layer Functions
> @@ -3277,8 +3275,16 @@ static int dwc2_host_is_b_hnp_enabled(struct dwc2_hsotg *hsotg)
>   	return hcd->self.b_hnp_enable;
>   }
>   
> -/* Must NOT be called with interrupt disabled or spinlock held */
> -static void dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex)
> +/**
> + * dwc2_port_suspend() - Put controller in suspend mode for host.
> + *
> + * @hsotg: Programming view of the DWC_otg controller
> + * @windex: The control request wIndex field
> + *
> + * This function is for entering Host mode suspend.
> + * Must NOT be called with interrupt disabled or spinlock held.
> + */
> +void dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex)
>   {
>   	unsigned long flags;
>   	u32 hprt0;
> @@ -3328,8 +3334,15 @@ static void dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex)
>   	}
>   }
>   
> -/* Must NOT be called with interrupt disabled or spinlock held */
> -static void dwc2_port_resume(struct dwc2_hsotg *hsotg)
> +/**
> + * dwc2_port_resume() - Exit controller from suspend mode for host.
> + *
> + * @hsotg: Programming view of the DWC_otg controller
> + *
> + * This function is for exiting Host mode suspend.
> + * Must NOT be called with interrupt disabled or spinlock held.
> + */
> +void dwc2_port_resume(struct dwc2_hsotg *hsotg)
>   {
>   	unsigned long flags;
>   	u32 hprt0;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ