Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp6357867pxb; Thu, 27 Jan 2022 12:02:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvbrDxJAKfTySabz101yNY2rdrG8kQQM6OoOq3vbB2oLpJOIgc+SaIy9TsAkBD261rERwg X-Received: by 2002:a17:90b:3003:: with SMTP id hg3mr5868034pjb.53.1643313760102; Thu, 27 Jan 2022 12:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643313760; cv=none; d=google.com; s=arc-20160816; b=nJ7TUm41IZpvsrYSKQvJg7fFzS4MjCUzVS6B/kLeFHnPTfVBIeP5+hv4AiO7bk6mOe 2COCNNF1D/6oTmydXQH89Ar7MlNRhyg0/DXTQeVxNWx+DtgsUF08UrpwXEnIaNKVyucC neXCrtrB5inUlAgvJgushlxasvZmqFNxpdQFRhELlf4osh7GkdmqX5NfhK6SJ9yuFCWb yVcGk35fJpAc8yKLUWFQ3FSHUJx1P3+poqVXlR98vNI8hcD7g1BXHz97zS+3cGvwCVuz zUw2Sf4NcT6yPq+53EzsQoka2qtqW08mruAkMFv7DGOLI8W7KsKHwTan1q3/BdTd9YUM 9C4Q== 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=d9CDYgl2umAoGdKUFGBPAc6Iw/HelqbubhneFWpUpZ4=; b=Sv05+lCj6QdRwAP4kqKXTzoNJZkLJzu2OKlZbu34VKiqMhpA2D0B4a4QOotnOXzChy C5ZMDsnrgyI0CkP1BTentyKJu1DjybjbO/SZ0aMGhhUr2r6/E52pnzqzsKwOj5Il445f c+9F9Gk1dJdiPeqT3sDfZTosY8KAxzP5aw8vty1g3ql7bHIF3TWUmPiO2ouhCo2K+Pd9 p4gKWArsiTojhySWywLWTpAo5oagX77J7RSQxT6dhiUUXDSQLQAfqgFNjf2Vp+K+zSoL WcUHGldkdTnaEgE7Ix5ZxrD8z1kp+pPD+GBvYHNWFsUQ7FtFPEKPvehXirq76PftqZD7 73qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q1dqbeyn; 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 ot5si318521pjb.108.2022.01.27.12.02.22; Thu, 27 Jan 2022 12:02:40 -0800 (PST) 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=Q1dqbeyn; 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 S240351AbiA0LaY (ORCPT + 99 others); Thu, 27 Jan 2022 06:30:24 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:35266 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbiA0LaX (ORCPT ); Thu, 27 Jan 2022 06:30:23 -0500 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 69B956181D; Thu, 27 Jan 2022 11:30:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44FF6C340E4; Thu, 27 Jan 2022 11:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643283022; bh=nuVIdVfY68a6mnwbLdAZuHokHgEveE8vKcaTX6XBEGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q1dqbeynuM669sRodIlHVeHhf9+T2UDVfXQKK5PueOJd3P1hJvpy9m5/GkV8/dCcr vsDnZGrQp1isq6/AMI9doqL5AtyWRweSycxOMBGj/74Wh4ZcPcZRY/dEGSFrAOle8Q dqwJynsIhwNNC/FvOsMr9P/gjAuCLNCU5+Adb0zc= Date: Thu, 27 Jan 2022 12:30:20 +0100 From: Greg KH To: Oleksij Rempel Cc: Oliver Neukum , "David S. Miller" , Jakub Kicinski , Rob Herring , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH net-next v1 4/4] usbnet: add support for label from device tree Message-ID: References: <20220127104905.899341-1-o.rempel@pengutronix.de> <20220127104905.899341-5-o.rempel@pengutronix.de> <20220127112305.GC9150@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220127112305.GC9150@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 12:23:05PM +0100, Oleksij Rempel wrote: > On Thu, Jan 27, 2022 at 11:57:26AM +0100, Greg KH wrote: > > On Thu, Jan 27, 2022 at 11:49:05AM +0100, Oleksij Rempel wrote: > > > Similar to the option to set a netdev name in device tree for switch > > > ports by using the property "label" in the DSA framework, this patch > > > adds this functionality to the usbnet infrastructure. > > > > > > This will help to name the interfaces properly throughout supported > > > devices. This provides stable interface names which are useful > > > especially in embedded use cases. > > > > Stable interface names are for userspace to set, not the kernel. > > > > Why would USB care about this? If you need something like this, get it > > from the USB device itself, not DT, which should have nothing to do with > > USB as USB is a dynamic, self-describing, bus. Unlike DT. > > > > So I do not think this is a good idea. > > This is needed for embedded devices with integrated USB Ethernet > controller. Currently I have following use cases to solve: > - Board with one or multiple USB Ethernet controllers with external PHY. > The PHY need devicetree to describe IRQ, clock sources, label on board, etc. The phy is for the USB controller, not the Ethernet controller, right? If for the ethernet controller, ugh, that's a crazy design and I would argue a broken one. But whatever, DT should not be used to describe a USB device itself. > - Board with USB Ethernet controller with DSA switch. The USB ethernet > controller is attached to the CPU port of DSA switch. In this case, > DSA switch is the sub-node of the USB device. What do you mean exactly by "sub node"? USB does not have such a term. > The CPU port should have > stable name for all device related to this product. name for who to use? Userspace? Or within the kernel? Naming is done by userspace, as USB is NOT determinisitic in numbering / naming the devices attached to it, by design. If you need to have a stable name, do so in userspace please, we have loads of tools that already do this there today. Let's not reinvent the wheel. > Using user space tools to name interfaces would double the maintenance > of similar information: DT - describing the HW + udev scripts describing > same HW again. Not for the network name of the device, that belongs in userspace. Do not be listing USB device ids in a DT file, that way lies madness. thanks, greg k-h