Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp4544412rwp; Sun, 16 Jul 2023 05:51:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlHV8NjLB9W1+TDEx7a1eJMJrkc4AhrPrxX//2tkdGhLb+EO1x9V/gCasAY8Z8ih0oVlPz+P X-Received: by 2002:a17:902:d488:b0:1b5:ccd:af69 with SMTP id c8-20020a170902d48800b001b50ccdaf69mr8310133plg.69.1689511914283; Sun, 16 Jul 2023 05:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689511914; cv=none; d=google.com; s=arc-20160816; b=j7fDvQfMWYnfFwLsgEhNoyXEfU18uWWDrj7SJp2W59MQxgRjrQCM3rTvjhHsgVpw+D t7y/VIcXN3mw+5hsos8ChxLy9dWml1SS/Z1FcqSnqdih5IsqBuWriKULjYfyS5e2GMpx vOiRmPa8gW93RGxDKeZc7UlAtFlnzV6FnPcBcDns2UxClU/eHXV0dF1petjcS+jprkZJ s01yDO2elh1ynfYr0OUS54xTy1V1BSGKFGY0a8BQ+IkjIxeTODZqBN5JJA2uLU6WcapZ 1VyX6jxDTqmOscaF3/iJGnqfbPqR2IpopOamPUF+CoVqsGbnAIUTBMc1RkxhyRjYcE8w czdw== 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=se9yW8PHjURd6py3s3NnA2H4A8p+/ZeQiUo09AMjMrM=; fh=iv2K9cVtn+39giV5lJqGPfs3aLATGf+a7NH496NTqzM=; b=ru3YGOiJXwzwk6OvhoTisS/pv8FuTc5MzX6jDBjDg8SFjmm5K63CowVmeQ4o8GNNH3 u4zuH1XQ37sktqBihm1Q919uymOz5zgY5SqOvfryVxWZpAvwtVfobiDxLnV1pqB7LAEu +Tao5LH+7VMVQ3WvODCC3YQtUL0osWdAjjh+8hhByqnqTjiuIb41CDSKf1t4bdYKGrkw RtffZyDd2kXGCtdaBg4U45N02a4W/GCuScqIxHoWLfGuycADE0HMQpiKseS1Q0WP5BZb 2+XjWKDYTmZA1/IO82m12/jYI3XeqLXwkpDamvIhxxKbetiIFWD4RbfYm0A+FEecdDVO 750g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wq7e4dOK; 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 i3-20020a1709026ac300b001b89462881fsi3871665plt.561.2023.07.16.05.51.35; Sun, 16 Jul 2023 05:51:54 -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=Wq7e4dOK; 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 S229830AbjGPLzl (ORCPT + 99 others); Sun, 16 Jul 2023 07:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjGPLzk (ORCPT ); Sun, 16 Jul 2023 07:55:40 -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 29667132; Sun, 16 Jul 2023 04:55:40 -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 A281360C86; Sun, 16 Jul 2023 11:55:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EEC1C433C8; Sun, 16 Jul 2023 11:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689508539; bh=onrgGfezSZ78zkV6GkuuBBoVKrb8pSR1afTXmN0TJ3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wq7e4dOKQ1LcuxmWoNyPCsvQflML6pA4/VU59zX8ym43ANJ17t05MnRSQ7n781RtP BVv2eDLXgawyPls2svjRIYW+P4pew4FS8awr5bx/CnxbNCBU2JmIOIH2IoqmIgHhEL r69RSoNlJbTX6dkVENM9muWYcNfhBSGNvMIDsEPNqAZujn6T9mJjINb5wTzScj150m w73ZxpISQWmINZQWHfVVv6nF4Qd/an/am/fNET0y3iquk5iftZhj6J71IndMmWfD84 8CFsPGBzjV6ZbkN+iLy8Su5996kyd/9Ve4XdlNUxgn6euUOTSCTGdTMSb+qfpNnCAm av670DaEcsNOA== Date: Sun, 16 Jul 2023 19:55:29 +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: <20230716115529.GA2529084@nchen-desktop> References: <20230713081429.326660-1-pawell@cadence.com> <20230714021436.GA2520702@nchen-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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-14 07:19:21, Pawel Laszczak wrote: > > > >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? Would you please explain which situation triggers it? > > > >> 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? > > It's just simpler and faster way - no other reasons. Okay, get it. -- Thanks, Peter Chen