return;
}
spin_lock_irqsave(&sqp->qc_lock, iflags);
- sd_dp->defer_t = SDEB_DEFER_NONE;
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_NONE);
sqcp = &sqp->qc_arr[qc_idx];
scp = sqcp->a_cmnd;
if (unlikely(scp == NULL)) {
sqcp->a_cmnd = NULL;
sd_dp = sqcp->sd_dp;
if (sd_dp) {
- l_defer_t = sd_dp->defer_t;
- sd_dp->defer_t = SDEB_DEFER_NONE;
+ l_defer_t = READ_ONCE(sd_dp->defer_t);
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_NONE);
} else
l_defer_t = SDEB_DEFER_NONE;
spin_unlock_irqrestore(&sqp->qc_lock, iflags);
sqcp->a_cmnd = NULL;
sd_dp = sqcp->sd_dp;
if (sd_dp) {
- l_defer_t = sd_dp->defer_t;
- sd_dp->defer_t = SDEB_DEFER_NONE;
+ l_defer_t = READ_ONCE(sd_dp->defer_t);
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_NONE);
} else
l_defer_t = SDEB_DEFER_NONE;
spin_unlock_irqrestore(&sqp->qc_lock, iflags);
sd_dp->sqa_idx = sqp - sdebug_q_arr;
sd_dp->qc_idx = k;
}
- sd_dp->defer_t = SDEB_DEFER_POLL;
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_POLL);
spin_unlock_irqrestore(&sqp->qc_lock, iflags);
} else {
if (!sd_dp->init_hrt) {
sd_dp->sqa_idx = sqp - sdebug_q_arr;
sd_dp->qc_idx = k;
}
- sd_dp->defer_t = SDEB_DEFER_HRT;
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_HRT);
/* schedule the invocation of scsi_done() for a later time */
hrtimer_start(&sd_dp->hrt, kt, HRTIMER_MODE_REL_PINNED);
}
sd_dp->sqa_idx = sqp - sdebug_q_arr;
sd_dp->qc_idx = k;
}
- sd_dp->defer_t = SDEB_DEFER_POLL;
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_POLL);
spin_unlock_irqrestore(&sqp->qc_lock, iflags);
} else {
if (!sd_dp->init_wq) {
sd_dp->qc_idx = k;
INIT_WORK(&sd_dp->ew.work, sdebug_q_cmd_wq_complete);
}
- sd_dp->defer_t = SDEB_DEFER_WQ;
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_WQ);
schedule_work(&sd_dp->ew.work);
}
if (sdebug_statistics)
queue_num, qc_idx, __func__);
break;
}
- if (sd_dp->defer_t == SDEB_DEFER_POLL) {
+ if (READ_ONCE(sd_dp->defer_t) == SDEB_DEFER_POLL) {
if (kt_from_boot < sd_dp->cmpl_ts)
continue;
else
atomic_set(&retired_max_queue, k + 1);
}
- sd_dp->defer_t = SDEB_DEFER_NONE;
+ WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_NONE);
spin_unlock_irqrestore(&sqp->qc_lock, iflags);
scsi_done(scp); /* callback to mid level */
spin_lock_irqsave(&sqp->qc_lock, iflags);