.. | .. |
---|
259 | 259 | } |
---|
260 | 260 | |
---|
261 | 261 | /* |
---|
262 | | - * If there are effects for the command we are about to execute, or |
---|
263 | | - * an end_req function we need to use nvme_execute_passthru_rq() |
---|
264 | | - * synchronously in a work item seeing the end_req function and |
---|
265 | | - * nvme_passthru_end() can't be called in the request done callback |
---|
266 | | - * which is typically in interrupt context. |
---|
| 262 | + * If a command needs post-execution fixups, or there are any |
---|
| 263 | + * non-trivial effects, make sure to execute the command synchronously |
---|
| 264 | + * in a workqueue so that nvme_passthru_end gets called. |
---|
267 | 265 | */ |
---|
268 | 266 | effects = nvme_command_effects(ctrl, ns, req->cmd->common.opcode); |
---|
269 | | - if (req->p.use_workqueue || effects) { |
---|
| 267 | + if (req->p.use_workqueue || |
---|
| 268 | + (effects & ~(NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC))) { |
---|
270 | 269 | INIT_WORK(&req->p.work, nvmet_passthru_execute_cmd_work); |
---|
271 | 270 | req->p.rq = rq; |
---|
272 | 271 | schedule_work(&req->p.work); |
---|