From patchwork Tue Mar 28 16:07:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Kurapati X-Patchwork-Id: 7352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2350216vqo; Tue, 28 Mar 2023 09:32:05 -0700 (PDT) X-Google-Smtp-Source: AKy350aCiAcS8SxFT8+0Ss+kSy0ACjB6DRoJ7yWsD95nIdT/dklYe8K7eCgcApe50EYObVLFBhBU X-Received: by 2002:a17:907:205b:b0:931:cac0:60ec with SMTP id pg27-20020a170907205b00b00931cac060ecmr15393712ejb.48.1680021124873; Tue, 28 Mar 2023 09:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680021124; cv=none; d=google.com; s=arc-20160816; b=RE5mTOBurdl7Haat3kSwx/zI0TaEg0OZgnfsGdIuCxX6Bw5NFI2caGPXJCwW7kBJ0T aZX/i4VwCCRVpzlqs9DnUwm5GuFIfET3yGmOlDvDmYN+7Ts3vuZkbE8RWPcTUiwCx5ar jYEBKV3kmeqAvJjdWNxHpaR8xBJbUWKdfWHiv99LmoX26jIrGjKVw9rXT466U9VpCStH 3neuGzB/1tu0iPP7aq2oGp5HVchxOgqRA/+0jE/NuXCSQnOONaco9IUi78ZVCXjkbz95 flpKI5RaEDiKZeuaF+RYC/d3opm2ri8BjZtmv/vFgGd/lS7Mi+Rh4ZPbnk8g7ER7E4pu LwNg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=4Cd7FiiJO37CbrdHVr5t20E/qKeGVKmXVyF6KG0EpX8=; b=fBCsQnq5epPsEr5OAivGH64H6VOrCwWdU2AydnoUCSl6PY1dXe+7+ewox6qrQrLhp5 qe/U4om8AhxvooJ0ZN2KaXsnctSwKPcjVSwfWWA3+57qynmZpD18e4HXXIEVedrD1eVB KYOkfPljDS1Lat0t+oWCKrvZ9sh3/cwFwC0A75+MVOWKi0ICDWWyrEMfbH3EUn1CXuzG hyQC3KAai/OsSMdyKHiggoM2tjaTmU08PXxULsRIFwwj2N8GeFpwMr3oOLwPye5aBqIb 7HrbMsCbcpgYW/YlWQw5bvA6LPwLCGhunbhzvP8RhOGQJFU6bi6JHHxywQMyOkWdxegL AVqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NXm2unGf; 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 d11-20020aa7c1cb000000b00501d2eb7d0dsi13111120edp.199.2023.03.28.09.31.40; Tue, 28 Mar 2023 09:32:04 -0700 (PDT) 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=NXm2unGf; 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 S232108AbjC1QIa (ORCPT + 99 others); Tue, 28 Mar 2023 12:08:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232220AbjC1QI1 (ORCPT ); Tue, 28 Mar 2023 12:08:27 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46C35CA22; Tue, 28 Mar 2023 09:08:26 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32SBGbDR006581; Tue, 28 Mar 2023 16:08:11 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-transfer-encoding : content-type; s=qcppdkim1; bh=4Cd7FiiJO37CbrdHVr5t20E/qKeGVKmXVyF6KG0EpX8=; b=NXm2unGfOI8lYKgaLuM3OqSq2oPs791IHCeYvyRj4xgXfaXa+ZN/0wr0Zoqhxoi8EST3 RvXAsE4ED+Iio+eRfuzr4Tbw6ZAVB9zZ6dsEWlfsZAJ/4sGf1XPlWmvUnK0lnpKHgIQi sHeBS9FKTZxOq9JszNhcbTMzlC1sIs/1vBS3vUbXfouTdi5rNMohAZo5p2TYVw2/sAF2 kPtMZMrfwXO66b1/8wir9uQbiBD/qR6vbwfUVTkJijIIpz8LzStVNBxROqstJW6Z/ikM NIEW8U3EKAB64TW/2peJe0+7PbKG3rKQFSCYW89KBWEqO6s1x8R6R1/jvIU0vQxTP1wJ 3w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pky700vtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Mar 2023 16:08:11 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32SG8AqH030273 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Mar 2023 16:08:10 GMT Received: from hu-kriskura-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.41; Tue, 28 Mar 2023 09:08:05 -0700 From: Krishna Kurapati To: Thinh Nguyen , Greg Kroah-Hartman , Alan Stern , "Geert Uytterhoeven" , Colin Ian King , Jiantao Zhang , "Rafael J . Wysocki" CC: , , , , , , Krishna Kurapati Subject: [PATCH v2 0/2] Handle core soft reset failure in pullup Date: Tue, 28 Mar 2023 21:37:54 +0530 Message-ID: <20230328160756.30520-1-quic_kriskura@quicinc.com> X-Mailer: git-send-email 2.40.0 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) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: KYZHOfRS-zCUyEVqMpXipDBdacuBbk6u X-Proofpoint-GUID: KYZHOfRS-zCUyEVqMpXipDBdacuBbk6u X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-28_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 suspectscore=0 mlxscore=0 mlxlogscore=858 priorityscore=1501 spamscore=0 phishscore=0 impostorscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303280126 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761629831113919960?= X-GMAIL-MSGID: =?utf-8?q?1761629831113919960?= When core soft reset timeout happens, pullup doesn't check for the return value and proceeds setting up of event buffers and starts the controller. In this scneario, it is observed sometimes that the GEVTADDR LO/HI registers read zero while we are setting the run stop bit and we end up accessing address 0x00 leading to a crash. This series tries to address this issue by handling the timeout and return back appropriate error code to configfs for it to retry enumeration if it chooses to. Link to v1: https://lore.kernel.org/all/20230322092740.28491-1-quic_kriskura@quicinc.com/ changes in v2: Fixed comments addressing incomplete error handling in udc core Krishna Kurapati (2): usb: dwc3: gadget: Bail out in pullup if soft reset timeout happens usb: gadget: udc: Handle gadget_connect failure during bind operation drivers/usb/dwc3/gadget.c | 5 ++++- drivers/usb/gadget/udc/core.c | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-)