[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <kghfto33klbvpdgehzmjjxzsoqymhrq3dbwbtwa4xddsjdj7q4@uqd7epguntgt>
Date: Tue, 8 Jul 2025 13:29:31 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Nitin Rawat <quic_nitirawa@...cinc.com>
Cc: James.Bottomley@...senpartnership.com, martin.petersen@...cle.com,
bvanassche@....org, avri.altman@....com, ebiggers@...gle.com,
neil.armstrong@...aro.org, konrad.dybcio@....qualcomm.com, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: Re: [PATCH V2 2/3] scsi: ufs: core: Add ufshcd_dme_rmw to modify DME
attributes
On Tue, Jul 08, 2025 at 02:32:59AM GMT, Nitin Rawat wrote:
> Introduce `ufshcd_dme_rmw` API to read, modify, and write DME
> attributes in UFS host controllers using a mask and value.
>
> Signed-off-by: Nitin Rawat <quic_nitirawa@...cinc.com>
> ---
> include/ufs/ufshcd.h | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
> index 9b3515cee711..fe4bb248484c 100644
> --- a/include/ufs/ufshcd.h
> +++ b/include/ufs/ufshcd.h
> @@ -1498,6 +1498,32 @@ static inline int ufshcd_vops_phy_initialization(struct ufs_hba *hba)
> return 0;
> }
>
> +/**
> + * ufshcd_dme_rmw - get modify set a dme attribute
s/dme/DME
Maybe name the function as, 'ufshcd_dme_update()'?
> + * @hba - per adapter instance
> + * @mask - mask to apply on read value
> + * @val - actual value to write
> + * @attr - dme attribute
> + */
> +static inline int ufshcd_dme_rmw(struct ufs_hba *hba, u32 mask,
> + u32 val, u32 attr)
Please move the definition to ufshcd.c
> +{
> + u32 cfg = 0;
> + int err = 0;
No need to initialize these.
> +
> + err = ufshcd_dme_get(hba, UIC_ARG_MIB(attr), &cfg);
> + if (err)
> + goto out;
Just do, 'return err'.
> +
> + cfg &= ~mask;
> + cfg |= (val & mask);
> +
> + err = ufshcd_dme_set(hba, UIC_ARG_MIB(attr), cfg);
return ufshcd_dme_set();
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists