Re: [RFC PATCH v7 01/23] sched: Wrap rq::lock access
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <ef37f149fba553de650312f3a24f784e137ff1be.1598643276.git.jdesfossez(a)digitalocean.com>
References: <ef37f149fba553de650312f3a24f784e137ff1be.1598643276.git.jdesfossez(a)digitalocean.com>
TO: Julien Desfossez <jdesfossez(a)digitalocean.com>
Hi Julien,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on tip/sched/core]
[also build test WARNING on tip/x86/core kvm/linux-next linus/master asm-generic/master v5.9-rc2 next-20200828]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Julien-Desfossez/Core-scheduling...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 4fc472f1214ef75e5450f207e23ff13af6eecad4
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago
config: i386-randconfig-m021-20200829 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
kernel/sched/sched.h:2125 _double_lock_balance() warn: inconsistent returns '*rq_lockp(busiest)'.
kernel/sched/sched.h:2125 _double_lock_balance() warn: inconsistent returns '*rq_lockp(busiest)'.
# https://github.com/0day-ci/linux/commit/26eacbffc0e275e5bc6708de9b3c4dc9c...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Julien-Desfossez/Core-scheduling-v7/20200829-035707
git checkout 26eacbffc0e275e5bc6708de9b3c4dc9cf7102de
vim +2125 kernel/sched/sched.h
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2096
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2097 #else
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2098 /*
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2099 * Unfair double_lock_balance: Optimizes throughput at the expense of
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2100 * latency by eliminating extra atomic operations when the locks are
97fb7a0a8944bd kernel/sched/sched.h Ingo Molnar 2018-03-03 2101 * already in proper order on entry. This favors lower CPU-ids and will
97fb7a0a8944bd kernel/sched/sched.h Ingo Molnar 2018-03-03 2102 * grant the double lock to lower CPUs over higher ids under contention,
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2103 * regardless of entry order into the function.
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2104 */
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2105 static inline int _double_lock_balance(struct rq *this_rq, struct rq *busiest)
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2106 __releases(this_rq->lock)
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2107 __acquires(busiest->lock)
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2108 __acquires(this_rq->lock)
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2109 {
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2110 if (rq_lockp(this_rq) == rq_lockp(busiest))
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2111 return 0;
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2112
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2113 if (likely(raw_spin_trylock(rq_lockp(busiest))))
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2114 return 0;
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2115
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2116 if (rq_lockp(busiest) >= rq_lockp(this_rq)) {
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2117 raw_spin_lock_nested(rq_lockp(busiest), SINGLE_DEPTH_NESTING);
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2118 return 0;
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2119 }
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2120
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2121 raw_spin_unlock(rq_lockp(this_rq));
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2122 raw_spin_lock(rq_lockp(busiest));
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2123 raw_spin_lock_nested(rq_lockp(this_rq), SINGLE_DEPTH_NESTING);
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 2124
26eacbffc0e275 kernel/sched/sched.h Peter Zijlstra 2020-08-28 @2125 return 1;
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2126 }
029632fbb7b7c9 kernel/sched.h Peter Zijlstra 2011-10-25 2127
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/net/dsa/sja1105/sja1105_main.c:2180 sja1105_build_subvlans() warn: should '(((1))) << (v->port)' be a 64 bit
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vladimir Oltean <vladimir.oltean(a)nxp.com>
CC: Florian Fainelli <f.fainelli(a)gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: 3f01c91aab9276ca48acccd20f6c379cf48a51f9 net: dsa: sja1105: implement VLAN retagging for dsa_8021q sub-VLANs
date: 4 months ago
:::::: branch date: 13 hours ago
:::::: commit date: 4 months ago
config: arm-randconfig-m031-20200829 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:2180 sja1105_build_subvlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2181 sja1105_build_subvlans() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2347 sja1105_build_crosschip_subvlans() warn: should '(((1))) << (tmp->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2348 sja1105_build_crosschip_subvlans() warn: should '(((1))) << upstream' be a 64 bit type?
Old smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:46 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:47 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:48 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:188 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:191 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:197 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:202 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:562 sja1105_init_avb_params() warn: is 'table->entries' large enough for 'struct sja1105_avb_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:1154 sja1105_find_static_fdb_entry() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1272 sja1105et_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1274 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1282 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1368 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1376 sja1105pqrs_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1381 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1431 sja1105pqrs_fdb_del() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1515 sja1105_fdb_dump() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1751 sja1105_static_config_reload() warn: bitwise AND condition is false here
drivers/net/dsa/sja1105/sja1105_main.c:2105 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2106 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2108 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2127 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2128 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2130 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2182 sja1105_build_subvlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2183 sja1105_build_subvlans() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2188 sja1105_build_subvlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2190 sja1105_build_subvlans() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2206 sja1105_build_subvlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2207 sja1105_build_subvlans() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2356 sja1105_build_crosschip_subvlans() warn: should '(((1))) << (tmp->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2357 sja1105_build_crosschip_subvlans() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2382 sja1105_build_crosschip_subvlans() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2383 sja1105_build_crosschip_subvlans() warn: should '(((1))) << (tmp->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2785 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.
drivers/net/dsa/sja1105/sja1105_main.c:3000 sja1105_mgmt_xmit() warn: should '(((1))) << port' be a 64 bit type?
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3f01c91aab9276ca48acccd20f6c379cf48a51f9
vim +2180 drivers/net/dsa/sja1105/sja1105_main.c
ec5ae61076d07b Vladimir Oltean 2020-05-12 2135
3f01c91aab9276 Vladimir Oltean 2020-05-12 2136 static int sja1105_build_subvlans(struct sja1105_private *priv,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2137 u16 subvlan_map[][DSA_8021Q_N_SUBVLAN],
3f01c91aab9276 Vladimir Oltean 2020-05-12 2138 struct sja1105_vlan_lookup_entry *new_vlan,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2139 struct sja1105_retagging_entry *new_retagging,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2140 int *num_retagging)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2141 {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2142 struct sja1105_bridge_vlan *v;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2143 int k = *num_retagging;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2144
3f01c91aab9276 Vladimir Oltean 2020-05-12 2145 if (priv->vlan_state != SJA1105_VLAN_BEST_EFFORT)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2146 return 0;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2147
3f01c91aab9276 Vladimir Oltean 2020-05-12 2148 list_for_each_entry(v, &priv->bridge_vlans, list) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2149 int upstream = dsa_upstream_port(priv->ds, v->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2150 int match, subvlan;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2151 u16 rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2152
3f01c91aab9276 Vladimir Oltean 2020-05-12 2153 /* Only sub-VLANs on user ports need to be applied.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2154 * Bridge VLANs also include VLANs added automatically
3f01c91aab9276 Vladimir Oltean 2020-05-12 2155 * by DSA on the CPU port.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2156 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2157 if (!dsa_is_user_port(priv->ds, v->port))
3f01c91aab9276 Vladimir Oltean 2020-05-12 2158 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2159
3f01c91aab9276 Vladimir Oltean 2020-05-12 2160 subvlan = sja1105_find_subvlan(subvlan_map[v->port],
3f01c91aab9276 Vladimir Oltean 2020-05-12 2161 v->vid);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2162 if (subvlan < 0) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2163 subvlan = sja1105_find_free_subvlan(subvlan_map[v->port],
3f01c91aab9276 Vladimir Oltean 2020-05-12 2164 v->pvid);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2165 if (subvlan < 0) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2166 dev_err(priv->ds->dev, "No more free subvlans\n");
3f01c91aab9276 Vladimir Oltean 2020-05-12 2167 return -ENOSPC;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2168 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2169 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2170
3f01c91aab9276 Vladimir Oltean 2020-05-12 2171 rx_vid = dsa_8021q_rx_vid_subvlan(priv->ds, v->port, subvlan);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2172
3f01c91aab9276 Vladimir Oltean 2020-05-12 2173 /* @v->vid on @v->port needs to be retagged to @rx_vid
3f01c91aab9276 Vladimir Oltean 2020-05-12 2174 * on @upstream. Assume @v->vid on @v->port and on
3f01c91aab9276 Vladimir Oltean 2020-05-12 2175 * @upstream was already configured by the previous
3f01c91aab9276 Vladimir Oltean 2020-05-12 2176 * iteration over bridge_vlans.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2177 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2178 match = rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2179 new_vlan[match].vlanid = rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 @2180 new_vlan[match].vmemb_port |= BIT(v->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 @2181 new_vlan[match].vmemb_port |= BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2182 new_vlan[match].vlan_bc |= BIT(v->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2183 new_vlan[match].vlan_bc |= BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2184 /* The "untagged" flag is set the same as for the
3f01c91aab9276 Vladimir Oltean 2020-05-12 2185 * original VLAN
3f01c91aab9276 Vladimir Oltean 2020-05-12 2186 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2187 if (!v->untagged)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2188 new_vlan[match].tag_port |= BIT(v->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2189 /* But it's always tagged towards the CPU */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2190 new_vlan[match].tag_port |= BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2191
3f01c91aab9276 Vladimir Oltean 2020-05-12 2192 /* The Retagging Table generates packet *clones* with
3f01c91aab9276 Vladimir Oltean 2020-05-12 2193 * the new VLAN. This is a very odd hardware quirk
3f01c91aab9276 Vladimir Oltean 2020-05-12 2194 * which we need to suppress by dropping the original
3f01c91aab9276 Vladimir Oltean 2020-05-12 2195 * packet.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2196 * Deny egress of the original VLAN towards the CPU
3f01c91aab9276 Vladimir Oltean 2020-05-12 2197 * port. This will force the switch to drop it, and
3f01c91aab9276 Vladimir Oltean 2020-05-12 2198 * we'll see only the retagged packets.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2199 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2200 match = v->vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2201 new_vlan[match].vlan_bc &= ~BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2202
3f01c91aab9276 Vladimir Oltean 2020-05-12 2203 /* And the retagging itself */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2204 new_retagging[k].vlan_ing = v->vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2205 new_retagging[k].vlan_egr = rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2206 new_retagging[k].ing_port = BIT(v->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2207 new_retagging[k].egr_port = BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2208 if (k++ == SJA1105_MAX_RETAGGING_COUNT) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2209 dev_err(priv->ds->dev, "No more retagging rules\n");
3f01c91aab9276 Vladimir Oltean 2020-05-12 2210 return -ENOSPC;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2211 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2212
3f01c91aab9276 Vladimir Oltean 2020-05-12 2213 subvlan_map[v->port][subvlan] = v->vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2214 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2215
3f01c91aab9276 Vladimir Oltean 2020-05-12 2216 *num_retagging = k;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2217
3f01c91aab9276 Vladimir Oltean 2020-05-12 2218 return 0;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2219 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2220
3f01c91aab9276 Vladimir Oltean 2020-05-12 2221 /* Sadly, in crosschip scenarios where the CPU port is also the link to another
3f01c91aab9276 Vladimir Oltean 2020-05-12 2222 * switch, we should retag backwards (the dsa_8021q vid to the original vid) on
3f01c91aab9276 Vladimir Oltean 2020-05-12 2223 * the CPU port of neighbour switches.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2224 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2225 static int
3f01c91aab9276 Vladimir Oltean 2020-05-12 2226 sja1105_build_crosschip_subvlans(struct sja1105_private *priv,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2227 struct sja1105_vlan_lookup_entry *new_vlan,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2228 struct sja1105_retagging_entry *new_retagging,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2229 int *num_retagging)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2230 {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2231 struct sja1105_crosschip_vlan *tmp, *pos;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2232 struct dsa_8021q_crosschip_link *c;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2233 struct sja1105_bridge_vlan *v, *w;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2234 struct list_head crosschip_vlans;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2235 int k = *num_retagging;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2236 int rc = 0;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2237
3f01c91aab9276 Vladimir Oltean 2020-05-12 2238 if (priv->vlan_state != SJA1105_VLAN_BEST_EFFORT)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2239 return 0;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2240
3f01c91aab9276 Vladimir Oltean 2020-05-12 2241 INIT_LIST_HEAD(&crosschip_vlans);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2242
3f01c91aab9276 Vladimir Oltean 2020-05-12 2243 list_for_each_entry(c, &priv->crosschip_links, list) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2244 struct sja1105_private *other_priv = c->other_ds->priv;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2245
3f01c91aab9276 Vladimir Oltean 2020-05-12 2246 if (other_priv->vlan_state == SJA1105_VLAN_FILTERING_FULL)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2247 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2248
3f01c91aab9276 Vladimir Oltean 2020-05-12 2249 /* Crosschip links are also added to the CPU ports.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2250 * Ignore those.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2251 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2252 if (!dsa_is_user_port(priv->ds, c->port))
3f01c91aab9276 Vladimir Oltean 2020-05-12 2253 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2254 if (!dsa_is_user_port(c->other_ds, c->other_port))
3f01c91aab9276 Vladimir Oltean 2020-05-12 2255 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2256
3f01c91aab9276 Vladimir Oltean 2020-05-12 2257 /* Search for VLANs on the remote port */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2258 list_for_each_entry(v, &other_priv->bridge_vlans, list) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2259 bool already_added = false;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2260 bool we_have_it = false;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2261
3f01c91aab9276 Vladimir Oltean 2020-05-12 2262 if (v->port != c->other_port)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2263 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2264
3f01c91aab9276 Vladimir Oltean 2020-05-12 2265 /* If @v is a pvid on @other_ds, it does not need
3f01c91aab9276 Vladimir Oltean 2020-05-12 2266 * re-retagging, because its SVL field is 0 and we
3f01c91aab9276 Vladimir Oltean 2020-05-12 2267 * already allow that, via the dsa_8021q crosschip
3f01c91aab9276 Vladimir Oltean 2020-05-12 2268 * links.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2269 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2270 if (v->pvid)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2271 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2272
3f01c91aab9276 Vladimir Oltean 2020-05-12 2273 /* Search for the VLAN on our local port */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2274 list_for_each_entry(w, &priv->bridge_vlans, list) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2275 if (w->port == c->port && w->vid == v->vid) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2276 we_have_it = true;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2277 break;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2278 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2279 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2280
3f01c91aab9276 Vladimir Oltean 2020-05-12 2281 if (!we_have_it)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2282 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2283
3f01c91aab9276 Vladimir Oltean 2020-05-12 2284 list_for_each_entry(tmp, &crosschip_vlans, list) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2285 if (tmp->vid == v->vid &&
3f01c91aab9276 Vladimir Oltean 2020-05-12 2286 tmp->untagged == v->untagged &&
3f01c91aab9276 Vladimir Oltean 2020-05-12 2287 tmp->port == c->port &&
3f01c91aab9276 Vladimir Oltean 2020-05-12 2288 tmp->other_port == v->port &&
3f01c91aab9276 Vladimir Oltean 2020-05-12 2289 tmp->other_ds == c->other_ds) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2290 already_added = true;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2291 break;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2292 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2293 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2294
3f01c91aab9276 Vladimir Oltean 2020-05-12 2295 if (already_added)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2296 continue;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2297
3f01c91aab9276 Vladimir Oltean 2020-05-12 2298 tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2299 if (!tmp) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2300 dev_err(priv->ds->dev, "Failed to allocate memory\n");
3f01c91aab9276 Vladimir Oltean 2020-05-12 2301 rc = -ENOMEM;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2302 goto out;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2303 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2304 tmp->vid = v->vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2305 tmp->port = c->port;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2306 tmp->other_port = v->port;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2307 tmp->other_ds = c->other_ds;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2308 tmp->untagged = v->untagged;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2309 list_add(&tmp->list, &crosschip_vlans);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2310 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2311 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2312
3f01c91aab9276 Vladimir Oltean 2020-05-12 2313 list_for_each_entry(tmp, &crosschip_vlans, list) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2314 struct sja1105_private *other_priv = tmp->other_ds->priv;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2315 int upstream = dsa_upstream_port(priv->ds, tmp->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2316 int match, subvlan;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2317 u16 rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2318
3f01c91aab9276 Vladimir Oltean 2020-05-12 2319 subvlan = sja1105_find_committed_subvlan(other_priv,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2320 tmp->other_port,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2321 tmp->vid);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2322 /* If this happens, it's a bug. The neighbour switch does not
3f01c91aab9276 Vladimir Oltean 2020-05-12 2323 * have a subvlan for tmp->vid on tmp->other_port, but it
3f01c91aab9276 Vladimir Oltean 2020-05-12 2324 * should, since we already checked for its vlan_state.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2325 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2326 if (WARN_ON(subvlan < 0)) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2327 rc = -EINVAL;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2328 goto out;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2329 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2330
3f01c91aab9276 Vladimir Oltean 2020-05-12 2331 rx_vid = dsa_8021q_rx_vid_subvlan(tmp->other_ds,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2332 tmp->other_port,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2333 subvlan);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2334
3f01c91aab9276 Vladimir Oltean 2020-05-12 2335 /* The @rx_vid retagged from @tmp->vid on
3f01c91aab9276 Vladimir Oltean 2020-05-12 2336 * {@tmp->other_ds, @tmp->other_port} needs to be
3f01c91aab9276 Vladimir Oltean 2020-05-12 2337 * re-retagged to @tmp->vid on the way back to us.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2338 *
3f01c91aab9276 Vladimir Oltean 2020-05-12 2339 * Assume the original @tmp->vid is already configured
3f01c91aab9276 Vladimir Oltean 2020-05-12 2340 * on this local switch, otherwise we wouldn't be
3f01c91aab9276 Vladimir Oltean 2020-05-12 2341 * retagging its subvlan on the other switch in the
3f01c91aab9276 Vladimir Oltean 2020-05-12 2342 * first place. We just need to add a reverse retagging
3f01c91aab9276 Vladimir Oltean 2020-05-12 2343 * rule for @rx_vid and install @rx_vid on our ports.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2344 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2345 match = rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2346 new_vlan[match].vlanid = rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 @2347 new_vlan[match].vmemb_port |= BIT(tmp->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 @2348 new_vlan[match].vmemb_port |= BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2349 /* The "untagged" flag is set the same as for the
3f01c91aab9276 Vladimir Oltean 2020-05-12 2350 * original VLAN. And towards the CPU, it doesn't
3f01c91aab9276 Vladimir Oltean 2020-05-12 2351 * really matter, because @rx_vid will only receive
3f01c91aab9276 Vladimir Oltean 2020-05-12 2352 * traffic on that port. For consistency with other dsa_8021q
3f01c91aab9276 Vladimir Oltean 2020-05-12 2353 * VLANs, we'll keep the CPU port tagged.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2354 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2355 if (!tmp->untagged)
3f01c91aab9276 Vladimir Oltean 2020-05-12 2356 new_vlan[match].tag_port |= BIT(tmp->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2357 new_vlan[match].tag_port |= BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2358 /* Deny egress of @rx_vid towards our front-panel port.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2359 * This will force the switch to drop it, and we'll see
3f01c91aab9276 Vladimir Oltean 2020-05-12 2360 * only the re-retagged packets (having the original,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2361 * pre-initial-retagging, VLAN @tmp->vid).
3f01c91aab9276 Vladimir Oltean 2020-05-12 2362 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2363 new_vlan[match].vlan_bc &= ~BIT(tmp->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2364
3f01c91aab9276 Vladimir Oltean 2020-05-12 2365 /* On reverse retagging, the same ingress VLAN goes to multiple
3f01c91aab9276 Vladimir Oltean 2020-05-12 2366 * ports. So we have an opportunity to create composite rules
3f01c91aab9276 Vladimir Oltean 2020-05-12 2367 * to not waste the limited space in the retagging table.
3f01c91aab9276 Vladimir Oltean 2020-05-12 2368 */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2369 k = sja1105_find_retagging_entry(new_retagging, *num_retagging,
3f01c91aab9276 Vladimir Oltean 2020-05-12 2370 upstream, rx_vid, tmp->vid);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2371 if (k < 0) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2372 if (*num_retagging == SJA1105_MAX_RETAGGING_COUNT) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2373 dev_err(priv->ds->dev, "No more retagging rules\n");
3f01c91aab9276 Vladimir Oltean 2020-05-12 2374 rc = -ENOSPC;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2375 goto out;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2376 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2377 k = (*num_retagging)++;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2378 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2379 /* And the retagging itself */
3f01c91aab9276 Vladimir Oltean 2020-05-12 2380 new_retagging[k].vlan_ing = rx_vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2381 new_retagging[k].vlan_egr = tmp->vid;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2382 new_retagging[k].ing_port = BIT(upstream);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2383 new_retagging[k].egr_port |= BIT(tmp->port);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2384 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2385
3f01c91aab9276 Vladimir Oltean 2020-05-12 2386 out:
3f01c91aab9276 Vladimir Oltean 2020-05-12 2387 list_for_each_entry_safe(tmp, pos, &crosschip_vlans, list) {
3f01c91aab9276 Vladimir Oltean 2020-05-12 2388 list_del(&tmp->list);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2389 kfree(tmp);
3f01c91aab9276 Vladimir Oltean 2020-05-12 2390 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2391
3f01c91aab9276 Vladimir Oltean 2020-05-12 2392 return rc;
3f01c91aab9276 Vladimir Oltean 2020-05-12 2393 }
3f01c91aab9276 Vladimir Oltean 2020-05-12 2394
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vladimir Oltean <vladimir.oltean(a)nxp.com>
CC: Florian Fainelli <f.fainelli(a)gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: 2cafa72e516f61b6d82c2416b4f5963fb48fd9ce net: dsa: sja1105: add a new best_effort_vlan_filtering devlink parameter
date: 4 months ago
:::::: branch date: 12 hours ago
:::::: commit date: 4 months ago
config: arm-randconfig-m031-20200829 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.
Old smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:46 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:47 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:48 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:188 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:191 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:197 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:202 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:527 sja1105_init_avb_params() warn: is 'table->entries' large enough for 'struct sja1105_avb_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:1119 sja1105_find_static_fdb_entry() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1237 sja1105et_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1239 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1247 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1333 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1341 sja1105pqrs_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1346 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1396 sja1105pqrs_fdb_del() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1480 sja1105_fdb_dump() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1716 sja1105_static_config_reload() warn: bitwise AND condition is false here
drivers/net/dsa/sja1105/sja1105_main.c:1958 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1959 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1961 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1980 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1981 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1983 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2557 sja1105_mgmt_xmit() warn: should '(((1))) << port' be a 64 bit type?
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2cafa72e516f61b6d82c2416b4f5963fb48fd9ce
vim +/rc +2342 drivers/net/dsa/sja1105/sja1105_main.c
2cafa72e516f61 Vladimir Oltean 2020-05-12 2315
2cafa72e516f61 Vladimir Oltean 2020-05-12 2316 static int sja1105_best_effort_vlan_filtering_set(struct sja1105_private *priv,
2cafa72e516f61 Vladimir Oltean 2020-05-12 2317 bool be_vlan)
2cafa72e516f61 Vladimir Oltean 2020-05-12 2318 {
2cafa72e516f61 Vladimir Oltean 2020-05-12 2319 struct dsa_switch *ds = priv->ds;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2320 bool vlan_filtering;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2321 int port;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2322 int rc;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2323
2cafa72e516f61 Vladimir Oltean 2020-05-12 2324 priv->best_effort_vlan_filtering = be_vlan;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2325
2cafa72e516f61 Vladimir Oltean 2020-05-12 2326 rtnl_lock();
2cafa72e516f61 Vladimir Oltean 2020-05-12 2327 for (port = 0; port < ds->num_ports; port++) {
2cafa72e516f61 Vladimir Oltean 2020-05-12 2328 struct dsa_port *dp;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2329
2cafa72e516f61 Vladimir Oltean 2020-05-12 2330 if (!dsa_is_user_port(ds, port))
2cafa72e516f61 Vladimir Oltean 2020-05-12 2331 continue;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2332
2cafa72e516f61 Vladimir Oltean 2020-05-12 2333 dp = dsa_to_port(ds, port);
2cafa72e516f61 Vladimir Oltean 2020-05-12 2334 vlan_filtering = dsa_port_is_vlan_filtering(dp);
2cafa72e516f61 Vladimir Oltean 2020-05-12 2335
2cafa72e516f61 Vladimir Oltean 2020-05-12 2336 rc = sja1105_vlan_filtering(ds, port, vlan_filtering);
2cafa72e516f61 Vladimir Oltean 2020-05-12 2337 if (rc)
2cafa72e516f61 Vladimir Oltean 2020-05-12 2338 break;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2339 }
2cafa72e516f61 Vladimir Oltean 2020-05-12 2340 rtnl_unlock();
2cafa72e516f61 Vladimir Oltean 2020-05-12 2341
2cafa72e516f61 Vladimir Oltean 2020-05-12 @2342 return rc;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2343 }
2cafa72e516f61 Vladimir Oltean 2020-05-12 2344
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/net/ethernet/ti/cpts.c:303 cpts_match_tx_ts() error: double unlocked 'cpts->txq.lock' (orig line 274)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Grygorii Strashko <grygorii.strashko(a)ti.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: c8f8e47efe66dae775b617982e47a4564d7c4dda net: ethernet: ti: cpts: move tx timestamp processing to ptp worker only
date: 4 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 4 months ago
config: microblaze-randconfig-m031-20200828 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/ethernet/ti/cpts.c:303 cpts_match_tx_ts() error: double unlocked 'cpts->txq.lock' (orig line 274)
drivers/net/ethernet/ti/cpts.c:332 cpts_process_events() error: double unlocked 'cpts->lock' (orig line 318)
Old smatch warnings:
arch/microblaze/include/asm/thread_info.h:91 current_thread_info() error: uninitialized symbol 'sp'.
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c8f8e47efe66dae775b617982e47a4564d7c4dda
vim +303 drivers/net/ethernet/ti/cpts.c
87c0e764d43aca Richard Cochran 2012-10-29 256
c8f8e47efe66da Grygorii Strashko 2020-04-23 257 static bool cpts_match_tx_ts(struct cpts *cpts, struct cpts_event *event)
c8f8e47efe66da Grygorii Strashko 2020-04-23 258 {
c8f8e47efe66da Grygorii Strashko 2020-04-23 259 struct sk_buff_head txq_list;
c8f8e47efe66da Grygorii Strashko 2020-04-23 260 struct sk_buff *skb, *tmp;
c8f8e47efe66da Grygorii Strashko 2020-04-23 261 unsigned long flags;
c8f8e47efe66da Grygorii Strashko 2020-04-23 262 bool found = false;
c8f8e47efe66da Grygorii Strashko 2020-04-23 263 u32 mtype_seqid;
c8f8e47efe66da Grygorii Strashko 2020-04-23 264
c8f8e47efe66da Grygorii Strashko 2020-04-23 265 mtype_seqid = event->high &
c8f8e47efe66da Grygorii Strashko 2020-04-23 266 ((MESSAGE_TYPE_MASK << MESSAGE_TYPE_SHIFT) |
c8f8e47efe66da Grygorii Strashko 2020-04-23 267 (SEQUENCE_ID_MASK << SEQUENCE_ID_SHIFT) |
c8f8e47efe66da Grygorii Strashko 2020-04-23 268 (EVENT_TYPE_MASK << EVENT_TYPE_SHIFT));
c8f8e47efe66da Grygorii Strashko 2020-04-23 269
c8f8e47efe66da Grygorii Strashko 2020-04-23 270 __skb_queue_head_init(&txq_list);
c8f8e47efe66da Grygorii Strashko 2020-04-23 271
c8f8e47efe66da Grygorii Strashko 2020-04-23 272 spin_lock_irqsave(&cpts->txq.lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 273 skb_queue_splice_init(&cpts->txq, &txq_list);
c8f8e47efe66da Grygorii Strashko 2020-04-23 @274 spin_unlock_irqrestore(&cpts->txq.lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 275
c8f8e47efe66da Grygorii Strashko 2020-04-23 276 skb_queue_walk_safe(&txq_list, skb, tmp) {
c8f8e47efe66da Grygorii Strashko 2020-04-23 277 struct skb_shared_hwtstamps ssh;
c8f8e47efe66da Grygorii Strashko 2020-04-23 278 struct cpts_skb_cb_data *skb_cb =
c8f8e47efe66da Grygorii Strashko 2020-04-23 279 (struct cpts_skb_cb_data *)skb->cb;
c8f8e47efe66da Grygorii Strashko 2020-04-23 280
c8f8e47efe66da Grygorii Strashko 2020-04-23 281 if (mtype_seqid == skb_cb->skb_mtype_seqid) {
c8f8e47efe66da Grygorii Strashko 2020-04-23 282 memset(&ssh, 0, sizeof(ssh));
c8f8e47efe66da Grygorii Strashko 2020-04-23 283 ssh.hwtstamp = ns_to_ktime(event->timestamp);
c8f8e47efe66da Grygorii Strashko 2020-04-23 284 skb_tstamp_tx(skb, &ssh);
c8f8e47efe66da Grygorii Strashko 2020-04-23 285 found = true;
c8f8e47efe66da Grygorii Strashko 2020-04-23 286 __skb_unlink(skb, &txq_list);
c8f8e47efe66da Grygorii Strashko 2020-04-23 287 dev_consume_skb_any(skb);
c8f8e47efe66da Grygorii Strashko 2020-04-23 288 dev_dbg(cpts->dev, "match tx timestamp mtype_seqid %08x\n",
c8f8e47efe66da Grygorii Strashko 2020-04-23 289 mtype_seqid);
c8f8e47efe66da Grygorii Strashko 2020-04-23 290 break;
c8f8e47efe66da Grygorii Strashko 2020-04-23 291 }
c8f8e47efe66da Grygorii Strashko 2020-04-23 292
c8f8e47efe66da Grygorii Strashko 2020-04-23 293 if (time_after(jiffies, skb_cb->tmo)) {
c8f8e47efe66da Grygorii Strashko 2020-04-23 294 /* timeout any expired skbs over 1s */
c8f8e47efe66da Grygorii Strashko 2020-04-23 295 dev_dbg(cpts->dev, "expiring tx timestamp from txq\n");
c8f8e47efe66da Grygorii Strashko 2020-04-23 296 __skb_unlink(skb, &txq_list);
c8f8e47efe66da Grygorii Strashko 2020-04-23 297 dev_consume_skb_any(skb);
c8f8e47efe66da Grygorii Strashko 2020-04-23 298 }
c8f8e47efe66da Grygorii Strashko 2020-04-23 299 }
c8f8e47efe66da Grygorii Strashko 2020-04-23 300
c8f8e47efe66da Grygorii Strashko 2020-04-23 301 spin_lock_irqsave(&cpts->txq.lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 302 skb_queue_splice(&txq_list, &cpts->txq);
c8f8e47efe66da Grygorii Strashko 2020-04-23 @303 spin_unlock_irqrestore(&cpts->txq.lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 304
c8f8e47efe66da Grygorii Strashko 2020-04-23 305 return found;
c8f8e47efe66da Grygorii Strashko 2020-04-23 306 }
c8f8e47efe66da Grygorii Strashko 2020-04-23 307
c8f8e47efe66da Grygorii Strashko 2020-04-23 308 static void cpts_process_events(struct cpts *cpts)
c8f8e47efe66da Grygorii Strashko 2020-04-23 309 {
c8f8e47efe66da Grygorii Strashko 2020-04-23 310 struct list_head *this, *next;
c8f8e47efe66da Grygorii Strashko 2020-04-23 311 struct cpts_event *event;
c8f8e47efe66da Grygorii Strashko 2020-04-23 312 LIST_HEAD(events_free);
c8f8e47efe66da Grygorii Strashko 2020-04-23 313 unsigned long flags;
c8f8e47efe66da Grygorii Strashko 2020-04-23 314 LIST_HEAD(events);
c8f8e47efe66da Grygorii Strashko 2020-04-23 315
c8f8e47efe66da Grygorii Strashko 2020-04-23 316 spin_lock_irqsave(&cpts->lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 317 list_splice_init(&cpts->events, &events);
c8f8e47efe66da Grygorii Strashko 2020-04-23 @318 spin_unlock_irqrestore(&cpts->lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 319
c8f8e47efe66da Grygorii Strashko 2020-04-23 320 list_for_each_safe(this, next, &events) {
c8f8e47efe66da Grygorii Strashko 2020-04-23 321 event = list_entry(this, struct cpts_event, list);
c8f8e47efe66da Grygorii Strashko 2020-04-23 322 if (cpts_match_tx_ts(cpts, event) ||
c8f8e47efe66da Grygorii Strashko 2020-04-23 323 time_after(jiffies, event->tmo)) {
c8f8e47efe66da Grygorii Strashko 2020-04-23 324 list_del_init(&event->list);
c8f8e47efe66da Grygorii Strashko 2020-04-23 325 list_add(&event->list, &events_free);
c8f8e47efe66da Grygorii Strashko 2020-04-23 326 }
c8f8e47efe66da Grygorii Strashko 2020-04-23 327 }
c8f8e47efe66da Grygorii Strashko 2020-04-23 328
c8f8e47efe66da Grygorii Strashko 2020-04-23 329 spin_lock_irqsave(&cpts->lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 330 list_splice_tail(&events, &cpts->events);
c8f8e47efe66da Grygorii Strashko 2020-04-23 331 list_splice_tail(&events_free, &cpts->pool);
c8f8e47efe66da Grygorii Strashko 2020-04-23 @332 spin_unlock_irqrestore(&cpts->lock, flags);
c8f8e47efe66da Grygorii Strashko 2020-04-23 333 }
c8f8e47efe66da Grygorii Strashko 2020-04-23 334
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/dma/tegra20-apb-dma.c:829 tegra_dma_synchronize() error: double unlocked 'tdc->lock' (orig line 829)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Dmitry Osipenko <digetx(a)gmail.com>
CC: Vinod Koul <vkoul(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: 6697255f239f5c04fcd6b819c0d35ae05bbf808c dmaengine: tegra-apb: Improve DMA synchronization
date: 5 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 5 months ago
config: microblaze-randconfig-m031-20200828 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/dma/tegra20-apb-dma.c:829 tegra_dma_synchronize() error: double unlocked 'tdc->lock' (orig line 829)
drivers/dma/tegra20-apb-dma.c:829 tegra_dma_synchronize() error: double unlocked 'tdc->lock' (orig line 829)
Old smatch warnings:
arch/microblaze/include/asm/thread_info.h:94 current_thread_info() error: uninitialized symbol 'sp'.
drivers/dma/tegra20-apb-dma.c:670 tegra_dma_tasklet() error: double unlocked 'tdc->lock' (orig line 665)
drivers/dma/tegra20-apb-dma.c:1125 tegra_dma_prep_slave_sg() error: double unlocked 'tdc->lock' (orig line 1122)
drivers/dma/tegra20-apb-dma.c:1159 tegra_dma_prep_slave_sg() error: double unlocked 'tdc->lock' (orig line 1122)
drivers/dma/tegra20-apb-dma.c:1262 tegra_dma_prep_dma_cyclic() error: double unlocked 'tdc->lock' (orig line 1259)
drivers/dma/tegra20-apb-dma.c:1296 tegra_dma_prep_dma_cyclic() error: double unlocked 'tdc->lock' (orig line 1259)
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6697255f239f5c04fcd6b819c0d35ae05bbf808c
vim +829 drivers/dma/tegra20-apb-dma.c
6697255f239f5c Dmitry Osipenko 2020-03-20 819
dda5e35a771043 Dmitry Osipenko 2020-02-09 820 static void tegra_dma_synchronize(struct dma_chan *dc)
dda5e35a771043 Dmitry Osipenko 2020-02-09 821 {
dda5e35a771043 Dmitry Osipenko 2020-02-09 822 struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc);
dda5e35a771043 Dmitry Osipenko 2020-02-09 823
6697255f239f5c Dmitry Osipenko 2020-03-20 824 /*
6697255f239f5c Dmitry Osipenko 2020-03-20 825 * CPU, which handles interrupt, could be busy in
6697255f239f5c Dmitry Osipenko 2020-03-20 826 * uninterruptible state, in this case sibling CPU
6697255f239f5c Dmitry Osipenko 2020-03-20 827 * should wait until interrupt is handled.
6697255f239f5c Dmitry Osipenko 2020-03-20 828 */
6697255f239f5c Dmitry Osipenko 2020-03-20 @829 wait_event(tdc->wq, tegra_dma_eoc_interrupt_deasserted(tdc));
6697255f239f5c Dmitry Osipenko 2020-03-20 830
dda5e35a771043 Dmitry Osipenko 2020-02-09 831 tasklet_kill(&tdc->tasklet);
dda5e35a771043 Dmitry Osipenko 2020-02-09 832 }
dda5e35a771043 Dmitry Osipenko 2020-02-09 833
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/net/dsa/sja1105/sja1105_main.c:1958 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vladimir Oltean <vladimir.oltean(a)nxp.com>
CC: Florian Fainelli <f.fainelli(a)gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: ec5ae61076d07be986df19773662506220757c9f net: dsa: sja1105: save/restore VLANs using a delta commit method
date: 4 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 4 months ago
config: arm-randconfig-m031-20200829 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:1958 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1980 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
Old smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:46 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:47 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:48 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:188 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:191 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:197 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:202 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:527 sja1105_init_avb_params() warn: is 'table->entries' large enough for 'struct sja1105_avb_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:1119 sja1105_find_static_fdb_entry() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1237 sja1105et_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1239 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1247 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1333 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1341 sja1105pqrs_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1346 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1396 sja1105pqrs_fdb_del() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1480 sja1105_fdb_dump() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1716 sja1105_static_config_reload() warn: bitwise AND condition is false here
drivers/net/dsa/sja1105/sja1105_main.c:1959 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1961 sja1105_build_bridge_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1981 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1983 sja1105_build_dsa_8021q_vlans() warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2431 sja1105_mgmt_xmit() warn: should '(((1))) << port' be a 64 bit type?
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ec5ae61076d07be986df19773662506220757c9f
vim +1958 drivers/net/dsa/sja1105/sja1105_main.c
ec5ae61076d07b Vladimir Oltean 2020-05-12 1944
ec5ae61076d07b Vladimir Oltean 2020-05-12 1945 static int
ec5ae61076d07b Vladimir Oltean 2020-05-12 1946 sja1105_build_bridge_vlans(struct sja1105_private *priv,
ec5ae61076d07b Vladimir Oltean 2020-05-12 1947 struct sja1105_vlan_lookup_entry *new_vlan)
ec5ae61076d07b Vladimir Oltean 2020-05-12 1948 {
ec5ae61076d07b Vladimir Oltean 2020-05-12 1949 struct sja1105_bridge_vlan *v;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1950
ec5ae61076d07b Vladimir Oltean 2020-05-12 1951 if (priv->vlan_state == SJA1105_VLAN_UNAWARE)
ec5ae61076d07b Vladimir Oltean 2020-05-12 1952 return 0;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1953
ec5ae61076d07b Vladimir Oltean 2020-05-12 1954 list_for_each_entry(v, &priv->bridge_vlans, list) {
ec5ae61076d07b Vladimir Oltean 2020-05-12 1955 int match = v->vid;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1956
ec5ae61076d07b Vladimir Oltean 2020-05-12 1957 new_vlan[match].vlanid = v->vid;
ec5ae61076d07b Vladimir Oltean 2020-05-12 @1958 new_vlan[match].vmemb_port |= BIT(v->port);
ec5ae61076d07b Vladimir Oltean 2020-05-12 1959 new_vlan[match].vlan_bc |= BIT(v->port);
ec5ae61076d07b Vladimir Oltean 2020-05-12 1960 if (!v->untagged)
ec5ae61076d07b Vladimir Oltean 2020-05-12 1961 new_vlan[match].tag_port |= BIT(v->port);
ec5ae61076d07b Vladimir Oltean 2020-05-12 1962 }
ec5ae61076d07b Vladimir Oltean 2020-05-12 1963
ec5ae61076d07b Vladimir Oltean 2020-05-12 1964 return 0;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1965 }
ec5ae61076d07b Vladimir Oltean 2020-05-12 1966
ec5ae61076d07b Vladimir Oltean 2020-05-12 1967 static int
ec5ae61076d07b Vladimir Oltean 2020-05-12 1968 sja1105_build_dsa_8021q_vlans(struct sja1105_private *priv,
ec5ae61076d07b Vladimir Oltean 2020-05-12 1969 struct sja1105_vlan_lookup_entry *new_vlan)
ec5ae61076d07b Vladimir Oltean 2020-05-12 1970 {
ec5ae61076d07b Vladimir Oltean 2020-05-12 1971 struct sja1105_bridge_vlan *v;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1972
ec5ae61076d07b Vladimir Oltean 2020-05-12 1973 if (priv->vlan_state == SJA1105_VLAN_FILTERING_FULL)
ec5ae61076d07b Vladimir Oltean 2020-05-12 1974 return 0;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1975
ec5ae61076d07b Vladimir Oltean 2020-05-12 1976 list_for_each_entry(v, &priv->dsa_8021q_vlans, list) {
ec5ae61076d07b Vladimir Oltean 2020-05-12 1977 int match = v->vid;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1978
ec5ae61076d07b Vladimir Oltean 2020-05-12 1979 new_vlan[match].vlanid = v->vid;
ec5ae61076d07b Vladimir Oltean 2020-05-12 @1980 new_vlan[match].vmemb_port |= BIT(v->port);
ec5ae61076d07b Vladimir Oltean 2020-05-12 1981 new_vlan[match].vlan_bc |= BIT(v->port);
ec5ae61076d07b Vladimir Oltean 2020-05-12 1982 if (!v->untagged)
ec5ae61076d07b Vladimir Oltean 2020-05-12 1983 new_vlan[match].tag_port |= BIT(v->port);
ec5ae61076d07b Vladimir Oltean 2020-05-12 1984 }
ec5ae61076d07b Vladimir Oltean 2020-05-12 1985
ec5ae61076d07b Vladimir Oltean 2020-05-12 1986 return 0;
ec5ae61076d07b Vladimir Oltean 2020-05-12 1987 }
ec5ae61076d07b Vladimir Oltean 2020-05-12 1988
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/net/dsa/sja1105/sja1105_main.c:1608 sja1105_static_config_reload() warn: bitwise AND condition is false here
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vladimir Oltean <vladimir.oltean(a)nxp.com>
CC: Russell King <rmk+kernel(a)armlinux.org.uk>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: ffe10e679cec9a99f19049459cb27c2fbb1e913a net: dsa: sja1105: Add support for the SGMII port
date: 5 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 5 months ago
config: arm-randconfig-m031-20200829 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:1608 sja1105_static_config_reload() warn: bitwise AND condition is false here
Old smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:44 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:45 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:46 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:186 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:189 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:195 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:200 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:1013 sja1105_find_static_fdb_entry() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1131 sja1105et_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1133 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1141 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1227 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1235 sja1105pqrs_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1240 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1290 sja1105pqrs_fdb_del() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1374 sja1105_fdb_dump() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1672 sja1105_vlan_apply() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1673 sja1105_vlan_apply() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1684 sja1105_vlan_apply() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1981 sja1105_mgmt_xmit() warn: should '(((1))) << port' be a 64 bit type?
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ffe10e679cec9a99f19049459cb27c2fbb1e913a
vim +1608 drivers/net/dsa/sja1105/sja1105_main.c
2eea1fa82f681b Vladimir Oltean 2019-11-12 1508
6666cebc5e306f Vladimir Oltean 2019-05-02 1509 /* For situations where we need to change a setting at runtime that is only
6666cebc5e306f Vladimir Oltean 2019-05-02 1510 * available through the static configuration, resetting the switch in order
6666cebc5e306f Vladimir Oltean 2019-05-02 1511 * to upload the new static config is unavoidable. Back up the settings we
6666cebc5e306f Vladimir Oltean 2019-05-02 1512 * modify at runtime (currently only MAC) and restore them after uploading,
6666cebc5e306f Vladimir Oltean 2019-05-02 1513 * such that this operation is relatively seamless.
6666cebc5e306f Vladimir Oltean 2019-05-02 1514 */
2eea1fa82f681b Vladimir Oltean 2019-11-12 1515 int sja1105_static_config_reload(struct sja1105_private *priv,
2eea1fa82f681b Vladimir Oltean 2019-11-12 1516 enum sja1105_reset_reason reason)
6666cebc5e306f Vladimir Oltean 2019-05-02 1517 {
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1518 struct ptp_system_timestamp ptp_sts_before;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1519 struct ptp_system_timestamp ptp_sts_after;
6666cebc5e306f Vladimir Oltean 2019-05-02 1520 struct sja1105_mac_config_entry *mac;
6666cebc5e306f Vladimir Oltean 2019-05-02 1521 int speed_mbps[SJA1105_NUM_PORTS];
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1522 struct dsa_switch *ds = priv->ds;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1523 s64 t1, t2, t3, t4;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1524 s64 t12, t34;
ffe10e679cec9a Vladimir Oltean 2020-03-20 1525 u16 bmcr = 0;
6666cebc5e306f Vladimir Oltean 2019-05-02 1526 int rc, i;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1527 s64 now;
6666cebc5e306f Vladimir Oltean 2019-05-02 1528
af580ae2dcb250 Vladimir Oltean 2019-11-09 1529 mutex_lock(&priv->mgmt_lock);
af580ae2dcb250 Vladimir Oltean 2019-11-09 1530
6666cebc5e306f Vladimir Oltean 2019-05-02 1531 mac = priv->static_config.tables[BLK_IDX_MAC_CONFIG].entries;
6666cebc5e306f Vladimir Oltean 2019-05-02 1532
8400cff60b472c Vladimir Oltean 2019-06-08 1533 /* Back up the dynamic link speed changed by sja1105_adjust_port_config
8400cff60b472c Vladimir Oltean 2019-06-08 1534 * in order to temporarily restore it to SJA1105_SPEED_AUTO - which the
8400cff60b472c Vladimir Oltean 2019-06-08 1535 * switch wants to see in the static config in order to allow us to
8400cff60b472c Vladimir Oltean 2019-06-08 1536 * change it through the dynamic interface later.
6666cebc5e306f Vladimir Oltean 2019-05-02 1537 */
6666cebc5e306f Vladimir Oltean 2019-05-02 1538 for (i = 0; i < SJA1105_NUM_PORTS; i++) {
6666cebc5e306f Vladimir Oltean 2019-05-02 1539 speed_mbps[i] = sja1105_speed[mac[i].speed];
6666cebc5e306f Vladimir Oltean 2019-05-02 1540 mac[i].speed = SJA1105_SPEED_AUTO;
6666cebc5e306f Vladimir Oltean 2019-05-02 1541 }
6666cebc5e306f Vladimir Oltean 2019-05-02 1542
ffe10e679cec9a Vladimir Oltean 2020-03-20 1543 if (sja1105_supports_sgmii(priv, SJA1105_SGMII_PORT))
ffe10e679cec9a Vladimir Oltean 2020-03-20 1544 bmcr = sja1105_sgmii_read(priv, MII_BMCR);
ffe10e679cec9a Vladimir Oltean 2020-03-20 1545
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1546 /* No PTP operations can run right now */
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1547 mutex_lock(&priv->ptp_data.lock);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1548
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1549 rc = __sja1105_ptp_gettimex(ds, &now, &ptp_sts_before);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1550 if (rc < 0)
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1551 goto out_unlock_ptp;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1552
6666cebc5e306f Vladimir Oltean 2019-05-02 1553 /* Reset switch and send updated static configuration */
6666cebc5e306f Vladimir Oltean 2019-05-02 1554 rc = sja1105_static_config_upload(priv);
6666cebc5e306f Vladimir Oltean 2019-05-02 1555 if (rc < 0)
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1556 goto out_unlock_ptp;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1557
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1558 rc = __sja1105_ptp_settime(ds, 0, &ptp_sts_after);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1559 if (rc < 0)
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1560 goto out_unlock_ptp;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1561
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1562 t1 = timespec64_to_ns(&ptp_sts_before.pre_ts);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1563 t2 = timespec64_to_ns(&ptp_sts_before.post_ts);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1564 t3 = timespec64_to_ns(&ptp_sts_after.pre_ts);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1565 t4 = timespec64_to_ns(&ptp_sts_after.post_ts);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1566 /* Mid point, corresponds to pre-reset PTPCLKVAL */
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1567 t12 = t1 + (t2 - t1) / 2;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1568 /* Mid point, corresponds to post-reset PTPCLKVAL, aka 0 */
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1569 t34 = t3 + (t4 - t3) / 2;
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1570 /* Advance PTPCLKVAL by the time it took since its readout */
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1571 now += (t34 - t12);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1572
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1573 __sja1105_ptp_adjtime(ds, now);
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1574
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1575 out_unlock_ptp:
6cf99c13ea07b5 Vladimir Oltean 2019-11-09 1576 mutex_unlock(&priv->ptp_data.lock);
6666cebc5e306f Vladimir Oltean 2019-05-02 1577
2eea1fa82f681b Vladimir Oltean 2019-11-12 1578 dev_info(priv->ds->dev,
2eea1fa82f681b Vladimir Oltean 2019-11-12 1579 "Reset switch and programmed static config. Reason: %s\n",
2eea1fa82f681b Vladimir Oltean 2019-11-12 1580 sja1105_reset_reasons[reason]);
2eea1fa82f681b Vladimir Oltean 2019-11-12 1581
6666cebc5e306f Vladimir Oltean 2019-05-02 1582 /* Configure the CGU (PLLs) for MII and RMII PHYs.
6666cebc5e306f Vladimir Oltean 2019-05-02 1583 * For these interfaces there is no dynamic configuration
6666cebc5e306f Vladimir Oltean 2019-05-02 1584 * needed, since PLLs have same settings at all speeds.
6666cebc5e306f Vladimir Oltean 2019-05-02 1585 */
6666cebc5e306f Vladimir Oltean 2019-05-02 1586 rc = sja1105_clocking_setup(priv);
6666cebc5e306f Vladimir Oltean 2019-05-02 1587 if (rc < 0)
6666cebc5e306f Vladimir Oltean 2019-05-02 1588 goto out;
6666cebc5e306f Vladimir Oltean 2019-05-02 1589
6666cebc5e306f Vladimir Oltean 2019-05-02 1590 for (i = 0; i < SJA1105_NUM_PORTS; i++) {
8400cff60b472c Vladimir Oltean 2019-06-08 1591 rc = sja1105_adjust_port_config(priv, i, speed_mbps[i]);
6666cebc5e306f Vladimir Oltean 2019-05-02 1592 if (rc < 0)
6666cebc5e306f Vladimir Oltean 2019-05-02 1593 goto out;
6666cebc5e306f Vladimir Oltean 2019-05-02 1594 }
ffe10e679cec9a Vladimir Oltean 2020-03-20 1595
ffe10e679cec9a Vladimir Oltean 2020-03-20 1596 if (sja1105_supports_sgmii(priv, SJA1105_SGMII_PORT)) {
ffe10e679cec9a Vladimir Oltean 2020-03-20 1597 bool an_enabled = !!(bmcr & BMCR_ANENABLE);
ffe10e679cec9a Vladimir Oltean 2020-03-20 1598
ffe10e679cec9a Vladimir Oltean 2020-03-20 1599 sja1105_sgmii_pcs_config(priv, an_enabled, false);
ffe10e679cec9a Vladimir Oltean 2020-03-20 1600
ffe10e679cec9a Vladimir Oltean 2020-03-20 1601 if (!an_enabled) {
ffe10e679cec9a Vladimir Oltean 2020-03-20 1602 int speed = SPEED_UNKNOWN;
ffe10e679cec9a Vladimir Oltean 2020-03-20 1603
ffe10e679cec9a Vladimir Oltean 2020-03-20 1604 if (bmcr & BMCR_SPEED1000)
ffe10e679cec9a Vladimir Oltean 2020-03-20 1605 speed = SPEED_1000;
ffe10e679cec9a Vladimir Oltean 2020-03-20 1606 else if (bmcr & BMCR_SPEED100)
ffe10e679cec9a Vladimir Oltean 2020-03-20 1607 speed = SPEED_100;
ffe10e679cec9a Vladimir Oltean 2020-03-20 @1608 else if (bmcr & BMCR_SPEED10)
ffe10e679cec9a Vladimir Oltean 2020-03-20 1609 speed = SPEED_10;
ffe10e679cec9a Vladimir Oltean 2020-03-20 1610
ffe10e679cec9a Vladimir Oltean 2020-03-20 1611 sja1105_sgmii_pcs_force_speed(priv, speed);
ffe10e679cec9a Vladimir Oltean 2020-03-20 1612 }
ffe10e679cec9a Vladimir Oltean 2020-03-20 1613 }
6666cebc5e306f Vladimir Oltean 2019-05-02 1614 out:
af580ae2dcb250 Vladimir Oltean 2019-11-09 1615 mutex_unlock(&priv->mgmt_lock);
af580ae2dcb250 Vladimir Oltean 2019-11-09 1616
6666cebc5e306f Vladimir Oltean 2019-05-02 1617 return rc;
6666cebc5e306f Vladimir Oltean 2019-05-02 1618 }
6666cebc5e306f Vladimir Oltean 2019-05-02 1619
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/dma/tegra20-apb-dma.c:670 tegra_dma_tasklet() error: double unlocked 'tdc->lock' (orig line 665)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Dmitry Osipenko <digetx(a)gmail.com>
CC: Vinod Koul <vkoul(a)kernel.org>
Hi Dmitry,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: 6c41ac96ad9217fe2a6f31c9dcc31b97365b21f6 dmaengine: tegra-apb: Support COMPILE_TEST
date: 6 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 6 months ago
config: microblaze-randconfig-m031-20200828 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/dma/tegra20-apb-dma.c:670 tegra_dma_tasklet() error: double unlocked 'tdc->lock' (orig line 665)
drivers/dma/tegra20-apb-dma.c:1105 tegra_dma_prep_slave_sg() error: double unlocked 'tdc->lock' (orig line 1102)
drivers/dma/tegra20-apb-dma.c:1242 tegra_dma_prep_dma_cyclic() error: double unlocked 'tdc->lock' (orig line 1239)
Old smatch warnings:
arch/microblaze/include/asm/thread_info.h:94 current_thread_info() error: uninitialized symbol 'sp'.
drivers/dma/tegra20-apb-dma.c:1139 tegra_dma_prep_slave_sg() error: double unlocked 'tdc->lock' (orig line 1102)
drivers/dma/tegra20-apb-dma.c:1276 tegra_dma_prep_dma_cyclic() error: double unlocked 'tdc->lock' (orig line 1239)
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6c41ac96ad9217fe2a6f31c9dcc31b97365b21f6
vim +670 drivers/dma/tegra20-apb-dma.c
ec8a1586780cbb Laxman Dewangan 2012-06-06 646
ec8a1586780cbb Laxman Dewangan 2012-06-06 647 static void tegra_dma_tasklet(unsigned long data)
ec8a1586780cbb Laxman Dewangan 2012-06-06 648 {
ec8a1586780cbb Laxman Dewangan 2012-06-06 649 struct tegra_dma_channel *tdc = (struct tegra_dma_channel *)data;
370c0446af5e3c Dave Jiang 2016-07-20 650 struct dmaengine_desc_callback cb;
ec8a1586780cbb Laxman Dewangan 2012-06-06 651 struct tegra_dma_desc *dma_desc;
3964293aecf9c6 Dmitry Osipenko 2020-02-09 652 unsigned int cb_count;
ec8a1586780cbb Laxman Dewangan 2012-06-06 653 unsigned long flags;
ec8a1586780cbb Laxman Dewangan 2012-06-06 654
ec8a1586780cbb Laxman Dewangan 2012-06-06 655 spin_lock_irqsave(&tdc->lock, flags);
ec8a1586780cbb Laxman Dewangan 2012-06-06 656 while (!list_empty(&tdc->cb_desc)) {
3964293aecf9c6 Dmitry Osipenko 2020-02-09 657 dma_desc = list_first_entry(&tdc->cb_desc, typeof(*dma_desc),
3964293aecf9c6 Dmitry Osipenko 2020-02-09 658 cb_node);
ec8a1586780cbb Laxman Dewangan 2012-06-06 659 list_del(&dma_desc->cb_node);
370c0446af5e3c Dave Jiang 2016-07-20 660 dmaengine_desc_get_callback(&dma_desc->txd, &cb);
ec8a1586780cbb Laxman Dewangan 2012-06-06 661 cb_count = dma_desc->cb_count;
ec8a1586780cbb Laxman Dewangan 2012-06-06 662 dma_desc->cb_count = 0;
95f295f9fe0816 Ben Dooks 2018-11-21 663 trace_tegra_dma_complete_cb(&tdc->dma_chan, cb_count,
95f295f9fe0816 Ben Dooks 2018-11-21 664 cb.callback);
ec8a1586780cbb Laxman Dewangan 2012-06-06 @665 spin_unlock_irqrestore(&tdc->lock, flags);
370c0446af5e3c Dave Jiang 2016-07-20 666 while (cb_count--)
370c0446af5e3c Dave Jiang 2016-07-20 667 dmaengine_desc_callback_invoke(&cb, NULL);
ec8a1586780cbb Laxman Dewangan 2012-06-06 668 spin_lock_irqsave(&tdc->lock, flags);
ec8a1586780cbb Laxman Dewangan 2012-06-06 669 }
ec8a1586780cbb Laxman Dewangan 2012-06-06 @670 spin_unlock_irqrestore(&tdc->lock, flags);
ec8a1586780cbb Laxman Dewangan 2012-06-06 671 }
ec8a1586780cbb Laxman Dewangan 2012-06-06 672
:::::: The code at line 670 was first introduced by commit
:::::: ec8a1586780cbb437aeb2006957c5bbe113c7046 dma: tegra: add dmaengine based dma driver
:::::: TO: Laxman Dewangan <ldewangan(a)nvidia.com>
:::::: CC: Vinod Koul <vinod.koul(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/mailbox/imx-mailbox.c:217 imx_mu_scu_rx() error: double unlocked 'priv->xcr_lock' (orig line 198)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Peng Fan <peng.fan(a)nxp.com>
CC: Jassi Brar <jaswinder.singh(a)linaro.org>
CC: Oleksij Rempel <o.rempel(a)pengutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: 0a67003b1985c79811160af1b01aca07cd5fbc53 mailbox: imx: add SCU MU support
date: 5 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 5 months ago
config: microblaze-randconfig-m031-20200828 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/mailbox/imx-mailbox.c:217 imx_mu_scu_rx() error: double unlocked 'priv->xcr_lock' (orig line 198)
Old smatch warnings:
arch/microblaze/include/asm/thread_info.h:94 current_thread_info() error: uninitialized symbol 'sp'.
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0a67003b1985c79811160af1b01aca07cd5fbc53
vim +217 drivers/mailbox/imx-mailbox.c
0a67003b1985c7 Peng Fan 2020-03-19 189
0a67003b1985c7 Peng Fan 2020-03-19 190 static int imx_mu_scu_rx(struct imx_mu_priv *priv,
0a67003b1985c7 Peng Fan 2020-03-19 191 struct imx_mu_con_priv *cp)
0a67003b1985c7 Peng Fan 2020-03-19 192 {
0a67003b1985c7 Peng Fan 2020-03-19 193 struct imx_sc_rpc_msg_max msg;
0a67003b1985c7 Peng Fan 2020-03-19 194 u32 *data = (u32 *)&msg;
0a67003b1985c7 Peng Fan 2020-03-19 195 int i, ret;
0a67003b1985c7 Peng Fan 2020-03-19 196 u32 xsr;
0a67003b1985c7 Peng Fan 2020-03-19 197
0a67003b1985c7 Peng Fan 2020-03-19 @198 imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_RIEn(0));
0a67003b1985c7 Peng Fan 2020-03-19 199 *data++ = imx_mu_read(priv, priv->dcfg->xRR[0]);
0a67003b1985c7 Peng Fan 2020-03-19 200
0a67003b1985c7 Peng Fan 2020-03-19 201 if (msg.hdr.size > sizeof(msg)) {
0a67003b1985c7 Peng Fan 2020-03-19 202 dev_err(priv->dev, "Exceed max msg size (%zu) on RX, got: %i\n",
0a67003b1985c7 Peng Fan 2020-03-19 203 sizeof(msg), msg.hdr.size);
0a67003b1985c7 Peng Fan 2020-03-19 204 return -EINVAL;
0a67003b1985c7 Peng Fan 2020-03-19 205 }
0a67003b1985c7 Peng Fan 2020-03-19 206
0a67003b1985c7 Peng Fan 2020-03-19 207 for (i = 1; i < msg.hdr.size; i++) {
0a67003b1985c7 Peng Fan 2020-03-19 208 ret = readl_poll_timeout(priv->base + priv->dcfg->xSR, xsr,
0a67003b1985c7 Peng Fan 2020-03-19 209 xsr & IMX_MU_xSR_RFn(i % 4), 0, 100);
0a67003b1985c7 Peng Fan 2020-03-19 210 if (ret) {
0a67003b1985c7 Peng Fan 2020-03-19 211 dev_err(priv->dev, "timeout read idx %d\n", i);
0a67003b1985c7 Peng Fan 2020-03-19 212 return ret;
0a67003b1985c7 Peng Fan 2020-03-19 213 }
0a67003b1985c7 Peng Fan 2020-03-19 214 *data++ = imx_mu_read(priv, priv->dcfg->xRR[i % 4]);
0a67003b1985c7 Peng Fan 2020-03-19 215 }
0a67003b1985c7 Peng Fan 2020-03-19 216
0a67003b1985c7 Peng Fan 2020-03-19 @217 imx_mu_xcr_rmw(priv, IMX_MU_xCR_RIEn(0), 0);
0a67003b1985c7 Peng Fan 2020-03-19 218 mbox_chan_received_data(cp->chan, (void *)&msg);
0a67003b1985c7 Peng Fan 2020-03-19 219
0a67003b1985c7 Peng Fan 2020-03-19 220 return 0;
0a67003b1985c7 Peng Fan 2020-03-19 221 }
0a67003b1985c7 Peng Fan 2020-03-19 222
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months
drivers/i2c/busses/i2c-mv64xxx.c:586 mv64xxx_i2c_execute_msg() error: double unlocked 'drv_data->lock' (orig line 584)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Krzysztof Kozlowski <krzk(a)kernel.org>
CC: Wolfram Sang <wsa-dev(a)sang-engineering.com>
Hi Krzysztof,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: 4a2d5f663dab6614772d8e28ca190b127ba46d9d i2c: Enable compile testing for more drivers
date: 7 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 7 months ago
config: microblaze-randconfig-m031-20200828 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/i2c/busses/i2c-mv64xxx.c:586 mv64xxx_i2c_execute_msg() error: double unlocked 'drv_data->lock' (orig line 584)
drivers/i2c/busses/i2c-mv64xxx.c:656 mv64xxx_i2c_offload_xfer() error: double unlocked 'drv_data->lock' (orig line 654)
Old smatch warnings:
drivers/i2c/busses/i2c-mv64xxx.c:510 mv64xxx_i2c_intr() warn: this loop depends on readl() succeeding
arch/microblaze/include/asm/thread_info.h:94 current_thread_info() error: uninitialized symbol 'sp'.
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4a2d5f663dab6614772d8e28ca190b127ba46d9d
vim +586 drivers/i2c/busses/i2c-mv64xxx.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 570
^1da177e4c3f415 Linus Torvalds 2005-04-16 571 static int
eda6bee6c7e67b5 Rodolfo Giometti 2010-11-26 572 mv64xxx_i2c_execute_msg(struct mv64xxx_i2c_data *drv_data, struct i2c_msg *msg,
4243fa0bad551b8 Russell King 2013-05-16 573 int is_last)
^1da177e4c3f415 Linus Torvalds 2005-04-16 574 {
^1da177e4c3f415 Linus Torvalds 2005-04-16 575 unsigned long flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16 576
^1da177e4c3f415 Linus Torvalds 2005-04-16 577 spin_lock_irqsave(&drv_data->lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16 578
aa6bce5319a54c0 Russell King 2013-05-16 579 drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_START_COND;
79970db213344b4 Wolfram Sang 2014-02-13 580
eda6bee6c7e67b5 Rodolfo Giometti 2010-11-26 581 drv_data->send_stop = is_last;
^1da177e4c3f415 Linus Torvalds 2005-04-16 582 drv_data->block = 1;
b0200abeba31340 Wolfram Sang 2014-02-13 583 mv64xxx_i2c_send_start(drv_data);
^1da177e4c3f415 Linus Torvalds 2005-04-16 @584 spin_unlock_irqrestore(&drv_data->lock, flags);
^1da177e4c3f415 Linus Torvalds 2005-04-16 585
^1da177e4c3f415 Linus Torvalds 2005-04-16 @586 mv64xxx_i2c_wait_for_completion(drv_data);
^1da177e4c3f415 Linus Torvalds 2005-04-16 587 return drv_data->rc;
^1da177e4c3f415 Linus Torvalds 2005-04-16 588 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 589
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 590 static void
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 591 mv64xxx_i2c_prepare_tx(struct mv64xxx_i2c_data *drv_data)
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 592 {
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 593 struct i2c_msg *msg = drv_data->msgs;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 594 u32 buf[2];
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 595
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 596 memcpy(buf, msg->buf, msg->len);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 597
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 598 writel(buf[0], drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_LO);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 599 writel(buf[1], drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_HI);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 600 }
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 601
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 602 static int
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 603 mv64xxx_i2c_offload_xfer(struct mv64xxx_i2c_data *drv_data)
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 604 {
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 605 struct i2c_msg *msgs = drv_data->msgs;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 606 int num = drv_data->num_msgs;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 607 unsigned long ctrl_reg;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 608 unsigned long flags;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 609
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 610 spin_lock_irqsave(&drv_data->lock, flags);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 611
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 612 /* Build transaction */
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 613 ctrl_reg = MV64XXX_I2C_BRIDGE_CONTROL_ENABLE |
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 614 (msgs[0].addr << MV64XXX_I2C_BRIDGE_CONTROL_ADDR_SHIFT);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 615
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 616 if (msgs[0].flags & I2C_M_TEN)
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 617 ctrl_reg |= MV64XXX_I2C_BRIDGE_CONTROL_ADDR_EXT;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 618
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 619 /* Single write message transaction */
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 620 if (num == 1 && !(msgs[0].flags & I2C_M_RD)) {
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 621 size_t len = msgs[0].len - 1;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 622
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 623 ctrl_reg |= MV64XXX_I2C_BRIDGE_CONTROL_WR |
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 624 (len << MV64XXX_I2C_BRIDGE_CONTROL_TX_SIZE_SHIFT);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 625 mv64xxx_i2c_prepare_tx(drv_data);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 626 }
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 627 /* Single read message transaction */
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 628 else if (num == 1 && msgs[0].flags & I2C_M_RD) {
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 629 size_t len = msgs[0].len - 1;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 630
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 631 ctrl_reg |= MV64XXX_I2C_BRIDGE_CONTROL_RD |
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 632 (len << MV64XXX_I2C_BRIDGE_CONTROL_RX_SIZE_SHIFT);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 633 }
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 634 /*
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 635 * Transaction with one write and one read message. This is
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 636 * guaranteed by the mv64xx_i2c_can_offload() checks.
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 637 */
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 638 else if (num == 2) {
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 639 size_t lentx = msgs[0].len - 1;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 640 size_t lenrx = msgs[1].len - 1;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 641
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 642 ctrl_reg |=
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 643 MV64XXX_I2C_BRIDGE_CONTROL_RD |
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 644 MV64XXX_I2C_BRIDGE_CONTROL_WR |
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 645 (lentx << MV64XXX_I2C_BRIDGE_CONTROL_TX_SIZE_SHIFT) |
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 646 (lenrx << MV64XXX_I2C_BRIDGE_CONTROL_RX_SIZE_SHIFT) |
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 647 MV64XXX_I2C_BRIDGE_CONTROL_REPEATED_START;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 648 mv64xxx_i2c_prepare_tx(drv_data);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 649 }
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 650
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 651 /* Execute transaction */
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 652 drv_data->block = 1;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 653 writel(ctrl_reg, drv_data->reg_base + MV64XXX_I2C_REG_BRIDGE_CONTROL);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 @654 spin_unlock_irqrestore(&drv_data->lock, flags);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 655
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 @656 mv64xxx_i2c_wait_for_completion(drv_data);
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 657
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 658 return drv_data->rc;
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 659 }
00d8689b85a7bb3 Thomas Petazzoni 2014-12-11 660
:::::: The code at line 586 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 11 months