From patchwork Thu Apr 15 07:41:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 422151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43C6DC43460 for ; Thu, 15 Apr 2021 07:42:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D2556120E for ; Thu, 15 Apr 2021 07:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231417AbhDOHm1 (ORCPT ); Thu, 15 Apr 2021 03:42:27 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:58970 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhDOHmX (ORCPT ); Thu, 15 Apr 2021 03:42:23 -0400 Received: from mailhost.synopsys.com (sv1-mailhost1.synopsys.com [10.205.2.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id AD717C063D; Thu, 15 Apr 2021 07:42:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618472520; bh=1R3A1+CrXL2wZ1Q7bP7xL0OTwOy7UrbMG7yt4dnK+5U=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=DflxfW+SVm2rDF5T5DZEPN6gRjqlVPsW96v7BSNG5cdmFck42pwih+iAMOH5NqiTV AiKWj930BhyDCGI2plWYZnGmiXcgxsaIVIiGl3AhE8oxIH4SZhR9+THY6rE4K4VlTX TmqnnHCyqp7i+lh2S9oYp4rWjYUGwKCwmOozUEWbzpLvHDJOMZ8K7hENylVAcH5SL1 l1xy4oTOlP046jpSxBkg8D/w1Rrm30vOd1qYCgr3doGLR0yS1nVWAPpf3Ha242ha8C uLLPyrOCTPtWzbl9P+x0kD1mz5bFY06WkWDMo/XFX3ULI8Df6YzjQqdVgx7fSPCFjm XgejWNwVy03Xg== Received: from lab-vbox (unknown [10.205.128.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPSA id 495A7A005F; Thu, 15 Apr 2021 07:41:59 +0000 (UTC) Received: by lab-vbox (sSMTP sendmail emulation); Thu, 15 Apr 2021 00:41:58 -0700 Date: Thu, 15 Apr 2021 00:41:58 -0700 Message-Id: <5d4139ae89d810eb0a2d8577fb096fc88e87bfab.1618472454.git.Thinh.Nguyen@synopsys.com> In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Thinh Nguyen Subject: [PATCH v2] usb: dwc3: gadget: Remove FS bInterval_m1 limitation To: Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: John Youn , Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The programming guide incorrectly stated that the DCFG.bInterval_m1 must be set to 0 when operating in fullspeed. There's no such limitation for all IPs. See DWC_usb3x programming guide section 3.2.2.1. Cc: Fixes: a1679af85b2a ("usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1") Signed-off-by: Thinh Nguyen Acked-by: Felipe Balbi --- Changes in v2: - Noted programming guide section number drivers/usb/dwc3/gadget.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) base-commit: 4b853c236c7b5161a2e444bd8b3c76fe5aa5ddcb diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 6227641f2d31..3609311b24f1 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -608,12 +608,14 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action) u8 bInterval_m1; /* - * Valid range for DEPCFG.bInterval_m1 is from 0 to 13, and it - * must be set to 0 when the controller operates in full-speed. + * Valid range for DEPCFG.bInterval_m1 is from 0 to 13. + * + * NOTE: The programming guide incorrectly stated bInterval_m1 + * must be set to 0 when operating in fullspeed. Internally the + * controller does not have this limitation. See DWC_usb3x + * programming guide section 3.2.2.1. */ bInterval_m1 = min_t(u8, desc->bInterval - 1, 13); - if (dwc->gadget->speed == USB_SPEED_FULL) - bInterval_m1 = 0; if (usb_endpoint_type(desc) == USB_ENDPOINT_XFER_INT && dwc->gadget->speed == USB_SPEED_FULL)