Re: [PATCH v2 2/5] net: hpe: Add GXP UMAC MDIO

From: Hawkins, Nick
Date: Tue Aug 15 2023 - 20:57:41 EST


Greetings Andrew,

I have a follow up question below:

>> +static int umac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
>> +{
>> + struct umac_mdio_priv *umac_mdio = bus->priv;
>> + unsigned int status;
>> + unsigned int value;
>> + int ret;
>> +
>> + status = __raw_readl(umac_mdio->base + UMAC_MII);
>> +
>> + status &= ~(UMAC_MII_PHY_ADDR_MASK | UMAC_MII_REG_ADDR_MASK);
>> + status |= ((phy_id << UMAC_MII_PHY_ADDR_SHIFT) &
>> + UMAC_MII_PHY_ADDR_MASK);
>> + status |= (reg & UMAC_MII_REG_ADDR_MASK);
>> + status |= UMAC_MII_MRNW; /* set bit for read mode */
>> + __raw_writel(status, umac_mdio->base + UMAC_MII);
>> +
>> + status |= UMAC_MII_MOWNER; /* set bit to activate mii transfer */
>> + __raw_writel(status, umac_mdio->base + UMAC_MII);


> I assume UMAC_MII_MOWNER must be set in a separate operation? But
> using __raw_writel() i'm not sure there is any barrier between the two
> writes.

Is there a function you would recommend using instead?

Thank you for the assistance,

-Nick Hawkins