Re: [PATCH net-next v4 08/15] net: phy: mscc: macsec initialization

From: David Miller
Date: Thu Dec 19 2019 - 15:11:25 EST


From: Antoine Tenart <antoine.tenart@xxxxxxxxxxx>
Date: Thu, 19 Dec 2019 11:55:08 +0100

> +static u32 __vsc8584_macsec_phy_read(struct phy_device *phydev,
> + enum macsec_bank bank, u32 reg, bool init)
> +{
> + u32 val, val_l = 0, val_h = 0;
> + unsigned long deadline;
> + int rc;
> +
> + if (!init) {
> + rc = phy_select_page(phydev, MSCC_PHY_PAGE_MACSEC);
> + if (rc < 0)
> + goto failed;
> + } else {
> + __phy_write_page(phydev, MSCC_PHY_PAGE_MACSEC);
> + }

Having to export __phy_write_page() in the previous patch looked like
a huge red flag to me, and indeed on top of it you're using it to do
conditional locking here.

I'm going to unfortunately have to push back on this, please sanitize
the locking here so that you can use the existing exports properly.