From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756899AbcC2LVh (ORCPT ); Tue, 29 Mar 2016 07:21:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:11569 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbcC2LVf (ORCPT ); Tue, 29 Mar 2016 07:21:35 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,410,1455004800"; d="asc'?scan'208";a="943613150" From: Felipe Balbi To: Dmitry Osipenko , Li Yang , Sergei Shtylyov Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status In-Reply-To: <56FA6411.4070802@gmail.com> References: <1458918681-18879-1-git-send-email-digetx@gmail.com> <87io05shhq.fsf@intel.com> <56FA6411.4070802@gmail.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Tue, 29 Mar 2016 14:19:42 +0300 Message-ID: <87egatsf8x.fsf@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dmitry Osipenko writes: > 29.03.2016 13:31, Felipe Balbi =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> Dmitry Osipenko 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 >>> --- >>> Changelog: >>> V2: "(is_on !=3D 0)" changed to "!!is_on" as per Sergei Shtylyov commen= t, >>> 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 =3D container_of(gadget, struct fsl_udc, gadget); >>> >>> + udc->softconnect =3D !!is_on; >>> + >>> if (!udc->vbus_active) >>> return -EOPNOTSUPP; >>> >>> - udc->softconnect =3D (is_on !=3D 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 diff= erences=20 > to make it work with other hardware and missed that upstream driver enabl= es=20 > controller on resume unconditionally. Sorry for the noise and please igno= re this=20 > patch. you shouldn't send patches unless you have tested them. Simply cherry-picking from another tree and sending it is NOT good enough. You MUST test what you're sending with latest tag from Linus (right now, that's v4.6-rc1). If you can't update your kernel, then don't try to patch something you can't validate. Thanks =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW+mTPAAoJEIaOsuA1yqREhCMP/jyIOD2IK1F9uXDQjFkz9Uqq +zbmlcK+06uXn2k2p2R+AqUky/UmbBdGNEqKzu9nwDPsZTYtk71dyW0jZ4MlWi5H ZDoRgkx3tLm3SRHq3Jo1cP+UcFrZtxWPnd0nFMXn1qeHBok4G/Egu+CkxjpW7tLG DjshZTKU/dAR7SOsz7xEf1RPsZ0bo3497sNsxb+C9sAiGZZgr7CAC+eihh9v61sx u8X3/IlOFWahCpuDH76YhUMzSRf6ffspK2U91rnh/GHgf+FdtwBKyAeNDB6Yqk1R +FRX9an7cFL+1lsIDc/pyd7vZsNNObv24nF5aT0zQRlevwvpcH5D8PaUZwecvT75 RT3q6oFg6J0XA1gXEsKZ0uws4Q5EH4U2C47I3qzdPDwHqK6tfebz1nPEh0Y9WRvV rDSshWFx/uIpzkeS4Vd2S1xdRkDoWM8tNh/kKONxgdfYlFUZU5rMVQ+XNrbdP9/P MipgZKo9j88Zst5g8CcOsgYLLoCLiud/Zs+5sDwfedptr5vru5XsxhQIlyRMyObd MtjOshhvpjYmGOjvS/zzmmse7KafJrKZSWyKruinw8Q0jDKc10ZQ/8IxFskql96r 1eaVydy8YRTf3j8d8uQau6NFF20wO/dtLw/btqf6VKH9Dony5a5GKANOuYFx65W5 6dEUVe8sFA+oIFZOjs7b =IorK -----END PGP SIGNATURE----- --=-=-=--