Message ID | 1674559787-25928-1-git-send-email-quic_prashk@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2095385wrn; Tue, 24 Jan 2023 03:30:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdD665tZq7LxzcOmB/WtCWpDJaakfJjDp53avBEeZariH30vkckjS9bGd7Z4LckCpKvEmJ X-Received: by 2002:a17:906:57cf:b0:841:e5b3:c95f with SMTP id u15-20020a17090657cf00b00841e5b3c95fmr28224689ejr.29.1674559858396; Tue, 24 Jan 2023 03:30:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674559858; cv=none; d=google.com; s=arc-20160816; b=Fm2O/imZGQjUJTgZJ0r53qxc5WgDzuxA4R6mbGf5PKKGFyEw7jUba1JzMRXf+r9l7F 0lJ2Jfc13yaWDSw8m3PlukGCHNQ9V62nh9JNR59ktKBzlr3Gmz+DT1rxlewQsco/Wd02 RJMHVXN7dOjZWSS6aKQ3Yqu1h2l6L1khkQlftlyrdwyAIZlc5lUdrQC6O1b/A5k/JV58 FVt/XD1mH6DFJgngIjzhiWlYa5S96JbunYiEflTbz+K5Kasmue4wDWaj9xRCUU5lSCPh jlp5RDfDIT88CLBIkl75yHZi5VALsXnC5ijijI3e9zcv/XHqXtjIN7eCa8+MCHQhvWMK 3Xiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=AMUWpUodEbI7H+vRL55ybyyirAI/GVv4RRP8XFfQNHQ=; b=WVVusvyy8VL0o4lXPuHq++anIXjdVp+zzadi2IJgfTgqcgTPktc1o4xJlGXLrn80O9 tvHETgjQkQlelGjmo1GpxnBHTQ5ZBS3EuBsvjVjdimv5YVFia4t1n3fbQ8+dIx8V+P2m ZaK3a7MqZ2mU8EDA46KhH5sENEoFl/pqx/RocbrFHue2ijMQuGY0UL15BJ/LaGjisYS5 dedoRyaTzZFiNt5Gag1y6FsX+YWyXuKtNFOx9vyjH0YE8U3c7OrXEuf2RVFk0SR2sPXa H3YLdXAqC7XdlAbrM3pJt5ZzgMudYOcHdGemQ+FhknxLZJdGopCLLJuB0iFdGn6G0OrP kQPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XfbVPvEJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a17090791d100b007cb0cf0b18asi1955538ejz.743.2023.01.24.03.30.33; Tue, 24 Jan 2023 03:30:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XfbVPvEJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233633AbjAXLaZ (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Tue, 24 Jan 2023 06:30:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234014AbjAXLaW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 24 Jan 2023 06:30:22 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAE06F772; Tue, 24 Jan 2023 03:30:21 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30OAr4qX020739; Tue, 24 Jan 2023 11:30:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=AMUWpUodEbI7H+vRL55ybyyirAI/GVv4RRP8XFfQNHQ=; b=XfbVPvEJUNzvNsZS7kr9eVA6F3SWzQew3HKi8MVzVcK+MkkOCUZDsFihO1sZfe7j8WaQ 981ZdFcEzaLeAtHPos64hblk1w+TAsP5lLD0ZNzJEv/72ZZ73n57PGGSDqMv0fky3nW1 SfdOavbrEGiGOAcdmV9B0jwqajhN/LWwODnwiRFiUTVpLXwvXgkATzhvvhRW6CWxLaTZ JvVTs6NGRdpdDuuGDIw/6stGz6fsAVGfGdcRcLkKS3rFGx7X0mVCp4n+WphTl87/NH7s PxMd5gwTPxfyyRGtQzcs/96ZmA7BwshdDYdU0oEhgJvKUJEIAY2VoBjuCZWPS8hTdK4h UQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3n89fm4yn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Jan 2023 11:30:11 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30OBUAZ1010536 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Jan 2023 11:30:10 GMT Received: from hu-prashk-hyd.qualcomm.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.986.36; Tue, 24 Jan 2023 03:30:07 -0800 From: Prashanth K <quic_prashk@quicinc.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Pavel Hofman <pavel.hofman@ivitera.com>, Joe Perches <joe@perches.com>, Julian Scheel <julian@jusst.de>, Colin Ian King <colin.i.king@gmail.com> CC: Pratham Pratap <quic_ppratap@quicinc.com>, Jack Pham <quic_jackp@quicinc.com>, <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Prashanth K <quic_prashk@quicinc.com> Subject: [v2] usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints Date: Tue, 24 Jan 2023 16:59:47 +0530 Message-ID: <1674559787-25928-1-git-send-email-quic_prashk@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 2kLLFk5h5QQ0B_xMBYm2jiEC3UfUVzuh X-Proofpoint-GUID: 2kLLFk5h5QQ0B_xMBYm2jiEC3UfUVzuh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-23_12,2023-01-24_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1011 malwarescore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=626 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301240105 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755903278325618055?= X-GMAIL-MSGID: =?utf-8?q?1755903278325618055?= |
Series |
[v2] usb: gadget: f_uac2: Fix incorrect increment of bNumEndpoints
|
|
Commit Message
Prashanth K
Jan. 24, 2023, 11:29 a.m. UTC
Currently connect/disconnect of USB cable calls afunc_bind and eventually increments the bNumEndpoints. Performing multiple plugin/plugout will increment bNumEndpoints incorrectly, and on the next plug-in it leads to invalid configuration of descriptor and hence enumeration fails. Fix this by resetting the value of bNumEndpoints to 1 on every afunc_bind call. Fixes: 40c73b30546e ("usb: gadget: f_uac2: add adaptive sync support for capture") Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com> Signed-off-by: Prashanth K <quic_prashk@quicinc.com> --- drivers/usb/gadget/function/f_uac2.c | 1 + 1 file changed, 1 insertion(+)
Comments
On Tue, Jan 24, 2023 at 04:59:47PM +0530, Prashanth K wrote: > Currently connect/disconnect of USB cable calls afunc_bind and > eventually increments the bNumEndpoints. Performing multiple > plugin/plugout will increment bNumEndpoints incorrectly, and on > the next plug-in it leads to invalid configuration of descriptor > and hence enumeration fails. > > Fix this by resetting the value of bNumEndpoints to 1 on every > afunc_bind call. > > Fixes: 40c73b30546e ("usb: gadget: f_uac2: add adaptive sync support for capture") > Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com> > Signed-off-by: Prashanth K <quic_prashk@quicinc.com> > --- > drivers/usb/gadget/function/f_uac2.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c > index 08726e4..0219cd7 100644 > --- a/drivers/usb/gadget/function/f_uac2.c > +++ b/drivers/usb/gadget/function/f_uac2.c > @@ -1142,6 +1142,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) > } > std_as_out_if0_desc.bInterfaceNumber = ret; > std_as_out_if1_desc.bInterfaceNumber = ret; > + std_as_out_if1_desc.bNumEndpoints = 1; > uac2->as_out_intf = ret; > uac2->as_out_alt = 0; > > -- > 2.7.4 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 08726e4..0219cd7 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -1142,6 +1142,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) } std_as_out_if0_desc.bInterfaceNumber = ret; std_as_out_if1_desc.bInterfaceNumber = ret; + std_as_out_if1_desc.bNumEndpoints = 1; uac2->as_out_intf = ret; uac2->as_out_alt = 0;