From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755335AbdBQIFb (ORCPT ); Fri, 17 Feb 2017 03:05:31 -0500 Received: from mga01.intel.com ([192.55.52.88]:49638 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408AbdBQIFa (ORCPT ); Fri, 17 Feb 2017 03:05:30 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,171,1484035200"; d="asc'?scan'208";a="65803698" From: Felipe Balbi To: Baolin Wang Cc: Alan Stern , Greg KH , USB , LKML , Linaro Kernel Mailman List , Mark Brown Subject: Re: [PATCH] usb: dwc3: ep0: Fix the possible missed request for handling delay STATUS phase In-Reply-To: References: <87h94q6lai.fsf@linux.intel.com> Date: Fri, 17 Feb 2017 10:04:56 +0200 Message-ID: <87o9y1medz.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; 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 Content-Transfer-Encoding: quoted-printable Hi, Baolin Wang writes: >>> (One possible approach would be to have the setup routine return >>> different values for explicit and implicit status stages -- for >>> example, return 1 if it wants to submit an explicit status request. >>> That wouldn't be very different from the current >>> USB_GADGET_DELAYED_STATUS approach.) >> >> not really, no. The idea was for composite.c and/or functions to support >> both methods (temporarily) and use "gadget->wants_explicit_stages" to >> explicitly queue DATA and STATUS. That would mean that f_mass_storage >> wouldn't have to return DELAYED_STATUS if >> (gadget->wants_explicit_stages). >> >> After all UDCs are converted over and set wants_explicit_stages (which >> should all be done in a single series), then we get rid of the flag and >> the older method of DELAYED_STATUS. > > (Sorry for late reply due to my holiday) > I also met the problem pointed by Alan, from my test, I still want to > need one return value to indicate if it wants to submit an explicit > status request. Think about the Control-IN with a data stage, we can > not get the STATUS phase request from usb_ep_queue() call, and we need why not? wLength tells you that this is a 3-stage transfer. Gadget driver should be able to figure out that it needs to usb_ep_queue() another request for status stage. > to handle this STATUS phase request in dwc3_ep0_xfernotready(). But > Control-OUT will get one 0-length IN request for the status stage from > usb_ep_queue(), so we need one return value from setup routine to no we don't :-) > distinguish these in dwc3_ep0_xfernotready(), or we can not handle > status request correctly. Maybe I missed something else. >> >>> On the other hand, I am very doubtful about requiring explicit setup >>> requests. >> >> right, me too ;-) > > So do you suggest me continue to try to do this? Thanks. explicit setup? no explicit status? yes If you don't wanna do it, it's fine :-) I'll just add to my TODO list. It just depends on how much other tasks you have on your end ;-) =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlimrqgACgkQzL64meEa mQZJPQ/+LEfT/Zy72eoRFp8RT0sp8bj1cR5q9xYy1oOCODvVJClqEGSnlfPbsMxQ Ga1EFB6LHmEnsMpBjHlnkwf8qlF3JmmcjCz9Ro69jzEbgVkK0Cdo7zIKmsRs66Zw ft7zdsYZp/+yKhI7+R9qpKr0L92I9bsA5tXAsGMkWVFpvlNZ6bpg2zvfu14EE7Rl xHzjdOZmGawIm4UQwTkvJWw0CHl/DoxV0UtXQmsVs1pGJ+UnDROgGu7vhmCb/pBY x2tlXQVUzzCQoB3gX0CSVnXUpp/nm3YeZpmnEiU4S8Ky4ZsTLw591KBuA56yitLK d4AmS5wqTka7txKI8iz2zp+CuXsxMk/ZfBUrHSgumxeSaV4UIPbGjPCJCo5E422N FgfDu0sommpnzFg1hjts3IJA/trRXzdxJVwP7ovhXJXkCBgOPm8xJyz2qVgtP8wP uxFbuXb/sJBp1TwbOm+lX17osa6CM2OF/Q4LoNIUf+NRxASHfQd4BOXGxjiFaK3g 3yTN1e6ezG9AJf3Nt2iYrBy1Yc+cwQRtcfVkTe6XKl2kQhZlnS5RZUUcX0YgRIiu OW8ViPdYnq+G5WYzm6kyABMcFZRqJUIsQpQgmRcyfNWiRHf4hczLUVx06O1bajmL Zd6CVXjlb7IiCF0BhnQ02G2qYJ7oTx3vegwZD2GfF4KAuV/Ndd8= =PI+t -----END PGP SIGNATURE----- --=-=-=--