Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3560309pxb; Mon, 1 Mar 2021 13:21:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWAxsg3h8V7u06w5yU0OajACeiXG5ucuXh0D7cYoTkcDb4IZGhjJmxIfEevfSFkZYO+r69 X-Received: by 2002:aa7:d484:: with SMTP id b4mr10054193edr.63.1614633705918; Mon, 01 Mar 2021 13:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614633705; cv=none; d=google.com; s=arc-20160816; b=dJjhsM+/TJqqPZ0YyoOGuDenzv1UG/bUJ7geBQ34ZWjDygizWaVguvjte4OwVwLxh9 hv8NA+BT8SQ69yZ3uhk0nsyM64DrUUs163ockgaB6xVOe5cQDrWa2zHDjNGGLjKin/O7 WiOYDrnSVPs+xW71Vg8p9gjRHvHF0GRf/3FTtkwKWRPEisfqSR4eQwWcvwFnLKqzy/zG F5/j2NmLvBbgneDbXk2NxUyFB8cVWcQ3gJHKhAinWfGAJ0NELSno+98KjLxuS/RNo7gP zFmd08r6V5rBn0tmpumtAi+Bfe7UlXC508LJTUaceaE7NAK139TxUMEhAPTI4Soxi/Z8 YmLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oJjGqUiSf0q400Hy0O6KfnhMPhoRFr8Ql7YqQPGwgmE=; b=Qy549SFouN22UiJ4gY8VjImJudUWLYvhXp4obr5Ru/Zz4B3m+o7vfDqLscq26WIPuR OO78aCTY6d5ZX3KQNjtrep8k3sTDKP3o8zkHhMNuvreB2XLFMua2WL1zrrgnMwhKhBRj TkvGoXTtItHp5uGKsWl5J9aK4lumsAzN0giMiRmBeXw2IUdWfA1BmRFN/J1X689AYJCd t1AxOpjvRSViHh4ODOZYjfBTbtizapstwhI1RUtf6w5SVz1JBL/yhQvEnfMaT/e3tqzV DO5DxC+DgWln38D8apn7UbPj3cuVGwLKBLxvc/qJLI6HJ3NvDxSb/RIuGoK0/4+VPois kaUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J2zX0jue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si4939772ejy.617.2021.03.01.13.21.23; Mon, 01 Mar 2021 13:21:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J2zX0jue; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244315AbhCAVSz (ORCPT + 99 others); Mon, 1 Mar 2021 16:18:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:49744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231749AbhCAROC (ORCPT ); Mon, 1 Mar 2021 12:14:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B42B065039; Mon, 1 Mar 2021 16:45:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617112; bh=NioMROdtD/YdEvEAapbNjox0VOcloejlSzFGLRjuYBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J2zX0juetmhUdiFB4tvaVHPscivMn1nzDwQ7KEhPii+HUMwubiGbuIVqgTLiWYAMj 5MggHhHBNjJPa3j+ApyQw2plux2Td63SoLO0+cHjoicxl5UGCV7oQk3vEuj9MA0WVU csFkSlmvnODMdorM+p0o23YFsPv0627Q+NJ6tWcI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thinh Nguyen Subject: [PATCH 4.19 189/247] usb: dwc3: gadget: Fix dep->interval for fullspeed interrupt Date: Mon, 1 Mar 2021 17:13:29 +0100 Message-Id: <20210301161040.907365461@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thinh Nguyen commit 4b049f55ed95cd889bcdb3034fd75e1f01852b38 upstream. The dep->interval captures the number of frames/microframes per interval from bInterval. Fullspeed interrupt endpoint bInterval is the number of frames per interval and not 2^(bInterval - 1). So fix it here. This change is only for debugging purpose and should not affect the interrupt endpoint operation. Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Cc: Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/1263b563dedc4ab8b0fb854fba06ce4bc56bd495.1612820995.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -603,8 +603,13 @@ static int dwc3_gadget_set_ep_config(str 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) + dep->interval = desc->bInterval; + else + dep->interval = 1 << (desc->bInterval - 1); + params.param1 |= DWC3_DEPCFG_BINTERVAL_M1(bInterval_m1); - dep->interval = 1 << (desc->bInterval - 1); } return dwc3_send_gadget_ep_cmd(dep, DWC3_DEPCMD_SETEPCONFIG, ¶ms);