Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1891666rwp; Thu, 13 Jul 2023 19:21:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlG5kv68jvjmU8GGkuK8f21Ba1BY1fxyy91z3hezQaQJ3GxkeN/t4hoIFALv9RhfjDLaCM1j X-Received: by 2002:a17:902:c410:b0:1b9:ce7a:88b4 with SMTP id k16-20020a170902c41000b001b9ce7a88b4mr3264146plk.42.1689301305308; Thu, 13 Jul 2023 19:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689301305; cv=none; d=google.com; s=arc-20160816; b=jLVP60pV+dQogYxkW/r18K7BaobiZ1vwm1H8FHex5cbybaIctwjQeHulPi47QwgTgv mtCc2JmDco6HMQhajvLeZXNbNZptB2yV6d6v4vYgZpHasvpsgSheMpvd6r8aMpNNIfEg 1dRvqqDTO/bkVact5SLC0/Ay9PtVZV9PARFkf4DBqDUUdtSzZ5bG1L/IggaHI3TEbEWN O4p2llVhJ8usDaUhhra++HZ7jbGkNdloa7NTuXQA6osr0MpOyJYZXKEQu8yDTzcBak0P g+954i+TCP4paQubns9EC/ekC7ZsGgVUw7fFMHSaVvhd5dfYV2q2chzzPFLdEJF+9D5x df7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ywwik5JTYSSQWmwwoEXR8KAniLDdDjbNJWMXaI6FsZw=; fh=iCaW+ptQ0+QCFCRp3w5nDn2GMn0r6KUIVfNjGGg16Gs=; b=gunqvx0mjX8hwkD4StdXPkG0luzvKbT5soryAwkgn0GCdEz7dgJd/awS1tq6dNOGSz Mhie9CVCUN02t/huHJx0xy9CWSv6iw+Dk0L2B2iKh0PH+iUJNhUrxHJ9N9pBM38Vxi5Q U6p+1N+Yc7lYClGhE70ItX06EKbOC9Z7BHT0S9DTGLfoW3ZITBcrMNpTJy1Eo6VKOQaK EZi3z8Avvi2cyCTZvlfpBCTM1+EGVcGHMotB/becql/DevzsUYfM884PTdh2egiyscmD CNCmukBdg8TEe+5hxqMdxX9HXsYVIZCAdsIaRM1GkM3L1gQk/3gWynJN415nktmSIa/E bMww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cDH6ud/g"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020a170902a38900b001b85ab48092si6323925pla.499.2023.07.13.19.21.30; Thu, 13 Jul 2023 19:21:45 -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=@kernel.org header.s=k20201202 header.b="cDH6ud/g"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233139AbjGNCOt (ORCPT + 99 others); Thu, 13 Jul 2023 22:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232126AbjGNCOs (ORCPT ); Thu, 13 Jul 2023 22:14:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C987826BA; Thu, 13 Jul 2023 19:14:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5E7EB61BB2; Fri, 14 Jul 2023 02:14:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FBB8C433C9; Fri, 14 Jul 2023 02:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689300886; bh=8Su4tH7Uf2tt1RV6zTUILrzWkPBhK4BHT0mVRJAQcJI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cDH6ud/gSUOK41K3v0rFH4a4fpC3iav2I462ewa6HLKUipoWl6sNi6NeIC5hPGEcC 3WQPgXaVDYviIstLnH8GMndaqXNF6TZWul5EI+lR+vqJgIGaozHLTsDU3rBTGIpVDy PES2rpu90YlQVKMey+lnkvp0SvaXGBvP9iz1Bp46qQzTbnsskxu/RU2SMzDTqVjs1I djw2U01J2xKK8O21bCJKhlWym4anrGlYbe7Irm+KW3sGyVKjm0iS7hJjU5w0bMBP9x S80E5a9XZbxCMChvU/LwhII/kkr7Wj9cFGAzDQFSLhHkN2Evx12cXUjMYQGhLh2GK7 3AFYBgrGal4vw== Date: Fri, 14 Jul 2023 10:14:36 +0800 From: Peter Chen To: Pawel Laszczak Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] usb: cdnsp: Fixes issue with dequeuing not queued requests Message-ID: <20230714021436.GA2520702@nchen-desktop> References: <20230713081429.326660-1-pawell@cadence.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230713081429.326660-1-pawell@cadence.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 23-07-13 04:14:29, Pawel Laszczak wrote: > Gadget ACM while unloading module try to dequeue not queued usb > request which causes the kernel to crash. > Patch adds extra condition to check whether usb request is processed > by CDNSP driver. > Why ACM does that? > cc: > Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") > Signed-off-by: Pawel Laszczak > --- > drivers/usb/cdns3/cdnsp-gadget.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c > index fff9ec9c391f..3a30c2af0c00 100644 > --- a/drivers/usb/cdns3/cdnsp-gadget.c > +++ b/drivers/usb/cdns3/cdnsp-gadget.c > @@ -1125,6 +1125,9 @@ static int cdnsp_gadget_ep_dequeue(struct usb_ep *ep, > unsigned long flags; > int ret; > > + if (request->status != -EINPROGRESS) > + return 0; > + Why not you use pending list which used at cdnsp_ep_enqueue to do this? > if (!pep->endpoint.desc) { > dev_err(pdev->dev, > "%s: can't dequeue to disabled endpoint\n", > -- > 2.37.2 > -- Thanks, Peter Chen