[PATCH v4 06/10] phy: qcom: Add M31 based eUSB2 PHY driver

Vinod Koul vkoul at kernel.org
Thu Apr 10 04:53:28 PDT 2025


On 09-04-25, 10:48, Melody Olvera wrote:

> +static int m31eusb2_phy_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);

Why are you using _relaxed version here?

> +	tmp &= mask;
> +
> +	if (tmp != val) {
> +		pr_err("write: %x to offset: %x FAILED\n", val, offset);
> +		return -EINVAL;
> +	}
> +
> +	return 0;
> +}

-- 
~Vinod



More information about the linux-arm-kernel mailing list