Create general polling function for the nvme controller. Use it when
we're doing the various pin-based interrupt modes. Adjust nvme_ctrlr_intx_handler to use nvme_ctrlr_poll. Sponsored by: Netflix Suggested by: scottl@
This commit is contained in:
parent
c4231018d0
commit
bb1c7be429
@ -815,18 +815,33 @@ nvme_ctrlr_reset_task(void *arg, int pending)
|
||||
atomic_cmpset_32(&ctrlr->is_resetting, 1, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Poll all the queues enabled on the device for completion.
|
||||
*/
|
||||
void
|
||||
nvme_ctrlr_poll(struct nvme_controller *ctrlr)
|
||||
{
|
||||
int i;
|
||||
|
||||
nvme_qpair_process_completions(&ctrlr->adminq);
|
||||
|
||||
for (i = 0; i < ctrlr->num_io_queues; i++)
|
||||
if (ctrlr->ioq && ctrlr->ioq[i].cpl)
|
||||
nvme_qpair_process_completions(&ctrlr->ioq[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Poll the single-vector intertrupt case: num_io_queues will be 1 and
|
||||
* there's only a single vector. While we're polling, we mask further
|
||||
* interrupts in the controller.
|
||||
*/
|
||||
void
|
||||
nvme_ctrlr_intx_handler(void *arg)
|
||||
{
|
||||
struct nvme_controller *ctrlr = arg;
|
||||
|
||||
nvme_mmio_write_4(ctrlr, intms, 1);
|
||||
|
||||
nvme_qpair_process_completions(&ctrlr->adminq);
|
||||
|
||||
if (ctrlr->ioq && ctrlr->ioq[0].cpl)
|
||||
nvme_qpair_process_completions(&ctrlr->ioq[0]);
|
||||
|
||||
nvme_ctrlr_poll(ctrlr);
|
||||
nvme_mmio_write_4(ctrlr, intmc, 1);
|
||||
}
|
||||
|
||||
|
@ -542,5 +542,6 @@ void nvme_notify_fail_consumers(struct nvme_controller *ctrlr);
|
||||
void nvme_notify_new_controller(struct nvme_controller *ctrlr);
|
||||
|
||||
void nvme_ctrlr_intx_handler(void *arg);
|
||||
void nvme_ctrlr_poll(struct nvme_controller *ctrlr);
|
||||
|
||||
#endif /* __NVME_PRIVATE_H__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user