From patchwork Fri Jan 21 11:31:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Kondeti X-Patchwork-Id: 12719627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B328CC433F5 for ; Fri, 21 Jan 2022 11:31:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380186AbiAULbj (ORCPT ); Fri, 21 Jan 2022 06:31:39 -0500 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:20548 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238025AbiAULbg (ORCPT ); Fri, 21 Jan 2022 06:31:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1642764696; x=1674300696; h=from:to:cc:subject:date:message-id:mime-version; bh=8ynEde7ZN4GaqmwN0r+qJ24hKQj+FTjzFrSp6QEbks0=; b=dUCJXHVaIRtchAcYsN6EAjW8pXAlTQhgiWuo2uSXIldD47v22c9TQIw/ PTmZ1+mSZeWBHs/ny4EQpCLtos1+N7gFBtAl62TcAUlMGmSnxV6Z6bLDX sXclkVry9rk6dDclJzSZegIQyrgCAKF2lpoepRmyHxEdyOfzqhO+9V9zb M=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 21 Jan 2022 03:31:34 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2022 03:31:34 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Fri, 21 Jan 2022 03:31:34 -0800 Received: from quicinc.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Fri, 21 Jan 2022 03:31:32 -0800 From: Pavankumar Kondeti To: Felipe Balbi , Greg Kroah-Hartman CC: , , "Pavankumar Kondeti" Subject: [PATCH] usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS Date: Fri, 21 Jan 2022 17:01:24 +0530 Message-ID: <1642764684-26060-1-git-send-email-quic_pkondeti@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Currently when gadget enumerates in super speed plus, the isoc endpoint request buffer size is not calculated correctly. Fix this by checking the gadget speed against USB_SPEED_SUPER_PLUS and update the request buffer size. Signed-off-by: Pavankumar Kondeti --- drivers/usb/gadget/function/f_sourcesink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c index 1abf08e..0a423ba 100644 --- a/drivers/usb/gadget/function/f_sourcesink.c +++ b/drivers/usb/gadget/function/f_sourcesink.c @@ -584,6 +584,8 @@ static int source_sink_start_ep(struct f_sourcesink *ss, bool is_in, if (is_iso) { switch (speed) { + case USB_SPEED_SUPER_PLUS: + fallthrough; case USB_SPEED_SUPER: size = ss->isoc_maxpacket * (ss->isoc_mult + 1) *