Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2306884pxp; Mon, 21 Mar 2022 16:28:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHsLD0FKLrnG3J612ztB0t05gXT9BAqmk01WLqeYp0bqccxTHXhsYxrgCi2w6zV8lGbS++ X-Received: by 2002:a17:903:110d:b0:14e:ea6c:7086 with SMTP id n13-20020a170903110d00b0014eea6c7086mr15358715plh.0.1647905337814; Mon, 21 Mar 2022 16:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647905337; cv=none; d=google.com; s=arc-20160816; b=fWSTu2Ia5g9YJj5hFZIxHUCNvumqXXUUi3kv8UaHRzwSXhpKxqYyiSoeF78QtaKjgb IiCaaH7oU+VV82awPvTwNMgazwBfwqibipHk5i3Ul2dHYXILXT8d6Eha0+vbgcdcVLqT Qd2+bQjGzwYXz4zr6ekCHgl2q/DBVxNraT8ghdcNNIOE1UXXby7DUW3tnvo3QwaitlmA BLV3Rr+wj9s630kF//z7XCFE0CH4rHXQs8EObpcBMyRt7MnOoWggAknvURlysMlRmQXt 7dPlrtbrFvyirXFo1KSfNjEOsilG+z1Shw4S5l8xWuKQ3wwP/v+MTynvQrQ4dmya9w5K zyrg== 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:subject:to:from:date :content-transfer-encoding:mime-version:dkim-signature; bh=vTGNgxQ0XsK0oOSlp1IzamOEjyBB0AvzrZZ0Ss1/2Tw=; b=frlQEDvRRTkUdel+p0G1tjQg3nzVrCXTImlsABxdVrLwVhTSmDCn7HlJxyD2vBcis8 d4dOqPlhWzBRnHHM8y0GuE+klE9dmhbbEhGYJRNb0H6kUIhMP1tYCZp1smtJG1O3OAek KS5m2lk0vr7pH8oVYP5c8n+0rfNDSwFPTFNxVkj8vFHa8jHaPMFCo4FoinhG2PsKA5Pk pA+QECSN2Sy4mrQ6HhOKqR5C0WugwF1N125B7y6GF5p8WabZd33o1Z7a9PN1EyD/dWTK 6FFY8wJcbk9qndpNgL5/KpbZB9BJJwEdEVnbcDd85Y0EcoX9FKqKGxfUL/FHA/JQrgUX y7gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="iDE/Qo46"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w15-20020a1709027b8f00b00153f7e1559dsi11763912pll.55.2022.03.21.16.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="iDE/Qo46"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 AB1E7464181; Mon, 21 Mar 2022 15:19:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346734AbiCULXT (ORCPT + 99 others); Mon, 21 Mar 2022 07:23:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346730AbiCULXP (ORCPT ); Mon, 21 Mar 2022 07:23:15 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E569E8BE19; Mon, 21 Mar 2022 04:21:49 -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 62E6922175; Mon, 21 Mar 2022 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1647861708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vTGNgxQ0XsK0oOSlp1IzamOEjyBB0AvzrZZ0Ss1/2Tw=; b=iDE/Qo46vzHu5Jo2ge2/0/5mkHGnU95dkxQV1qJi9UuT5U8YZU2qVRjiDdtWhi3b/1qlZp r2kNcTMAhx4m3uef4liOCmsIeaN09p/SY7AaOVElqoAQqZJMJPYG8mo0o+c1wvOtDLMQPM U/URznJuJo9Dx41uHSfuaMbbKqWQ1Ns= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 21 Mar 2022 12:21:48 +0100 From: Michael Walle To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Clause 45 and Clause 22 PHYs on one MDIO bus User-Agent: Roundcube Webmail/1.4.13 Message-ID: <240354b0a54b37e8b5764773711b8aa3@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 Hi, I have a board with a c22 phy (microchip lan8814) and a c45 phy (intel/maxlinear gyp215) on one bus. If I understand it correctly, both accesses should be able to coexist on one bus. But the microchip lan8814 actually has a bug and gets confused by c45 accesses. For example it will respond in the middle of another transaction with its own data if it decodes it as a read. That is something we can see on a logic analyzer. But we also see random register writes on the lan8814 (which you don't see on the logic analyzer obviously). Fortunately, the GPY215 supports indirect MMD access by the standard c22 registers. Thus as a workaround for the problem, we could have a c22 only mdio bus. 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. I've looked at the mdio subsystem in linux, there is probe_capabilities (MDIOBUS_C45 and friends) but the mxl-gpy.c is using c45 accesses nevertheless. I'm not sure if this is a bug or not. I was thinking of a fallback mechanism for the c45 read access like in read_mmd. And even if the mdio controller is c45 capable, a PHY might opt out. In my case, the lan8814. What do you think? -michael