Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4506831rwi; Sat, 22 Oct 2022 11:08:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6lxPoJuOAZ3L8W3ezBoTcDhuQbM9ICllfU7s88s1o8eLvDwEpRVKCw93iy5cF0FbYVKPM9 X-Received: by 2002:a17:907:9815:b0:78e:4b6:1afb with SMTP id ji21-20020a170907981500b0078e04b61afbmr20695612ejc.291.1666462131883; Sat, 22 Oct 2022 11:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666462131; cv=none; d=google.com; s=arc-20160816; b=HVNsVgbh4LwL3kISUlq6WDdjRx07cyk/pl7m35WanT3wE6WYrW8qiM1QAAMO+Xe5zr +rdGb4otVEPQIU6H6ECwCXUPVX/ajD+/TL/WjpYcDOIki7hrKiAav0RTuG59Znm6AHHm elVK+iOIWvOfNgWw3bGJ3c6lidDuJHU1RVxtShiRAjhbGA07rclGwvUvx72hZ41FVP6F XJswfuUN/aurNily9TvfG2Hh+6uFa01RXFLtHSENoGjoUeLqh78TiOZRJ8kcjKMBz51S iSh6spputtAu0CTkTmru9H0CSfXg1h1TXlQj7iSmNgbwjhnXwOz+8MQCObj1h8wfmxu6 sCEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:references:in-reply-to :sensitivity:importance:date:subject:cc:to:from:message-id :mime-version:dkim-signature; bh=AfYNDmW2UgAvRctWRxqUjEuFZBWgmozMRxiCBT3AdXo=; b=WrNhJQue1doY5q5qUtcqYxyY2F0+0o+PcRD79pntbVjUAOGt02FkncYxxcF0rYDHT3 k8mreoOhfg0jtogFTeaNg5B3a9X/wLer+gFcAVkU1J5dBWDhgsOgy58yxXry43+ersnW zYRp71ykK+dFW6/JdDA77dY7rjLCf5Gzo1jpyjH1z1bdmKp8eUudSiyTbU2jsKDcmwcl CcdSObG2+DP0g6639DDq3QvO2OlvG8nFS9cRvKMkpGYhPTZfjvDvCPJtf15vgaQ5/fb0 AWq8ir5MDoItKx4zc3Nv5AbUHEcufgf9yUbFT7C9yC1Bk9X6fixPpLrJQM9jp4UU7Wws jJ3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=K3JdsHGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba7-20020a0564021ac700b004619e210510si212355edb.150.2022.10.22.11.08.24; Sat, 22 Oct 2022 11:08:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=K3JdsHGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229875AbiJVRx4 (ORCPT + 99 others); Sat, 22 Oct 2022 13:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbiJVRxx (ORCPT ); Sat, 22 Oct 2022 13:53:53 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D1918DD74; Sat, 22 Oct 2022 10:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1666461196; bh=TBzr85uWzatSpkiA1DzSeFU3cieZchfrifodRz9AlJI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=K3JdsHGTgoF1Ze2g677/8cmwtqvef7qs32CJs6K4raM6PkgUZj5uLRKMyIxzgchy8 eiK3XlutaJhYJaY+Vgod/IGUY0IL7RTpFZEx6Yyt3tM2t5xpsUMQzqj1BBH7oUR4kT n0WPKNrLtbf6AqVQgci6OEIrKrog7lDGhi4wLkpk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [80.245.73.148] ([80.245.73.148]) by web-mail.gmx.net (3c-app-gmx-bs49.server.lan [172.19.170.102]) (via HTTP); Sat, 22 Oct 2022 19:53:16 +0200 MIME-Version: 1.0 Message-ID: From: Frank Wunderlich To: "Russell King (Oracle)" Cc: Frank Wunderlich , linux-mediatek@lists.infradead.org, Alexander Couzens , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Aw: Re: Re: Re: Re: [PATCH v2] net: mtk_sgmii: implement mtk_pcs_ops Content-Type: text/plain; charset=UTF-8 Date: Sat, 22 Oct 2022 19:53:16 +0200 Importance: normal Sensitivity: Normal In-Reply-To: References: <02A54E45-2084-440A-A643-772C0CC9F988@public-files.de> <9BC397B2-3E0B-4687-99E5-B15472A1762B@fw-web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:OWdvSkP51RMdkQ7qb3NHHRIOta2CZi7LRpGSfsHBJuLrfbVKcY73ozQwYHiyx0BmkMDkl OofhqAfbiQWkba9LyqUPnvQKd29eb7xgu7r21pdZDo4zwIcESvCLPd/JCAnsqqLj3Tt1xdNqF0nJ cdkIXF+AiAiFk2bDIoKUlA/h70BUMMT+a+C+v2a6Z2YkVvOcCu0MtqysXDVjrMzs+1pZDCk+oXc9 +aOlakGRHI1kSrt97/1sRGNI32hV9vH9//3uH4aU0MSWP6MDVliOQwpb/NDsrsrxx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bKnj6DF6qtZAR9Q8q7WK5x2yh0Lr9FwuIBvB6 EUe6/o9tjsLXfBg1ZCeLIKrXAXVw9pZE0nax9ViJmaUwttEs1vurfO5X0LfDQTlJLUNitFw1v wbKQnLjTbYbVFAWjfgYJBAS68pGlbIEKpgcFQvi8soAQbod6T37jGM152WEUSjfTWVBy1086A chx9QHMf7ZZy8pM/TxnDtU3TMfM4EER/pK/xuGUDq62/Xzt3wJfsu/oIEytmt6LDUIRxZNwnd m8m52PBCXq/KxRg+m6Uq4JNejJdgcgDDTNFWdgZ6uQf000mA9b5cfCeJ+Jk/gGBx9SgB/Hd8/ Z0/tPM6e Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 > Gesendet: Samstag, 22. Oktober 2022 um 19:05 Uhr > Von: "Russell King (Oracle)" > On Sat, Oct 22, 2022 at 12:52:00PM +0200, Frank Wunderlich wrote: > > > Gesendet: Samstag, 22. Oktober 2022 um 11:11 Uhr > > > Von: "Russell King (Oracle)" > > this patch breaks connectivity at least on the sfp-port (eth1). > > pcs_get_state > > [ 65.522936] offset:0 0x2c1140 > > [ 65.522950] offset:4 0x4d544950 > > [ 65.525914] offset:8 0x40e041a0 > > [ 177.346183] offset:0 0x2c1140 > > [ 177.346202] offset:4 0x4d544950 > > [ 177.349168] offset:8 0x40e041a0 > > [ 177.352477] offset:0 0x2c1140 > > [ 177.356952] offset:4 0x4d544950 > > Hi, > > Thanks. Well, the results suggest that the register at offset 8 is > indeed the advertisement and link-partner advertisement register. So > we have a bit of progress and a little more understanding of this > hardware. > > Do you know if your link partner also thinks the link is up? yes link is up on my switch, cannot enable autoneg for fibre-port, so port= is fixed to 1000M/full flowcontrol enabled. > What I notice is: > > mtk_soc_eth 15100000.ethernet eth1: Link is Up - 1Gbps/Unknown - flow co= ntrol off > > The duplex is "unknown" which means you're not filling in the > state->duplex field in your pcs_get_state() function. Given the > link parter adverisement is 0x00e0, this means the link partner > supports PAUSE, 1000base-X/Half and 1000base-X/Full. The resolution > is therefore full duplex, so can we hack that in to your > pcs_get_state() so we're getting that right for this testing please? 0xe0 is bits 5-7 are set (in lower byte from upper word)..which one is for= duplex? so i should set state->duplex/pause based on this value (maybe compare wit= h own caps)? found a documentation where 5=3Dfull,6=3Dhalf, and bits 7+8 are for pause = (symetric/asymetric) regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1+8, &val); partner_advertising =3D (val & 0x00ff0000) >> 16; if (partner_advertising & BIT(5)) state->duplex =3D DUPLEX_FULL; else if (partner_advertising & BIT(6)) state->duplex =3D DUPLEX_HALF; if (partner_advertising & BIT(7)) state->pause =3D MAC_SYM_PAUSE; else if (partner_advertising & BIT(8)) state->pause =3D MAC_ASYM_PAUSE; > Now, I'm wondering what SGMII_IF_MODE_BIT0 and SGMII_IF_MODE_BIT5 do > in the SGMSYS_SGMII_MODE register. Does one of these bits set the > format for the 16-bit control word that's used to convey the > advertisements. I think the next step would be to play around with > these and see what effect setting or clearing these bits has - > please can you give that a go? these is not clear to me...should i blindly set these and how to verify wh= at they do? is network broken because of wrong duplex/pause setting? do not fully unde= rstand your Patch. But the timer-change can also break sgmii... regards Frank