Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp185174lqe; Wed, 27 Mar 2024 02:45:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBlBeUKtBsczyk3X/f3/NEHQW6KLv61WhqRLEnQvGJqbDRJEVe0pZkiCe517zpkGBIiBXv0rDVuoqq1roy5FuqFh5XfYGX25Dad8flvw== X-Google-Smtp-Source: AGHT+IFJv9QnZI4edDkj6m+fcsJoqmSJAtlW7uf+3iX9xAAzDhbuO9Ec/+3Tif+s+EJ/cZRAgEA/ X-Received: by 2002:a05:6358:9209:b0:17f:5ef7:1579 with SMTP id d9-20020a056358920900b0017f5ef71579mr4298080rwb.12.1711532711143; Wed, 27 Mar 2024 02:45:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711532711; cv=pass; d=google.com; s=arc-20160816; b=sYjJ9IseP1w3xj3L05XtwRpal/in9/LYkEOzzWudUNotDPFUKNz53hp4M+8Qcd1X1u uaFPxUTXx3XQtvRspVIinTxxUZlH0g4qWGGB9LG5o6lz+P+XOlXtySUxmbyIdo2sBAMZ XVbsV6m6RVNSV+04uQv9xbO2Hioe6PWCewAtXHSrWn6+rUjthp2dPbO6/PYl3j+r+dDO JMJgPe+797I1kAdSX97N6sSatL9dHSA/6ozSI8qCXGT3xejxTyxvPbRhpCsZ+2mgppac wEsXuJ4K4PVYnmqMf6FEPj8NhXkWQn5XsIA2fLgUfo8l1KM2lrOtoACqG7pqjhOuap4O lvHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature:dkim-signature; bh=rQ/JY3X0GomTvd9YbXCROPDzE84c887ZCDkKnstdjVQ=; fh=eyWUSmJy0XXODmHseNqT46/YLmJjysG1lrlCqq0MBQI=; b=puR1d+JJTs8RWMl5pWBY1MqsntCyRqwDfvVNtZTtdgV5Y6N3cCvbpGmJ99P1T8NR/Z 7A8dvXU/fRkUFiLDMliogh7CFICMBaQwAGR0aXL9KtCE+UR1QLFryW2uRnbcBhyGaKYr AZmXwAitU4sNn6E45wLw0/+9768R2JbEaK5aujvhR6e8hUEuTvXOm6tBYCzQXfDnrVCL 8X79w1fd+OyuViYvRft05dhcm2LHFWCdhXcbU/524V2X52gNJZLPM3fg81WukgEE45bF wcqeEyPYDWHga5tykIFm7+YHZhN4jCuuq/KyJEuLPDrEtIkVWZSxnNHtOT4LwkLg4r6t vDrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=dlJZikWu; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b="XXnV9/jC"; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-120625-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120625-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a17-20020a631a51000000b005cdd9963f49si11428903pgm.863.2024.03.27.02.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 02:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120625-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=dlJZikWu; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b="XXnV9/jC"; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-120625-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120625-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D53A1B2393F for ; Wed, 27 Mar 2024 09:43:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C32E38DDA; Wed, 27 Mar 2024 09:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="dlJZikWu"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="XXnV9/jC" Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (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 B103E381CD; Wed, 27 Mar 2024 09:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711532581; cv=none; b=G2J583N9GKZw7riHqkfRyKvYOp/RLPc5IERssuc6qVWWSxtMMrH7AUjwaLSRYaKasXKYk+pUmsSim00JdRxIQ3ik+SNF/ZUhJgrng17GGZ0jUmnVI9q+CD1J8VT1CKW2eLQCOhz+H8kzzg3iappFWlnslYwiPWlP71GzNJRPVcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711532581; c=relaxed/simple; bh=JS90u7tq7VFJO/hnamqzxcTLZD6N3Vt7MknyUw/cu/Y=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=MGIt/8xYiSGSkdCAHGDIrzV6htAxwc5+gKN+yA6qd5u40J3ML/gtXsTGCpmOimpWpw4KWepPcUk2UWgwJHnLsnO0nz49PnXQO4iKByhb0R0B+TLtU4ydMI6YbNoZcAkLug0cdeoGFdEeQA12a/X4DehMlgQHcREdwaZkqwYJEE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=dlJZikWu; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=XXnV9/jC reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1711532577; x=1743068577; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=rQ/JY3X0GomTvd9YbXCROPDzE84c887ZCDkKnstdjVQ=; b=dlJZikWuAgfQR6vCdVDIhLzE/dDyQcKcKZ04y0kqmBKnuKVzK3aFQAJx +spxnExRuj5Iwp0f4HwyqBn8jp8bgLgHQ0CIblwmtygnITfcRBbWM7y1C +jVqpOrGA5uYgTSFfNZmA5zp+Po+79Sb7UQD8NgQ52JISJNCk4DXCxrHL xD60LCgdnFTe7nbgU8gcS9amUDHcs4CSMFS1iN/EyyhM5helvzcR0PyQQ nNulOIbZbUMx4jqThlJCsZWsoah78KghGFxDA+mvrYW6d4V6RkY3m188/ lx0NyQnmVTKSik2Za95Z2HmTu0pZlRlW4Rc0mZI6DXycGmDD+rTJQc8lt g==; X-IronPort-AV: E=Sophos;i="6.07,158,1708383600"; d="scan'208";a="36125462" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 27 Mar 2024 10:42:48 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3B9C716E0A1; Wed, 27 Mar 2024 10:42:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1711532563; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=rQ/JY3X0GomTvd9YbXCROPDzE84c887ZCDkKnstdjVQ=; b=XXnV9/jCsuQjKp99nK+OeU2p9yzI8WrAX73jXfym0mPinV8mDCqW3LF7g/bvIZdOAT84hS lSklUjSTkIC+Vf7Wi82lhDQ8Gu42argZpjiHFzftfwWjSJDFSTEW4k5WzTw8JdUoG2xrJs kTOC2p3PEu+aPBSsqVxxblWJvCcOFki3OmFRJTMWhgYhH+AfNPom3yKhGhQt//tmhie98+ Krf5h1bdD/lbugbqcW2YuVOAARWS2YhBr4R8+koqpoxuwfFLlnLQG32Flq+ltv6UkugxhD vuq091QLQcZC/Qx80TvI+Dwb4O5FbbPfTdPjs8GcKrnwTPTYBsR07Yu9YIwFRg== Message-ID: Subject: Re: [PATCH] net: dsa: mv88e6xxx: fix usable ports on 88e6020 From: Matthias Schiffer To: Lukasz Majewski Cc: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@ew.tq-group.com, Michael Krummsdorf Date: Wed, 27 Mar 2024 10:42:41 +0100 In-Reply-To: <20240326165215.5fb4326c@wsk> References: <20240326123655.40666-1-matthias.schiffer@ew.tq-group.com> <20240326143424.3368d9b1@wsk> <35cc888230a0146a7687d8b859e5a6ceffec581a.camel@ew.tq-group.com> <20240326165215.5fb4326c@wsk> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 On Tue, 2024-03-26 at 16:52 +0100, Lukasz Majewski wrote: > Hi Matthias, >=20 > > On Tue, 2024-03-26 at 14:34 +0100, Lukasz Majewski wrote: > > > Hi Matthias, > > > =20 > > > > From: Michael Krummsdorf > > > >=20 > > > > The switch has 4 ports with 2 internal PHYs, but ports are > > > > numbered up to 6, with ports 0, 1, 5 and 6 being usable. > > > >=20 > > > > Fixes: 71d94a432a15 ("net: dsa: mv88e6xxx: add support for > > > > MV88E6020 switch") Signed-off-by: Michael Krummsdorf > > > > Signed-off-by: Matthias Schiffer > > > > --- > > > >=20 > > > > I was unfortunately too busy to notice the issue when the patch > > > > this Fixes was resubmitted in my name. It would have been better > > > > to change my From into a Based-on-patch-by or similar when > > > > modifying it =20 > > >=20 > > > The "discussion" about this work was lasting at least a few months > > > with several iterations and changing the design decisions ... > > > =20 > > > > - and > > > > the final version obviously wasn't even tested on an 88E6020... = =20 > > >=20 > > >=20 > > > Can you share on which kernel version have you tested the patch that > > > you claim that testing was omitted? =20 > >=20 > > Hi Lukasz, > >=20 > > we are currently testing with commit 71d94a432a15 backported onto a > > recent Linux 6.1.y. At least on this kernel version, the driver will > > reject a Device Tree configuration that uses the=C2=A0ports 5 and 6 > > (rightfully so, as num_ports is set to 4), leaving only the > > internal-PHY ports 0 and 1, and none of the *MII ports that are > > likely to be used as CPU ports. > >=20 > > So if the accepted version worked fine for you, your configuration > > possibly only used the first two ports, >=20 > And then the penny has dropped.... >=20 >=20 > switch@10 { > compatible =3D "marvell,mv88e6250"; > reg =3D <0x10>; >=20 > ports { > #address-cells =3D <1>; > #size-cells =3D <0>; >=20 > port@0 { > reg =3D <0>; > label =3D "lan1"; > }; >=20 > port@1 { > reg =3D <1>; > label =3D "lan2"; > }; >=20 > port@6 { > reg =3D <6>; > label =3D "cpu"; > phy-mode =3D "rmii"; > ethernet =3D <&fec2>; >=20 > fixed-link { > speed =3D <100>; > full-duplex; > }; > }; > }; > }; >=20 >=20 >=20 > > or newer kernels somehow > > ignore num_ports when determining if a port number is valid. > >=20 > > We should be able to repeat our test on a newer kernel next week if > > needed. >=20 > I think that considering the above snippet - customer was using only > port 0 and 1. Hmm, I don't think that's right - the DTS has port 6 as CPU port, which sho= uld make the whole probe of the switch fail with num_ports =3D=3D 4 (`reg >=3D ds->num_ports` check = in dsa_switch_parse_ports_of()) - that's what we saw on kernel 6.1.y with our board for CPU on port 5. Best regards, Matthias > >=20 > > > =20 > > > >=20 > > > >=20 > > > > drivers/net/dsa/mv88e6xxx/chip.c | 6 +++++- > > > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > >=20 > > > > diff --git a/drivers/net/dsa/mv88e6xxx/chip.c > > > > b/drivers/net/dsa/mv88e6xxx/chip.c index > > > > 9ed1821184ece..c95787cb90867 100644 --- > > > > a/drivers/net/dsa/mv88e6xxx/chip.c +++ > > > > b/drivers/net/dsa/mv88e6xxx/chip.c @@ -5503,8 +5503,12 @@ static > > > > const struct mv88e6xxx_info mv88e6xxx_table[] =3D { .family =3D > > > > MV88E6XXX_FAMILY_6250, .name =3D "Marvell 88E6020", > > > > .num_databases =3D 64, > > > > - .num_ports =3D 4, > > > > + /* Ports 2-4 are not routed to pins > > > > + * =3D> usable ports 0, 1, 5, 6 > > > > + */ > > > > + .num_ports =3D 7, > > > > .num_internal_phys =3D 2, > > > > + .invalid_port_mask =3D BIT(2) | BIT(3) | BIT(4), > > > > .max_vid =3D 4095, > > > > .port_base_addr =3D 0x8, > > > > .phy_base_addr =3D 0x0, =20 > > >=20 > > >=20 > > >=20 > > >=20 > > > Best regards, > > >=20 > > > Lukasz Majewski > > >=20 > > > -- > > >=20 > > > DENX Software Engineering GmbH, Managing Director: Erika Unter > > > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, > > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: > > > lukma@denx.de Achtung externe E-Mail:=C2=A0=C3=96ffnen Sie Anh=C3=A4n= ge und Links > > > nur, wenn Sie wissen, dass diese aus einer sicheren Quelle stammen > > > und sicher sind. Leiten Sie die E-Mail im Zweifelsfall zur Pr=C3=BCfu= ng > > > an den IT-Helpdesk weiter. Attention external email:=C2=A0Open > > > attachments and links only if you know that they are from a secure > > > source and are safe. In doubt forward the email to the IT-Helpdesk > > > to check it. > > >=20 > > > =C2=A0 =20 > >=20 >=20 >=20 >=20 >=20 > Best regards, >=20 > Lukasz Majewski >=20 > -- >=20 > DENX Software Engineering GmbH, Managing Director: Erika Unter > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de > Achtung externe E-Mail:=C2=A0=C3=96ffnen Sie Anh=C3=A4nge und Links nur, = wenn Sie wissen, dass diese aus einer sicheren Quelle stammen und sicher si= nd. Leiten Sie die E-Mail im Zweifelsfall zur Pr=C3=BCfung an den IT-Helpde= sk weiter. > Attention external email:=C2=A0Open attachments and links only if you k= now that they are from a secure source and are safe. In doubt forward the e= mail to the IT-Helpdesk to check it. >=20 > =C2=A0