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] [day] [month] [year] [list]
Message-ID: <20250617012948.hw7koyx55gj7n7a7@synopsys.com>
Date: Tue, 17 Jun 2025 01:29:52 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Krishna Kurapati <krishna.kurapati@....qualcomm.com>
CC: Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Bjorn Andersson <bjorn.andersson@....qualcomm.com>,
        "linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/4] usb: dwc3: core: Introduce glue callbacks for
 flattened implementations

Hi,

On Tue, Jun 10, 2025, Krishna Kurapati wrote:
> In certain situations like role switching, the glue layers need to be
> informed of these events, so that they can take any necessary action.
> But in non-flattened implementations, the glue drivers have no data on
> when the core driver probe was successful post invoking of_platform_
> populate. Now that the core driver supports flattened implementations
> as well, introduce vendor callbacks that can be passed on from glue to
> core before invoking dwc3_core_probe.
> 
> Introduce callbacks to notify glue layer of role_switch and run_stop
> changes. These can be used by flattened implementation of Qualcomm
> glue layer to generate connect/disconnect events in controller during
> cable connect and run stop modifications by udc in device mode.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@....qualcomm.com>
> ---
>  drivers/usb/dwc3/core.c   |  1 +
>  drivers/usb/dwc3/core.h   | 26 ++++++++++++++++++++++++++
>  drivers/usb/dwc3/drd.c    |  1 +
>  drivers/usb/dwc3/gadget.c |  1 +
>  4 files changed, 29 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 2bc775a747f2..c01b15e3710f 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -2351,6 +2351,7 @@ static int dwc3_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	dwc->dev = &pdev->dev;
> +	dwc->glue_ops = NULL;
>  
>  	probe_data.dwc = dwc;
>  	probe_data.res = res;
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index d5b985fa12f4..a803884be4ed 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -992,6 +992,17 @@ struct dwc3_scratchpad_array {
>  	__le64	dma_adr[DWC3_MAX_HIBER_SCRATCHBUFS];
>  };
>  
> +/*
> + * struct dwc3_glue_ops - The ops indicate the notifications that
> + *				need to be passed on to glue layer
> + * @notify_set_role: Notify glue of role switch notifications
> + * @notify_run_stop: Notify run stop enable/disable information to glue
> + */
> +struct dwc3_glue_ops {
> +	void	(*notify_set_role)(struct dwc3 *dwc, enum usb_role role);
> +	void	(*notify_run_stop)(struct dwc3 *dwc, bool is_on);

These are not to simply to "notify". They are callbacks right? Perhaps
prefix them pre_* or post_* instead of notify_*.

> +};
> +

(Appologies for the delays, I'll get back on reviewing more of this
series. I've been flooded with other tasks these last few days).

BR,
Thinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ