Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2315550pxp; Mon, 21 Mar 2022 16:43:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSl0kh2eL5eAScWBMP6/kDerGhg+hskQrrbBWLXHYazf3+aH0G2uN6KCiIr5ahxVCxni1R X-Received: by 2002:a17:90a:1d05:b0:1bf:6a85:fbf5 with SMTP id c5-20020a17090a1d0500b001bf6a85fbf5mr1606989pjd.205.1647906235972; Mon, 21 Mar 2022 16:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647906235; cv=none; d=google.com; s=arc-20160816; b=Q7fzvibGuWIgnHoXgOCaLFf5RGyYEIsa8SjOmY4MkqVdzHjI90gNsq1Xijs4tnONOU qmUYCi4FtxCb31kPrZ5KeOloh7NecFOwVWnJt3iQG0QZTfjgXd2XpHSS/Jlgiuhp5sbR NtnFUQ9wGkx8dC9LFKfw9ZDDEjv2EPNsxFpgT8rap87gJ9k/1FnEfLel7WiA1KsozfmP KSv8RXphPCxXaAWsE+Pq3z2aqqhREMIBJJmD/WQKKoUcUQQ+T4MU6R5QDNWx6XAacM9F 9mwyUnlYAcDlj2EgxzcryXv0BUxEhWynY/noSWR3GYG0TlUu1yF7tji/R+cbajLz2oj2 oq4w== 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=zZPO69nLtcVoVNY/8WX7cNadUBapLv4v6RdmgLF+eNE=; b=AGLLz8cAVBYtq9z2syFCgqUhaMnzSTMuUn7Vrv9JC3Caf52DmSrTACZiwfveLQvqD5 RhWcBehDOBoFSRuy0od07xkX7rtthsNaBtuwyVVHOir2viBWidUG6GsbI9ZXA4y9BGVp 8lEfWLbcPokvivFt6JB3HrcmiiJrNPXXOEKxlJ+j5HEKykSOCxFhwyYChuV8eWAGEoAA yxxzRuXDixHVsZYkY1EHMcDtSpORG7FRE1jCyq79ADrnr33KLfJt00PwN8dy+56RBY1q lbWdNzc619bgkoL/gtY+g12h2KrpQVne632EGy5tjczKc/NlkwClbPrIwuiI+L3VbvPi fW+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=qC2R+Sk2; 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 kk9-20020a17090b4a0900b001c6fb9a0ff6si627579pjb.161.2022.03.21.16.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:43:55 -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=qC2R+Sk2; 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 243A8401AB0; Mon, 21 Mar 2022 16:00:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbiCUXBM (ORCPT + 99 others); Mon, 21 Mar 2022 19:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233817AbiCUW7Z (ORCPT ); Mon, 21 Mar 2022 18:59:25 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA4E5399B50; Mon, 21 Mar 2022 15:47: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 99799223EA; Mon, 21 Mar 2022 22:51:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1647899489; 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=zZPO69nLtcVoVNY/8WX7cNadUBapLv4v6RdmgLF+eNE=; b=qC2R+Sk2zeSQp8GXc0s2WUZq/ahHlgtEhKCGH/PNDSbsgJQY0dRaNcDRdCPau4/UsejBxC ZxWV2ZHm5B6MIL95cCFX4NNFA/kYiHNr1GWv57NH0rukuNgaLfV5rEngsLk6Chp6daOdKm bi8zajADj1XswTXM2s5RihUA2YXiepg= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 21 Mar 2022 22:51:29 +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: 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:21, schrieb Andrew Lunn: > On Mon, Mar 21, 2022 at 12:21:48PM +0100, Michael Walle wrote: >> The SoC I'm using is the LAN9668, which uses the mdio-mscc-mdio >> driver. >> First problem there, it doesn't support C45 (yet) but also doesn't >> check >> for MII_ADDR_C45 and happily reads/writes bogus registers. > > There are many drivers like that :-( > > Whenever a new driver is posted, it is one of the things i ask > for. But older drivers are missing such checks. Should that be a patch for net or net-next? One thing to consider; The gpy215 is probing just fine with a c22 only mdio driver which doesn't check for c45 accesses. It might read fishy registers during its probe, though. After adding the c45 check in the mdio drivers read and write it will fail to probe. So depending on the mdio driver it might went unnoticed that the phy_get_c45_ids() could fail. If it should go via net, then it should probably be accompanied by a patch to fix the gpy_probe() (i.e. ignoring -EOPNOTSUPP error). -michael