]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - net/sched/sch_generic.c
Apply preempt_rt patch-4.9-rt1.patch.xz
[zynq/linux.git] / net / sched / sch_generic.c
index 6cfb6e9038c28187cc888cebf004e61270f00871..20727e1347de8f7aaf8b7cfea2742f0e6f352104 100644 (file)
@@ -425,7 +425,11 @@ struct Qdisc noop_qdisc = {
        .ops            =       &noop_qdisc_ops,
        .q.lock         =       __SPIN_LOCK_UNLOCKED(noop_qdisc.q.lock),
        .dev_queue      =       &noop_netdev_queue,
+#ifdef CONFIG_PREEMPT_RT_BASE
+       .running        =       __SEQLOCK_UNLOCKED(noop_qdisc.running),
+#else
        .running        =       SEQCNT_ZERO(noop_qdisc.running),
+#endif
        .busylock       =       __SPIN_LOCK_UNLOCKED(noop_qdisc.busylock),
 };
 EXPORT_SYMBOL(noop_qdisc);
@@ -624,9 +628,17 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
        lockdep_set_class(&sch->busylock,
                          dev->qdisc_tx_busylock ?: &qdisc_tx_busylock);
 
+#ifdef CONFIG_PREEMPT_RT_BASE
+       seqlock_init(&sch->running);
+       lockdep_set_class(&sch->running.seqcount,
+                         dev->qdisc_running_key ?: &qdisc_running_key);
+       lockdep_set_class(&sch->running.lock,
+                         dev->qdisc_running_key ?: &qdisc_running_key);
+#else
        seqcount_init(&sch->running);
        lockdep_set_class(&sch->running,
                          dev->qdisc_running_key ?: &qdisc_running_key);
+#endif
 
        sch->ops = ops;
        sch->enqueue = ops->enqueue;
@@ -925,7 +937,7 @@ void dev_deactivate_many(struct list_head *head)
        /* Wait for outstanding qdisc_run calls. */
        list_for_each_entry(dev, head, close_list)
                while (some_qdisc_is_busy(dev))
-                       yield();
+                       msleep(1);
 }
 
 void dev_deactivate(struct net_device *dev)