Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp484558rdb; Fri, 17 Nov 2023 04:46:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcm+YlVdmcNQTojfTvHr7b2NF/cFcZNJZ4peK4Z5Z9JzgViaO2c2xpqGSJJS4kNWY647v6 X-Received: by 2002:a17:902:e88a:b0:1cc:50ed:4931 with SMTP id w10-20020a170902e88a00b001cc50ed4931mr12401428plg.16.1700225198030; Fri, 17 Nov 2023 04:46:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700225198; cv=none; d=google.com; s=arc-20160816; b=Nr2ppSkU8p+jqP34yVdJDi25hex7hga+oYCbsRFTonFNllb1qmfwnx2ugTrhcbF3bC KDX9ZNw6I4qChN5M4T+1981EbUCV5ofpFP1KkPp7OvvC6D0lsCiYRvQmBAssSaydueDt vLyVGS685JBDvp+WU3m0EK3qrfJKt3Eb7RWn+DEJhNhoJaHvkuCvLGYc4PR4CPTlG+yN v5Evgz/eYqk5QXJTOI+AbRxI3zdB6eQ46t6x4i2+4zpYe+f/CgIrESt9NJa69LFAftZv BetVfzcdAa/6jrjoYlMV80fL1upCXnxWBkdWrzunjSnm+rt9W0+dA99R5tfTVCC2FgrR 1Fww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+YOin7g0g4T8byZD5QObPXU2WYjbG0dAcuL7qKb6CFQ=; fh=xcsJSOMsauiAXKZtl2P3D4ehS3miPMEerxEB8mH37nc=; b=m/VqqgeoAwkJ0UW/O3/690rVdaZCBfpoyP1mNuKDQSSpmfKguF0ulRYorwmqgpSoc+ mvv3Y5GcsMNiLnE6b/0vo+ShEMZ5o2Xdns3sr7SCsTiTyIqfyx2G+z9jr/TdtVOX84w/ dwdhCwFPo3u41iwHxRAOK3scMRP7+rlDkUEwFMVBe+RKGAZ+25WLTj+K4JT4dF14kgKn Lwb9JWpOB5F5fhsjJdRkUBkuHEPcx9Lamw9eMebGfQdVT5EdVKj/6/gQdxUfAMyJNvss 1qRuW+rlugxq/xTKMfjLY/OIPU1I0VmWHMuYPO2ysckWLGG7TRLRGSvQJUFg748MxGlM Vpbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=DPiPJrWk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id w13-20020a170902e88d00b001c72dbaf7b9si1846788plg.415.2023.11.17.04.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:46:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=DPiPJrWk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 467DB822CB1F; Fri, 17 Nov 2023 04:46:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbjKQMq1 (ORCPT + 99 others); Fri, 17 Nov 2023 07:46:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjKQMq0 (ORCPT ); Fri, 17 Nov 2023 07:46:26 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48C5BD4E; Fri, 17 Nov 2023 04:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+YOin7g0g4T8byZD5QObPXU2WYjbG0dAcuL7qKb6CFQ=; b=DPiPJrWkqqPu/2Ozcap4dDcGnH X1Y2JjbeKoMJOj6KZlKumVBPARupNyrG0VJdUZnJ5KyyYhMlGnrSEKMhLvsMLIIidfacdkSWgPvSm JB9Xp9iqqX9uYVZQgKbrlTeO5lPpXL/iaff+I4NVmjqZIc8dFTM7DZHR6rd88gD2ACoE+Dp4mb+dp jbAE8qK6HR8G2pAc/hpEUEmzatlRF5GzL3C8kyRNeMXz5Xj0OMAYN5i4KizcfLWiMdoX/vmCE6poB ba8D5bztG6nyrWYUPyQJM/+y/OEj3Po1s2GsJN/jvbP7DHKYagJqB1tYGGHIJzZvmarsVxQqXFHJE AYl1ZgdA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35790) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r3yEi-0002qX-2g; Fri, 17 Nov 2023 12:46:16 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r3yEk-00008Q-DK; Fri, 17 Nov 2023 12:46:18 +0000 Date: Fri, 17 Nov 2023 12:46:18 +0000 From: "Russell King (Oracle)" To: Robert Marko Cc: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ansuelsmth@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/2] net: phy: aquantia: validate PHY mode on AQR107 Message-ID: References: <20231117100958.425354-1-robimarko@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117100958.425354-1-robimarko@gmail.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 17 Nov 2023 04:46:35 -0800 (PST) On Fri, Nov 17, 2023 at 11:09:48AM +0100, Robert Marko wrote: > The Aquantia driver is not setting the PHY mode itself, but it does however > still check if the PHY mode set in DTS is one of the supported modes. > > However, the set PHY mode does not have to match the actual one, so lets > add update the PHY mode during .config_init and warn if they differ. This looks completely wrong to me. These PHYs can be configured to change their MAC-facing interface mode according to the media negotiated speed, but you are only checking that _if_ the media is up, then the interface that has resulted from that negotiation matches what is in DTS. That could be dependent on the link partner, so what works for a platform when connected to one link partner may issue your "info"-level warning when connected to a different link partner. So no, this to me looks completely wrong. You need to check the VEND1_GLOBAL_CFG_* registers, and determine from those what interface mode(s) will be used, and then use that to validate the mode. It just so happens that... http://git.armlinux.org.uk/cgit/linux-arm.git/commit/?h=net-queue&id=f7b531ee8855f81d267a8a42c44da51576f48daf http://git.armlinux.org.uk/cgit/linux-arm.git/commit/?h=net-queue&id=f55389aa5d11da8a32dfd65a1b98049878ce09f0 builds a bitmap that can then be tested to check this. Whether the above is entirely correct or not, I can't really say, I don't have enough information on this PHY. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!