Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp690191rwd; Thu, 18 May 2023 02:30:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5PJ/6nwT0n2yS5iDHzMIgTQAsEXs492TvlJ6jltirImgFdGxqkX0Cf2YBrNZFbVcEs/boM X-Received: by 2002:a05:6a00:1883:b0:643:96e:666b with SMTP id x3-20020a056a00188300b00643096e666bmr3552779pfh.34.1684402226608; Thu, 18 May 2023 02:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684402226; cv=none; d=google.com; s=arc-20160816; b=TZJLmvfdW1SnjZPShUJK6ut9TvTD19CP6P4mlD2boXuTwt116wcl2/Apk3g5Zcy4SL NEDfFKVvK98IHND9jxr6VjtjjprWfUpke2pw5/nyAJ/P1qqGBrUKqqx1PvYnBt5eNSjW Pz1nQdPCUbI9mgXbSx46LPkheQ63GPkG7wINv5trodSJ2lrjYHUCXJ7Hq2lyxDhucrtp Hscta6mDTFzrZrPPexOR+6zjonYnW8PopT7aiicyrbeBZe0DfzhroGryehX/iFpuFpMV kZ9jglaq8PoErY4BeFq9SKqFR4LRqx2gwOeyNehJxjftHjUShaCi+RJmvFz82jU+fYzo FYOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8ntNwT3ufuzTXN9KB3cXrWO9kyjTnFe0jhp+FBdX+ds=; b=Y5cMbtfOsNgscTzDSvlUzhZ1lx3aSV/9GUS1sRNe6unpjAey7Ge8T18A8KygdD9IvO EP98H4hxcdZ1hnYLc4en5+hWrbBvUPctqlU29iRIsWd6qF1pCPQYwe/zLIc2EdEzdQ0g bHvZUJ9+pbOa5+GyAkbY+NsQQBNHDITDt1qk4MVMIhZIyClM/uk/4lj4f6LzFY0NewRX 4aJAivimO+si2ty7Fiwh5c1SaOC0SzMr5EQxl2MlSGHQi0YJVEIxu7wN7U0bgtPGkZ3A RNByJONUWyBoZfpmBvA5K1eNTMEkbKPuqRAgkRkViugUMYT1k/GNjkAw3sxZHwK+uPLH PVoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=W8gXr6R3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv128-20020a632e86000000b0052c89d50011si901889pgb.676.2023.05.18.02.30.13; Thu, 18 May 2023 02:30:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=W8gXr6R3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbjERJKy (ORCPT + 99 others); Thu, 18 May 2023 05:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbjERJKx (ORCPT ); Thu, 18 May 2023 05:10:53 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 231DF1FDA; Thu, 18 May 2023 02:10:49 -0700 (PDT) Received: (Authenticated sender: alexis.lothore@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id C8EEF40006; Thu, 18 May 2023 09:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1684401048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8ntNwT3ufuzTXN9KB3cXrWO9kyjTnFe0jhp+FBdX+ds=; b=W8gXr6R38X04sJF2/cHt0+En8n9JYEMzddJmyaKaScaIqrOXq9pFMPmVcdNH9WZ0+I7RmV CUwMsk0fQGI/OSidxewPggsmfUaEW9HrwE1YFInhbSse3g8aKBhs8ZbWpqLZ8ehf+6gllJ l6XEcvFJeetfkeYbGZkEuXLMVWMeTD/yPxDq0QSm4+BnEO8XP6WhqT2NjNAVOfQ0YCkXwb sDB8uIp6OBi/ZHeSLp56CFMnAkIVpjvmxChzYjtcEA4oAWGfZJfmofoc3hyece5GraBUXM hEIHdBZ5XclCGn2PYB9RSwAW2RCqqtQidwoHVG4P5GjfC/SobjstSQNodnh3oQ== Message-ID: Date: Thu, 18 May 2023 11:11:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: enable support for 88E6361 switch To: Andrew Lunn Cc: Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, paul.arola@telus.com, scott.roberts@telus.com References: <20230517203430.448705-1-alexis.lothore@bootlin.com> <20230517203430.448705-3-alexis.lothore@bootlin.com> <9a836863-c279-490f-a49a-de4db5de9fd4@lunn.ch> Content-Language: en-US From: =?UTF-8?Q?Alexis_Lothor=c3=a9?= In-Reply-To: <9a836863-c279-490f-a49a-de4db5de9fd4@lunn.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hello Andrew, thanks for the prompt review ! On 5/17/23 22:51, Andrew Lunn wrote: > On Wed, May 17, 2023 at 10:34:30PM +0200, alexis.lothore@bootlin.com wrote: >> From: Alexis Lothoré >> >> Marvell 88E6361 is an 8-port switch derived from the >> 88E6393X/88E9193X/88E6191X switches family. It can benefit from the >> existing mv88e6xxx driver by simply adding the proper switch description in >> the driver. Main differences with other switches from this >> family are: >> - 8 ports exposed (instead of 11): ports 1, 2 and 8 not available >> - No 5GBase-x nor SFI/USXGMII support > > So what exactly is supported for link modes? > > The way you reuse the 6393 ops, are these differences actually > enforced? It looks like mv88e6393x_phylink_get_caps() will allow > 2500BaseX, 5GBaseX and 10GBaseR for port 10. You are right, mv88e6393x_phylink_get_caps is currently too "generous" with capabilities for 88E6361. With this chip, supported links modes are the following: - port 0: MII, RMII, RGMII, 1000BaseX, 2500BaseX - port 3 to 7: triple speed internal phys - port 9 and 10: 1000BaseX, 25000BaseX I'll add those specifications in cover letter for next revision for this series. So indeed reported capabilities are wrong, I will update it. Taking a quick look at other ops, I guess I'll have to fix some others too like mv88e6393x_port_max_speed_mode > >> + [MV88E6361] = { >> + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6361, >> + .family = MV88E6XXX_FAMILY_6393, >> + .name = "Marvell 88E6361", >> + .num_databases = 4096, >> + .num_macs = 16384, >> + .num_ports = 11, >> + /* Ports 1, 2 and 8 are not routed */ >> + .invalid_port_mask = BIT(1) | BIT(2) | BIT(8), >> + .num_internal_phys = 5, > > Which ports have internal PHYs? 2, 3, 4, 5, 6, 7 ? What does > mv88e6xxx_phy_is_internal() return for these ports, and > mv88e6xxx_get_capsmv88e6xxx_get_caps()? I'm wondering if you actually > need to list 8 here? Indeed there is something wrong here too. I need to tune mv88e6393x_phylink_get_caps to reflect 88E6361 differences. As stated above, port 3 to 7 are the ones with internal PHY. For mv88e6xxx_phy_is_internal, I see that it is merely comparing the port index to the number of internal phys, so in this case it would advertise (wrongly) that ports 0 to 4 have internal phys. I also see that your suggestion (setting num_interal_phys to max internal phy index + 1) is already in use for this family (6393X has 8 internal phys but defines num_internal_phys to 9), so if it's acceptable I will do as you suggest and set it to 8. Thanks, Alexis > > Andrew -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com