Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp287814imu; Mon, 5 Nov 2018 00:28:52 -0800 (PST) X-Google-Smtp-Source: AJdET5d3lKmBtrBM0T5rh5tjICkSWEhFo/wePZMg2BU4fFrgG8J6smy7gK8J2uHu4/BkPDoGyQ8s X-Received: by 2002:a17:902:788b:: with SMTP id q11-v6mr21687178pll.54.1541406532269; Mon, 05 Nov 2018 00:28:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541406532; cv=none; d=google.com; s=arc-20160816; b=AeBW9/Kt2g/ROX/ZQ4z3OIZoEB1+9FpJzFKbHvXtHPqZDlm7YPwHrY8gyVIoAzyvnS lckfC8ytNLSVsYiyDjiJsY7pngUJs3zipKSsLt0kCyNW0iuIIvJ3TenK5r6PcljvgINe nfVmpsocBh7JZMOdyx1WFKsAD6RE7fsQIBGk8pSYLtdjj7P3QItjFTYPg1+aOSNZuM5M JZc8N7oBehoZ5cVlW7yVBsLZz6cxldD1MRNUzFLsaulA2YwgCgvAUQxeHlCKGlZdIhZH dqLqo3Vhi0Uvnz9EgHDmOBkpVFH2Ra9pECXw9wGD+RzfjrNWgnK3xBe03UcB6l+38OIn HggQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=vojHCz+jH5amSOSYHyURlU/FeMxvVTTXPwslvB63DGk=; b=NiI+6NReXdkB9yLPpo0h3xgvig5p9gNZ/ZncM+0E7wlLP+CXHYAkrLf2XQvLHaWD2c KuU7dcz4lHpzGiOMzitWrcF2X3kxeDewz8TzDgzWNNpFIcrdnEOsO+v2VeKfeFdNCk1r B9VDpvH1Nwmk5X7dGyTNfNhh+svVSobeJN/l1Zm20SoOxST34Lp32HgFt4UUrLMcNCdm uQxKx9M4I5ZnJCnPH8Y6rcNCbJjWWT33TjjoQQipVoyMOPct16epkV88QWh5GxlzhkbF 7PR8IQnX9TSUP3UYQ4e+2uwjbhSj1K+FxJywoXwVe9vC/9MXvye3A60+S53Hyk1R/seU rAyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=OoOCqvpW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y23-v6si41848453pgh.269.2018.11.05.00.28.36; Mon, 05 Nov 2018 00:28:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=OoOCqvpW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727251AbeKERqn (ORCPT + 99 others); Mon, 5 Nov 2018 12:46:43 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:42850 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbeKERqn (ORCPT ); Mon, 5 Nov 2018 12:46:43 -0500 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id B670E10C1133; Mon, 5 Nov 2018 00:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541406491; bh=fGSYD6WY3JFs7uVqm/DwZOEYeAOhnWE073CGT8RUvrE=; h=From:To:CC:Subject:Date:References:From; b=OoOCqvpWplCMHkOLVtwbsUfmpg8jwVzpcc8OCVOdpNrSVo6A+JhldrI+2Vpmr+30a aHF63bOepDRVlxNP+RQeL4EFSOuQ41e108nkJnhoH1ESauYuMX6xu/OggcEyG3zjHl yz/TQmcTHx+SIpiG95XlItTy7w2ymJuJ0YjKvJB9e71HMm/qJjukN4sjLnfRl3H1Lc jJBPdFhenCrT07IhOt3k91k+aPkc26Qfj1niP83A4ZPnxU5srxsrSsqfjXz6obI2Fn bqOCJ99F1uM2NGwTlY2URQOxQ9xeIMqXAHMIS9w46GLNqWTjSqjDWpcvJN78smblcY MLaPkh4KXraUw== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id 5B70F3799; Mon, 5 Nov 2018 00:28:11 -0800 (PST) Received: from AM04WEHTCB.internal.synopsys.com (10.116.16.192) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 5 Nov 2018 00:28:11 -0800 Received: from AM04WEMBXA.internal.synopsys.com ([fe80::79c3:55f2:1f20:5bf4]) by am04wehtcb.internal.synopsys.com ([::1]) with mapi id 14.03.0415.000; Mon, 5 Nov 2018 12:28:08 +0400 From: Minas Harutyunyan To: John Keeping , Minas Harutyunyan CC: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "arthur.petrosyan@synopsys.com" Subject: Re: [PATCH] usb: dwc2: gadget: fix ISOC frame overflow handling Thread-Topic: [PATCH] usb: dwc2: gadget: fix ISOC frame overflow handling Thread-Index: AQHUatZW7CBOg1jSlEOevZqXY6bG3Q== Date: Mon, 5 Nov 2018 08:28:07 +0000 Message-ID: <410670D7E743164D87FA6160E7907A56013A79E7CE@am04wembxa.internal.synopsys.com> References: <20181023134355.29829-1-john@metanate.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.116.70.150] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John,=0A= =0A= On 10/23/2018 5:43 PM, John Keeping wrote:=0A= > By clearing the overrun flag as soon as the target frame is next=0A= > incremented, we can end up incrementing the target frame more than=0A= > expected in dwc2_gadget_handle_ep_disabled() when the endpoint's=0A= > interval is greater than 1. This happens if the target frame has just=0A= > wrapped at the point when the endpoint is disabled and the frame number= =0A= > has not yet done so.=0A= > =0A= > Instead, wait until the frame number also wraps and then clear the=0A= > overrun flag.=0A= > =0A= > Signed-off-by: John Keeping =0A= > ---=0A= > drivers/usb/dwc2/gadget.c | 2 +-=0A= > 1 file changed, 1 insertion(+), 1 deletion(-)=0A= > =0A= > diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c=0A= > index 2d6d2c8244de..8da2c052dfa1 100644=0A= > --- a/drivers/usb/dwc2/gadget.c=0A= > +++ b/drivers/usb/dwc2/gadget.c=0A= > @@ -117,7 +117,7 @@ static inline void dwc2_gadget_incr_frame_num(struct = dwc2_hsotg_ep *hs_ep)=0A= > if (hs_ep->target_frame > DSTS_SOFFN_LIMIT) {=0A= > hs_ep->frame_overrun =3D true;=0A= > hs_ep->target_frame &=3D DSTS_SOFFN_LIMIT;=0A= > - } else {=0A= > + } else if (hs_ep->parent->frame_number < hs_ep->target_frame) {=0A= > hs_ep->frame_overrun =3D false;=0A= > }=0A= > }=0A= > =0A= Did you tested mentioned by you scenario? If you see issue can you =0A= provide debug log and point the issue line in the log.=0A= =0A= Thanks,=0A= Minas=0A= =0A=