Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp841501rdh; Thu, 26 Oct 2023 18:31:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHO45Fksoz4vw8E05+ckjGvgFM4c4lFasySPWR3XhiiloiTTaIZbvr1H2iFzJFNKahYd6qw X-Received: by 2002:a25:c541:0:b0:d9a:5ff4:cfde with SMTP id v62-20020a25c541000000b00d9a5ff4cfdemr1118076ybe.13.1698370281084; Thu, 26 Oct 2023 18:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698370281; cv=none; d=google.com; s=arc-20160816; b=s1WkCuCoUOeT7wlXhOgG6yC4zPojSGmv7Xvho8mOuiHnrNP3rQkUUqw5dAXGaJOkGV xYxNc96ELdjGtBYbKp6YWMAFzn7283/AyJJIUq9wgC4F63oPmonD10R64jKEKlMtp/rG ZdxevN86QQgNKeBa38EizqtUEdCTWepz0F2AiImAOhrZPS3BwwWSpC+2bCXJwpRUH0KV L3Wnz90l1AyImVXZBg/07J0lMIwjQrs0YocMxsq0bik47bzedUqEIkR2iUnQnGw1Fv7f Dt/XOIbdfwk9gzbhC+YTaJNmuD8TXayD8pRYHV/FdW+ZnQGGmfAUHnOlxUFToz7pLQyv 1YrA== 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=arYff/SCra0xkf8HiflfVw1XVW/wydYzYNvsdlbBYek=; fh=BBizdbLfo9qmYLXJevJwvpl5lRX6XVuX6Y7KtQpxapo=; b=mOUqNHwbPh2loQdlDI+WPFwEy0Vr0KCtx4hLLIfMZjlVLBrq4F/2NWlS2yK0q3BVQn gJN2F7i1nW3j0KoQdbiIHd7AN84tZ1hPPeVXXh2JheW/Q7yH6usghD2fRSP8/d7NH6A7 55d4PVGso2dh46JAMh58H00p4n0dQ0P4R1M1VywaF+uNannG3KGChKKNPPvSVPxoIe8U cldX/S2KG/8KisVKQoBYnd3vAfngQadzXm3IPieBxxEHR4X46GK4dypKYSaChKhHCcmw yXj7rju5Lbo9SZdKc29wYH6vI1ZW1ITmIYa9+xL3hggJcGpVtnfhJb/zU3r6fMbb0qMS zv6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wj4A3uMG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id s125-20020a257783000000b00d9a6b5c9f37si1341377ybc.262.2023.10.26.18.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 18:31:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wj4A3uMG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3F563837E99C; Thu, 26 Oct 2023 18:30:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231431AbjJ0BaP (ORCPT + 99 others); Thu, 26 Oct 2023 21:30:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjJ0BaO (ORCPT ); Thu, 26 Oct 2023 21:30:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 879AD1B6 for ; Thu, 26 Oct 2023 18:30:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0828C433C8; Fri, 27 Oct 2023 01:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698370211; bh=YOWD4N121xIJhA9vwpTTpOpv0xx0mse7znzmlAJoBog=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wj4A3uMGS3yFDPXYQ8aIxkhnakLmR0yyl6SHkfJlU+TNpqqH8xLB6Ub9zwuAZQsFg zkVYmO/TxqN8r2sYYe7tSJalSIE3/9g2PrUaKvMKX7mNw5PPew2rr6orVBaDLFXrla kG91GUJVBpf+wpGxcDl6LPa5N3xDbX3uj+T8ayKYzQMCF566Q8CdkStqx0Q7CXYx0B iKjue9Azn2JUy0EUdUGiSujP8TgxFkOzbgoOoRXWi10N//0f8v2zQQoi68NIXVdVPX /vPXm3/mj7Imz9k4Q2DQ5eHlWmYyPdpYMOXy6wnhF1LyqpduzPU9pZUGdx5SGI6P5x sPdI21GPo96FQ== Date: Fri, 27 Oct 2023 09:30:01 +0800 From: Peter Chen To: Pawel Laszczak Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb:cdnsp: remove TRB_FLUSH_ENDPOINT command Message-ID: <20231027013001.GA1669606@nchen-desktop> References: <20231026073737.165450-1-pawell@cadence.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231026073737.165450-1-pawell@cadence.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 18:30:56 -0700 (PDT) On 23-10-26 09:37:37, Pawel Laszczak wrote: > Patch removes TRB_FLUSH_ENDPOINT command from driver. > This command is not supported by controller and > USBSSP returns TRB Error completion code for it. > > Signed-off-by: Pawel Laszczak Acked-by: Peter Chen Peter > --- > drivers/usb/cdns3/cdnsp-debug.h | 3 --- > drivers/usb/cdns3/cdnsp-gadget.c | 6 +----- > drivers/usb/cdns3/cdnsp-gadget.h | 5 ----- > drivers/usb/cdns3/cdnsp-ring.c | 24 ------------------------ > 4 files changed, 1 insertion(+), 37 deletions(-) > > diff --git a/drivers/usb/cdns3/cdnsp-debug.h b/drivers/usb/cdns3/cdnsp-debug.h > index f0ca865cce2a..ad617b7455b9 100644 > --- a/drivers/usb/cdns3/cdnsp-debug.h > +++ b/drivers/usb/cdns3/cdnsp-debug.h > @@ -131,8 +131,6 @@ static inline const char *cdnsp_trb_type_string(u8 type) > return "Endpoint Not ready"; > case TRB_HALT_ENDPOINT: > return "Halt Endpoint"; > - case TRB_FLUSH_ENDPOINT: > - return "FLush Endpoint"; > default: > return "UNKNOWN"; > } > @@ -328,7 +326,6 @@ static inline const char *cdnsp_decode_trb(char *str, size_t size, u32 field0, > break; > case TRB_RESET_EP: > case TRB_HALT_ENDPOINT: > - case TRB_FLUSH_ENDPOINT: > ret = snprintf(str, size, > "%s: ep%d%s(%d) ctx %08x%08x slot %ld flags %c", > cdnsp_trb_type_string(type), > diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c > index 4b67749edb99..4a3f0f958256 100644 > --- a/drivers/usb/cdns3/cdnsp-gadget.c > +++ b/drivers/usb/cdns3/cdnsp-gadget.c > @@ -1024,10 +1024,8 @@ static int cdnsp_gadget_ep_disable(struct usb_ep *ep) > pep->ep_state |= EP_DIS_IN_RROGRESS; > > /* Endpoint was unconfigured by Reset Device command. */ > - if (!(pep->ep_state & EP_UNCONFIGURED)) { > + if (!(pep->ep_state & EP_UNCONFIGURED)) > cdnsp_cmd_stop_ep(pdev, pep); > - cdnsp_cmd_flush_ep(pdev, pep); > - } > > /* Remove all queued USB requests. */ > while (!list_empty(&pep->pending_list)) { > @@ -1424,8 +1422,6 @@ static void cdnsp_stop(struct cdnsp_device *pdev) > { > u32 temp; > > - cdnsp_cmd_flush_ep(pdev, &pdev->eps[0]); > - > /* Remove internally queued request for ep0. */ > if (!list_empty(&pdev->eps[0].pending_list)) { > struct cdnsp_request *req; > diff --git a/drivers/usb/cdns3/cdnsp-gadget.h b/drivers/usb/cdns3/cdnsp-gadget.h > index e1b5801fdddf..dbee6f085277 100644 > --- a/drivers/usb/cdns3/cdnsp-gadget.h > +++ b/drivers/usb/cdns3/cdnsp-gadget.h > @@ -1128,8 +1128,6 @@ union cdnsp_trb { > #define TRB_HALT_ENDPOINT 54 > /* Doorbell Overflow Event. */ > #define TRB_DRB_OVERFLOW 57 > -/* Flush Endpoint Command. */ > -#define TRB_FLUSH_ENDPOINT 58 > > #define TRB_TYPE_LINK(x) (((x) & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK)) > #define TRB_TYPE_LINK_LE32(x) (((x) & cpu_to_le32(TRB_TYPE_BITMASK)) == \ > @@ -1539,8 +1537,6 @@ void cdnsp_queue_configure_endpoint(struct cdnsp_device *pdev, > void cdnsp_queue_reset_ep(struct cdnsp_device *pdev, unsigned int ep_index); > void cdnsp_queue_halt_endpoint(struct cdnsp_device *pdev, > unsigned int ep_index); > -void cdnsp_queue_flush_endpoint(struct cdnsp_device *pdev, > - unsigned int ep_index); > void cdnsp_force_header_wakeup(struct cdnsp_device *pdev, int intf_num); > void cdnsp_queue_reset_device(struct cdnsp_device *pdev); > void cdnsp_queue_new_dequeue_state(struct cdnsp_device *pdev, > @@ -1574,7 +1570,6 @@ void cdnsp_irq_reset(struct cdnsp_device *pdev); > int cdnsp_halt_endpoint(struct cdnsp_device *pdev, > struct cdnsp_ep *pep, int value); > int cdnsp_cmd_stop_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep); > -int cdnsp_cmd_flush_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep); > void cdnsp_setup_analyze(struct cdnsp_device *pdev); > int cdnsp_status_stage(struct cdnsp_device *pdev); > int cdnsp_reset_device(struct cdnsp_device *pdev); > diff --git a/drivers/usb/cdns3/cdnsp-ring.c b/drivers/usb/cdns3/cdnsp-ring.c > index 07f6068342d4..af981778382d 100644 > --- a/drivers/usb/cdns3/cdnsp-ring.c > +++ b/drivers/usb/cdns3/cdnsp-ring.c > @@ -2123,19 +2123,6 @@ int cdnsp_cmd_stop_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep) > return ret; > } > > -int cdnsp_cmd_flush_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep) > -{ > - int ret; > - > - cdnsp_queue_flush_endpoint(pdev, pep->idx); > - cdnsp_ring_cmd_db(pdev); > - ret = cdnsp_wait_for_cmd_compl(pdev); > - > - trace_cdnsp_handle_cmd_flush_ep(pep->out_ctx); > - > - return ret; > -} > - > /* > * The transfer burst count field of the isochronous TRB defines the number of > * bursts that are required to move all packets in this TD. Only SuperSpeed > @@ -2465,17 +2452,6 @@ void cdnsp_queue_halt_endpoint(struct cdnsp_device *pdev, unsigned int ep_index) > EP_ID_FOR_TRB(ep_index)); > } > > -/* > - * Queue a flush endpoint request on the command ring. > - */ > -void cdnsp_queue_flush_endpoint(struct cdnsp_device *pdev, > - unsigned int ep_index) > -{ > - cdnsp_queue_command(pdev, 0, 0, 0, TRB_TYPE(TRB_FLUSH_ENDPOINT) | > - SLOT_ID_FOR_TRB(pdev->slot_id) | > - EP_ID_FOR_TRB(ep_index)); > -} > - > void cdnsp_force_header_wakeup(struct cdnsp_device *pdev, int intf_num) > { > u32 lo, mid; > -- > 2.25.1 > -- Thanks, Peter Chen