Commit c9acece0 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by David S. Miller

net: dsa: mv88e6xxx: introduce helpers for handling chip->reg_lock

This is a no-op that simply moves all locking and unlocking of
->reg_lock into trivial helpers. I did that to be able to easily add
some ad hoc instrumentation to those helpers to get some information
on contention and hold times of the mutex. Perhaps others want to do
something similar at some point, so this frees them from doing the
'sed -i' yoga, and have a much smaller 'git diff' while fiddling.
Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3e5bfb18
...@@ -118,9 +118,9 @@ static irqreturn_t mv88e6xxx_g1_irq_thread_work(struct mv88e6xxx_chip *chip) ...@@ -118,9 +118,9 @@ static irqreturn_t mv88e6xxx_g1_irq_thread_work(struct mv88e6xxx_chip *chip)
u16 ctl1; u16 ctl1;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_STS, &reg); err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_STS, &reg);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
goto out; goto out;
...@@ -135,13 +135,13 @@ static irqreturn_t mv88e6xxx_g1_irq_thread_work(struct mv88e6xxx_chip *chip) ...@@ -135,13 +135,13 @@ static irqreturn_t mv88e6xxx_g1_irq_thread_work(struct mv88e6xxx_chip *chip)
} }
} }
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_CTL1, &ctl1); err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_CTL1, &ctl1);
if (err) if (err)
goto unlock; goto unlock;
err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_STS, &reg); err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_STS, &reg);
unlock: unlock:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
goto out; goto out;
ctl1 &= GENMASK(chip->g1_irq.nirqs, 0); ctl1 &= GENMASK(chip->g1_irq.nirqs, 0);
...@@ -162,7 +162,7 @@ static void mv88e6xxx_g1_irq_bus_lock(struct irq_data *d) ...@@ -162,7 +162,7 @@ static void mv88e6xxx_g1_irq_bus_lock(struct irq_data *d)
{ {
struct mv88e6xxx_chip *chip = irq_data_get_irq_chip_data(d); struct mv88e6xxx_chip *chip = irq_data_get_irq_chip_data(d);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
} }
static void mv88e6xxx_g1_irq_bus_sync_unlock(struct irq_data *d) static void mv88e6xxx_g1_irq_bus_sync_unlock(struct irq_data *d)
...@@ -184,7 +184,7 @@ static void mv88e6xxx_g1_irq_bus_sync_unlock(struct irq_data *d) ...@@ -184,7 +184,7 @@ static void mv88e6xxx_g1_irq_bus_sync_unlock(struct irq_data *d)
goto out; goto out;
out: out:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static const struct irq_chip mv88e6xxx_g1_irq_chip = { static const struct irq_chip mv88e6xxx_g1_irq_chip = {
...@@ -239,9 +239,9 @@ static void mv88e6xxx_g1_irq_free(struct mv88e6xxx_chip *chip) ...@@ -239,9 +239,9 @@ static void mv88e6xxx_g1_irq_free(struct mv88e6xxx_chip *chip)
*/ */
free_irq(chip->irq, chip); free_irq(chip->irq, chip);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
mv88e6xxx_g1_irq_free_common(chip); mv88e6xxx_g1_irq_free_common(chip);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int mv88e6xxx_g1_irq_setup_common(struct mv88e6xxx_chip *chip) static int mv88e6xxx_g1_irq_setup_common(struct mv88e6xxx_chip *chip)
...@@ -310,12 +310,12 @@ static int mv88e6xxx_g1_irq_setup(struct mv88e6xxx_chip *chip) ...@@ -310,12 +310,12 @@ static int mv88e6xxx_g1_irq_setup(struct mv88e6xxx_chip *chip)
*/ */
irq_set_lockdep_class(chip->irq, &lock_key, &request_key); irq_set_lockdep_class(chip->irq, &lock_key, &request_key);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
err = request_threaded_irq(chip->irq, NULL, err = request_threaded_irq(chip->irq, NULL,
mv88e6xxx_g1_irq_thread_fn, mv88e6xxx_g1_irq_thread_fn,
IRQF_ONESHOT | IRQF_SHARED, IRQF_ONESHOT | IRQF_SHARED,
dev_name(chip->dev), chip); dev_name(chip->dev), chip);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (err) if (err)
mv88e6xxx_g1_irq_free_common(chip); mv88e6xxx_g1_irq_free_common(chip);
...@@ -359,9 +359,9 @@ static void mv88e6xxx_irq_poll_free(struct mv88e6xxx_chip *chip) ...@@ -359,9 +359,9 @@ static void mv88e6xxx_irq_poll_free(struct mv88e6xxx_chip *chip)
kthread_cancel_delayed_work_sync(&chip->irq_poll_work); kthread_cancel_delayed_work_sync(&chip->irq_poll_work);
kthread_destroy_worker(chip->kworker); kthread_destroy_worker(chip->kworker);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
mv88e6xxx_g1_irq_free_common(chip); mv88e6xxx_g1_irq_free_common(chip);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
int mv88e6xxx_wait(struct mv88e6xxx_chip *chip, int addr, int reg, u16 mask) int mv88e6xxx_wait(struct mv88e6xxx_chip *chip, int addr, int reg, u16 mask)
...@@ -496,11 +496,11 @@ static void mv88e6xxx_adjust_link(struct dsa_switch *ds, int port, ...@@ -496,11 +496,11 @@ static void mv88e6xxx_adjust_link(struct dsa_switch *ds, int port,
mv88e6xxx_phy_is_internal(ds, port)) mv88e6xxx_phy_is_internal(ds, port))
return; return;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_setup_mac(chip, port, phydev->link, phydev->speed, err = mv88e6xxx_port_setup_mac(chip, port, phydev->link, phydev->speed,
phydev->duplex, phydev->pause, phydev->duplex, phydev->pause,
phydev->interface); phydev->interface);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
dev_err(ds->dev, "p%d: failed to configure MAC\n", port); dev_err(ds->dev, "p%d: failed to configure MAC\n", port);
...@@ -616,12 +616,12 @@ static int mv88e6xxx_link_state(struct dsa_switch *ds, int port, ...@@ -616,12 +616,12 @@ static int mv88e6xxx_link_state(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->port_link_state) if (chip->info->ops->port_link_state)
err = chip->info->ops->port_link_state(chip, port, state); err = chip->info->ops->port_link_state(chip, port, state);
else else
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -651,10 +651,10 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port, ...@@ -651,10 +651,10 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
} }
pause = !!phylink_test(state->advertising, Pause); pause = !!phylink_test(state->advertising, Pause);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_setup_mac(chip, port, link, speed, duplex, pause, err = mv88e6xxx_port_setup_mac(chip, port, link, speed, duplex, pause,
state->interface); state->interface);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
dev_err(ds->dev, "p%d: failed to configure MAC\n", port); dev_err(ds->dev, "p%d: failed to configure MAC\n", port);
...@@ -665,9 +665,9 @@ static void mv88e6xxx_mac_link_force(struct dsa_switch *ds, int port, int link) ...@@ -665,9 +665,9 @@ static void mv88e6xxx_mac_link_force(struct dsa_switch *ds, int port, int link)
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = chip->info->ops->port_set_link(chip, port, link); err = chip->info->ops->port_set_link(chip, port, link);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
dev_err(chip->dev, "p%d: failed to force MAC link\n", port); dev_err(chip->dev, "p%d: failed to force MAC link\n", port);
...@@ -865,7 +865,7 @@ static void mv88e6xxx_get_strings(struct dsa_switch *ds, int port, ...@@ -865,7 +865,7 @@ static void mv88e6xxx_get_strings(struct dsa_switch *ds, int port,
if (stringset != ETH_SS_STATS) if (stringset != ETH_SS_STATS)
return; return;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->stats_get_strings) if (chip->info->ops->stats_get_strings)
count = chip->info->ops->stats_get_strings(chip, data); count = chip->info->ops->stats_get_strings(chip, data);
...@@ -878,7 +878,7 @@ static void mv88e6xxx_get_strings(struct dsa_switch *ds, int port, ...@@ -878,7 +878,7 @@ static void mv88e6xxx_get_strings(struct dsa_switch *ds, int port,
data += count * ETH_GSTRING_LEN; data += count * ETH_GSTRING_LEN;
mv88e6xxx_atu_vtu_get_strings(data); mv88e6xxx_atu_vtu_get_strings(data);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int mv88e6xxx_stats_get_sset_count(struct mv88e6xxx_chip *chip, static int mv88e6xxx_stats_get_sset_count(struct mv88e6xxx_chip *chip,
...@@ -921,7 +921,7 @@ static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port, int sset) ...@@ -921,7 +921,7 @@ static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port, int sset)
if (sset != ETH_SS_STATS) if (sset != ETH_SS_STATS)
return 0; return 0;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->stats_get_sset_count) if (chip->info->ops->stats_get_sset_count)
count = chip->info->ops->stats_get_sset_count(chip); count = chip->info->ops->stats_get_sset_count(chip);
if (count < 0) if (count < 0)
...@@ -938,7 +938,7 @@ static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port, int sset) ...@@ -938,7 +938,7 @@ static int mv88e6xxx_get_sset_count(struct dsa_switch *ds, int port, int sset)
count += ARRAY_SIZE(mv88e6xxx_atu_vtu_stats_strings); count += ARRAY_SIZE(mv88e6xxx_atu_vtu_stats_strings);
out: out:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return count; return count;
} }
...@@ -953,11 +953,11 @@ static int mv88e6xxx_stats_get_stats(struct mv88e6xxx_chip *chip, int port, ...@@ -953,11 +953,11 @@ static int mv88e6xxx_stats_get_stats(struct mv88e6xxx_chip *chip, int port,
for (i = 0, j = 0; i < ARRAY_SIZE(mv88e6xxx_hw_stats); i++) { for (i = 0, j = 0; i < ARRAY_SIZE(mv88e6xxx_hw_stats); i++) {
stat = &mv88e6xxx_hw_stats[i]; stat = &mv88e6xxx_hw_stats[i];
if (stat->type & types) { if (stat->type & types) {
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
data[j] = _mv88e6xxx_get_ethtool_stat(chip, stat, port, data[j] = _mv88e6xxx_get_ethtool_stat(chip, stat, port,
bank1_select, bank1_select,
histogram); histogram);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
j++; j++;
} }
...@@ -1016,14 +1016,14 @@ static void mv88e6xxx_get_stats(struct mv88e6xxx_chip *chip, int port, ...@@ -1016,14 +1016,14 @@ static void mv88e6xxx_get_stats(struct mv88e6xxx_chip *chip, int port,
if (chip->info->ops->stats_get_stats) if (chip->info->ops->stats_get_stats)
count = chip->info->ops->stats_get_stats(chip, port, data); count = chip->info->ops->stats_get_stats(chip, port, data);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->serdes_get_stats) { if (chip->info->ops->serdes_get_stats) {
data += count; data += count;
count = chip->info->ops->serdes_get_stats(chip, port, data); count = chip->info->ops->serdes_get_stats(chip, port, data);
} }
data += count; data += count;
mv88e6xxx_atu_vtu_get_stats(chip, port, data); mv88e6xxx_atu_vtu_get_stats(chip, port, data);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, int port, static void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, int port,
...@@ -1032,10 +1032,10 @@ static void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, int port, ...@@ -1032,10 +1032,10 @@ static void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int ret; int ret;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
ret = mv88e6xxx_stats_snapshot(chip, port); ret = mv88e6xxx_stats_snapshot(chip, port);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (ret < 0) if (ret < 0)
return; return;
...@@ -1062,7 +1062,7 @@ static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port, ...@@ -1062,7 +1062,7 @@ static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port,
memset(p, 0xff, 32 * sizeof(u16)); memset(p, 0xff, 32 * sizeof(u16));
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
...@@ -1071,7 +1071,7 @@ static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port, ...@@ -1071,7 +1071,7 @@ static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port,
p[i] = reg; p[i] = reg;
} }
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int mv88e6xxx_get_mac_eee(struct dsa_switch *ds, int port, static int mv88e6xxx_get_mac_eee(struct dsa_switch *ds, int port,
...@@ -1137,9 +1137,9 @@ static void mv88e6xxx_port_stp_state_set(struct dsa_switch *ds, int port, ...@@ -1137,9 +1137,9 @@ static void mv88e6xxx_port_stp_state_set(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_set_state(chip, port, state); err = mv88e6xxx_port_set_state(chip, port, state);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
dev_err(ds->dev, "p%d: failed to update state\n", port); dev_err(ds->dev, "p%d: failed to update state\n", port);
...@@ -1324,9 +1324,9 @@ static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port) ...@@ -1324,9 +1324,9 @@ static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port)
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g1_atu_remove(chip, 0, port, false); err = mv88e6xxx_g1_atu_remove(chip, 0, port, false);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
dev_err(ds->dev, "p%d: failed to flush ATU\n", port); dev_err(ds->dev, "p%d: failed to flush ATU\n", port);
...@@ -1454,7 +1454,7 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port, ...@@ -1454,7 +1454,7 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
if (!vid_begin) if (!vid_begin)
return -EOPNOTSUPP; return -EOPNOTSUPP;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
do { do {
err = mv88e6xxx_vtu_getnext(chip, &vlan); err = mv88e6xxx_vtu_getnext(chip, &vlan);
...@@ -1494,7 +1494,7 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port, ...@@ -1494,7 +1494,7 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
} while (vlan.vid < vid_end); } while (vlan.vid < vid_end);
unlock: unlock:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1510,9 +1510,9 @@ static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port, ...@@ -1510,9 +1510,9 @@ static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port,
if (!chip->info->max_vid) if (!chip->info->max_vid)
return -EOPNOTSUPP; return -EOPNOTSUPP;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_set_8021q_mode(chip, port, mode); err = mv88e6xxx_port_set_8021q_mode(chip, port, mode);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1646,7 +1646,7 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port, ...@@ -1646,7 +1646,7 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
else else
member = MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_TAGGED; member = MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_TAGGED;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid)
if (_mv88e6xxx_port_vlan_add(chip, port, vid, member)) if (_mv88e6xxx_port_vlan_add(chip, port, vid, member))
...@@ -1657,7 +1657,7 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port, ...@@ -1657,7 +1657,7 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
dev_err(ds->dev, "p%d: failed to set PVID %d\n", port, dev_err(ds->dev, "p%d: failed to set PVID %d\n", port,
vlan->vid_end); vlan->vid_end);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip, static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
...@@ -1703,7 +1703,7 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port, ...@@ -1703,7 +1703,7 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port,
if (!chip->info->max_vid) if (!chip->info->max_vid)
return -EOPNOTSUPP; return -EOPNOTSUPP;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_get_pvid(chip, port, &pvid); err = mv88e6xxx_port_get_pvid(chip, port, &pvid);
if (err) if (err)
...@@ -1722,7 +1722,7 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port, ...@@ -1722,7 +1722,7 @@ static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port,
} }
unlock: unlock:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1733,10 +1733,10 @@ static int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port, ...@@ -1733,10 +1733,10 @@ static int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid, err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid,
MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC); MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1747,10 +1747,10 @@ static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port, ...@@ -1747,10 +1747,10 @@ static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid, err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid,
MV88E6XXX_G1_ATU_DATA_STATE_UNUSED); MV88E6XXX_G1_ATU_DATA_STATE_UNUSED);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1832,9 +1832,9 @@ static int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port, ...@@ -1832,9 +1832,9 @@ static int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_db_dump(chip, port, cb, data); err = mv88e6xxx_port_db_dump(chip, port, cb, data);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1883,9 +1883,9 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, ...@@ -1883,9 +1883,9 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_bridge_map(chip, br); err = mv88e6xxx_bridge_map(chip, br);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1895,11 +1895,11 @@ static void mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port, ...@@ -1895,11 +1895,11 @@ static void mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port,
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (mv88e6xxx_bridge_map(chip, br) || if (mv88e6xxx_bridge_map(chip, br) ||
mv88e6xxx_port_vlan_map(chip, port)) mv88e6xxx_port_vlan_map(chip, port))
dev_err(ds->dev, "failed to remap in-chip Port VLAN\n"); dev_err(ds->dev, "failed to remap in-chip Port VLAN\n");
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int mv88e6xxx_crosschip_bridge_join(struct dsa_switch *ds, int dev, static int mv88e6xxx_crosschip_bridge_join(struct dsa_switch *ds, int dev,
...@@ -1911,9 +1911,9 @@ static int mv88e6xxx_crosschip_bridge_join(struct dsa_switch *ds, int dev, ...@@ -1911,9 +1911,9 @@ static int mv88e6xxx_crosschip_bridge_join(struct dsa_switch *ds, int dev,
if (!mv88e6xxx_has_pvt(chip)) if (!mv88e6xxx_has_pvt(chip))
return 0; return 0;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_pvt_map(chip, dev, port); err = mv88e6xxx_pvt_map(chip, dev, port);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -1926,10 +1926,10 @@ static void mv88e6xxx_crosschip_bridge_leave(struct dsa_switch *ds, int dev, ...@@ -1926,10 +1926,10 @@ static void mv88e6xxx_crosschip_bridge_leave(struct dsa_switch *ds, int dev,
if (!mv88e6xxx_has_pvt(chip)) if (!mv88e6xxx_has_pvt(chip))
return; return;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (mv88e6xxx_pvt_map(chip, dev, port)) if (mv88e6xxx_pvt_map(chip, dev, port))
dev_err(ds->dev, "failed to remap cross-chip Port VLAN\n"); dev_err(ds->dev, "failed to remap cross-chip Port VLAN\n");
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int mv88e6xxx_software_reset(struct mv88e6xxx_chip *chip) static int mv88e6xxx_software_reset(struct mv88e6xxx_chip *chip)
...@@ -2280,14 +2280,14 @@ static int mv88e6xxx_port_enable(struct dsa_switch *ds, int port, ...@@ -2280,14 +2280,14 @@ static int mv88e6xxx_port_enable(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_serdes_power(chip, port, true); err = mv88e6xxx_serdes_power(chip, port, true);
if (!err && chip->info->ops->serdes_irq_setup) if (!err && chip->info->ops->serdes_irq_setup)
err = chip->info->ops->serdes_irq_setup(chip, port); err = chip->info->ops->serdes_irq_setup(chip, port);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -2296,7 +2296,7 @@ static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port) ...@@ -2296,7 +2296,7 @@ static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED)) if (mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED))
dev_err(chip->dev, "failed to disable port\n"); dev_err(chip->dev, "failed to disable port\n");
...@@ -2307,7 +2307,7 @@ static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port) ...@@ -2307,7 +2307,7 @@ static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port)
if (mv88e6xxx_serdes_power(chip, port, false)) if (mv88e6xxx_serdes_power(chip, port, false))
dev_err(chip->dev, "failed to power off SERDES\n"); dev_err(chip->dev, "failed to power off SERDES\n");
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int mv88e6xxx_set_ageing_time(struct dsa_switch *ds, static int mv88e6xxx_set_ageing_time(struct dsa_switch *ds,
...@@ -2316,9 +2316,9 @@ static int mv88e6xxx_set_ageing_time(struct dsa_switch *ds, ...@@ -2316,9 +2316,9 @@ static int mv88e6xxx_set_ageing_time(struct dsa_switch *ds,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g1_atu_set_age_time(chip, ageing_time); err = mv88e6xxx_g1_atu_set_age_time(chip, ageing_time);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -2448,7 +2448,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) ...@@ -2448,7 +2448,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
chip->ds = ds; chip->ds = ds;
ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip); ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->setup_errata) { if (chip->info->ops->setup_errata) {
err = chip->info->ops->setup_errata(chip); err = chip->info->ops->setup_errata(chip);
...@@ -2555,7 +2555,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) ...@@ -2555,7 +2555,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
goto unlock; goto unlock;
unlock: unlock:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -2570,9 +2570,9 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) ...@@ -2570,9 +2570,9 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
if (!chip->info->ops->phy_read) if (!chip->info->ops->phy_read)
return -EOPNOTSUPP; return -EOPNOTSUPP;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = chip->info->ops->phy_read(chip, bus, phy, reg, &val); err = chip->info->ops->phy_read(chip, bus, phy, reg, &val);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (reg == MII_PHYSID2) { if (reg == MII_PHYSID2) {
/* Some internal PHYs don't have a model number. */ /* Some internal PHYs don't have a model number. */
...@@ -2605,9 +2605,9 @@ static int mv88e6xxx_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val) ...@@ -2605,9 +2605,9 @@ static int mv88e6xxx_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val)
if (!chip->info->ops->phy_write) if (!chip->info->ops->phy_write)
return -EOPNOTSUPP; return -EOPNOTSUPP;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = chip->info->ops->phy_write(chip, bus, phy, reg, val); err = chip->info->ops->phy_write(chip, bus, phy, reg, val);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -2622,9 +2622,9 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip, ...@@ -2622,9 +2622,9 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
int err; int err;
if (external) { if (external) {
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g2_scratch_gpio_set_smi(chip, true); err = mv88e6xxx_g2_scratch_gpio_set_smi(chip, true);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
return err; return err;
...@@ -2745,9 +2745,9 @@ static int mv88e6xxx_get_eeprom(struct dsa_switch *ds, ...@@ -2745,9 +2745,9 @@ static int mv88e6xxx_get_eeprom(struct dsa_switch *ds,
if (!chip->info->ops->get_eeprom) if (!chip->info->ops->get_eeprom)
return -EOPNOTSUPP; return -EOPNOTSUPP;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = chip->info->ops->get_eeprom(chip, eeprom, data); err = chip->info->ops->get_eeprom(chip, eeprom, data);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
return err; return err;
...@@ -2769,9 +2769,9 @@ static int mv88e6xxx_set_eeprom(struct dsa_switch *ds, ...@@ -2769,9 +2769,9 @@ static int mv88e6xxx_set_eeprom(struct dsa_switch *ds,
if (eeprom->magic != 0xc3ec4951) if (eeprom->magic != 0xc3ec4951)
return -EINVAL; return -EINVAL;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = chip->info->ops->set_eeprom(chip, eeprom, data); err = chip->info->ops->set_eeprom(chip, eeprom, data);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -4532,9 +4532,9 @@ static int mv88e6xxx_detect(struct mv88e6xxx_chip *chip) ...@@ -4532,9 +4532,9 @@ static int mv88e6xxx_detect(struct mv88e6xxx_chip *chip)
u16 id; u16 id;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_read(chip, 0, MV88E6XXX_PORT_SWITCH_ID, &id); err = mv88e6xxx_port_read(chip, 0, MV88E6XXX_PORT_SWITCH_ID, &id);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
return err; return err;
...@@ -4597,12 +4597,12 @@ static void mv88e6xxx_port_mdb_add(struct dsa_switch *ds, int port, ...@@ -4597,12 +4597,12 @@ static void mv88e6xxx_port_mdb_add(struct dsa_switch *ds, int port,
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (mv88e6xxx_port_db_load_purge(chip, port, mdb->addr, mdb->vid, if (mv88e6xxx_port_db_load_purge(chip, port, mdb->addr, mdb->vid,
MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC)) MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC))
dev_err(ds->dev, "p%d: failed to load multicast MAC address\n", dev_err(ds->dev, "p%d: failed to load multicast MAC address\n",
port); port);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port, static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port,
...@@ -4611,10 +4611,10 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port, ...@@ -4611,10 +4611,10 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_db_load_purge(chip, port, mdb->addr, mdb->vid, err = mv88e6xxx_port_db_load_purge(chip, port, mdb->addr, mdb->vid,
MV88E6XXX_G1_ATU_DATA_STATE_UNUSED); MV88E6XXX_G1_ATU_DATA_STATE_UNUSED);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -4625,12 +4625,12 @@ static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, ...@@ -4625,12 +4625,12 @@ static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port,
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err = -EOPNOTSUPP; int err = -EOPNOTSUPP;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->port_set_egress_floods) if (chip->info->ops->port_set_egress_floods)
err = chip->info->ops->port_set_egress_floods(chip, port, err = chip->info->ops->port_set_egress_floods(chip, port,
unicast, unicast,
multicast); multicast);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -4801,9 +4801,9 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) ...@@ -4801,9 +4801,9 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
chip->eeprom_len = pdata->eeprom_len; chip->eeprom_len = pdata->eeprom_len;
} }
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_switch_reset(chip); err = mv88e6xxx_switch_reset(chip);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
goto out; goto out;
...@@ -4822,12 +4822,12 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) ...@@ -4822,12 +4822,12 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
* the PHYs will link their interrupts to these interrupt * the PHYs will link their interrupts to these interrupt
* controllers * controllers
*/ */
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->irq > 0) if (chip->irq > 0)
err = mv88e6xxx_g1_irq_setup(chip); err = mv88e6xxx_g1_irq_setup(chip);
else else
err = mv88e6xxx_irq_poll_setup(chip); err = mv88e6xxx_irq_poll_setup(chip);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
goto out; goto out;
......
...@@ -580,4 +580,14 @@ int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port, int link, ...@@ -580,4 +580,14 @@ int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port, int link,
phy_interface_t mode); phy_interface_t mode);
struct mii_bus *mv88e6xxx_default_mdio_bus(struct mv88e6xxx_chip *chip); struct mii_bus *mv88e6xxx_default_mdio_bus(struct mv88e6xxx_chip *chip);
static inline void mv88e6xxx_reg_lock(struct mv88e6xxx_chip *chip)
{
mutex_lock(&chip->reg_lock);
}
static inline void mv88e6xxx_reg_unlock(struct mv88e6xxx_chip *chip)
{
mutex_unlock(&chip->reg_lock);
}
#endif /* _MV88E6XXX_CHIP_H */ #endif /* _MV88E6XXX_CHIP_H */
...@@ -317,7 +317,7 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) ...@@ -317,7 +317,7 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
int err; int err;
u16 val; u16 val;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g1_atu_op(chip, 0, err = mv88e6xxx_g1_atu_op(chip, 0,
MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION); MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION);
...@@ -364,12 +364,12 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) ...@@ -364,12 +364,12 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
entry.mac, entry.portvec, spid); entry.mac, entry.portvec, spid);
chip->ports[spid].atu_full_violation++; chip->ports[spid].atu_full_violation++;
} }
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return IRQ_HANDLED; return IRQ_HANDLED;
out: out:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
dev_err(chip->dev, "ATU problem: error %d while handling interrupt\n", dev_err(chip->dev, "ATU problem: error %d while handling interrupt\n",
err); err);
......
...@@ -579,7 +579,7 @@ static irqreturn_t mv88e6xxx_g1_vtu_prob_irq_thread_fn(int irq, void *dev_id) ...@@ -579,7 +579,7 @@ static irqreturn_t mv88e6xxx_g1_vtu_prob_irq_thread_fn(int irq, void *dev_id)
int err; int err;
u16 val; u16 val;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g1_vtu_op(chip, MV88E6XXX_G1_VTU_OP_GET_CLR_VIOLATION); err = mv88e6xxx_g1_vtu_op(chip, MV88E6XXX_G1_VTU_OP_GET_CLR_VIOLATION);
if (err) if (err)
...@@ -607,12 +607,12 @@ static irqreturn_t mv88e6xxx_g1_vtu_prob_irq_thread_fn(int irq, void *dev_id) ...@@ -607,12 +607,12 @@ static irqreturn_t mv88e6xxx_g1_vtu_prob_irq_thread_fn(int irq, void *dev_id)
chip->ports[spid].vtu_miss_violation++; chip->ports[spid].vtu_miss_violation++;
} }
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return IRQ_HANDLED; return IRQ_HANDLED;
out: out:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
dev_err(chip->dev, "VTU problem: error %d while handling interrupt\n", dev_err(chip->dev, "VTU problem: error %d while handling interrupt\n",
err); err);
......
...@@ -893,20 +893,20 @@ static irqreturn_t mv88e6xxx_g2_watchdog_thread_fn(int irq, void *dev_id) ...@@ -893,20 +893,20 @@ static irqreturn_t mv88e6xxx_g2_watchdog_thread_fn(int irq, void *dev_id)
struct mv88e6xxx_chip *chip = dev_id; struct mv88e6xxx_chip *chip = dev_id;
irqreturn_t ret = IRQ_NONE; irqreturn_t ret = IRQ_NONE;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->watchdog_ops->irq_action) if (chip->info->ops->watchdog_ops->irq_action)
ret = chip->info->ops->watchdog_ops->irq_action(chip, irq); ret = chip->info->ops->watchdog_ops->irq_action(chip, irq);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return ret; return ret;
} }
static void mv88e6xxx_g2_watchdog_free(struct mv88e6xxx_chip *chip) static void mv88e6xxx_g2_watchdog_free(struct mv88e6xxx_chip *chip)
{ {
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->watchdog_ops->irq_free) if (chip->info->ops->watchdog_ops->irq_free)
chip->info->ops->watchdog_ops->irq_free(chip); chip->info->ops->watchdog_ops->irq_free(chip);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
free_irq(chip->watchdog_irq, chip); free_irq(chip->watchdog_irq, chip);
irq_dispose_mapping(chip->watchdog_irq); irq_dispose_mapping(chip->watchdog_irq);
...@@ -928,10 +928,10 @@ static int mv88e6xxx_g2_watchdog_setup(struct mv88e6xxx_chip *chip) ...@@ -928,10 +928,10 @@ static int mv88e6xxx_g2_watchdog_setup(struct mv88e6xxx_chip *chip)
if (err) if (err)
return err; return err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (chip->info->ops->watchdog_ops->irq_setup) if (chip->info->ops->watchdog_ops->irq_setup)
err = chip->info->ops->watchdog_ops->irq_setup(chip); err = chip->info->ops->watchdog_ops->irq_setup(chip);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
...@@ -986,9 +986,9 @@ static irqreturn_t mv88e6xxx_g2_irq_thread_fn(int irq, void *dev_id) ...@@ -986,9 +986,9 @@ static irqreturn_t mv88e6xxx_g2_irq_thread_fn(int irq, void *dev_id)
int err; int err;
u16 reg; u16 reg;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_g2_int_source(chip, &reg); err = mv88e6xxx_g2_int_source(chip, &reg);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
goto out; goto out;
...@@ -1007,7 +1007,7 @@ static void mv88e6xxx_g2_irq_bus_lock(struct irq_data *d) ...@@ -1007,7 +1007,7 @@ static void mv88e6xxx_g2_irq_bus_lock(struct irq_data *d)
{ {
struct mv88e6xxx_chip *chip = irq_data_get_irq_chip_data(d); struct mv88e6xxx_chip *chip = irq_data_get_irq_chip_data(d);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
} }
static void mv88e6xxx_g2_irq_bus_sync_unlock(struct irq_data *d) static void mv88e6xxx_g2_irq_bus_sync_unlock(struct irq_data *d)
...@@ -1019,7 +1019,7 @@ static void mv88e6xxx_g2_irq_bus_sync_unlock(struct irq_data *d) ...@@ -1019,7 +1019,7 @@ static void mv88e6xxx_g2_irq_bus_sync_unlock(struct irq_data *d)
if (err) if (err)
dev_err(chip->dev, "failed to mask interrupts\n"); dev_err(chip->dev, "failed to mask interrupts\n");
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static const struct irq_chip mv88e6xxx_g2_irq_chip = { static const struct irq_chip mv88e6xxx_g2_irq_chip = {
......
...@@ -147,7 +147,7 @@ static int mv88e6xxx_set_hwtstamp_config(struct mv88e6xxx_chip *chip, int port, ...@@ -147,7 +147,7 @@ static int mv88e6xxx_set_hwtstamp_config(struct mv88e6xxx_chip *chip, int port,
return -ERANGE; return -ERANGE;
} }
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (tstamp_enable) { if (tstamp_enable) {
chip->enable_count += 1; chip->enable_count += 1;
if (chip->enable_count == 1 && ptp_ops->global_enable) if (chip->enable_count == 1 && ptp_ops->global_enable)
...@@ -161,7 +161,7 @@ static int mv88e6xxx_set_hwtstamp_config(struct mv88e6xxx_chip *chip, int port, ...@@ -161,7 +161,7 @@ static int mv88e6xxx_set_hwtstamp_config(struct mv88e6xxx_chip *chip, int port,
if (chip->enable_count == 0 && ptp_ops->global_disable) if (chip->enable_count == 0 && ptp_ops->global_disable)
ptp_ops->global_disable(chip); ptp_ops->global_disable(chip);
} }
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
/* Once hardware has been configured, enable timestamp checks /* Once hardware has been configured, enable timestamp checks
* in the RX/TX paths. * in the RX/TX paths.
...@@ -301,10 +301,10 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip, ...@@ -301,10 +301,10 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip,
skb_queue_splice_tail_init(rxq, &received); skb_queue_splice_tail_init(rxq, &received);
spin_unlock_irqrestore(&rxq->lock, flags); spin_unlock_irqrestore(&rxq->lock, flags);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_ptp_read(chip, ps->port_id, err = mv88e6xxx_port_ptp_read(chip, ps->port_id,
reg, buf, ARRAY_SIZE(buf)); reg, buf, ARRAY_SIZE(buf));
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
pr_err("failed to get the receive time stamp\n"); pr_err("failed to get the receive time stamp\n");
...@@ -314,9 +314,9 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip, ...@@ -314,9 +314,9 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip,
seq_id = buf[3]; seq_id = buf[3];
if (status & MV88E6XXX_PTP_TS_VALID) { if (status & MV88E6XXX_PTP_TS_VALID) {
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_ptp_write(chip, ps->port_id, reg, 0); err = mv88e6xxx_port_ptp_write(chip, ps->port_id, reg, 0);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
pr_err("failed to clear the receive status\n"); pr_err("failed to clear the receive status\n");
} }
...@@ -327,9 +327,9 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip, ...@@ -327,9 +327,9 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip,
if (mv88e6xxx_ts_valid(status) && seq_match(skb, seq_id)) { if (mv88e6xxx_ts_valid(status) && seq_match(skb, seq_id)) {
ns = timehi << 16 | timelo; ns = timehi << 16 | timelo;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
ns = timecounter_cyc2time(&chip->tstamp_tc, ns); ns = timecounter_cyc2time(&chip->tstamp_tc, ns);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
shwt = skb_hwtstamps(skb); shwt = skb_hwtstamps(skb);
memset(shwt, 0, sizeof(*shwt)); memset(shwt, 0, sizeof(*shwt));
shwt->hwtstamp = ns_to_ktime(ns); shwt->hwtstamp = ns_to_ktime(ns);
...@@ -405,12 +405,12 @@ static int mv88e6xxx_txtstamp_work(struct mv88e6xxx_chip *chip, ...@@ -405,12 +405,12 @@ static int mv88e6xxx_txtstamp_work(struct mv88e6xxx_chip *chip,
if (!ps->tx_skb) if (!ps->tx_skb)
return 0; return 0;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_ptp_read(chip, ps->port_id, err = mv88e6xxx_port_ptp_read(chip, ps->port_id,
ptp_ops->dep_sts_reg, ptp_ops->dep_sts_reg,
departure_block, departure_block,
ARRAY_SIZE(departure_block)); ARRAY_SIZE(departure_block));
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) if (err)
goto free_and_clear_skb; goto free_and_clear_skb;
...@@ -430,9 +430,9 @@ static int mv88e6xxx_txtstamp_work(struct mv88e6xxx_chip *chip, ...@@ -430,9 +430,9 @@ static int mv88e6xxx_txtstamp_work(struct mv88e6xxx_chip *chip,
} }
/* We have the timestamp; go ahead and clear valid now */ /* We have the timestamp; go ahead and clear valid now */
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
mv88e6xxx_port_ptp_write(chip, ps->port_id, ptp_ops->dep_sts_reg, 0); mv88e6xxx_port_ptp_write(chip, ps->port_id, ptp_ops->dep_sts_reg, 0);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
status = departure_block[0] & MV88E6XXX_PTP_TS_STATUS_MASK; status = departure_block[0] & MV88E6XXX_PTP_TS_STATUS_MASK;
if (status != MV88E6XXX_PTP_TS_STATUS_NORMAL) { if (status != MV88E6XXX_PTP_TS_STATUS_NORMAL) {
...@@ -447,9 +447,9 @@ static int mv88e6xxx_txtstamp_work(struct mv88e6xxx_chip *chip, ...@@ -447,9 +447,9 @@ static int mv88e6xxx_txtstamp_work(struct mv88e6xxx_chip *chip,
memset(&shhwtstamps, 0, sizeof(shhwtstamps)); memset(&shhwtstamps, 0, sizeof(shhwtstamps));
time_raw = ((u32)departure_block[2] << 16) | departure_block[1]; time_raw = ((u32)departure_block[2] << 16) | departure_block[1];
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
ns = timecounter_cyc2time(&chip->tstamp_tc, time_raw); ns = timecounter_cyc2time(&chip->tstamp_tc, time_raw);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
shhwtstamps.hwtstamp = ns_to_ktime(ns); shhwtstamps.hwtstamp = ns_to_ktime(ns);
dev_dbg(chip->dev, dev_dbg(chip->dev,
......
...@@ -137,7 +137,7 @@ static void mv88e6xxx_phy_ppu_reenable_work(struct work_struct *ugly) ...@@ -137,7 +137,7 @@ static void mv88e6xxx_phy_ppu_reenable_work(struct work_struct *ugly)
chip = container_of(ugly, struct mv88e6xxx_chip, ppu_work); chip = container_of(ugly, struct mv88e6xxx_chip, ppu_work);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (mutex_trylock(&chip->ppu_mutex)) { if (mutex_trylock(&chip->ppu_mutex)) {
if (mv88e6xxx_phy_ppu_enable(chip) == 0) if (mv88e6xxx_phy_ppu_enable(chip) == 0)
...@@ -145,7 +145,7 @@ static void mv88e6xxx_phy_ppu_reenable_work(struct work_struct *ugly) ...@@ -145,7 +145,7 @@ static void mv88e6xxx_phy_ppu_reenable_work(struct work_struct *ugly)
mutex_unlock(&chip->ppu_mutex); mutex_unlock(&chip->ppu_mutex);
} }
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
} }
static void mv88e6xxx_phy_ppu_reenable_timer(struct timer_list *t) static void mv88e6xxx_phy_ppu_reenable_timer(struct timer_list *t)
......
...@@ -138,10 +138,10 @@ static void mv88e6352_tai_event_work(struct work_struct *ugly) ...@@ -138,10 +138,10 @@ static void mv88e6352_tai_event_work(struct work_struct *ugly)
u32 raw_ts; u32 raw_ts;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_tai_read(chip, MV88E6XXX_TAI_EVENT_STATUS, err = mv88e6xxx_tai_read(chip, MV88E6XXX_TAI_EVENT_STATUS,
status, ARRAY_SIZE(status)); status, ARRAY_SIZE(status));
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
if (err) { if (err) {
dev_err(chip->dev, "failed to read TAI status register\n"); dev_err(chip->dev, "failed to read TAI status register\n");
...@@ -158,18 +158,18 @@ static void mv88e6352_tai_event_work(struct work_struct *ugly) ...@@ -158,18 +158,18 @@ static void mv88e6352_tai_event_work(struct work_struct *ugly)
/* Clear the valid bit so the next timestamp can come in */ /* Clear the valid bit so the next timestamp can come in */
status[0] &= ~MV88E6XXX_TAI_EVENT_STATUS_VALID; status[0] &= ~MV88E6XXX_TAI_EVENT_STATUS_VALID;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_tai_write(chip, MV88E6XXX_TAI_EVENT_STATUS, status[0]); err = mv88e6xxx_tai_write(chip, MV88E6XXX_TAI_EVENT_STATUS, status[0]);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
/* This is an external timestamp */ /* This is an external timestamp */
ev.type = PTP_CLOCK_EXTTS; ev.type = PTP_CLOCK_EXTTS;
/* We only have one timestamping channel. */ /* We only have one timestamping channel. */
ev.index = 0; ev.index = 0;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
ev.timestamp = timecounter_cyc2time(&chip->tstamp_tc, raw_ts); ev.timestamp = timecounter_cyc2time(&chip->tstamp_tc, raw_ts);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
ptp_clock_event(chip->ptp_clock, &ev); ptp_clock_event(chip->ptp_clock, &ev);
out: out:
...@@ -192,12 +192,12 @@ static int mv88e6xxx_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) ...@@ -192,12 +192,12 @@ static int mv88e6xxx_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
adj *= scaled_ppm; adj *= scaled_ppm;
diff = div_u64(adj, CC_MULT_DEM); diff = div_u64(adj, CC_MULT_DEM);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
timecounter_read(&chip->tstamp_tc); timecounter_read(&chip->tstamp_tc);
chip->tstamp_cc.mult = neg_adj ? mult - diff : mult + diff; chip->tstamp_cc.mult = neg_adj ? mult - diff : mult + diff;
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return 0; return 0;
} }
...@@ -206,9 +206,9 @@ static int mv88e6xxx_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) ...@@ -206,9 +206,9 @@ static int mv88e6xxx_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
{ {
struct mv88e6xxx_chip *chip = ptp_to_chip(ptp); struct mv88e6xxx_chip *chip = ptp_to_chip(ptp);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
timecounter_adjtime(&chip->tstamp_tc, delta); timecounter_adjtime(&chip->tstamp_tc, delta);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return 0; return 0;
} }
...@@ -219,9 +219,9 @@ static int mv88e6xxx_ptp_gettime(struct ptp_clock_info *ptp, ...@@ -219,9 +219,9 @@ static int mv88e6xxx_ptp_gettime(struct ptp_clock_info *ptp,
struct mv88e6xxx_chip *chip = ptp_to_chip(ptp); struct mv88e6xxx_chip *chip = ptp_to_chip(ptp);
u64 ns; u64 ns;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
ns = timecounter_read(&chip->tstamp_tc); ns = timecounter_read(&chip->tstamp_tc);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
*ts = ns_to_timespec64(ns); *ts = ns_to_timespec64(ns);
...@@ -236,9 +236,9 @@ static int mv88e6xxx_ptp_settime(struct ptp_clock_info *ptp, ...@@ -236,9 +236,9 @@ static int mv88e6xxx_ptp_settime(struct ptp_clock_info *ptp,
ns = timespec64_to_ns(ts); ns = timespec64_to_ns(ts);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
timecounter_init(&chip->tstamp_tc, &chip->tstamp_cc, ns); timecounter_init(&chip->tstamp_tc, &chip->tstamp_cc, ns);
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return 0; return 0;
} }
...@@ -256,7 +256,7 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip, ...@@ -256,7 +256,7 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip,
if (pin < 0) if (pin < 0)
return -EBUSY; return -EBUSY;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (on) { if (on) {
func = MV88E6352_G2_SCRATCH_GPIO_PCTL_EVREQ; func = MV88E6352_G2_SCRATCH_GPIO_PCTL_EVREQ;
...@@ -278,7 +278,7 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip, ...@@ -278,7 +278,7 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip,
} }
out: out:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return err; return err;
} }
......
...@@ -208,7 +208,7 @@ static irqreturn_t mv88e6352_serdes_thread_fn(int irq, void *dev_id) ...@@ -208,7 +208,7 @@ static irqreturn_t mv88e6352_serdes_thread_fn(int irq, void *dev_id)
u16 status; u16 status;
int err; int err;
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
err = mv88e6352_serdes_read(chip, MV88E6352_SERDES_INT_STATUS, &status); err = mv88e6352_serdes_read(chip, MV88E6352_SERDES_INT_STATUS, &status);
if (err) if (err)
...@@ -219,7 +219,7 @@ static irqreturn_t mv88e6352_serdes_thread_fn(int irq, void *dev_id) ...@@ -219,7 +219,7 @@ static irqreturn_t mv88e6352_serdes_thread_fn(int irq, void *dev_id)
mv88e6352_serdes_irq_link(chip, port->port); mv88e6352_serdes_irq_link(chip, port->port);
} }
out: out:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return ret; return ret;
} }
...@@ -253,12 +253,12 @@ int mv88e6352_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port) ...@@ -253,12 +253,12 @@ int mv88e6352_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port)
/* Requesting the IRQ will trigger irq callbacks. So we cannot /* Requesting the IRQ will trigger irq callbacks. So we cannot
* hold the reg_lock. * hold the reg_lock.
*/ */
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
err = request_threaded_irq(chip->ports[port].serdes_irq, NULL, err = request_threaded_irq(chip->ports[port].serdes_irq, NULL,
mv88e6352_serdes_thread_fn, mv88e6352_serdes_thread_fn,
IRQF_ONESHOT, "mv88e6xxx-serdes", IRQF_ONESHOT, "mv88e6xxx-serdes",
&chip->ports[port]); &chip->ports[port]);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (err) { if (err) {
dev_err(chip->dev, "Unable to request SERDES interrupt: %d\n", dev_err(chip->dev, "Unable to request SERDES interrupt: %d\n",
...@@ -279,9 +279,9 @@ void mv88e6352_serdes_irq_free(struct mv88e6xxx_chip *chip, int port) ...@@ -279,9 +279,9 @@ void mv88e6352_serdes_irq_free(struct mv88e6xxx_chip *chip, int port)
/* Freeing the IRQ will trigger irq callbacks. So we cannot /* Freeing the IRQ will trigger irq callbacks. So we cannot
* hold the reg_lock. * hold the reg_lock.
*/ */
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
free_irq(chip->ports[port].serdes_irq, &chip->ports[port]); free_irq(chip->ports[port].serdes_irq, &chip->ports[port]);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
chip->ports[port].serdes_irq = 0; chip->ports[port].serdes_irq = 0;
} }
...@@ -621,7 +621,7 @@ static irqreturn_t mv88e6390_serdes_thread_fn(int irq, void *dev_id) ...@@ -621,7 +621,7 @@ static irqreturn_t mv88e6390_serdes_thread_fn(int irq, void *dev_id)
lane = mv88e6390x_serdes_get_lane(chip, port->port); lane = mv88e6390x_serdes_get_lane(chip, port->port);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
switch (cmode) { switch (cmode) {
case MV88E6XXX_PORT_STS_CMODE_SGMII: case MV88E6XXX_PORT_STS_CMODE_SGMII:
...@@ -637,7 +637,7 @@ static irqreturn_t mv88e6390_serdes_thread_fn(int irq, void *dev_id) ...@@ -637,7 +637,7 @@ static irqreturn_t mv88e6390_serdes_thread_fn(int irq, void *dev_id)
} }
} }
out: out:
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
return ret; return ret;
} }
...@@ -666,12 +666,12 @@ int mv88e6390x_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port) ...@@ -666,12 +666,12 @@ int mv88e6390x_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port)
/* Requesting the IRQ will trigger irq callbacks. So we cannot /* Requesting the IRQ will trigger irq callbacks. So we cannot
* hold the reg_lock. * hold the reg_lock.
*/ */
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
err = request_threaded_irq(chip->ports[port].serdes_irq, NULL, err = request_threaded_irq(chip->ports[port].serdes_irq, NULL,
mv88e6390_serdes_thread_fn, mv88e6390_serdes_thread_fn,
IRQF_ONESHOT, "mv88e6xxx-serdes", IRQF_ONESHOT, "mv88e6xxx-serdes",
&chip->ports[port]); &chip->ports[port]);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
if (err) { if (err) {
dev_err(chip->dev, "Unable to request SERDES interrupt: %d\n", dev_err(chip->dev, "Unable to request SERDES interrupt: %d\n",
...@@ -705,9 +705,9 @@ void mv88e6390x_serdes_irq_free(struct mv88e6xxx_chip *chip, int port) ...@@ -705,9 +705,9 @@ void mv88e6390x_serdes_irq_free(struct mv88e6xxx_chip *chip, int port)
/* Freeing the IRQ will trigger irq callbacks. So we cannot /* Freeing the IRQ will trigger irq callbacks. So we cannot
* hold the reg_lock. * hold the reg_lock.
*/ */
mutex_unlock(&chip->reg_lock); mv88e6xxx_reg_unlock(chip);
free_irq(chip->ports[port].serdes_irq, &chip->ports[port]); free_irq(chip->ports[port].serdes_irq, &chip->ports[port]);
mutex_lock(&chip->reg_lock); mv88e6xxx_reg_lock(chip);
chip->ports[port].serdes_irq = 0; chip->ports[port].serdes_irq = 0;
} }
......
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