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: <20200723081352.hrg6rdpz5zxpp2so@axis.com>
Date:   Thu, 23 Jul 2020 10:13:54 +0200
From:   Vincent Whitchurch <vincent.whitchurch@...s.com>
To:     Bryan O'Donoghue <bryan.odonoghue@...aro.org>
CC:     <balbi@...nel.org>, <gregkh@...uxfoundation.org>,
        <linux-usb@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <bjorn.andersson@...aro.org>,
        <jackp@...eaurora.org>, <robh@...nel.org>,
        Andy Gross <agross@...nel.org>,
        Lee Jones <lee.jones@...aro.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        <mike.looijmans@...ic.nl>
Subject: Re: [PATCH 6/7] usb: dwc3: Add support for a role-switch notifier

On Wed, Mar 11, 2020 at 07:15:00PM +0000, Bryan O'Donoghue wrote:
> diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
> index 2705871ec95e..789e93dd93b4 100644
> --- a/drivers/usb/dwc3/drd.c
> +++ b/drivers/usb/dwc3/drd.c
> @@ -497,6 +497,8 @@ static int dwc3_usb_role_switch_set(struct usb_role_switch *sw, enum usb_role ro
>  	}
>  
>  	dwc3_set_mode(dwc, mode);
> +	raw_notifier_call_chain(&dwc->role_sw_nl, mode, NULL);
> +
>  	return 0;
>  }

dwc3_set_mode() is called from a bunch of other places too, is it
sufficient to call the notifier only from here?  Also, dwc3_set_mode()
performs the mode set asynchronously so the mode switch can race with
this notifier call, is that OK?

Mike Looijmans proposed the control of a vbus regulator from
__dwc3_set_mode(), and that would take care of both the points above.
Perhaps this notifier call can be moved to the same place or perhaps
Mike's patch could even work for you?  The only problem is that your
switching code in dwc3-qcom.c would have to be modelled as a reulator:

 https://lore.kernel.org/linux-usb/20200619142512.19824-1-mike.looijmans@topic.nl/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ