drivers/ufs/host/ufs-exynos.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
Notify the ufs phy of the hibern8 link state so that it can program the
appropriate values.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
---
Note 1: The phy_notify_state() API is part of v6.19-rc1 and onwards.
Note 2: I've added Barts Reviewed-by from v1. The API name and parameter
changed slightly during the phy subsystem review, but the intent is still
the same.
---
Changes in v2:
- Collect up tags
- Rebased onto next-20260106
- Update phy_notify_pmstate() to phy_notify_state()
- Link to v1: https://lore.kernel.org/r/20250703-ufs-exynos-phy_notify_pmstate-v1-1-49446d7852d1@linaro.org
---
drivers/ufs/host/ufs-exynos.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 70d195179ebaa01f38331faaee6f8349211c4c3b..6da3d7ee744b92cfe1806fa654eb80a564ae65bb 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -1568,12 +1568,17 @@ static void exynos_ufs_pre_hibern8(struct ufs_hba *hba, enum uic_cmd_dme cmd)
{
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
struct exynos_ufs_uic_attr *attr = ufs->drv_data->uic_attr;
+ union phy_notify phystate = {
+ .ufs_state = PHY_UFS_HIBERN8_EXIT
+ };
if (cmd == UIC_CMD_DME_HIBER_EXIT) {
if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL)
exynos_ufs_disable_auto_ctrl_hcc(ufs);
exynos_ufs_ungate_clks(ufs);
+ phy_notify_state(ufs->phy, phystate);
+
if (ufs->opts & EXYNOS_UFS_OPT_USE_SW_HIBERN8_TIMER) {
static const unsigned int granularity_tbl[] = {
1, 4, 8, 16, 32, 100
@@ -1600,12 +1605,17 @@ static void exynos_ufs_pre_hibern8(struct ufs_hba *hba, enum uic_cmd_dme cmd)
static void exynos_ufs_post_hibern8(struct ufs_hba *hba, enum uic_cmd_dme cmd)
{
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
+ union phy_notify phystate = {
+ .ufs_state = PHY_UFS_HIBERN8_ENTER
+ };
if (cmd == UIC_CMD_DME_HIBER_ENTER) {
ufs->entry_hibern8_t = ktime_get();
exynos_ufs_gate_clks(ufs);
if (ufs->opts & EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL)
exynos_ufs_enable_auto_ctrl_hcc(ufs);
+
+ phy_notify_state(ufs->phy, phystate);
}
}
---
base-commit: 6cd6c12031130a349a098dbeb19d8c3070d2dfbe
change-id: 20250703-ufs-exynos-phy_notify_pmstate-c0e9db95ac66
Best regards,
--
Peter Griffin <peter.griffin@linaro.org>
On 1/7/26 5:51 AM, Peter Griffin wrote:
> + union phy_notify phystate = {
> + .ufs_state = PHY_UFS_HIBERN8_EXIT
> + };
Should this be declared 'static const'?
> + phy_notify_state(ufs->phy, phystate);
Can you please ask the maintainer of include/linux/phy/phy.h why
phy_notify is a union since it only has a single member? From that
header file:
union phy_notify {
enum phy_ufs_state ufs_state;
};
> + union phy_notify phystate = {
> + .ufs_state = PHY_UFS_HIBERN8_ENTER
> + };
Same question here: should this be declared 'static const'?
Thanks,
Bart.
Hi Bart,
Thanks for your review feedback.
On Wed, 7 Jan 2026 at 16:57, Bart Van Assche <bvanassche@acm.org> wrote:
>
> On 1/7/26 5:51 AM, Peter Griffin wrote:
> > + union phy_notify phystate = {
> > + .ufs_state = PHY_UFS_HIBERN8_EXIT
> > + };
>
> Should this be declared 'static const'?
Yes, good point, I can update that.
>
> > + phy_notify_state(ufs->phy, phystate);
>
> Can you please ask the maintainer of include/linux/phy/phy.h why
> phy_notify is a union since it only has a single member? From that
> header file:
>
> union phy_notify {
> enum phy_ufs_state ufs_state;
> };
Originally in v1 it was proposed as an enum. Some feedback from Mani
was to have it as an 'int state' and let drivers pass their own link
state values to support multiple peripherals. Vinod (phy maintainer)
wanted to lock it down to stop any API abuse (see
https://lore.kernel.org/all/aICKM-ebp9SMAkZ_@vaman/). So we ended up
on a union with peripheral specific values (of which currently UFS is
the only member, but the expectation is more will be added for other
peripheral types).
>
> > + union phy_notify phystate = {
> > + .ufs_state = PHY_UFS_HIBERN8_ENTER
> > + };
>
> Same question here: should this be declared 'static const'?
Will update to 'static const'.
Thanks,
Peter
© 2016 - 2026 Red Hat, Inc.