--- /dev/null
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -412,23 +412,73 @@
+ return ret == ARRAY_SIZE(msgs) ? len : 0;
+ }
+
++static int sfp_smbus_read(struct sfp *sfp, bool a2, u8 dev_addr, void *buf,
++ size_t len)
++{
++ union i2c_smbus_data data;
++ u8 bus_addr = a2 ? 0x51 : 0x50, *val = buf;
++ int ret;
++
++ while (len > 0) {
++ ret = i2c_smbus_xfer(sfp->i2c, bus_addr, 0, I2C_SMBUS_READ,
++ dev_addr, I2C_SMBUS_BYTE_DATA, &data) < 0;
++ if (ret)
++ return -EIO;
++
++ *val = data.byte;
++
++ val++;
++ dev_addr++;
++ len--;
++ }
++
++ return val - (u8 *)buf;
++}
++
++static int sfp_smbus_write(struct sfp *sfp, bool a2, u8 dev_addr, void *buf,
++ size_t len)
++{
++ union i2c_smbus_data data;
++ u8 bus_addr = a2 ? 0x51 : 0x50;
++ int ret;
++
++ memcpy(&data.byte, buf, len);
++
++ ret = i2c_smbus_xfer(sfp->i2c, bus_addr, 0, I2C_SMBUS_WRITE,
++ dev_addr, I2C_SMBUS_BYTE_DATA, &data);
++
++ return ret;
++}
++
+ static int sfp_i2c_configure(struct sfp *sfp, struct i2c_adapter *i2c)
+ {
+ struct mii_bus *i2c_mii;
+ int ret;
+
+- if (!i2c_check_functionality(i2c, I2C_FUNC_I2C))
++ if (i2c_check_functionality(i2c, I2C_FUNC_I2C)) {
++ sfp->read = sfp_i2c_read;
++ sfp->write = sfp_i2c_write;
++
++ i2c_mii = mdio_i2c_alloc(sfp->dev, i2c);
++ if (IS_ERR(i2c_mii))
++ return PTR_ERR(i2c_mii);
++
++ i2c_mii->name = "SFP I2C Bus";
++ } else if (i2c_check_functionality(i2c, I2C_FUNC_SMBUS_BYTE_DATA)) {
++ sfp->read = sfp_smbus_read;
++ sfp->write = sfp_smbus_write;
++
++ i2c_mii = mdio_i2c_alloc(sfp->dev, i2c);
++ if (IS_ERR(i2c_mii))
++ return PTR_ERR(i2c_mii);
++
++ i2c_mii->name = "SFP SMBus";
++ } else {
+ return -EINVAL;
++ }
+
+ sfp->i2c = i2c;
+- sfp->read = sfp_i2c_read;
+- sfp->write = sfp_i2c_write;
+-
+- i2c_mii = mdio_i2c_alloc(sfp->dev, i2c);
+- if (IS_ERR(i2c_mii))
+- return PTR_ERR(i2c_mii);
+
+- i2c_mii->name = "SFP I2C Bus";
+ i2c_mii->phy_mask = ~0;
+
+ ret = mdiobus_register(i2c_mii);
+--- a/drivers/net/mdio/mdio-i2c.c
++++ b/drivers/net/mdio/mdio-i2c.c
+@@ -35,6 +35,8 @@
+ u8 addr[3], data[2], *p;
+ int bus_addr, ret;
+
++ return 0xffff;
++
+ if (!i2c_mii_valid_phy_id(phy_id))
+ return 0xffff;
+
+@@ -69,6 +71,8 @@
+ int ret;
+ u8 data[5], *p;
+
++ return 0;
++
+ if (!i2c_mii_valid_phy_id(phy_id))
+ return 0;
+
+@@ -95,8 +99,8 @@
+ {
+ struct mii_bus *mii;
+
+- if (!i2c_check_functionality(i2c, I2C_FUNC_I2C))
+- return ERR_PTR(-EINVAL);
++// if (!i2c_check_functionality(i2c, I2C_FUNC_I2C))
++// return ERR_PTR(-EINVAL);
+
+ mii = mdiobus_alloc();
+ if (!mii)