Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5143766iob; Mon, 9 May 2022 09:29:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhtPcZEnwVHBLWbTnglg/f2J7wKptV+2Dp1hLYp462Q3IbOP3xcy4+qvl8he9OpeW8gX8g X-Received: by 2002:a63:2a04:0:b0:3c4:a041:d71 with SMTP id q4-20020a632a04000000b003c4a0410d71mr13686287pgq.492.1652113757786; Mon, 09 May 2022 09:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652113757; cv=none; d=google.com; s=arc-20160816; b=tTqdhvSv12O1Gewx/nfPbAY5gf/WLzTXD6PS51cifzXobPjwUvbL5MpAI2MSCBVVVh A8zXMZf8lktp4sKRBmim9X4O9Yn7itpUdSMBlRi3Uky6Va+pX2iniIxSHEqGMvCLcWet x9+wuCkMcEcxCdwHeEyh8vag7yhuiwjdXf/BGKNyb8ZMHPu3uQiSypH+7quxizZmcStD 1dGus/IoyWoIulkm66duu2uI9dNsHfs7DJ89g3i+fYSFPh0YkJ5Fcl+aPmEV4C4nilLF QeKvwuRKt3Qg7ml7FUphGfI0ZAdMzAup0karC8fCyH28WsB6Djq/wTZ8LUB6QLoZVfwJ /u2w== 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=wlsYTgG60OwUAM1SxEQTX3ifu3rrJUPB7mj/U7ReVPI=; b=o5SCrQKItD7o64bIJFJItRMigVNRmcXfV4h7fMNI5eRUNNa34hUwHgeJAQVc/qGVjV 2vNZAjrFc46QzKurL7Lqs2BF234gLeU38ZH9g18ueYBXHlfr4LapUsbCjCRZ9BdL9p94 iqqfv1/GX3DFHelcfYB/DuPbQlXQWxiMJxfv7Xhf7X0h1Q58QH6VWvPZNMyh2i1onvLk qcBzxLSOXp05D+yR/tSkyeSAV3ERSh0oTohKdCki9lUlR2QIpEHemWa2kjcFmEV6IZ10 mJKtbVNCF2KJk5mFZPZ0k9Wn78Hd8X/Y20X4XuZkLsTpLnTQYseCNyrqcmLDkzUamBRA 0xPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lUuSPYt1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c15-20020a056a00248f00b00510769162f7si13434001pfv.208.2022.05.09.09.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 09:29:17 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lUuSPYt1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9380C5A2F7; Mon, 9 May 2022 09:23:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238990AbiEIQ1b (ORCPT + 99 others); Mon, 9 May 2022 12:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238954AbiEIQ13 (ORCPT ); Mon, 9 May 2022 12:27:29 -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 9712F267C1D; Mon, 9 May 2022 09:23:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 364F861346; Mon, 9 May 2022 16:23:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A05DC385AE; Mon, 9 May 2022 16:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652113414; bh=ngSvpw7u74fP7XgiM1AYbKle6d50YZH9faXKosWM2f4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lUuSPYt1TaoAj2CZqI7Kq5yFQJWR7KJGX7rG1/oY8+OTg5raGKO3gPZrwygB+7eSJ /vaWJSKl/qc9+uq/hH4tdidB8iasb83hLVNVzewZ7veqgtriJfFIWcXDdTRJjwoW6r gWapCevqld16l+YaF6/q2x3UqZZ+ro8CQDL7N5q0= Date: Mon, 9 May 2022 18:23:31 +0200 From: Greg KH To: Alan Stern Cc: Geert Uytterhoeven , Felipe Balbi , USB mailing list , Linux-Renesas , Linux Kernel Mailing List , Yoshihiro Shimoda Subject: Re: [PATCH 4/4] USB: gadget: Add a new bus for gadgets Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, May 09, 2022 at 11:05:06AM -0400, Alan Stern wrote: > On Mon, May 09, 2022 at 04:42:01PM +0200, Geert Uytterhoeven wrote: > > Hi Alan, > > > > On Mon, May 9, 2022 at 4:15 PM Alan Stern wrote: > > > On Mon, May 09, 2022 at 09:46:25AM +0200, Geert Uytterhoeven wrote: > > > > > 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 > > > > > > Thanks! > > > > > > > > might end up causing other problems down the line...) > > > > > > > > Can you please elaborate? I'm not too familiar with UBS gadgets. > > > > > > I was concerned about the fact that changing the name of a file, > > > directory, or symbolic link in sysfs means changing a user API, and so > > > it might cause some existing programs to fail. That would be a > > > regression. > > > > > > Perhaps the best way to work around the problem is to leave the name set > > > to "gadget" if the ID number is 0, while adding the ID number on to the > > > name if the value is > 0. What do you think? > > > > Oh, you mean the "gadget.N" subdirs, which are the targets of the > > symlinks above? These were indeed named "gadget" before. > > > > Would it be possible to append the ".N" suffixes only to the actual > > symlinks, while keeping the target directory names unchanged? > > E.g. /sys/bus/gadget/devices/gadget.0 -> > > ../../../devices/platform/soc/e659c000.usb/gadget > > No, it's not possible. Or at least, not without significant changes to > the driver core. Besides, people expect these names to be the same. It should always be ok to change the names of devices as those are not going to be persistent / determinisitic. It's the attributes of devices that are supposed to be used to determine those types of things. So I think let's start out with the .N suffix for everything for now. I'll be glad to submit the fixed patch to the Android kernel build system to see what their testing comes back with to see if they happened to make any name assumptions as that's the largest user of this codebase. thanks, greg k-h