]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: remove the transactional logic from ageing time notifiers
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 9 Jan 2021 00:01:51 +0000 (02:01 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Jan 2021 00:00:57 +0000 (16:00 -0800)
Remove the shim introduced in DSA for offloading the bridge ageing time
from switchdev, by first checking whether the ageing time is within the
range limits requested by the driver.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/switch.c

index 3e6063bf3f176b15dfaab7143a075085ac956d83..89143cc049db575dfd6eeb5cd6f9c344d5956295 100644 (file)
@@ -29,7 +29,6 @@ enum {
 
 /* DSA_NOTIFIER_AGEING_TIME */
 struct dsa_notifier_ageing_time_info {
-       struct switchdev_trans *trans;
        unsigned int ageing_time;
 };
 
index 14bf0053ae011b74fdcc321972a6c5ce21ebf6a0..e59bf66c4c0da4a9b5d83d2019340903e6488dfc 100644 (file)
@@ -310,21 +310,17 @@ int dsa_port_ageing_time(struct dsa_port *dp, clock_t ageing_clock)
        unsigned long ageing_jiffies = clock_t_to_jiffies(ageing_clock);
        unsigned int ageing_time = jiffies_to_msecs(ageing_jiffies);
        struct dsa_notifier_ageing_time_info info;
-       struct switchdev_trans trans;
        int err;
 
        info.ageing_time = ageing_time;
-       info.trans = &trans;
 
-       trans.ph_prepare = true;
        err = dsa_port_notify(dp, DSA_NOTIFIER_AGEING_TIME, &info);
        if (err)
                return err;
 
        dp->ageing_time = ageing_time;
 
-       trans.ph_prepare = false;
-       return dsa_port_notify(dp, DSA_NOTIFIER_AGEING_TIME, &info);
+       return 0;
 }
 
 int dsa_port_pre_bridge_flags(const struct dsa_port *dp, unsigned long flags)
index 17979956d756e42f82cbfb66a47e6eb601c319c9..c6b3ac93bcc74f84986d9a9ae762745ae013889d 100644 (file)
@@ -33,15 +33,12 @@ static int dsa_switch_ageing_time(struct dsa_switch *ds,
                                  struct dsa_notifier_ageing_time_info *info)
 {
        unsigned int ageing_time = info->ageing_time;
-       struct switchdev_trans *trans = info->trans;
-
-       if (switchdev_trans_ph_prepare(trans)) {
-               if (ds->ageing_time_min && ageing_time < ds->ageing_time_min)
-                       return -ERANGE;
-               if (ds->ageing_time_max && ageing_time > ds->ageing_time_max)
-                       return -ERANGE;
-               return 0;
-       }
+
+       if (ds->ageing_time_min && ageing_time < ds->ageing_time_min)
+               return -ERANGE;
+
+       if (ds->ageing_time_max && ageing_time > ds->ageing_time_max)
+               return -ERANGE;
 
        /* Program the fastest ageing time in case of multiple bridges */
        ageing_time = dsa_switch_fastest_ageing_time(ds, ageing_time);