From: Vinod Koul <vkoul@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: "Peter Griffin" <peter.griffin@linaro.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"André Draszik" <andre.draszik@linaro.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
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" <willmcvicker@google.com>
Subject: Re: [PATCH v2 1/2] phy: add new phy_notify_pmstate() api
Date: Wed, 23 Jul 2025 12:37:31 +0530 [thread overview]
Message-ID: <aICKM-ebp9SMAkZ_@vaman> (raw)
In-Reply-To: <e2lhm237c3xtbdjux2wuesq5fwu7nky3w7oq2fnsgn2pqcg5kh@xhxktriooyes>
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 <peter.griffin@linaro.org>
> > ---
> > 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?
>
> > + * 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
--
~Vinod
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: "Peter Griffin" <peter.griffin@linaro.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"André Draszik" <andre.draszik@linaro.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
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" <willmcvicker@google.com>
Subject: Re: [PATCH v2 1/2] phy: add new phy_notify_pmstate() api
Date: Wed, 23 Jul 2025 12:37:31 +0530 [thread overview]
Message-ID: <aICKM-ebp9SMAkZ_@vaman> (raw)
In-Reply-To: <e2lhm237c3xtbdjux2wuesq5fwu7nky3w7oq2fnsgn2pqcg5kh@xhxktriooyes>
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 <peter.griffin@linaro.org>
> > ---
> > 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?
>
> > + * 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
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2025-07-23 7:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 13:03 [PATCH v2 0/2] Add new phy_notify_pmstate() api Peter Griffin
2025-07-03 13:03 ` Peter Griffin
2025-07-03 13:03 ` [PATCH v2 1/2] phy: add " Peter Griffin
2025-07-03 13:03 ` Peter Griffin
2025-07-22 16:34 ` Manivannan Sadhasivam
2025-07-22 16:34 ` Manivannan Sadhasivam
2025-07-23 7:07 ` Vinod Koul [this message]
2025-07-23 7:07 ` Vinod Koul
2025-07-23 7:52 ` neil.armstrong
2025-07-23 7:52 ` neil.armstrong
2025-07-23 8:04 ` Manivannan Sadhasivam
2025-07-23 8:04 ` Manivannan Sadhasivam
2025-07-25 10:21 ` Peter Griffin
2025-07-25 10:21 ` Peter Griffin
2025-08-06 14:40 ` Neil Armstrong
2025-08-06 14:40 ` Neil Armstrong
2025-07-03 13:03 ` [PATCH v2 2/2] phy: samsung: gs101-ufs: Add .notify_pmstate() and hibern8 enter/exit values Peter Griffin
2025-07-03 13:03 ` Peter Griffin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aICKM-ebp9SMAkZ_@vaman \
--to=vkoul@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=andre.draszik@linaro.org \
--cc=kernel-team@android.com \
--cc=kishon@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mani@kernel.org \
--cc=peter.griffin@linaro.org \
--cc=tudor.ambarus@linaro.org \
--cc=willmcvicker@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.