Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1535412rwr; Wed, 3 May 2023 17:21:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UQu46B8yIGqrx5un5luZfVH2nODiOnukqrBrDyimHAZcOUz57nDZ+imdl05/I2yM43rQ4 X-Received: by 2002:a17:90a:74c1:b0:24b:a5b6:e866 with SMTP id p1-20020a17090a74c100b0024ba5b6e866mr420020pjl.24.1683159718079; Wed, 03 May 2023 17:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683159718; cv=none; d=google.com; s=arc-20160816; b=DmTUQONtz4zU5pSNMrZ2byt0OmlO5nHuBwsPHo8GyLRriHXa8ULddjrGAeMhT8G/In bMIWlXwQ/Njr1nPfNcuqdLlRXga0Qp+kG1nwRCEp3V8EwqlGwSHEMkeeuDx6pFlWk12b kJIGp5W6ogkxuo8lK3PY32CPz5V19kfeagD9dVZjPgxJvqCIUSGqKEyVB9y4tylhMLfX rfW3OQJdqD+bxIix8tMiPCh2//u14sxRcAJPxZHy2ksuxs/25zv/EaPUqlQ68f0ymJmw kHF+9/JIcJNDVrPIlVR8ib4vHLzw3y3d6WrX+8lXXmEdlu0uB34GhVK9gBgjvkhrtLNC v9/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qIk186o9zoU+mH9r76xErzn/99J8aYL+vdhv+aIdc+U=; b=mrlS2FMLRDEr5HwpZL+C3WEn4TBDaZZLUGsY+A07uk4IRPji6VcooEC5w6uN1gYofQ 4XUQkdIMkrCBpmE0kC4uPdQWIMfEoIErjulfWOAmgHWM4lvmf1Clrz9Z7tjPxrqqD+sw TgCSmAkkFGXB5TqZdb9EmpPdnTStTGqAXf474gx0w1jnYBra6q3JI/U9Li+3VRXmSJlH 2yNdnEz1PXm1TXt40PSA9ZvvOahH0u3GfnXAPt/W2jG4juWMNu0jcjnC4t+QoQFqdRw9 Ty8rT/RTyBznGr4gTwQPurEoWddJaMDTQ8gsJF4dwNFwBbFPwDgu3KZquEouUutwsyOc 2Ibw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=SqfLZAXg; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ng14-20020a17090b1a8e00b002471d40b4d0si2868907pjb.106.2023.05.03.17.21.45; Wed, 03 May 2023 17:21:58 -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=@google.com header.s=20221208 header.b=SqfLZAXg; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbjECXw7 (ORCPT + 99 others); Wed, 3 May 2023 19:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjECXw6 (ORCPT ); Wed, 3 May 2023 19:52:58 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FBD69038 for ; Wed, 3 May 2023 16:52:51 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-51fcf5d1e44so5067691a12.3 for ; Wed, 03 May 2023 16:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683157971; x=1685749971; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qIk186o9zoU+mH9r76xErzn/99J8aYL+vdhv+aIdc+U=; b=SqfLZAXg/l88TDO+OsrXZVcZFb6V6f1Q+efyB31p2r9PNxlRc3eTU52bgTZRc+jQYq DuX+kmZM38KFAEPH9tqVJZO7ED+df11RKSSXsKOA3jH5bSUSivfS2TdDkHpb8lj+QI1T 2zyJ9Rn7faPmjPqhhJRmx4PBguV2dpspCQjVS1q1O+lCuyO6DU7mgGKC7vNQaZDEnM9R Nr83bdxfjPEKs/N8AQh+D3B1fWfhMu+SIE/GPBRnmd5xJW9CCMLrkPm16GvfluGgZFOX m5P1g/+3x+4vDYjdZbJfCHgvhNXvWR9TFx82p9z+dULbdSNKWosOnBryG6ekyWTNstTh 4oxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683157971; x=1685749971; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qIk186o9zoU+mH9r76xErzn/99J8aYL+vdhv+aIdc+U=; b=YaSUGawawhCMPsHHsHRzPJc8T2bECVHNvzxowu8x/V3/qbzyoZfxeBqDMuRZo/rA2H HcrjouwhG8+Ng5utSZk3XiW5yPO8jwQCXR2K1C2AYDNhC1HtgsEryGHzpKXNAHkYpNiG SppvUpzTzlwEEdhbCOQ7+7pnUNlIwn8Hgi7iLB767C3JLnjs5/lTBhh7+kbFOuep+gnD UXWRwcZfokqBFGaHJMiYaXycfG8doncYtJMrXEF/G0qXa04UFyLdP7hBeRxb3pjkZfmn TklhwLRZul7kWr8pFIhCmcywMOfaEY1ayINjErBHDk9Q+CFkDqEnbfrW4xbdckEYVOdK Z2Ag== X-Gm-Message-State: AC+VfDz/ED0BOExuiVmX1h/E7zR6xmKaF3mH1JtGegg7Yml4YEmgC1i6 u3Y+v6C/OvcCXvdLBOr2B3pFKiy1JBlrIWSPtJCYcg== X-Received: by 2002:a17:90a:883:b0:24e:20df:e74d with SMTP id v3-20020a17090a088300b0024e20dfe74dmr334855pjc.18.1683157970566; Wed, 03 May 2023 16:52:50 -0700 (PDT) MIME-Version: 1.0 References: <20230503003144.3782774-1-royluo@google.com> <20230503230053.mbhh6p2h4qakfc65@synopsys.com> In-Reply-To: <20230503230053.mbhh6p2h4qakfc65@synopsys.com> From: Roy Luo Date: Wed, 3 May 2023 16:52:14 -0700 Message-ID: Subject: Re: [PATCH v1] usb: dwc3: Add error logs for unknown endpoint events To: Thinh Nguyen Cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "badhri@google.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 3, 2023 at 4:01=E2=80=AFPM Thinh Nguyen wrote: > > On Wed, May 03, 2023, Roy Luo wrote: > > In cases where the controller somehow fails to write to event buffer > > memory (e.g. due to incorrect MMU config), the driver would receive > > all-zero dwc3 events. However, the abnormal event is silently dropped > > as a regular ep0out event. > > When it does happen, will these prints flood the dmesg log? When this does happen, the driver cannot do the required actions to move things forward in correspondence to the HW events (e.g. Xfercomplete, reset, connection done, etc.). Therefore, the controller might throw some events in the beginning but it would cease quickly until the host does a new move that triggers the controller to send new events. > > > Add error logs when an unknown endpoint event is received to highlight > > the anamoly. > > anomaly? Thanks for catching this typo, will fix it in the next patchset. > > > > > Signed-off-by: Roy Luo > > --- > > drivers/usb/dwc3/ep0.c | 2 ++ > > drivers/usb/dwc3/gadget.c | 2 ++ > > 2 files changed, 4 insertions(+) > > > > diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c > > index 953b752a5052..8c9560a9999e 100644 > > --- a/drivers/usb/dwc3/ep0.c > > +++ b/drivers/usb/dwc3/ep0.c > > @@ -1207,5 +1207,7 @@ void dwc3_ep0_interrupt(struct dwc3 *dwc, > > dep->flags &=3D ~DWC3_EP_TRANSFER_STARTED; > > } > > break; > > + default: > > + dev_err(dwc->dev, "unknown endpoint event %d\n", event->e= ndpoint_event); > > Can we add a break here? Sure ,will do it in the next patchset. > > > } > > } > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index c0ca4d12f95d..054f6f297e17 100644 > > --- a/drivers/usb/dwc3/gadget.c > > +++ b/drivers/usb/dwc3/gadget.c > > @@ -3803,6 +3803,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *= dwc, > > break; > > case DWC3_DEPEVT_RXTXFIFOEVT: > > break; > > + default: > > + dev_err(dwc->dev, "unknown endpoint event %d\n", event->e= ndpoint_event); > > and here too. Sure ,will do. > > > } > > } > > > > > > base-commit: c8c655c34e33544aec9d64b660872ab33c29b5f1 > > -- > > 2.40.1.495.gc816e09b53d-goog > > > > Thanks, > Thinh Regards, Roy Luo