Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2311810pxp; Mon, 21 Mar 2022 16:37:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyliVEEnsUCZQT7z6PF9pQS3MB9JxdGXoTXR1/hcoMbQMZhMQDDjgLcojQSXkE1sBGgYmTQ X-Received: by 2002:a17:90b:3ec3:b0:1c7:24c4:e28f with SMTP id rm3-20020a17090b3ec300b001c724c4e28fmr1673948pjb.191.1647905842904; Mon, 21 Mar 2022 16:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647905842; cv=none; d=google.com; s=arc-20160816; b=Usu5tiTc007WURxT5TY45IEtQlFT+AZmjHQL96zZEhhrT6Z0wFF+xGz1L6b2vfx1cW eyrmeSebTckbwBDUsewS46bf7dPFPxIQC/uXsIyBD0K9fyqfq/YwCoRFHRc/93aRjM1Q ewOUa5RvwIVAQVeepxWT6lB5nd+n48cTPXesItOS+HotazCOEKj5soxPKl0DW50CoJXD wRrpco2BiHtQJwoFt2QXtTL6F6fkEd3gy9eT92meP+qXd0IscsVUGqXsGvQoiXgCyTT6 p/myCHvfBXveiuP+rFJoxqg3uQmGn4gIbBYobhVxCthGSUQvCOtnikOfxeAsbYf9WTaI S6nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=H8b7+3L8jyoijK3U5LHdUPt3et03RXlG9z84o4vPklU=; b=lUvQtlLQWl9HQ9g2txCmScrVCskgku27SlNSZj2SYlx+94bxZ/xHzAYTc1g76jOgAM L/Ilu8maMEaJK4gj4g9nyS9gRD8ctv4OVH7R33Qsjh0YDHW1ucggiXJ2w6NPGEFxIVIx C+LGrr+ENhSY2rO8LrYqTH488Zdz+hozjE4lKKYsT8aYYtPQKdoi7vr9yYi3YJlM2Bdu GMK8hRrXGeN5WMMfKoaxFsBtVmrMDbzDWLW02M7xv1fgpUaDyu6BCveR4NBoJ64Ynacv 69bxlpF7wMW4dPK8CvcKN6oeJFRpnEtpTzXR0FBLNrWABIeHqN1wJEu5/yr2+apjTHWf TB/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="o/s/oQAP"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v2-20020a170902d68200b00153c1012914si10665092ply.181.2022.03.21.16.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:37:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="o/s/oQAP"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 36F293672FF; Mon, 21 Mar 2022 15:46:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbiCUWrz (ORCPT + 99 others); Mon, 21 Mar 2022 18:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbiCUWrf (ORCPT ); Mon, 21 Mar 2022 18:47:35 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E67843A35D7; Mon, 21 Mar 2022 15:27:35 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 81CD722175; Mon, 21 Mar 2022 22:41:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1647898916; 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=H8b7+3L8jyoijK3U5LHdUPt3et03RXlG9z84o4vPklU=; b=o/s/oQAP6fhf078SLdCjf35BeBa/MVgWK2EQ5ACRLZmmB8sjXAdT3mItde5d4yhj+YoGJW 3SLTBJsX0ffwSsf8G6o0IqCEkV2zYwBf0JTd4YWhUQpjzGtOJcFLRbz7kGeP13ltxceJGS NnJZuKXpaSB3iQSAX/Coq1cQjYYnYPE= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 21 Mar 2022 22:41:56 +0100 From: Michael Walle To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Clause 45 and Clause 22 PHYs on one MDIO bus In-Reply-To: References: <240354b0a54b37e8b5764773711b8aa3@walle.cc> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <4d728d267e45fe591c933c86cdfff333@walle.cc> X-Sender: michael@walle.cc X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Am 2022-03-21 21:36, schrieb Andrew Lunn: >> Actually, it looks like mdiobus_c45_read() is really c45 only and only >> used for PHYs which just support c45 and not c45-over-c22 (?). I was >> mistaken by the heavy use of the function in phy_device.c. All the >> methods in phy-c45.c use phy_*_mmd() functions. Thus it might only be >> the mxl-gpy doing something fishy in its probe function. > > Yes, there is something odd here. You should search back on the > mailing list. > > If i remember correctly, it is something like it responds to both c22 > and c45. If it is found via c22, phylib does not set phydev->is_c45, > and everything ends up going indirect. So the probe additionally tries > to find it via c45? Or something like that. Yeah, found it: https://lore.kernel.org/netdev/YLaG9cdn6ewdffjV@lunn.ch/ But that means that if the controller is not c45 capable, it will always fail to probe, no? I've added the "if (regnum & MII_ADDR_C45) return -EOPNOTSUPP" to the mdio driver and the gpy phy will then fail to probe - as expected. Should it check for -EOPNOTSUPP and just ignore that error and continue probing? Or make it a no-op if probe_capabilities say it has no c45 access so it would take advantage of a quirk flag (derived from dt)? >> Nevertheless, I'd still need the opt-out of any c45 access. Otherwise, >> if someone will ever implement c45 support for the mdio-mscc-mdio >> driver, I'll run in the erratic behavior. > > Yah, i need to think about that. Are you purely in the DT world, or is > ACPI also an option? Just DT world. > Maybe extend of_mdiobus_register() to look for a DT property to limit > what values probe_capabilities can take? I'll have to give it a try. First I was thinking that we wouldn't need it because a broken PHY driver could just set a quirk "broken_c45_access" or similar. But that would mean it has to be probed before any c45 PHY. Dunno if that will be true for the future. And it sounds rather fragile. So yes, a dt property might be a better option. -michael