Skip to content

Commit 5f79f12

Browse files
committed
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: David S. Miller <[email protected]>
2 parents 3fa1056 + ef1a99c commit 5f79f12

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

drivers/mfd/ocelot-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static const struct mfd_cell vsc7512_devs[] = {
177177
.num_resources = ARRAY_SIZE(vsc7512_miim1_resources),
178178
.resources = vsc7512_miim1_resources,
179179
}, {
180-
.name = "ocelot-switch",
180+
.name = "ocelot-ext-switch",
181181
.of_compatible = "mscc,vsc7512-switch",
182182
.num_resources = ARRAY_SIZE(vsc7512_switch_resources),
183183
.resources = vsc7512_switch_resources,

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static const char * const vsc9959_resource_names[TARGET_MAX] = {
554554
* SGMII/QSGMII MAC PCS can be found.
555555
*/
556556
static const struct resource vsc9959_imdio_res =
557-
DEFINE_RES_MEM_NAMED(0x8030, 0x8040, "imdio");
557+
DEFINE_RES_MEM_NAMED(0x8030, 0x10, "imdio");
558558

559559
static const struct reg_field vsc9959_regfields[REGFIELD_MAX] = {
560560
[ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 6, 6),

drivers/net/dsa/ocelot/ocelot_ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match);
149149

150150
static struct platform_driver ocelot_ext_switch_driver = {
151151
.driver = {
152-
.name = "ocelot-switch",
152+
.name = "ocelot-ext-switch",
153153
.of_match_table = of_match_ptr(ocelot_ext_switch_of_match),
154154
},
155155
.probe = ocelot_ext_probe,

drivers/net/dsa/ocelot/seville_vsc9953.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,8 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot)
893893

894894
rc = mscc_miim_setup(dev, &bus, "VSC9953 internal MDIO bus",
895895
ocelot->targets[GCB],
896-
ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK]);
897-
896+
ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK],
897+
true);
898898
if (rc) {
899899
dev_err(dev, "failed to setup MDIO bus\n");
900900
return rc;

drivers/net/mdio/mdio-mscc-miim.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct mscc_miim_info {
5252
struct mscc_miim_dev {
5353
struct regmap *regs;
5454
int mii_status_offset;
55+
bool ignore_read_errors;
5556
struct regmap *phy_regs;
5657
const struct mscc_miim_info *info;
5758
struct clk *clk;
@@ -135,7 +136,7 @@ static int mscc_miim_read(struct mii_bus *bus, int mii_id, int regnum)
135136
goto out;
136137
}
137138

138-
if (val & MSCC_MIIM_DATA_ERROR) {
139+
if (!miim->ignore_read_errors && !!(val & MSCC_MIIM_DATA_ERROR)) {
139140
ret = -EIO;
140141
goto out;
141142
}
@@ -212,7 +213,8 @@ static const struct regmap_config mscc_miim_phy_regmap_config = {
212213
};
213214

214215
int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name,
215-
struct regmap *mii_regmap, int status_offset)
216+
struct regmap *mii_regmap, int status_offset,
217+
bool ignore_read_errors)
216218
{
217219
struct mscc_miim_dev *miim;
218220
struct mii_bus *bus;
@@ -234,6 +236,7 @@ int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name,
234236

235237
miim->regs = mii_regmap;
236238
miim->mii_status_offset = status_offset;
239+
miim->ignore_read_errors = ignore_read_errors;
237240

238241
*pbus = bus;
239242

@@ -285,7 +288,7 @@ static int mscc_miim_probe(struct platform_device *pdev)
285288
return dev_err_probe(dev, PTR_ERR(phy_regmap),
286289
"Unable to create phy register regmap\n");
287290

288-
ret = mscc_miim_setup(dev, &bus, "mscc_miim", mii_regmap, 0);
291+
ret = mscc_miim_setup(dev, &bus, "mscc_miim", mii_regmap, 0, false);
289292
if (ret < 0) {
290293
dev_err(dev, "Unable to setup the MDIO bus\n");
291294
return ret;

include/linux/mdio/mdio-mscc-miim.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
int mscc_miim_setup(struct device *device, struct mii_bus **bus,
1616
const char *name, struct regmap *mii_regmap,
17-
int status_offset);
17+
int status_offset, bool ignore_read_errors);
1818

1919
#endif

0 commit comments

Comments
 (0)