Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp360268pxj; Thu, 17 Jun 2021 04:34:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMFp7Bfdv0cW4MFX/40WAMigSytkJNOOw+n5PL00ZFE5afrHjk7784rcrH0kIYLm1A67QV X-Received: by 2002:aa7:db94:: with SMTP id u20mr5791779edt.381.1623929645389; Thu, 17 Jun 2021 04:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623929645; cv=none; d=google.com; s=arc-20160816; b=WxW5hNOAVD75RIJRRaxJMnqCqNffU7YB44SykcTcijs9dS6QqLHsLP2b5TgMbRBszC Tn+2Xcx1r7PEACBWqSfoIWRTXinrKNZWBpdMHEQ2zVBwi1q8xMV4tH/T+KJI0jqf4nlp w9DTMbXSqYc+NGU8WQBMaaMAv69XaWSNn4I1kENkYshHp1QivFXstGO1Bb4j/lgaZZ3E pO0FSmqKbcK54g4UrvI4SPEPtIksepB2lyeR3DaHK3imhIxyl2y9SECJuWQeYrl8viir geiF+RiedCwVUwmSdsixdgYmky5AvplG1ZbpnxCmmCjYZmj7wER1rG27FO/CYHgcfor5 PpsA== 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=jg9IgbKZ04JmqWoNlpsIekdG9favyO9BsEdLKNjOZjc=; b=Uj8c9syky3ot3b6aMY4TaAC9cmZOoA5oB5wWa9zs7W0jIidzBu49VY0W3F4TtihWv+ P0Neb3vCDi36X9NHkp9uHVOpr//E+EfP77+n2d+tdctbI9UeJi1JeqZVkcgse1LGYjTU sRSl6Hlp7ovVRYa89nQFUPGBo1FG1uqCqHnvPl/qX5SUVK/oedC8bzlE9LDiZ6jszdhc CpimKkomf+K+YY0t99hnwB9KFDrMTJy5WIEDQAF5x9ziU6Rz1b3nYdUkT/UhTW7Xhe5X +6SQeZFSXde38GpIzDjYOMOnOP8pCXGu3ssnR70gOwrQxkFjD6L0tBAdVIRSOttAOcka wgsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OCqCYuFR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si1048068eds.410.2021.06.17.04.33.42; Thu, 17 Jun 2021 04:34:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OCqCYuFR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbhFQLL0 (ORCPT + 99 others); Thu, 17 Jun 2021 07:11:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:52504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbhFQLLU (ORCPT ); Thu, 17 Jun 2021 07:11:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8096561209; Thu, 17 Jun 2021 11:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623928152; bh=84l+h0maKkmzDzigHHjqNqGTeEXAil0QmCCQktMiKnU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OCqCYuFRbPTGiAXnTGZ7lxSgKOK6smXubt5fQQPSGApIFrVXK3YHRVBdyVXyU5Rj1 Bneu7FbTwGtCoTO/BLJIWQD3VU1GsoyMnbUh8sHc6R/bnpjA1E/knBPkBkKT9mSHRa QhQf9p+Am13S5RrOdxGNGHXOseLb1Fqw1ld5CvfQ= Date: Thu, 17 Jun 2021 13:09:09 +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 1/6] usb: gadget: udc: core: Introduce check_config to verify USB configuration Message-ID: References: <1623923899-16759-1-git-send-email-wcheng@codeaurora.org> <1623923899-16759-2-git-send-email-wcheng@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1623923899-16759-2-git-send-email-wcheng@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 17, 2021 at 02:58:14AM -0700, Wesley Cheng wrote: > Some UDCs may have constraints on how many high bandwidth endpoints it can > support in a certain configuration. This API allows for the composite > driver to pass down the total number of endpoints to the UDC so it can verify > it has the required resources to support the configuration. > > Signed-off-by: Wesley Cheng > --- > drivers/usb/gadget/udc/core.c | 25 +++++++++++++++++++++++++ > include/linux/usb/gadget.h | 5 +++++ > 2 files changed, 30 insertions(+) > > diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c > index b7f0b1e..e33ae2d 100644 > --- a/drivers/usb/gadget/udc/core.c > +++ b/drivers/usb/gadget/udc/core.c > @@ -1003,6 +1003,31 @@ int usb_gadget_ep_match_desc(struct usb_gadget *gadget, > } > EXPORT_SYMBOL_GPL(usb_gadget_ep_match_desc); > > +/** > + * usb_gadget_check_config - checks if the UDC can support the number of eps > + * @gadget: controller to check the USB configuration > + * @ep_map: bitmap of endpoints being requested by a USB configuration Will a u64 really hold all of the possible endpoints? Why make it odd like this, why not just provide a list like we do in the USB core with the structure that USB drivers use? What can a driver do with a bitmap only? thanks, greg k-h