Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2582697rwd; Fri, 19 May 2023 07:36:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YP4EWYRKpZtz5qDDNrR64LLvkva04D326a5lxAdvC/G5iOSPVGrHMhRq9PW7DqtkXdzzr X-Received: by 2002:a17:90b:19c6:b0:253:2f1b:612b with SMTP id nm6-20020a17090b19c600b002532f1b612bmr3060130pjb.11.1684507010794; Fri, 19 May 2023 07:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684507010; cv=none; d=google.com; s=arc-20160816; b=lEo0gjxfO+rd6gEQNSBl3KPXY0Fe6OuYoT4R4MfVqgHCI9di8ehpUWMauXmdZYXxfC 5uoFUBB4CAO+DoTgXDfLRcfFxVD1PdWzNrA10i+CjykkmcHLkzaohAjfpwGDE0+ZaPMw 8Lqi9ueKtwnXT1T5QERCdfEFAfLMIpkTkcqtjVJAZ9wGDpT1rIrTKrixe3J1j08KnPm9 6GNd2SpWdQu+0p9Hm4a0ydePpTftccnDsla6ScGnaHjtlvED02BXVylyQVsqALg1TvAB yvE85BscnPeh3q+OLwC2+bcbDZk9wV45hF0t1+Bde3r4+8XFhdZ2XhVLi5rImw1jLDeM TjEA== 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=CHMFMX7wtsHi+JJrcQ8ch2zghp9ED1gM5742JvmFaww=; b=yIBNLtiDkrQFM4n/HTMxiO+gtV0oSjnyyALSClnkEuuKBNh15HzVzlH44pWGgzZW/z uRBNOjbMusDYcvakKK7UUUS4+RcHRlVMAZAs2Mgh0TMU80HbvD0iqGN52ocY7nzsE+Hh XX30gxYpHO5pFJeBrL3IT1sP5QB5ldFnqjj3aRMC1k9e9jXORfmvgNX6bQn1060mwfpt F4wRMWKAHwRPawnEoC1lXtoKLi93mu3jVrVNs394Ntx8XtQ9RhlnJ7Wyu196zzXEszUl GdjLlVSTKlSwQ9LeI9CvXBz3Xe05fIyKsCnT37sWFJs3/epn0XQN0MWzr3qTeucidrBk 9/Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=B2g8iZif; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv3-20020a632e03000000b005343e03aa9fsi3938953pgb.145.2023.05.19.07.36.36; Fri, 19 May 2023 07:36:50 -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=@gmail.com header.s=20221208 header.b=B2g8iZif; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232013AbjESOaM (ORCPT + 99 others); Fri, 19 May 2023 10:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbjESOaK (ORCPT ); Fri, 19 May 2023 10:30:10 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C113EE1; Fri, 19 May 2023 07:30:09 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-96f7bf3cf9eso75228566b.0; Fri, 19 May 2023 07:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684506608; x=1687098608; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CHMFMX7wtsHi+JJrcQ8ch2zghp9ED1gM5742JvmFaww=; b=B2g8iZifUNFvKgNeimRo3zeDViTd78RIcgwcNpZ4RGq0xmmFBEdXsDMnThk7a4zwKY Is+IRqo1VwcUV3pFm8TIqIeg9mE4Nf+cVRMJTfVwm/hC7KJ4zrzavmM+MOL0jvlzNUQS xmfIA1AMG3XXgCMWqPRhQwTxQiJQpxil+zs9cQ4RXJbqRdnNHd1RX2zvIbX345Kr1NIk 5d5DiG/hJmCZsi0h/hNSFqo23il8oG1IsHA8XWoakB4SqUsZPy+PjEwAotqHq0g9Exxg AYVutobttq3ReW+fWl7P6sg2YbRuCEraQsVsqBOyFIvMFn+Qu+QeRLZzApJ5RQTQiStH 4avw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684506608; x=1687098608; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CHMFMX7wtsHi+JJrcQ8ch2zghp9ED1gM5742JvmFaww=; b=C4mooBB50gXuBHA7BvATk9cq/AtTWDNudEHEmd7VBA0vtr4mHMWr6ifWGyCt0CHVG6 cTsEwL9g9eoNlCVC/J/2ywAB5YA4SWpUq/D/I1kZ5qepVVwHmErMIc+A7wCBxfQKUoI/ jHMryCaQjfje1oZ0RiuAe+SO7ZbEEbs3QZ+NbBuPGk+3fD7oycggr8JTS5NCf2rMNVkx 9SteqDEVUzspW3NbhI6nUFUOPNprBilQd7qiA2jAuBOC3uENlYSoIv+o2WWxabalbfdT 3p/dOcluvav5EE1+8yi4hBAcuwB9SnkzkaJ75UNKjXQTc1VOrQB/KJMPkc8uagqffP8J cXWA== X-Gm-Message-State: AC+VfDzch/HuR2eHJT36XJ2IIGuXpObzPITW4IS3pg5+BovE0kLqOhVa 6SjEGFJ77aKuXnhu82HGSqM= X-Received: by 2002:a17:907:5cd:b0:94e:46ef:1361 with SMTP id wg13-20020a17090705cd00b0094e46ef1361mr1648791ejb.34.1684506607763; Fri, 19 May 2023 07:30:07 -0700 (PDT) Received: from skbuf ([188.27.184.189]) by smtp.gmail.com with ESMTPSA id gf3-20020a170906e20300b0096a16e49b0fsm2370805ejb.51.2023.05.19.07.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 07:30:07 -0700 (PDT) Date: Fri, 19 May 2023 17:30:04 +0300 From: Vladimir Oltean To: Oleksij Rempel Cc: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Woojung Huh , Arun Ramadoss , "Russell King (Oracle)" , Simon Horman , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net-next v4 1/2] net: dsa: microchip: ksz8: Make flow control, speed, and duplex on CPU port configurable Message-ID: <20230519143004.luvz73jiyvnqxk4y@skbuf> References: <20230519124700.635041-1-o.rempel@pengutronix.de> <20230519124700.635041-2-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230519124700.635041-2-o.rempel@pengutronix.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Fri, May 19, 2023 at 02:46:59PM +0200, Oleksij Rempel wrote: > +void ksz8_phylink_mac_link_up(struct ksz_device *dev, int port, > + unsigned int mode, phy_interface_t interface, > + struct phy_device *phydev, int speed, int duplex, > + bool tx_pause, bool rx_pause) > +{ > + /* If the port is the CPU port, apply special handling. Only the CPU > + * port is configured via global registers. > + */ > + if (dev->cpu_port == port) > + ksz8_cpu_port_link_up(dev, speed, duplex, tx_pause, rx_pause); > +} I'm sorry, but this is also baking in assumptions related to the topology of the tree (that the xMII port is used as a CPU port). The ksz8 driver may make this assumption in other places too, but I don't want to make it even worse to fix. Is the !dev->info->internal_phy[port] condition not enough here?