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]
Message-ID: <5625DA7E.8000601@mentor.com>
Date:	Tue, 20 Oct 2015 15:09:02 +0900
From:	Jiada Wang <jiada_wang@...tor.com>
To:	Peter Chen <peter.chen@...escale.com>
CC:	<gregkh@...uxfoundation.org>, <linux-usb@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: chipidea: udc: clear vbus_active flag in udc_stop

Hi

On 10/20/2015 03:01 PM, Peter Chen wrote:
> On Tue, Oct 20, 2015 at 11:29:18AM +0900, Jiada Wang wrote:
>> Currently in udc_stop, if vbus_active flag is true, all USB activities
>> will be stopped, but vbus_active flag is still left to be true,
>> this causes issue, when afterwards driver tries to connect gadget
>> device to host, But due to the uncleared vbus_active, some necessary
>> setup steps are skipped.
>>
>> This patch clears vbus_active flag in udc_stop callback.
>>
>> Signed-off-by: Jiada Wang <jiada_wang@...tor.com>
>> ---
>>   drivers/usb/chipidea/udc.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
>> index 8223fe7..b9ac228 100644
>> --- a/drivers/usb/chipidea/udc.c
>> +++ b/drivers/usb/chipidea/udc.c
>> @@ -1762,6 +1762,7 @@ static int ci_udc_stop(struct usb_gadget *gadget)
>>   	spin_lock_irqsave(&ci->lock, flags);
>>
>>   	if (ci->vbus_active) {
>> +		ci->vbus_active = 0;
>>   		hw_device_state(ci, 0);
>>   		if (ci->platdata->notify_event)
>>   			ci->platdata->notify_event(ci,
>> --
>> 2.4.5
>>
>
> This flag will be handled by vbus interrupt, would you please explain
> more what problem you have met?
the actual issue I had is,
build kernel with USB_OTG_FSM enabled,
keep usb cable plugged,
load/unload USB gadget module (for example I tried g_zero or g_serial),
after unload gadget module once, then the status of vbus_active is not
correct,
this causes host machine failed to detect gadget device when later
gadget device module is loaded again.


Thanks,
Jiada
>
--
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