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 21F49C83F25 for ; Wed, 23 Jul 2025 08:11:33 +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-Type: Content-Transfer-Encoding:Reply-To:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MAIyPiX5bV64AVSLo2klqYWehmPfxw60zDUn8I5fxcY=; b=vsWYTP7+Sr9b0/Ah3fPXULZYy1 LXVfhJJqhS+kHNBSjMgqRfiRK/wRDPLfGlRPvKr+VoKATMF/txiPWffOjsKe2zJmQZLczVhxMnqxg q5l5n0UyIp0tFCb0FsUhUQblxXrr6IUMfEjljXNbul77qQ6ROQngOf58FHk8S94OpfvUPbBJL6E3P OI2xq1pOs5M4SL4L8+2cWjq0e1lWcNwk6gTwrR/zdRLWqHHqAQk5zPfu2ZrtbBP6XyiWFJUv1JqgQ Xf7yzG9QL5vGdA5Fhw51bWa4pDjKVaYynVH+RW7T/EskcTEUlVsRzaD5x6+y/cwp/R0biIsnst66d RdwApHdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1ueUZY-00000004LHb-3bA8; Wed, 23 Jul 2025 08:11:32 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ueUHD-00000004IPJ-01iq for linux-phy@lists.infradead.org; Wed, 23 Jul 2025 07:52:36 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3b49ffbb31bso4112426f8f.3 for ; Wed, 23 Jul 2025 00:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1753257153; x=1753861953; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=wJr/hw1dHQH58OkL2qscj1xdCFrGFtnGhH2Sn1vmVSA=; b=rSGb/I4I+FGTbNKMTldcZ4YlghhzJwbc4DTyBtYbVxnNxwfquWpopBCmli04U+G6dM x4akROnnGjbs4Un7BU1vc3Y/2RFiOacnm/1RofSgk/4uGMZg26qpnlVVr7GD3iaTXs2z hbaabcgumK3SDdAMryzI7q5RBXXv4QTRLu5uCFbJZ10jjebMmU1GYlWWJ6w5T6ND2nbs tY/xkK2spSQ0HRXUHngt2a7IYNO3n+1AT1dJPx4M/FaNWVXWwlyLoylERpcgDcN7eWKr ZbBe+6AR8Z+qD1qQmNPh4SwTIKOKgrs4nrZ8fT1kM5x7JNmbOww3pYzGNqgfiqrg8EJL I6MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753257153; x=1753861953; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=wJr/hw1dHQH58OkL2qscj1xdCFrGFtnGhH2Sn1vmVSA=; b=BeVxkzFSAEnMRZ+yCGAkHvLWATAzV5Jah9WCIjgAR+5TCmc1yOHatRauX+u47XbSID EckrCjZnbc7pinqolO2HzaAmRCAYESbHj62J+34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:3b6:1630:9204 with SMTP id ffacd0b85a97d-3b768ec8a1bmr1439039f8f.19.1753257152837; Wed, 23 Jul 2025 00:52:32 -0700 (PDT) Received: from ?IPV6:2a01:e0a:3d9:2080:8813:2f0d:f9e0:5294? ([2a01:e0a:3d9:2080:8813:2f0d:f9e0:5294]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45869199605sm14357735e9.14.2025.07.23.00.52.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jul 2025 00:52:32 -0700 (PDT) Message-ID: Date: Wed, 23 Jul 2025 09:52:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: neil.armstrong@linaro.org Subject: Re: [PATCH v2 1/2] phy: add new phy_notify_pmstate() api To: Vinod Koul , Manivannan Sadhasivam Cc: Peter Griffin , Kishon Vijay Abraham I , =?UTF-8?Q?Andr=C3=A9_Draszik?= , Tudor Ambarus , Alim Akhtar , Krzysztof Kozlowski , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel-team@android.com, William Mcvicker References: <20250703-phy-notify-pmstate-v2-0-fc1690439117@linaro.org> <20250703-phy-notify-pmstate-v2-1-fc1690439117@linaro.org> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7k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IssFjwB0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250723_005235_038873_C4F81C07 X-CRM114-Status: GOOD ( 18.06 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Neil Armstrong Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On 23/07/2025 09:07, Vinod Koul wrote: > On 22-07-25, 22:04, Manivannan Sadhasivam wrote: >> On Thu, Jul 03, 2025 at 02:03:22PM GMT, Peter Griffin wrote: >>> Add a new phy_notify_pmstate() api that notifies and configures a phy for a >>> given PM link state transition. >>> >>> This is intended to be by phy drivers which need to do some runtime >>> configuration of parameters during the transition that can't be handled by >>> phy_calibrate() or phy_power_{on|off}(). >>> >>> The first usage of this API is in the Samsung UFS phy that needs to issue >>> some register writes when entering and exiting the hibernate link state. >>> >>> Signed-off-by: Peter Griffin >>> --- >>> drivers/phy/phy-core.c | 25 +++++++++++++++++++++++++ >>> include/linux/phy/phy.h | 25 +++++++++++++++++++++++++ >>> 2 files changed, 50 insertions(+) >>> >>> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c >>> index 04a5a34e7a950ae94fae915673c25d476fc071c1..0b29bc2c709890d7fc27d1480a35cda6a826fd30 100644 >>> --- a/drivers/phy/phy-core.c >>> +++ b/drivers/phy/phy-core.c >>> @@ -520,6 +520,31 @@ int phy_notify_disconnect(struct phy *phy, int port) >>> } >>> EXPORT_SYMBOL_GPL(phy_notify_disconnect); >>> >>> +/** >>> + * phy_notify_pmstate() - phy link state notification >> >> 'pmstate' doesn't correspond to 'link state'. So how about, >> phy_notify_link_state()? >> >> s/phy/PHY (here and below) >> >>> + * @phy: the phy returned by phy_get() >>> + * @state: the link state >>> + * >>> + * Notify the phy of some PM link state transition. Used to notify and >> >> Link state change is common for the PHY. So remove 'PM'. > > Is it really link or phy state? It seems to be a link state, and I think adding a way to force a link state to a phy, which is basically the role of a phy, more coherent. Neil > >> >>> + * configure the phy accordingly. >>> + * >>> + * Returns: %0 if successful, a negative error code otherwise >>> + */ >>> +int phy_notify_pmstate(struct phy *phy, enum phy_linkstate state) >> >> I think you need to use 'int state' and let drivers pass their own link state >> values. You cannot have generic link states across all peripherals. > > I would avoid that, people start overloading this if we let it keep > open! I would like to avoid the api -(ab)use > -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy