Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4865193iob; Mon, 9 May 2022 03:32:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcALHw0tCdUoQbkvcLhezgrFf4vlpwkQELp8Wv2qO1npH9yuag3A3WtM2t79iUkBrhexQJ X-Received: by 2002:a92:3609:0:b0:2c6:3595:2a25 with SMTP id d9-20020a923609000000b002c635952a25mr6557143ila.233.1652092362924; Mon, 09 May 2022 03:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652092362; cv=none; d=google.com; s=arc-20160816; b=BOrp1hloGUK+231h7jSkRpqMxa/XPC/gp6df28vyi6G8GR5/GYkwlsKm29NgLcQuS9 eKxy+qjgno0kcX0Xs0xp6GcVhCoPbldjyaZQ/YeQUteiOiGa5hFtFwCQ/qe6NqtmeuvL QDfBejC7v5o9dsItkQZn/PlAPNu19LNbyWgxtns+YIDlBv77XwfzR4tfZiK5xfgBzT2r Edu6tMcNVn24S2XgokOA/4NrtcbMvLzrja0gsSQasq3EVJg06C9z+EpeBLG/AcG4hw8P Q8u3gWbZ/dkrBA1qFazWcjYqlHkPNrvI/bHYnxWpbXYAYZhv5bZGAHkO5Hc0Ln5Ikm0b trqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=3XPGjru+uW0hOeRykS42TNYyIx8ZkoC8DFG5cF+O4o4=; b=fDcqVT4Pu/dkDdHU5KJnl18lRiSCh+yMI8ZzU75z7JFRyCYzIek5RtyQgf42uCcNLw d8S2IRYkgcJBQVraqfZ+fH3eI9WP/4IfK1DrBX63/OzYX+u9KW2hHYGm2RcazCXMSQq5 6pb8XLaqszJAzwVxjIHFFvcIcl4KktQmmNz3czBUEdxfAyzUKrLt8raUpADqnnvO/Xnp Qyzh8KbMktxToJt5Vv7W+fM5Yk9mwy8ZeG2Dc+S7Vl8PX73dWFl1yYtfVTo7fERCzt/z SJ93BleQMHDUmS9gnYXxP2lNs0rCCocF+/+6vkDcRAIKvD4KtfFZWRfc3OSm6bfRFHSO 1aRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g4-20020a056602150400b0064958084501si8781883iow.30.2022.05.09.03.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:32:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D79D2013AB; Mon, 9 May 2022 03:02:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236768AbiEIHx7 (ORCPT + 99 others); Mon, 9 May 2022 03:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233897AbiEIHud (ORCPT ); Mon, 9 May 2022 03:50:33 -0400 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0A2617CC87; Mon, 9 May 2022 00:46:38 -0700 (PDT) Received: by mail-qt1-f174.google.com with SMTP id hf18so10439352qtb.0; Mon, 09 May 2022 00:46:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3XPGjru+uW0hOeRykS42TNYyIx8ZkoC8DFG5cF+O4o4=; b=41F9GyWZlsfocB5MenQJl7d0bF5bQN5+OHhw7IwhQxihHqhhYlAwOGtex2kpjR0nap 3KGJyib2NQ5zz1sidV1zAHrPdoPy3m2SNZKaCBT9W38BBGzrA1tciu2RylX2SteqAllA LLehhLi/JSu34sDMJ/AaPp6Zkhr7pYzq2WN3PaMe65tShsZni2Fw1RR3wKMxtmo1fY6h ge6NTGekiWrRiRN4KMseD4yqI/ErHE5DvVy7b66yV8g6bEv6Od4TFvfCvislmTHz4quo Dqx11FZoM1WEuPg1p1+f8qanvEPJtnJnb074yBcVtZMAhtiewu5SdbV/t/N7rLKEVQFU 9SpA== X-Gm-Message-State: AOAM531ngeJfEyi/zsqFB7W0egtP9qBf3rw2rEG70Zf6DPfEbA0a5+81 JCeZiiUYHQrqBCmtE5GLjyaaJDlcoISUqQ== X-Received: by 2002:a05:622a:13d2:b0:2f3:d2aa:7c5a with SMTP id p18-20020a05622a13d200b002f3d2aa7c5amr7638987qtk.155.1652082397698; Mon, 09 May 2022 00:46:37 -0700 (PDT) Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com. [209.85.128.176]) by smtp.gmail.com with ESMTPSA id o12-20020ac8554c000000b002f39b99f6a8sm6913691qtr.66.2022.05.09.00.46.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 May 2022 00:46:37 -0700 (PDT) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-2f83983782fso134895587b3.6; Mon, 09 May 2022 00:46:37 -0700 (PDT) X-Received: by 2002:a81:9b0c:0:b0:2f4:c522:7d3c with SMTP id s12-20020a819b0c000000b002f4c5227d3cmr12831128ywg.316.1652082396821; Mon, 09 May 2022 00:46:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Geert Uytterhoeven Date: Mon, 9 May 2022 09:46:25 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] USB: gadget: Add a new bus for gadgets To: Alan Stern Cc: Felipe Balbi , Greg KH , USB mailing list , Linux-Renesas , Linux Kernel Mailing List , Yoshihiro Shimoda Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Alan, On Sat, May 7, 2022 at 5:36 PM Alan Stern wrote: > On Tue, May 03, 2022 at 11:48:33AM -0400, Alan Stern wrote: > > On Tue, May 03, 2022 at 05:27:08PM +0200, Geert Uytterhoeven wrote: > > > On Tue, May 3, 2022 at 5:14 PM Alan Stern wrote: > > > > On Tue, May 03, 2022 at 12:14:30PM +0200, Geert Uytterhoeven wrote: > > > > > On Sat, 23 Apr 2022, Alan Stern wrote: > > > > > > This patch adds a "gadget" bus and uses it for registering gadgets and > > > > > > their drivers. From now on, bindings will be managed by the driver > > > > > > core rather than through ad-hoc manipulations in the UDC core. > > > > > > > > > > > > As part of this change, the driver_pending_list is removed. The UDC > > > > > > core won't need to keep track of unbound drivers for later binding, > > > > > > because the driver core handles all of that for us. > > > > > > > > > > > > However, we do need one new feature: a way to prevent gadget drivers > > > > > > from being bound to more than one gadget at a time. The existing code > > > > > > does this automatically, but the driver core doesn't -- it's perfectly > > > > > > happy to bind a single driver to all the matching devices on the bus. > > > > > > The patch adds a new bitflag to the usb_gadget_driver structure for > > > > > > this purpose. > > > > > > > > > > > > A nice side effect of this change is a reduction in the total lines of > > > > > > code, since now the driver core will do part of the work that the UDC > > > > > > used to do. > > > > > > > > > > > > A possible future patch could add udc devices to the gadget bus, say > > > > > > as a separate device type. > > > > > > > > > > > > Signed-off-by: Alan Stern > > > > > > > > > > Thanks for your patch, which is now commit fc274c1e997314bf ("USB: > > > > > gadget: Add a new bus for gadgets") in usb-next. > > > > > > > > > > This patch cause a regression on the Renesas Salvator-XS development > > > > > board, as R-Car H3 has multiple USB gadget devices: > > > > > > > > Then these gadgets ought to have distinct names in order to avoid the > > > > conflict below: > > Geert: > > Can you test the patch below? It ought to fix the problem (although it Thanks! root@h3-salvator-xs:~# ls -l /sys/bus/gadget/devices/ total 0 lrwxrwxrwx 1 root root 0 Feb 14 2019 gadget.0 -> ../../../devices/platform/soc/e659c000.usb/gadget.0 lrwxrwxrwx 1 root root 0 Feb 14 2019 gadget.1 -> ../../../devices/platform/soc/ee020000.usb/gadget.1 lrwxrwxrwx 1 root root 0 Feb 14 2019 gadget.2 -> ../../../devices/platform/soc/e6590000.usb/gadget.2 Tested-by: Geert Uytterhoeven LGTM, so Reviewed-by: Geert Uytterhoeven > might end up causing other problems down the line...) Can you please elaborate? I'm not too familiar with UBS gadgets. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds