Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp93093rba; Wed, 20 Mar 2024 11:57:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzjGZGDfAmGar8ugPfhsTeEUNnJY7NIZf0Rm6Wfz1VqkdnhYbvTepN3AxWCXpKo7ze6PjKZ2BXTsitG4CXqP1PSHQJWEEYuXQ0H81lpg== X-Google-Smtp-Source: AGHT+IEGyGDn3a7OKnwfaflo6x6yCpzS/l6JZGnFWTETg4j706iIQjHbOEaNb+hZh1HAk7nDc28F X-Received: by 2002:a05:622a:1449:b0:431:14cf:d62a with SMTP id v9-20020a05622a144900b0043114cfd62amr810522qtx.19.1710961051121; Wed, 20 Mar 2024 11:57:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710961051; cv=pass; d=google.com; s=arc-20160816; b=I3E0gaUFVwlwcymGaiWHCutLPrLSYxxj2T8eO5K5HKlJ/Q0DhqqFgCtsptQuzr0KKz 6oGqQysHyvWOjNA1KxJqWSr4ddeZi9wNViVdjY4o2QyFnBUf4k2bi0U5dtpHeRWwn0pq PtaXjoypNwVROF9kpJwxEiwAhZW+86rnbK5I7VA4Bt6GaRe2CjaXKHCZJdJz8WCkdtye akf7JQR1y56sIBN9DMsMj2axU7qqyUk/C+OT5ljS4AzfEGp6UY3uOCv7X8OyMq7neJvH k4OlbIwPBskSr7jkiD3L+RzSuZEaF0u2x81M8Ht1j0g4smeS54zFVFeScRCYkMQJFoqO D02g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u5PQvM3epMT5XzIgzOnyWl6WvqIUgL5aXdBDmyi5TZI=; fh=YaX8J8TbPMLisEMdNnxf3+UN2s8BRXWvfOc3tcuqi0o=; b=Z8vXFwPEe/k8q+Ckuae0yUkTnYlbSjsuKaaaOVUt3OQaRIaatweeUoBbcRyXeHM216 ON/tKJj7dmbp1dpEOmu647VsfteuA9jghd9xo5lbtAQI/R523DKemh4zLkoWKuLMtuCF S3XsVq0BLS5JUJ8k9EJPAIlGHB6e4N/EarqU74RgY6fbLC+74qQ8okf7Q1yiExOL8pFn /5J+Oft0pcOnl2vMPChpt8yHo+RAaRHljOOED430kcWjWwV7JkKQcj22laPhVCSTT/+T BO3bjUZBrrMSaiIdgFdRC3DnErCtNehOBbGBVWyMGmZMnqXLdxtCTeF2TXBRyyxmt7lD fppA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=GW9UWxDS; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-109323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a6-20020a05622a02c600b0042ef4502630si10083014qtx.744.2024.03.20.11.57.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 11:57:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=GW9UWxDS; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-109323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CDBB41C20B6B for ; Wed, 20 Mar 2024 18:57:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16C278562E; Wed, 20 Mar 2024 18:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="GW9UWxDS" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A674A1E4AD; Wed, 20 Mar 2024 18:57:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710961040; cv=none; b=QalfBi6RJwLd/LMCBk3uAjMw1X9iRei3cmPW0/lL4OoAxe6ttvqpbXC/h+lipY8KEQ2PsaosdDv3uCGQHWAw9Kegk5N2Pwlb6tAdUBxCp9zc31AsH54ql6qSY3lKrtqc95N/WrQHFW2uLT17o3qsgg8BGpJ7NvEmrRU17L8PXTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710961040; c=relaxed/simple; bh=Igur+ST22ucZbbutrgiQ3PXgj+k3Gv2Nd/xFZ8mGSWU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=okESk08/KDAnJeb0srobOA8F3BKeinAoTnInhKP8Hqfr09m/97fi2Utj/4YkxUeo0JRE8O38PgEIVBn5/ipuAPQ0TNPid+VfYPlEGRadJPhJfVL7CxigYshob5CCe/vatfUkc67aDdSW5bO4IGn1XHNNC4SyMjc24tvi5r7DQvQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=GW9UWxDS; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=u5PQvM3epMT5XzIgzOnyWl6WvqIUgL5aXdBDmyi5TZI=; b=GW9UWxDSSjOGgTNeMaWfBl32pA XrdXlPWa36gP6XLnsmw3Bx2ZuTzzpI123tNM8awaI7a3EUgB8/6SqgqIXG4d6KmqytDYR6HT25/Bh /jAqEG9UdOsRAu+xk+HgfmAT0VMBPUlF5N/wtvd8a/b+lv0EkmLw9Mpu/pEANZBXhtn0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rn17Y-00AoGr-Jz; Wed, 20 Mar 2024 19:57:04 +0100 Date: Wed, 20 Mar 2024 19:57:04 +0100 From: Andrew Lunn To: Josua Mayer Cc: Jiri Pirko , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] net: dsa: mv88e6xxx: add warning for truncated mdio bus id Message-ID: <793649ff-990c-46f0-9132-bc6e95fcb94f@lunn.ch> References: <20240320-mv88e6xxx-truncate-busid-v1-1-cface50b2efb@solid-run.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: > With separators ('!') we have: > cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio > cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio-external > Truncated to MII_BUS_ID_SIZE: > cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdi > cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdi This has been made worse by the DT maintainers wanting ethernet-switch@4, not switch@4. And i guess config-space was also something shorter in the past. I think your idea of cropping from the beginning, not the end, is in general a good solution. However, is there any danger of cp0!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio-external and cp1!config-space@f2000000!mdio@12a200!ethernet-switch@4!mdio-external I assume the two instances of cp have the same peripherals, at the same address? Another option would be if the name needs to be truncated, use the fallback as if there was no np: bus->name = "mv88e6xxx SMI"; snprintf(bus->id, MII_BUS_ID_SIZE, "mv88e6xxx-%d", index++); That at least gives you unique names. Andrew