public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Felipe Balbi <balbi@kernel.org>, Li Yang <leoli@freescale.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status
Date: Tue, 29 Mar 2016 14:16:33 +0300	[thread overview]
Message-ID: <56FA6411.4070802@gmail.com> (raw)
In-Reply-To: <87io05shhq.fsf@intel.com>

29.03.2016 13:31, Felipe Balbi пишет:
> Dmitry Osipenko <digetx@gmail.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@gmail.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

  reply	other threads:[~2016-03-29 11:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 15:11 [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status Dmitry Osipenko
2016-03-29 10:31 ` Felipe Balbi
2016-03-29 11:16   ` Dmitry Osipenko [this message]
2016-03-29 11:19     ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56FA6411.4070802@gmail.com \
    --to=digetx@gmail.com \
    --cc=balbi@kernel.org \
    --cc=leoli@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox