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:	Tue, 29 Mar 2016 14:16:33 +0300
From:	Dmitry Osipenko <digetx@...il.com>
To:	Felipe Balbi <balbi@...nel.org>, Li Yang <leoli@...escale.com>,
	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status

29.03.2016 13:31, Felipe Balbi пишет:
> Dmitry Osipenko <digetx@...il.com> writes:
>> udc->softconnect should be set regardless of the VBUS state, otherwise
>> the USB peripheral device, connected during suspend, won't be detected
>> since can_pullup() would return false and the UDC won't be enabled.
>>
>> Fixes: 252455c40316 (usb: gadget: fsl driver pullup fix)
>> Signed-off-by: Dmitry Osipenko <digetx@...il.com>
>> ---
>> Changelog:
>> V2: "(is_on != 0)" changed to "!!is_on" as per Sergei Shtylyov comment,
>>      cleaned up commit message.
>>
>>   drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
>> index aab5221..4309b4f 100644
>> --- a/drivers/usb/gadget/udc/fsl_udc_core.c
>> +++ b/drivers/usb/gadget/udc/fsl_udc_core.c
>> @@ -1220,10 +1220,11 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on)
>>
>>   	udc = container_of(gadget, struct fsl_udc, gadget);
>>
>> +	udc->softconnect = !!is_on;
>> +
>>   	if (!udc->vbus_active)
>>   		return -EOPNOTSUPP;
>>
>> -	udc->softconnect = (is_on != 0);
>
> if we're suspended and VBUS was cut off, why would we keep softconnect
> set to true ? That would also cause a discrepancy between SW state and
> HW state.
>
> I don't have this HW to test, but this patch seems wrong to me.
>

Yeah, you are right. I'm using a fork of this driver with some minor differences 
to make it work with other hardware and missed that upstream driver enables 
controller on resume unconditionally. Sorry for the noise and please ignore this 
patch.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ