[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75b1b063-e8d4-417d-99a8-4320d72297cf@moroto.mountain>
Date: Wed, 17 Apr 2024 12:52:07 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Peter Griffin <peter.griffin@...aro.org>
Cc: mturquette@...libre.com, sboyd@...nel.org, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, vkoul@...nel.org,
kishon@...nel.org, alim.akhtar@...sung.com, avri.altman@....com,
bvanassche@....org, s.nawrocki@...sung.com, cw00.choi@...sung.com,
jejb@...ux.ibm.com, martin.petersen@...cle.com,
chanho61.park@...sung.com, ebiggers@...nel.org,
linux-scsi@...r.kernel.org, linux-phy@...ts.infradead.org,
devicetree@...r.kernel.org, linux-clk@...r.kernel.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, tudor.ambarus@...aro.org,
andre.draszik@...aro.org, saravanak@...gle.com,
willmcvicker@...gle.com
Subject: Re: [PATCH 10/17] phy: samsung-ufs: ufs: Add SoC callbacks for
calibration and clk data recovery
On Thu, Apr 04, 2024 at 01:25:52PM +0100, Peter Griffin wrote:
> diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c
> index c567efafc30f..f57a2f2a415d 100644
> --- a/drivers/phy/samsung/phy-samsung-ufs.c
> +++ b/drivers/phy/samsung/phy-samsung-ufs.c
> @@ -46,7 +46,7 @@ static void samsung_ufs_phy_config(struct samsung_ufs_phy *phy,
> }
> }
>
> -static int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy)
> +int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy, u8 lane)
> {
> struct samsung_ufs_phy *ufs_phy = get_samsung_ufs_phy(phy);
> const unsigned int timeout_us = 100000;
> @@ -98,8 +98,15 @@ static int samsung_ufs_phy_calibrate(struct phy *phy)
> }
> }
>
> - if (ufs_phy->ufs_phy_state == CFG_POST_PWR_HS)
> - err = samsung_ufs_phy_wait_for_lock_acq(phy);
> + for_each_phy_lane(ufs_phy, i) {
> + if (ufs_phy->ufs_phy_state == CFG_PRE_INIT &&
> + ufs_phy->drvdata->wait_for_cal)
> + err = ufs_phy->drvdata->wait_for_cal(phy, i);
> +
> + if (ufs_phy->ufs_phy_state == CFG_POST_PWR_HS &&
> + ufs_phy->drvdata->wait_for_cdr)
> + err = ufs_phy->drvdata->wait_for_cdr(phy, i);
The "err" value is only preserved from the last iteration in this loop.
regards,
dan carpenter
> + }
>
> /**
> * In Samsung ufshci, PHY need to be calibrated at different
Powered by blists - more mailing lists