return dur;
 }
 
+/*
+ * Return the farthest future time instant according to jiffies
+ * macros.
+ */
+static unsigned long bfq_greatest_from_now(void)
+{
+       return jiffies + MAX_JIFFY_OFFSET;
+}
+
+/*
+ * Return the farthest past time instant according to jiffies
+ * macros.
+ */
+static unsigned long bfq_smallest_from_now(void)
+{
+       return jiffies - MAX_JIFFY_OFFSET;
+}
+
 static void bfq_update_bfqq_wr_on_rq_arrival(struct bfq_data *bfqd,
                                             struct bfq_queue *bfqq,
                                             unsigned int old_wr_coeff,
                        bfqq->wr_coeff = bfqd->bfq_wr_coeff;
                        bfqq->wr_cur_max_time = bfq_wr_duration(bfqd);
                } else {
-                       bfqq->wr_start_at_switch_to_srt = jiffies;
+                       /*
+                        * No interactive weight raising in progress
+                        * here: assign minus infinity to
+                        * wr_start_at_switch_to_srt, to make sure
+                        * that, at the end of the soft-real-time
+                        * weight raising periods that is starting
+                        * now, no interactive weight-raising period
+                        * may be wrongly considered as still in
+                        * progress (and thus actually started by
+                        * mistake).
+                        */
+                       bfqq->wr_start_at_switch_to_srt =
+                               bfq_smallest_from_now();
                        bfqq->wr_coeff = bfqd->bfq_wr_coeff *
                                BFQ_SOFTRT_WEIGHT_FACTOR;
                        bfqq->wr_cur_max_time =
                   jiffies + nsecs_to_jiffies(bfqq->bfqd->bfq_slice_idle) + 4);
 }
 
-/*
- * Return the farthest future time instant according to jiffies
- * macros.
- */
-static unsigned long bfq_greatest_from_now(void)
-{
-       return jiffies + MAX_JIFFY_OFFSET;
-}
-
-/*
- * Return the farthest past time instant according to jiffies
- * macros.
- */
-static unsigned long bfq_smallest_from_now(void)
-{
-       return jiffies - MAX_JIFFY_OFFSET;
-}
-
 /**
  * bfq_bfqq_expire - expire a queue.
  * @bfqd: device owning the queue.