From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26172C433FE for ; Sat, 22 Oct 2022 17:54:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229476AbiJVRx6 (ORCPT ); Sat, 22 Oct 2022 13:53:58 -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/NDsrsrxx3HeAsTFegv5 7o= X-UI-Out-Filterresults: notjunk:1;V03:K0:RkvasrgfSok=:YRqilrFFbryqfyFbhCequw ZNYGO1O9Emc70JRF3Kj2JK8SGP2SzP4LW6IMaxEGBB6INEqmndgMAPmZyfkP1XxZ3MIwYrv+a nJMiKAE337rb5rg9s5CQNOGxGIyNN40cgtzPc56jf7Ljsdg8M8sGnj8MDe5G4oGkPbWoI0L8w lgKEXvvkNCq+u1WiuCdg6gPUQ57Uoh0c9Ajbx0AKHj4CNYVhr1VML8+DqMjV5zi6Bq/UBLeA9 tolKpajW+Sz+rPVR+ONYwv7Kno3KgKGhuMqsyPmXOt6kmmYrlSY0BUTAplc6MIjeJln5B0yLK O58qoY2e2MAykj2h7MD9nIsdlnGxeT5o1nBe3ksr8qH8RWquXph51OWSp0z8dmPuawc7NzU1g MMjCImm95D3/i4UAMRKK3R9/rVhhHQbjaSJGq/i8KzGSkZXewPyf166Sc3wnVdajdJH65lijL Ah/Ln2tBfGxiXdNnCOCGMBQstnknmT6JH5RaT4JXn+NbVy3DACnSO2lcPeu0qPk9hmlNhCDIu HwvBy5Y0JN1FMbjonbFfwvdjYFR30LJoW4DybbfUrX7gZi0ZA36hRUjZhncVzSq/0j6ZXUYka th+KDflW5QNHbOSpb9w77A5r1zRSZKEZSVPTyr/mpIIjOTRBM7KclwO9Cim5VLEvt8C0LmNUx pFR5kFzpQIX/r3b2JLqVuSbtlQ/JS4TpW7WJ7SeGp3Tj02Bmyx+pWpiIUkNUExST5ao0lHWJY FG6+ql9xEmHR42FQ5DUDUeNtT+EQ176rUceHNc/FCGM5vLb/DBT3RMLMvfi6sDeVGKywjs9w1 cDJ38hJ5gr9H1Dq3LGUnoriEtgjdeklxPjJUU+sH0gm9lp0WcWAPTQ5KVQvWl+zZnQNfs81wG y4BtgY2wE2dEcJ8iWnUTafKciY/KeyKaFK81PybxCFPG47nj8r6k2ujI4C/eB296KCEBhFv8W E9fn8UftUt5XFlwdg4Q6YJ0Yid6poDxX1vsPbKnj6DF6qtZAR9Q8q7WK5x2yh0Lr9FwuIBvB6 EUe6/o9tjsLXfBg1ZCeLIKrXAXVw9pZE0nax9ViJmaUwttEs1vurfO5X0LfDQTlJLUNitFw1v wbKQnLjTbYbVFAWjfgYJBAS68pGlbIEKpgcFQvi8soAQbod6T37jGM152WEUSjfTWVBy1086A chx9QHMf7ZZy8pM/TxnDtU3TMfM4EER/pK/xuGUDq62/Xzt3wJfsu/oIEytmt6LDUIRxZNwnd m8m52PBCXq/KxRg+m6Uq4JNejJdgcgDDTNFWdgZ6uQf000mA9b5cfCeJ+Jk/gGBx9SgB/Hd8/ Z0/tPM6e Content-Transfer-Encoding: quoted-printable 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00E73C433FE for ; Sat, 22 Oct 2022 17:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To:Date:Subject:Cc: To:From:Message-ID:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uqeEOa0plEm5W0DBR16cDPfkm12NH4RbXxpZJ8XDZmE=; b=KV2o5GXORpLyJe 6ycMo+lq+pgorhtHycns2jOitHlpXCqyKsrWeWvLuF1LqA37mn7ZpCEVHi3N/g9pHTaQynMijVOYz XmVQKggS6XuuH70NBVZszuI9FVtjvKffQ5qzVx1bS0DBXcNWRdJJHfoIOawk+5UvFB4NoWLOMdooM agILp1QWoAtc6Dz2xQGIAm2IfpzqWrycvDiiNSZ0Xlq4TNjOwKiAnRF3sUndUoePJuYBRx1kJPqsu FZ8oWxzx5L4tZpF3gRZYxbn7YXVvExWk68jgi0fbroLHt4D9ZfA1CPVcW5P1UjlR1TOdVQZix4cgw FqvOnamQ2Y6fXp/IcbGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1omIgt-00DSFf-5o; Sat, 22 Oct 2022 17:53:47 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1omIgp-00DSDr-4B; Sat, 22 Oct 2022 17:53:45 +0000 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 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/NDsrsrxx3HeAsTFegv5 7o= X-UI-Out-Filterresults: notjunk:1;V03:K0:RkvasrgfSok=:YRqilrFFbryqfyFbhCequw ZNYGO1O9Emc70JRF3Kj2JK8SGP2SzP4LW6IMaxEGBB6INEqmndgMAPmZyfkP1XxZ3MIwYrv+a nJMiKAE337rb5rg9s5CQNOGxGIyNN40cgtzPc56jf7Ljsdg8M8sGnj8MDe5G4oGkPbWoI0L8w lgKEXvvkNCq+u1WiuCdg6gPUQ57Uoh0c9Ajbx0AKHj4CNYVhr1VML8+DqMjV5zi6Bq/UBLeA9 tolKpajW+Sz+rPVR+ONYwv7Kno3KgKGhuMqsyPmXOt6kmmYrlSY0BUTAplc6MIjeJln5B0yLK O58qoY2e2MAykj2h7MD9nIsdlnGxeT5o1nBe3ksr8qH8RWquXph51OWSp0z8dmPuawc7NzU1g MMjCImm95D3/i4UAMRKK3R9/rVhhHQbjaSJGq/i8KzGSkZXewPyf166Sc3wnVdajdJH65lijL Ah/Ln2tBfGxiXdNnCOCGMBQstnknmT6JH5RaT4JXn+NbVy3DACnSO2lcPeu0qPk9hmlNhCDIu HwvBy5Y0JN1FMbjonbFfwvdjYFR30LJoW4DybbfUrX7gZi0ZA36hRUjZhncVzSq/0j6ZXUYka th+KDflW5QNHbOSpb9w77A5r1zRSZKEZSVPTyr/mpIIjOTRBM7KclwO9Cim5VLEvt8C0LmNUx pFR5kFzpQIX/r3b2JLqVuSbtlQ/JS4TpW7WJ7SeGp3Tj02Bmyx+pWpiIUkNUExST5ao0lHWJY FG6+ql9xEmHR42FQ5DUDUeNtT+EQ176rUceHNc/FCGM5vLb/DBT3RMLMvfi6sDeVGKywjs9w1 cDJ38hJ5gr9H1Dq3LGUnoriEtgjdeklxPjJUU+sH0gm9lp0WcWAPTQ5KVQvWl+zZnQNfs81wG y4BtgY2wE2dEcJ8iWnUTafKciY/KeyKaFK81PybxCFPG47nj8r6k2ujI4C/eB296KCEBhFv8W E9fn8UftUt5XFlwdg4Q6YJ0Yid6poDxX1vsPbKnj6DF6qtZAR9Q8q7WK5x2yh0Lr9FwuIBvB6 EUe6/o9tjsLXfBg1ZCeLIKrXAXVw9pZE0nax9ViJmaUwttEs1vurfO5X0LfDQTlJLUNitFw1v wbKQnLjTbYbVFAWjfgYJBAS68pGlbIEKpgcFQvi8soAQbod6T37jGM152WEUSjfTWVBy1086A chx9QHMf7ZZy8pM/TxnDtU3TMfM4EER/pK/xuGUDq62/Xzt3wJfsu/oIEytmt6LDUIRxZNwnd m8m52PBCXq/KxRg+m6Uq4JNejJdgcgDDTNFWdgZ6uQf000mA9b5cfCeJ+Jk/gGBx9SgB/Hd8/ Z0/tPM6e X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221022_105343_639631_5DEFE746 X-CRM114-Status: GOOD ( 21.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 control 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 with own caps)? found a documentation where 5=full,6=half, and bits 7+8 are for pause (symetric/asymetric) regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1+8, &val); partner_advertising = (val & 0x00ff0000) >> 16; if (partner_advertising & BIT(5)) state->duplex = DUPLEX_FULL; else if (partner_advertising & BIT(6)) state->duplex = DUPLEX_HALF; if (partner_advertising & BIT(7)) state->pause = MAC_SYM_PAUSE; else if (partner_advertising & BIT(8)) state->pause = 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 what they do? is network broken because of wrong duplex/pause setting? do not fully understand your Patch. But the timer-change can also break sgmii... regards Frank _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel