mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
nvme-pci: Introduce nvme_ring_cq_doorbell
Nice abstraction of the actual mechanics of how to do it. Note the change that we call it after we assign nvmeq->cq_head to avoid passing it. Signed-off-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
5657cb0797
commit
eb281c8283
1 changed files with 13 additions and 4 deletions
|
|
@ -730,6 +730,17 @@ static inline bool nvme_cqe_valid(struct nvme_queue *nvmeq, u16 head,
|
|||
return (le16_to_cpu(nvmeq->cqes[head].status) & 1) == phase;
|
||||
}
|
||||
|
||||
static inline void nvme_ring_cq_doorbell(struct nvme_queue *nvmeq)
|
||||
{
|
||||
u16 head = nvmeq->cq_head;
|
||||
|
||||
if (likely(nvmeq->cq_vector >= 0)) {
|
||||
if (nvme_dbbuf_update_and_check_event(head, nvmeq->dbbuf_cq_db,
|
||||
nvmeq->dbbuf_cq_ei))
|
||||
writel(head, nvmeq->q_db + nvmeq->dev->db_stride);
|
||||
}
|
||||
}
|
||||
|
||||
static void __nvme_process_cq(struct nvme_queue *nvmeq, unsigned int *tag)
|
||||
{
|
||||
u16 head, phase;
|
||||
|
|
@ -776,13 +787,11 @@ static void __nvme_process_cq(struct nvme_queue *nvmeq, unsigned int *tag)
|
|||
if (head == nvmeq->cq_head && phase == nvmeq->cq_phase)
|
||||
return;
|
||||
|
||||
if (likely(nvmeq->cq_vector >= 0))
|
||||
if (nvme_dbbuf_update_and_check_event(head, nvmeq->dbbuf_cq_db,
|
||||
nvmeq->dbbuf_cq_ei))
|
||||
writel(head, nvmeq->q_db + nvmeq->dev->db_stride);
|
||||
nvmeq->cq_head = head;
|
||||
nvmeq->cq_phase = phase;
|
||||
|
||||
nvme_ring_cq_doorbell(nvmeq);
|
||||
|
||||
nvmeq->cqe_seen = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue