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:	Mon, 4 Mar 2013 16:38:10 +0200
From:	Felipe Balbi <balbi@...com>
To:	Fabio Baltieri <fabio.baltieri@...aro.org>
CC:	Felipe Balbi <balbi@...com>,
	Linus Walleij <linus.walleij@...aro.org>,
	<linux-kernel@...r.kernel.org>, <linux-usb@...r.kernel.org>
Subject: Re: [PATCH 3/5] usb: musb: ux500: add otg notifier support

On Thu, Feb 28, 2013 at 11:38:52AM +0100, Fabio Baltieri wrote:
> Add transceiver notifier event handling to the ux500 driver to set vbus
> on specific transceiver events.
> 
> Acked-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Fabio Baltieri <fabio.baltieri@...aro.org>
> ---
>  drivers/usb/musb/ux500.c | 41 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
> index 5b742ba..b20326bb 100644
> --- a/drivers/usb/musb/ux500.c
> +++ b/drivers/usb/musb/ux500.c
> @@ -98,6 +98,36 @@ static void ux500_musb_set_vbus(struct musb *musb, int is_on)
>  		musb_readb(musb->mregs, MUSB_DEVCTL));
>  }
>  
> +static int musb_otg_notifications(struct notifier_block *nb,
> +		unsigned long event, void *unused)
> +{
> +	struct musb *musb = container_of(nb, struct musb, nb);
> +
> +	dev_dbg(musb->controller, "musb_otg_notifications %ld %s\n",
> +			event, otg_state_string(musb->xceiv->state));
> +
> +	switch (event) {
> +	case USB_EVENT_ID:
> +		dev_dbg(musb->controller, "ID GND\n");
> +		ux500_musb_set_vbus(musb, 1);
> +		break;
> +	case USB_EVENT_VBUS:
> +		dev_dbg(musb->controller, "VBUS Connect\n");

are you sure this is correct ? you're not doing anything in case of
vbus event. Shouldn't you make sure your vbus is off ? What if your user
uses a non-standard cable which has id-pin grounded on both sides ?

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ