Commit 5f79f12c authored by David S. Miller's avatar David S. Miller

Merge branch 'net-ocelot-switch-regressions'

Vladimir Oltean says:

====================
Regressions in Ocelot switch drivers

These are 3 patches which resolve a regression in the Seville driver,
one in the Felix driver and a generic one which affects any kernel
compiled with 2 Kconfig options enabled. All of them have in common my
lack of attention during review/testing. The patches touch the DSA, MFD
and MDIO drivers for Ocelot. I think it would be preferable if all
patches went through netdev (with Lee's Ack).
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3fa10563 ef1a99c6
...@@ -177,7 +177,7 @@ static const struct mfd_cell vsc7512_devs[] = { ...@@ -177,7 +177,7 @@ static const struct mfd_cell vsc7512_devs[] = {
.num_resources = ARRAY_SIZE(vsc7512_miim1_resources), .num_resources = ARRAY_SIZE(vsc7512_miim1_resources),
.resources = vsc7512_miim1_resources, .resources = vsc7512_miim1_resources,
}, { }, {
.name = "ocelot-switch", .name = "ocelot-ext-switch",
.of_compatible = "mscc,vsc7512-switch", .of_compatible = "mscc,vsc7512-switch",
.num_resources = ARRAY_SIZE(vsc7512_switch_resources), .num_resources = ARRAY_SIZE(vsc7512_switch_resources),
.resources = vsc7512_switch_resources, .resources = vsc7512_switch_resources,
......
...@@ -554,7 +554,7 @@ static const char * const vsc9959_resource_names[TARGET_MAX] = { ...@@ -554,7 +554,7 @@ static const char * const vsc9959_resource_names[TARGET_MAX] = {
* SGMII/QSGMII MAC PCS can be found. * SGMII/QSGMII MAC PCS can be found.
*/ */
static const struct resource vsc9959_imdio_res = static const struct resource vsc9959_imdio_res =
DEFINE_RES_MEM_NAMED(0x8030, 0x8040, "imdio"); DEFINE_RES_MEM_NAMED(0x8030, 0x10, "imdio");
static const struct reg_field vsc9959_regfields[REGFIELD_MAX] = { static const struct reg_field vsc9959_regfields[REGFIELD_MAX] = {
[ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 6, 6), [ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 6, 6),
......
...@@ -149,7 +149,7 @@ MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match); ...@@ -149,7 +149,7 @@ MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match);
static struct platform_driver ocelot_ext_switch_driver = { static struct platform_driver ocelot_ext_switch_driver = {
.driver = { .driver = {
.name = "ocelot-switch", .name = "ocelot-ext-switch",
.of_match_table = of_match_ptr(ocelot_ext_switch_of_match), .of_match_table = of_match_ptr(ocelot_ext_switch_of_match),
}, },
.probe = ocelot_ext_probe, .probe = ocelot_ext_probe,
......
...@@ -893,8 +893,8 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot) ...@@ -893,8 +893,8 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot)
rc = mscc_miim_setup(dev, &bus, "VSC9953 internal MDIO bus", rc = mscc_miim_setup(dev, &bus, "VSC9953 internal MDIO bus",
ocelot->targets[GCB], ocelot->targets[GCB],
ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK]); ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK],
true);
if (rc) { if (rc) {
dev_err(dev, "failed to setup MDIO bus\n"); dev_err(dev, "failed to setup MDIO bus\n");
return rc; return rc;
......
...@@ -52,6 +52,7 @@ struct mscc_miim_info { ...@@ -52,6 +52,7 @@ struct mscc_miim_info {
struct mscc_miim_dev { struct mscc_miim_dev {
struct regmap *regs; struct regmap *regs;
int mii_status_offset; int mii_status_offset;
bool ignore_read_errors;
struct regmap *phy_regs; struct regmap *phy_regs;
const struct mscc_miim_info *info; const struct mscc_miim_info *info;
struct clk *clk; struct clk *clk;
...@@ -135,7 +136,7 @@ static int mscc_miim_read(struct mii_bus *bus, int mii_id, int regnum) ...@@ -135,7 +136,7 @@ static int mscc_miim_read(struct mii_bus *bus, int mii_id, int regnum)
goto out; goto out;
} }
if (val & MSCC_MIIM_DATA_ERROR) { if (!miim->ignore_read_errors && !!(val & MSCC_MIIM_DATA_ERROR)) {
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -212,7 +213,8 @@ static const struct regmap_config mscc_miim_phy_regmap_config = { ...@@ -212,7 +213,8 @@ static const struct regmap_config mscc_miim_phy_regmap_config = {
}; };
int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name, int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name,
struct regmap *mii_regmap, int status_offset) struct regmap *mii_regmap, int status_offset,
bool ignore_read_errors)
{ {
struct mscc_miim_dev *miim; struct mscc_miim_dev *miim;
struct mii_bus *bus; struct mii_bus *bus;
...@@ -234,6 +236,7 @@ int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name, ...@@ -234,6 +236,7 @@ int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name,
miim->regs = mii_regmap; miim->regs = mii_regmap;
miim->mii_status_offset = status_offset; miim->mii_status_offset = status_offset;
miim->ignore_read_errors = ignore_read_errors;
*pbus = bus; *pbus = bus;
...@@ -285,7 +288,7 @@ static int mscc_miim_probe(struct platform_device *pdev) ...@@ -285,7 +288,7 @@ static int mscc_miim_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(phy_regmap), return dev_err_probe(dev, PTR_ERR(phy_regmap),
"Unable to create phy register regmap\n"); "Unable to create phy register regmap\n");
ret = mscc_miim_setup(dev, &bus, "mscc_miim", mii_regmap, 0); ret = mscc_miim_setup(dev, &bus, "mscc_miim", mii_regmap, 0, false);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "Unable to setup the MDIO bus\n"); dev_err(dev, "Unable to setup the MDIO bus\n");
return ret; return ret;
......
...@@ -14,6 +14,6 @@ ...@@ -14,6 +14,6 @@
int mscc_miim_setup(struct device *device, struct mii_bus **bus, int mscc_miim_setup(struct device *device, struct mii_bus **bus,
const char *name, struct regmap *mii_regmap, const char *name, struct regmap *mii_regmap,
int status_offset); int status_offset, bool ignore_read_errors);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment