diff options
Diffstat (limited to 'drivers/net/dsa')
| -rw-r--r-- | drivers/net/dsa/bcm_sf2_cfp.c | 6 | ||||
| -rw-r--r-- | drivers/net/dsa/mv88e6xxx/port.c | 24 |
2 files changed, 22 insertions, 8 deletions
diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c index e6234d209787..4212bc4a5f31 100644 --- a/drivers/net/dsa/bcm_sf2_cfp.c +++ b/drivers/net/dsa/bcm_sf2_cfp.c | |||
| @@ -886,6 +886,9 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port, | |||
| 886 | fs->m_ext.data[1])) | 886 | fs->m_ext.data[1])) |
| 887 | return -EINVAL; | 887 | return -EINVAL; |
| 888 | 888 | ||
| 889 | if (fs->location != RX_CLS_LOC_ANY && fs->location >= CFP_NUM_RULES) | ||
| 890 | return -EINVAL; | ||
| 891 | |||
| 889 | if (fs->location != RX_CLS_LOC_ANY && | 892 | if (fs->location != RX_CLS_LOC_ANY && |
| 890 | test_bit(fs->location, priv->cfp.used)) | 893 | test_bit(fs->location, priv->cfp.used)) |
| 891 | return -EBUSY; | 894 | return -EBUSY; |
| @@ -974,6 +977,9 @@ static int bcm_sf2_cfp_rule_del(struct bcm_sf2_priv *priv, int port, u32 loc) | |||
| 974 | struct cfp_rule *rule; | 977 | struct cfp_rule *rule; |
| 975 | int ret; | 978 | int ret; |
| 976 | 979 | ||
| 980 | if (loc >= CFP_NUM_RULES) | ||
| 981 | return -EINVAL; | ||
| 982 | |||
| 977 | /* Refuse deleting unused rules, and those that are not unique since | 983 | /* Refuse deleting unused rules, and those that are not unique since |
| 978 | * that could leave IPv6 rules with one of the chained rule in the | 984 | * that could leave IPv6 rules with one of the chained rule in the |
| 979 | * table. | 985 | * table. |
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c index dce84a2a65c7..c44b2822e4dd 100644 --- a/drivers/net/dsa/mv88e6xxx/port.c +++ b/drivers/net/dsa/mv88e6xxx/port.c | |||
| @@ -427,18 +427,22 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, | |||
| 427 | return 0; | 427 | return 0; |
| 428 | 428 | ||
| 429 | lane = mv88e6390x_serdes_get_lane(chip, port); | 429 | lane = mv88e6390x_serdes_get_lane(chip, port); |
| 430 | if (lane < 0) | 430 | if (lane < 0 && lane != -ENODEV) |
| 431 | return lane; | 431 | return lane; |
| 432 | 432 | ||
| 433 | if (chip->ports[port].serdes_irq) { | 433 | if (lane >= 0) { |
| 434 | err = mv88e6390_serdes_irq_disable(chip, port, lane); | 434 | if (chip->ports[port].serdes_irq) { |
| 435 | err = mv88e6390_serdes_irq_disable(chip, port, lane); | ||
| 436 | if (err) | ||
| 437 | return err; | ||
| 438 | } | ||
| 439 | |||
| 440 | err = mv88e6390x_serdes_power(chip, port, false); | ||
| 435 | if (err) | 441 | if (err) |
| 436 | return err; | 442 | return err; |
| 437 | } | 443 | } |
| 438 | 444 | ||
| 439 | err = mv88e6390x_serdes_power(chip, port, false); | 445 | chip->ports[port].cmode = 0; |
| 440 | if (err) | ||
| 441 | return err; | ||
| 442 | 446 | ||
| 443 | if (cmode) { | 447 | if (cmode) { |
| 444 | err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, ®); | 448 | err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, ®); |
| @@ -452,6 +456,12 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, | |||
| 452 | if (err) | 456 | if (err) |
| 453 | return err; | 457 | return err; |
| 454 | 458 | ||
| 459 | chip->ports[port].cmode = cmode; | ||
| 460 | |||
| 461 | lane = mv88e6390x_serdes_get_lane(chip, port); | ||
| 462 | if (lane < 0) | ||
| 463 | return lane; | ||
| 464 | |||
| 455 | err = mv88e6390x_serdes_power(chip, port, true); | 465 | err = mv88e6390x_serdes_power(chip, port, true); |
| 456 | if (err) | 466 | if (err) |
| 457 | return err; | 467 | return err; |
| @@ -463,8 +473,6 @@ int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, | |||
| 463 | } | 473 | } |
| 464 | } | 474 | } |
| 465 | 475 | ||
| 466 | chip->ports[port].cmode = cmode; | ||
| 467 | |||
| 468 | return 0; | 476 | return 0; |
| 469 | } | 477 | } |
| 470 | 478 | ||
