Re: [PATCH 04/10] scsi: ufs: Move Versal2 M-PHY CREG access helpers into ufshcd-dwc
From: Larisa Ileana Grigore
Date: Thu Aug 27 2026 - 10:14:24 EST
On 8/26/2026 6:36 PM, Bart Van Assche wrote:
On 8/26/26 6:40 AM, Larisa Grigore wrote:
+int ufshcd_dwc_phy_reg_write(struct ufs_hba *hba, u32 addr, u32 val)
+{
+ struct ufshcd_dme_attr_val phy_write_attrs[] = {
+ { UIC_ARG_MIB(CBCREGADDRLSB), 0, DME_LOCAL },
+ { UIC_ARG_MIB(CBCREGADDRMSB), 0, DME_LOCAL },
+ { UIC_ARG_MIB(CBCREGWRLSB), 0, DME_LOCAL },
+ { UIC_ARG_MIB(CBCREGWRMSB), 0, DME_LOCAL },
+ { UIC_ARG_MIB(CBCREGRDWRSEL), 1, DME_LOCAL },
+ { UIC_ARG_MIB(VS_MPHYCFGUPDT), 1, DME_LOCAL }
+ };
This array and similar arrays should be declared 'static const'.
Thanks,
Bart.
Thanks for the review Bart! I did not make the arrays static because their entries depend on the runtime addr and val arguments. A shared static buffer would be racy if two callers ran concurrently. However, I can make the arrays const in v2 by moving the addr/val-derived bytes directly into the initializer.
Regards,
Larisa