Re: [PATCH 04/10] scsi: ufs: Move Versal2 M-PHY CREG access helpers into ufshcd-dwc

Larisa Ileana Grigore <[email protected]>
Newsgroups org.kernel.vger.linux-scsi,dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.