Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp69078rdb; Tue, 16 Jan 2024 15:27:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFF/AylRJK8ktZcVD2VselVcMXCZZW28DMf1E4CIGAsktpMZErY/CaWYIa41u9UBTn45o1p X-Received: by 2002:a17:906:99ce:b0:a2e:c888:c3ac with SMTP id s14-20020a17090699ce00b00a2ec888c3acmr51075ejn.51.1705447620591; Tue, 16 Jan 2024 15:27:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705447620; cv=pass; d=google.com; s=arc-20160816; b=r1rLIcffkTS342x3DlQvu/u5GNBAiFUEnoeVXhyr8b4+DrK5LT+kFuXVVQDTXPrI9d uGIYXRrziSuK07R1JDAUDcHpnYWk50VZLaUbav6svSjU0Fw+g6rvCzWTjPqNb3+vjrdU M3ESqP584r3M9ZcLwL/B2gP73JDPZ2DDz8AA+gxx8P+jTEiL7O/EXVhOUXamfHv1R93e GSSnZWZrLkOq/3J+fu5eIJcArt4OQXO5UDCGlUnwzm3WpJ/q+6oKXnFGEK+sdevgIq01 IMsHVbEa4ndCabqxdQMDnzNhoSFnshbKWf/3AwTD2yZshvJDA0R5UmcC28xjIMzTKox7 cR+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=nv0E2bFJC3bwFCY7TgFvWMFZeHrdBHqDiGwtffKOX+s=; fh=kQr/RNziZSE8hzDvnOcSVc0upD5YY8kBNp3RCQF0YcE=; b=J1/T9pfV3TdIs7QFQ8+7hLcRzsvMhoj5t4eGs9lyD/qjUWs1eSo3vcYkSErf7jV87v HPTxqOoUzYWKitfsltaWGK0UExXaBJe0m0Lp9yg2Eg7vi0KypiG2k2JayTRnOm6FA8rD Fq6hoFEI9EnzAHX85sMJSqrsFdW7I7Ppk41CggRvOCdjlTB7Uzuk9/HhwLKcoBh2RDy1 bQoOK8gLhB9h8pVjPTkDx9mWg8nPAYfzH/7X14Urxn/xRohOpe1U8mXQhV/IbFsSB/JG XJEK0Ibr2frAbUhcKHmjH9pZSnK1Ar/eL/cMSYvP+2CQlbuETWD5wXkz4d0hLIfIs29f +TnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@purestorage.com header.s=google2022 header.b=GNcNqQGI; arc=pass (i=1 dkim=pass dkdomain=purestorage.com dmarc=pass fromdomain=purestorage.com); spf=pass (google.com: domain of linux-kernel+bounces-28347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=purestorage.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u23-20020a17090617d700b00a278f2bfea9si5156854eje.407.2024.01.16.15.27.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 15:27:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@purestorage.com header.s=google2022 header.b=GNcNqQGI; arc=pass (i=1 dkim=pass dkdomain=purestorage.com dmarc=pass fromdomain=purestorage.com); spf=pass (google.com: domain of linux-kernel+bounces-28347-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=purestorage.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 297661F26C0F for ; Tue, 16 Jan 2024 22:43:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D56232377B; Tue, 16 Jan 2024 22:25:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="GNcNqQGI" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DF61200C1 for ; Tue, 16 Jan 2024 22:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705443912; cv=none; b=Wm4Koxopx4+RxsXWUHZZ6xCfPcRZJtgwovBFfAbFT4hHME4OvuRVZR3rXuHi2EGDJZW5JkM5I/g+kpyxhqyt4TP+tKdLL0MtgBXXofGYV8HHGlldeqSqIiFa++xIlaZzNa3QOLrf089mVyzbcSmBERcbvL5D1Ly8JOz752N05yA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705443912; c=relaxed/simple; bh=iJ39MH4mqeyNt9Nv3baKzqxKkS+WUtb/vJwlljcnfSY=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version: References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc: Content-Type:Content-Transfer-Encoding; b=bjZv54vWp7XUfPqiLTWT60sUz+RNhhCQGcUoMZMzewa1JgeXHCsBMcG8At7oGeKGUPVINC8D1a6aTM+TnIxRbHpazErhpiYE9kfzO0urCloa7tJ88AUEJQU1QDOm3tDMVoCCOQ4Xr3FEzVyBJQoZcFVGs3lkqiAPMH1MsXUNCs4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=GNcNqQGI; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-50e79299da9so2030609e87.1 for ; Tue, 16 Jan 2024 14:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1705443908; x=1706048708; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nv0E2bFJC3bwFCY7TgFvWMFZeHrdBHqDiGwtffKOX+s=; b=GNcNqQGIyJ2j7ULNXl8Ld8x+umUNp9eDtDOZ65BvoCOrZfiLgtycKCrkuyRLPUSFfc HMckU8xaStYYv/C2n+kpQSU7+El6EzlKmXDDlDbqGCSsxPUJgzsDg7z9CwHa7AFuGXzO EnE7rS2x2cWth7nQrLE4Dp94tPUfkr/SLViws+aZ75s5lEuKIhYW0irKdEaUi6Ijo6xG veElBOQPMH1KDCaR7uB+vOEZDctlQ2WFqxGw2+49ThhV6uXV4Hg3NWMo7SoFeYE2NJ4V Yd2sCKA7xaJRz+lV5rP7Nd8G27lGUr2SWKEcvCqgta9YbDhIQGYWRlKYqTkZuHS9oJRs 2GcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705443908; x=1706048708; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nv0E2bFJC3bwFCY7TgFvWMFZeHrdBHqDiGwtffKOX+s=; b=rx8NTJ7r9+FL5RelBC2MpEp69BAoIP0VmvVgd6I3s4ynBXNwmNQu5LKaz0Uh8u68RH 9xw1d3dcdHr7fpcoAl8DTbMHT1MZkEHMT1qmadccHeVp0L2cRD7wnXB5mOfpEBdBmjy7 9+yb7AjPY/ifavZaNI+LMvCjHDgYqA0ZAIM2sP45Jhw8xEFXVZH8LjcvSum9QSViUxFc rzaPKpbmCM3dDydlIzIPDXxZaNd34vZLd0Yl9SWVYkwnGz1G+RAqp2vKF9vxfqRNdFiz QoyUXOKSj1mIdCqhF4OBx+uqXaTUhiYGypKGvxUSXNJdgVa19dZeJ5SM1NS1WtwVwZzZ UtdQ== X-Gm-Message-State: AOJu0Yzu2tcbzVBGExrWLRHJQm42Hf3+9DKE2O/m2NkOm2D6GsI31Gd7 Y0RDLRA6gXV1JtMHm44QcjDNHKcWiXJHClI46e4A2qIfVQDlcQ== X-Received: by 2002:a2e:2f06:0:b0:2cc:f5b9:bbf7 with SMTP id v6-20020a2e2f06000000b002ccf5b9bbf7mr7638928ljv.3.1705443908133; Tue, 16 Jan 2024 14:25:08 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240116193542.711482-1-tmenninger@purestorage.com> <04d22048-737a-4281-a43f-b125ebe0c896@lunn.ch> In-Reply-To: <04d22048-737a-4281-a43f-b125ebe0c896@lunn.ch> From: Tim Menninger Date: Tue, 16 Jan 2024 14:24:55 -0800 Message-ID: Subject: Re: [PATCH] net: dsa: mv88e6xxx: Make *_c45 callbacks agree with phy_*_c45 callbacks To: Andrew Lunn Cc: f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 16, 2024 at 11:59=E2=80=AFAM Andrew Lunn wrote= : > > On Tue, Jan 16, 2024 at 07:35:42PM +0000, Tim Menninger wrote: > > Set the read_c45 callback in the mii_bus struct in mv88e6xxx only if th= ere > > is a non-NULL phy_read_c45 callback on the chip mv88e6xxx_ops. Similarl= y > > for write_c45 and phy_write_c45. > > > > In commit 743a19e38d02 ("net: dsa: mv88e6xxx: Separate C22 and C45 tran= sactions") > > the MDIO bus driver split its API to separate C22 and C45 transfers. > > > > In commit 1a136ca2e089 ("net: mdio: scan bus based on bus capabilities = for C22 and C45") > > we do a C45 mdio bus scan based on existence of the read_c45 callback > > rather than checking MDIO bus capabilities then in > > commit da099a7fb13d ("net: phy: Remove probe_capabilities") we remove t= he > > probe_capabilities from the mii_bus struct. > > > > The combination of the above results in a scenario (e.g. mv88e6185) > > where we take a non-NULL read_c45 callback on the mii_bus struct to mea= n > > we can perform a C45 read and proceed with a C45 MDIO bus scan. The sca= n > > encounters a NULL phy_read_c45 callback in the mv88e6xxx_ops which impl= ies > > we can NOT perform a C45 read and fails with EOPNOTSUPP. The read_c45 > > callback should be NULL if phy_read_c45 is NULL, and similarly for > > write_c45 and phy_write_c45. > > Hi Tim > > What does phylib do with the return of -EOPNOTSUPP? I've not tested > it, but i would expect it just keeps going with the scan? It treats it > as if there is no device there? And since it never accesses the > hardware, this should be fast? > > Or is my assumption wrong? Do you see the EPOPNOTSUPP getting reported > back to user space, and the probe failing? > > Andrew > Hi Andrew, It bubbles up as EIO (the translation happens in get_phy_c45_ids when get_phy_c45_devs_in_pkg fails) and ultimately causes the probe to fail. The EIO causes the scan to stop and fail immediately - the way I read mdiobus_scan_bus_c45, only ENODEV is permissible. From logs: $ dmesg | grep mv88e6 [ 12.951149] mv88e6085 ixgbe-mdio-0000:05:00.0:00: switch 0x1a70 detected: Marvell 88E6185, revision 2 [ 13.272812] mv88e6085 ixgbe-mdio-0000:05:00.0:00: Cannot register MDIO bus (-5) [ 13.401140] mv88e6085: probe of ixgbe-mdio-0000:05:00.0:00 failed with error -5 [ 13.413105] mv88e6085 ixgbe-mdio-0000:05:00.1:00: switch 0x1a70 detected: Marvell 88E6185, revision 2 [ 13.730227] mv88e6085 ixgbe-mdio-0000:05:00.1:00: Cannot register MDIO bus (-5) [ 13.858336] mv88e6085: probe of ixgbe-mdio-0000:05:00.1:00 failed with error -5 Tim