[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1956a94e-b231-4458-a1c1-6d9f158da669@quicinc.com>
Date: Wed, 19 Mar 2025 12:03:00 -0700
From: Wesley Cheng <quic_wcheng@...cinc.com>
To: Konrad Dybcio <konrad.dybcio@....qualcomm.com>,
Melody Olvera
<quic_molvera@...cinc.com>,
Vinod Koul <vkoul@...nel.org>,
"Kishon Vijay
Abraham I" <kishon@...nel.org>,
Rob Herring <robh@...nel.org>,
"Krzysztof
Kozlowski" <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
"Greg
Kroah-Hartman" <gregkh@...uxfoundation.org>,
Philipp Zabel
<p.zabel@...gutronix.de>,
Bjorn Andersson <andersson@...nel.org>,
"Konrad
Dybcio" <konradybcio@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>
CC: <linux-arm-msm@...r.kernel.org>, <linux-phy@...ts.infradead.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-usb@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 6/9] phy: qcom: Add M31 based eUSB2 PHY driver
Hi Konrad,
On 3/11/2025 4:19 AM, Konrad Dybcio wrote:
> On 3/4/25 10:56 PM, Melody Olvera wrote:
>> From: Wesley Cheng <quic_wcheng@...cinc.com>
>>
>> SM8750 utilizes an eUSB2 PHY from M31. Add the initialization
>> sequences to bring it out of reset and into an operational state. This
>> differs to the M31 USB driver, in that the M31 eUSB2 driver will
>> require a connection to an eUSB2 repeater. This PHY driver will handle
>> the initialization of the associated eUSB2 repeater when required.
>>
>> Signed-off-by: Wesley Cheng <quic_wcheng@...cinc.com>
>> Signed-off-by: Melody Olvera <quic_molvera@...cinc.com>
>> ---
>
> [...]
>
>> +static int msm_m31_eusb2_write_readback(void __iomem *base, u32 offset,
>> + const u32 mask, u32 val)
>> +{
>> + u32 write_val;
>> + u32 tmp;
>> +
>> + tmp = readl_relaxed(base + offset);
>> + tmp &= ~mask;
>> + write_val = tmp | val;
>> +
>> + writel_relaxed(write_val, base + offset);
>> +
>> + tmp = readl_relaxed(base + offset);
>> + tmp &= mask;
>> +
>> + if (tmp != val) {
>> + pr_err("write: %x to offset: %x FAILED\n", val, offset);
>> + return -EINVAL;
>> + }
>> +
>> + return 0;
>
> Is there a reason we need to read back every write?
>
> Does this have to do with some funny write buffering?
>
Probably because its just a form of write synchronization, since we're
using the relaxed variants. If desired I can switch to just using writel
and remove the readback.
Thanks
Wesley Cheng
Powered by blists - more mailing lists