From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F550C49EA2 for ; Tue, 22 Jun 2021 06:06:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0528B61002 for ; Tue, 22 Jun 2021 06:06:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbhFVGIx (ORCPT ); Tue, 22 Jun 2021 02:08:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:59194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbhFVGIv (ORCPT ); Tue, 22 Jun 2021 02:08:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4852260E08; Tue, 22 Jun 2021 06:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624341996; bh=P/sR0ZcHpYZJo71sQ8g4ZAMLgWLeAEm1CfciXo95WnQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=imQvMMyE3IAu1todJsO4uYD3N1HdqWAp703ViHpmv7Bs95qZX/mGws8HmrM8tFwS5 i0qL2R2VUDebsbvv9H3GbJL2MDGShEbeI3jHokMc6EcHw+ER/jbuZRTxbIG7OCP/HR LoK/cS5WEIGvcp4bNjxK+tgU9aepOWlrADDoUDGM= Date: Tue, 22 Jun 2021 08:06:32 +0200 From: Greg KH To: Wesley Cheng Cc: balbi@kernel.org, robh+dt@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, frowand.list@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, jackp@codeaurora.org, fntoth@gmail.com, heikki.krogerus@linux.intel.com, andy.shevchenko@gmail.com Subject: Re: [PATCH v10 3/6] usb: dwc3: Resize TX FIFOs to meet EP bursting requirements Message-ID: References: <1623923899-16759-1-git-send-email-wcheng@codeaurora.org> <1623923899-16759-4-git-send-email-wcheng@codeaurora.org> <1a979c61-e996-b94a-c986-a9721d3b3297@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a979c61-e996-b94a-c986-a9721d3b3297@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 10:27:13PM -0700, Wesley Cheng wrote: > > > On 6/17/2021 4:10 AM, Greg KH wrote: > > On Thu, Jun 17, 2021 at 02:58:16AM -0700, Wesley Cheng wrote: > >> +static int dwc3_gadget_check_config(struct usb_gadget *g, unsigned long ep_map) > >> +{ > >> + struct dwc3 *dwc = gadget_to_dwc(g); > >> + unsigned long in_ep_map; > >> + int fifo_size = 0; > >> + int ram1_depth; > >> + int ep_num; > >> + > >> + if (!dwc->do_fifo_resize) > >> + return 0; > >> + > >> + /* Only interested in the IN endpoints */ > >> + in_ep_map = ep_map >> 16; > > Hi Greg, > > > > > Wait, this "map" is split up into 16/16 somehow? So it's only 32bits > > big? > > > > Yes, correct. Upper 16 carries IN eps, lower 16 carries OUT eps. Will > fix that based off your other comment. > > > Where did you document this map structure? Why is it needed at all, you > > have the gadget, don't you have access to the full list of endpoints > > here as well? > > > > confused, > > > > Unfortunately, we do not have the entire list of endpoints for each > function until the composite driver receives the SET_CONFIG packet from > the host. By this time, if we incorrectly allowed the configuration to > start enumeration w/ the host, and there were some EPs which have no > FIFO memory allocated, that would lead to those interfaces/functions > being broken. So how would this magic bitmap be any different here? I'm not understanding why you need to create something new here to represent data we already have. thanks, greg k-h