Thread (15 messages) flat view 15 messages, 2 authors, 4d ago

Re: [RFC PATCH net-next 4/9] net: phy: air: move the EN8811H firmware download into the library

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-09-04 01:16:35
Also in: linux-devicetree, lkml

quoted hunk ↗ jump to hunk
 static int an8811hb_check_crc(struct phy_device *phydev, u32 set1,
@@ -405,7 +319,8 @@ static int an8811hb_load_file(struct phy_device *phydev, const char *name,
 	if (ret < 0)
 		return ret;
 
-	ret = air_write_buf(phydev, address,  fw);
+	ret = air_fw_write_buf(phydev->mdio.bus, phydev->mdio.addr, address,
+			       fw);
This can probably become:

     air_fw_write_buf(&phydev->mdio, address, fw);
+int air_fw_write_buf(struct mii_bus *bus, int addr, u32 address,
+		     const struct firmware *fw)
+{
+	int saved_page, ret;
+
+	mutex_lock(&bus->mdio_lock);
If you are adding __mdiodev_read(), it makes sense to also add
mdiodev_lock()/mdiodev_unlock().
+static int air_mmd_status_read(struct mii_bus *bus, int addr, bool is_c45)
+{
+	int ret;
+
+	mutex_lock(&bus->mdio_lock);
+	ret = mmd_phy_read(bus, addr, is_c45, MDIO_MMD_VEND1,
+			   EN8811H_PHY_FW_STATUS);
+	mutex_unlock(&bus->mdio_lock);
+
+	return ret;
+}
Is C45 over C22 required here? At least when downloading the actual
firmware data, you don't want to be doing C45 over C22 if you can
avoid it. So maybe mdiodev_c45_read()?

      Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help