On 12/3/18 11:54 AM, Andrew Lunn wrote:
>> +static s32 ixgbe_x550em_a_mii_bus_read(struct mii_bus *bus, int addr,
>> +                                   int regnum)
>> +{
>> +    struct ixgbe_adapter *adapter = (struct ixgbe_adapter *)bus->priv;
>> +    struct ixgbe_hw *hw = &adapter->hw;
>> +    u32 gssr = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM;
>> +
>> +    if (hw->bus.lan_id)
>> +            gssr |= IXGBE_GSSR_PHY1_SM;
>> +    else
>> +            gssr |= IXGBE_GSSR_PHY0_SM;
> 
> Hi Steve
> 
> If you only have one bus, do you still need this? One semaphore is all
> you need. And i'm not even sure you need that. The MDIO layer will
> perform locking, assuming everything goes through the MDIO layer.

AFAIK I still need part of it.  There's a PHY polling unit in the card
that we need to sync with independent of the locking in the MDIO layer.
I can drop the hw->bus.lan_id check though and unconditionally OR in the
IXGBE_GSSR_PHY0_SM since we always register on function 0 now.

Reply via email to