Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1190032rdb; Wed, 6 Dec 2023 10:58:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IETK9QR0Db/87rSo7ipV0atvl33ywAqiE1V6V9Pay8+IvWGfnQDXXlmoCqSRtzFiwLe1Ar+ X-Received: by 2002:a05:6a20:2326:b0:18f:97c:4f70 with SMTP id n38-20020a056a20232600b0018f097c4f70mr851977pzc.124.1701889106450; Wed, 06 Dec 2023 10:58:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701889106; cv=none; d=google.com; s=arc-20160816; b=c6tAA+8wqOI2qiw68eWsTQjrQo8GMjGwkqCi0r5RTLoezIWQMe1Erwf/x0pPl8zoib 69XHTtDakOZHLl0F/ok0XmXXby+A6uHkiMOwI8GiDnSrXOGAQ/Q48dF4As3QrGZyQ8iB LLBDZsBNzlZwZ98FW5fK9d6lXj/UP02ZK1Fi5ti0U+C/OQhBBUh0T6P4VtvmJbHk5ygW yTK3ca7z5Yd1k9bOW2KKCx9hXcqZpxA+iomHqalc3KijRxSbQuYNzsI/9zRQMIXeuk9s SLb+kgAFM9MHtC9RsZTzo4/JhfF2f2RL564uJM9Y/wVmfm3eawciR84QcmME7uGr4Sys TENw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=cUror6Zovej/o+q+rAuuqniKbeAQpbMhZQ2xAZRjM6U=; fh=S6UzLMgardjKSB6UN5ue0X15qwIj0m9dTGd4Boo5mp0=; b=DGnLk7EtLQi+GfZW1Nh/vA2uFkGWttv7hnTXu8/0/OmHhJYBLQ/XdggIPKncvOSk8s vnGh5PQ5tivZIBG6b3D+6hzgXNtZO0iIYpWUP8fnBvvdqjrNt49rCITPiziPgVGmWe/I gIERTn2oToZFe4yYpnKmdbEET3ohZfYhS/fJ8R5Ug1UMtE7NI2N4hwIv1gMY1+yi+EcO eCwMQe2tQMy4E/V2nL2ZnW1DJlrP+RxiKnzaoBoDriO7827+tPUVWfqLPSlzvmdQreMU GzHlIPk11Upfxl1xNzhquYG+XhnFnpejSyXiwsl9PdQzveoY+VzhRpDMMcsaEPk3edKG n2+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lHD4O3ji; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id n8-20020a654508000000b005aebc9096d4si323083pgq.150.2023.12.06.10.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 10:58:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=lHD4O3ji; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 296078027F60; Wed, 6 Dec 2023 10:58:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379104AbjLFS6G (ORCPT + 99 others); Wed, 6 Dec 2023 13:58:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379144AbjLFS6D (ORCPT ); Wed, 6 Dec 2023 13:58:03 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64B40D64; Wed, 6 Dec 2023 10:58:08 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 73A46E0007; Wed, 6 Dec 2023 18:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701889086; 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=cUror6Zovej/o+q+rAuuqniKbeAQpbMhZQ2xAZRjM6U=; b=lHD4O3jig6uyxTqELk5Gy2q6UKohpFRsE0loQJ43ShLvd88HSx94xoiiTGs/uRgVUnSnez 8cu6VRs3Bc/VAkroGIkOkx9fbvzCIv3jcTqU8EFnghax0EsXMsAIMLJBqJh5548qct7nuP 0zGjX48NhCO/JSZdPX941pTH+Drg2G2PQT2NdNiuP6obdDMdnE/SCwyOoX8dugsFWoxEkW G6X86iVsJAQKLOh2dTdXXBf990JtCEf1J1ho8iqrHN4jzeQPQ69UtgJbEnUlYoDfub0nnD ErrJX/WnplCNXD/9Vmn6Bp9xQImfHXbO9aS7cI0YoUs4nSM9G8ESjvNBgeI5Tg== Date: Wed, 6 Dec 2023 19:58:02 +0100 From: Maxime Chevallier To: "Russell King (Oracle)" Cc: Daniel Golle , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Lunn , Heiner Kallweit , Alexander Couzens , Qingfang Deng , SkyLake Huang , Philipp Zabel , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org Subject: Re: [RFC PATCH v2 5/8] net: pcs: add driver for MediaTek USXGMII PCS Message-ID: <20231206195802.5d2562e7@device.home> In-Reply-To: References: <3cd8af5e44554c2db2d7898494ee813967206bd9.1701826319.git.daniel@makrotopia.org> <20231206105838.069ae288@device.home> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 06 Dec 2023 10:58:22 -0800 (PST) On Wed, 6 Dec 2023 17:58:08 +0000 "Russell King (Oracle)" wrote: > On Wed, Dec 06, 2023 at 10:58:38AM +0100, Maxime Chevallier wrote: > > On Wed, 6 Dec 2023 01:44:38 +0000 > > Daniel Golle wrote: > > > + /* Read USXGMII link status */ > > > + state->link = FIELD_GET(RG_PCS_RX_LINK_STATUS, > > > + mtk_r32(mpcs, RG_PCS_RX_STATUS0)); > > > + > > > + /* Continuously repeat re-configuration sequence until link comes up */ > > > + if (!state->link) { > > > + mtk_usxgmii_pcs_config(pcs, mpcs->neg_mode, > > > + state->interface, NULL, false); > > > + return; > > > > .pcs_get_state() isn't called only for link state polling,but also when querying > > the link state from ethtool, from phylink_ethtool_ksettings_get(). > > > > As mtk_usxgmii_pcs_config triggers a pcs reset and reconfiguration, won't this disrupt > > the link ? > > Highly likely if there's a race, but note that mtk_usxgmii_pcs_config() > only gets called if the link is *down*. I guess some IPs need a bit of > kicking to work properly. > Ah right that's true, it should be OK then. Thanks, Maxime