Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1565530rdb; Mon, 2 Oct 2023 13:44:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0K8yNETnyo50AJ2SmVWaZMjfGFqu8JLRcafBiFQbQGN2Iigl7TTkHP96iKWsY96U5a0hX X-Received: by 2002:a25:414:0:b0:d85:b09e:b9c9 with SMTP id 20-20020a250414000000b00d85b09eb9c9mr11774717ybe.52.1696279495963; Mon, 02 Oct 2023 13:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696279495; cv=none; d=google.com; s=arc-20160816; b=j+ZFNcXS9VL1+yNJ47ze4LMmIbbt0Eh9Fd6rbWxIioxgiSXV5+nGMJ0u6SE3t6q1WD cm8RwSSo0aTKcDNaRnaB+5wk2TCK5SmDDbcg5/3MWhongweBYCvcyX9hq01qCndFo2n/ 3Z4/V/mKk1NA/45HweyVmEDzGkOb+HemG7KIZqhjFIQTvYu5sbvc6UMiHqMY/pIHaSIn dXucGL9uP3KUlvxVRyi/Q7WwZQIwcbiD/rYK4EUzSnN/wtDB/7jGtnkPg1C4WhM7bi9k bmZx9uF5dkKJ1aeh8YzXxyeheaw4CojRtKTBgVDCZ9HW6DoKeQr3N5arZXHx1PYC7uKL N5Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7Tr1XYfZFQPwOIGZkao0xDKBVDpd/yFY9b0CTr+HCmI=; fh=pbZyqEDyWGy/KRFIOtnMVxtI61y5wDJ5XWPPA5sL6cg=; b=IyQycOsi3j8nz6PyL8TZ7HCeNLdcbtXGaNRAq8YzJYFyRJBlDfwNBYKQLlX09ccH+n YgV0BdFVo0pTq0+a/JaUSWY/GPwGj4N61YRHpKZzV47ryXrxbWoM+JbdaOAW4PTNHfcA MV1itQy+vYPuACAnTf4jAzAVXqF4277vus6bPC05bbGFuwPe/w6uzYl84YTosoeeX6fv WXOu/kc5ZfhS3pLiS47OGpJ4CkT2PR+3RgL2hLHtMZ6aWdVNyumtZ59nVb7qX2f66iq1 B78SuwiSwfVdCgBfCiN7TNTk5P1+F+mHScBmoFg8qogr8CWgTCEbnQXqlK3IK2We+IMY RPew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fG8Lk0qh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id o66-20020a634145000000b005657ba564bdsi19990385pga.826.2023.10.02.13.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 13:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fG8Lk0qh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0FB68804755C; Mon, 2 Oct 2023 12:16:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbjJBTQV (ORCPT + 99 others); Mon, 2 Oct 2023 15:16:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjJBTQU (ORCPT ); Mon, 2 Oct 2023 15:16:20 -0400 Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F4DDB3; Mon, 2 Oct 2023 12:16:17 -0700 (PDT) Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-4527d65354bso88163137.0; Mon, 02 Oct 2023 12:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696274176; x=1696878976; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7Tr1XYfZFQPwOIGZkao0xDKBVDpd/yFY9b0CTr+HCmI=; b=fG8Lk0qhIQ9sgBk798MAYtZLMMNfcPDOVCC0CpCe7i3XpsRF7tEScj/ldnV79b91Rj Ip41w2YhjKbY9PykpLqYXhDQzE1vOBiWpqyMQTOzhYL3apgFZW1zRoYokZKpG3oWC+E6 v24X0nLYLJkK6CsDBH/C/VBI/epdehsas0OrFS7uoSXpoRyiUPJt9rqt1iXOz/byznKm 6Kgj9PjFKAOguAINhI/d/6kkMEQg3jV/j3YrKVgSAFM6srkuPxUI8IRAvmk2bEdthyJo qOTLFJE/6/jUAwyisNI9UCnwcbdFuRc9ru1qk4wz6TTNdBcVggNz26eKJiA+vhpvrucg 1/KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696274176; x=1696878976; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7Tr1XYfZFQPwOIGZkao0xDKBVDpd/yFY9b0CTr+HCmI=; b=tpzlZQbbKX5mC9ZKRMyJViyEGcxsLl2iEu+QmxOWtJjtyUktDjcukGskb4KDa/NLsp sIDymMG0dox1SeNVoU43FQlBeVJpi9L/xnyFp4onRrd49a7FTyleSuVtZqMNdOmeP/6b 0Jk/9ukyfZ9veAzdPnZW8OiEm64avcO10e7Buu35DSsvS8AYLw4FH4ubE70+uFbOR7H5 Pxdxsv0+gBscC9azb6dQgMOd5bjP6a0/anVrU6lnznrm6zhuCsUSMES+hg0FvPipQN+f vVBHnArTuH39F8AeoRDPa2MjNjtpXghoVi0m7zaoYzBOpq0+J1FZxuWDp3X9gmfmSwUM kk/w== X-Gm-Message-State: AOJu0YyDpN1+/TDOtTAwAJbuzL8xonWvdm2JTpe0G8cA2gqHZnFAzNrg +CF5LuuP7EvpbV1IfwzsgKU= X-Received: by 2002:a05:6102:1cb:b0:454:6ccc:ab79 with SMTP id s11-20020a05610201cb00b004546cccab79mr10882242vsq.11.1696274176341; Mon, 02 Oct 2023 12:16:16 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id o20-20020a0cf4d4000000b00656329bb3b1sm7686722qvm.10.2023.10.02.12.16.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Oct 2023 12:16:15 -0700 (PDT) Message-ID: <4351a85a-ab53-acf8-9e80-e65b2ebfab66@gmail.com> Date: Mon, 2 Oct 2023 12:16:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [RFC PATCH v2 net-next 01/15] phy: introduce phy_get_status() and use it to report CDR lock Content-Language: en-US To: Vladimir Oltean , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Cc: "Russell King (Oracle)" , Heiner Kallweit , Andrew Lunn , Madalin Bucur , Ioana Ciornei , Camelia Groza , Li Yang , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sean Anderson , Maxime Chevallier , Vinod Koul , Kishon Vijay Abraham I References: <20230923134904.3627402-1-vladimir.oltean@nxp.com> <20230923134904.3627402-2-vladimir.oltean@nxp.com> From: Florian Fainelli In-Reply-To: <20230923134904.3627402-2-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 12:16:30 -0700 (PDT) On 9/23/23 06:48, Vladimir Oltean wrote: > Some modules, like the MTIP AN/LT block used as a copper backplane PHY > driver, need this extra information from the SerDes PHY as another > source of "link up" information. > > Namely, the 25GBase-R PCS does not have a MDIO_CTRL1_LPOWER bit > implemented in its MDIO_MMD_PCS:MDIO_CTRL1 register. That bit is > typically set from phy_suspend() or phylink_pcs_disable() implementations, > and that is supposed to cause a link drop event on the link partner. > But here it does not happen. > > By implementing the networking phylink_pcs_disable() as phy_power_off(), > we are able to actually power down the lane in a way that is visible to > the remote end. Where it is visible is the CDR lock, so we introduce > PHY_STATUS_TYPE_CDR_LOCK as an extra link indication, we are able to > detect that condition and signal it to upper layers of the network > stack. > > A more high-level and generic phy_get_status() operation was chosen > instead of the more specific phy_get_cdr_lock() alternative, because I > saw this as being more in the spirit of the generic PHY API. > Also, phy_get_status() is more extensible and reusable for other > purposes as well. > > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian