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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <797f2a4344754765a968250ef26f2b53@BN1PR03MB251.namprd03.prod.outlook.com>
Date:	Fri, 14 Mar 2014 20:53:24 +0000
From:	"suresh.gupta@...escale.com" <suresh.gupta@...escale.com>
To:	"balbi@...com" <balbi@...com>
CC:	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Stefani Seibold" <stefani@...bold.net>
Subject: RE: [PATCH] USB: Gadget: fsl driver pullup fix

Hi,

-----Original Message-----
From: Felipe Balbi [mailto:balbi@...com] 
Sent: Thursday, March 13, 2014 8:55 PM
To: Gupta Suresh-B42813
Cc: balbi@...com; gregkh@...uxfoundation.org; linux-usb@...r.kernel.org; linux-kernel@...r.kernel.org; Stefani Seibold
Subject: Re: [PATCH] USB: Gadget: fsl driver pullup fix

Hi,

On Thu, Mar 13, 2014 at 06:40:55PM +0530, Suresh Gupta wrote:
> Attached is a small fix for the fsl usb gadget driver. This fix the 
> driver in a way that the usb device will be only "pulled up" on 
> requests like other usb gadget drivers do.
> This is necessary, because the device information is not always 
> available until an application is up and running which provides this 
> datas.
> 
> Signed-off-by: Stefani Seibold <stefani@...bold.net>
> Signed-off-by: Suresh Gupta <suresh.gupta@...escale.com>
> ---
>  drivers/usb/gadget/fsl_udc_core.c | 38 
> +++++++++++++++++++++-----------------
>  1 file changed, 21 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/usb/gadget/fsl_udc_core.c 
> b/drivers/usb/gadget/fsl_udc_core.c
> index 35cb972..9a93727 100644
> --- a/drivers/usb/gadget/fsl_udc_core.c
> +++ b/drivers/usb/gadget/fsl_udc_core.c
> @@ -153,6 +153,21 @@ static inline void fsl_set_accessors(struct 
> fsl_usb2_platform_data *pdata) {}
>  /********************************************************************
>   *	Internal Used Function
>  ********************************************************************/
> +static int can_pullup(struct fsl_udc *udc) {
> +	return udc->driver && udc->softconnect && udc->vbus_active; }
> +
> +static void set_pullup(struct fsl_udc *udc) {
> +	if (can_pullup(udc))
> +		fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
> +				&dr_regs->usbcmd);
> +	else
> +		fsl_writel((fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP),
> +				&dr_regs->usbcmd);
> +}

why is this a "fix", you just re-factored some code into set_pullup().
[SuresH] I set udc->vbus_active and udc->softconnect to default value 
of 1 in struct_udc_setup. This was actual fix in this patch.
The can_pullup function return false when these values was not set 
and intern the code return without enabling the pullup and gadget controller stops. 

--
Thanks
SuresH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ