• Christian Marangi's avatar
    net: dsa: qca8k: improve mdio master read/write by using single lo/hi · a4165830
    Christian Marangi authored
    Improve mdio master read/write by using singe mii read/write lo/hi.
    
    In a read and write we need to poll the mdio master regs in a busy loop
    to check for a specific bit present in the upper half of the reg. We can
    ignore the other half since it won't contain useful data. This will save
    an additional useless read for each read and write operation.
    
    In a read operation the returned data is present in the mdio master reg
    lower half. We can ignore the other half since it won't contain useful
    data. This will save an additional useless read for each read operation.
    
    In a read operation it's needed to just set the hi half of the mdio
    master reg as the lo half will be replaced by the result. This will save
    an additional useless write for each read operation.
    Tested-by: default avatarRonald Wahl <ronald.wahl@raritan.com>
    Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a4165830
qca8k-8xxx.c 52.6 KB