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