Advertisement
Guest User

Untitled

a guest
Feb 16th, 2022
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. commit 852b70eca145437991a22f862baccf67fe21ecd7
  2. Author: Jens Axboe <axboe@kernel.dk>
  3. Date: Tue Feb 15 14:33:50 2022 -0700
  4.  
  5. apple-nvme: serialize command issue
  6.  
  7. Signed-off-by: Jens Axboe <axboe@kernel.dk>
  8.  
  9. diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
  10. index 56a3d05cd8bc..06f77adfc3b7 100644
  11. --- a/drivers/nvme/host/apple.c
  12. +++ b/drivers/nvme/host/apple.c
  13. @@ -189,6 +189,8 @@ struct apple_nvme {
  14. struct nvme_ctrl ctrl;
  15. struct work_struct remove_work;
  16.  
  17. + spinlock_t sq_lock;
  18. +
  19. struct apple_nvme_queue adminq;
  20. struct apple_nvme_queue ioq;
  21.  
  22. @@ -309,7 +311,9 @@ static void apple_nvme_submit_cmd(struct apple_nvme_queue *q,
  23. tcb->dma_flags |= APPLE_ANS_TCB_DMA_FROM_DEVICE;
  24.  
  25. memcpy(&q->sqes[tag], cmd, sizeof(*cmd));
  26. + spin_lock(&anv->sq_lock);
  27. writel(tag, q->sq_db);
  28. + spin_unlock(&anv->sq_lock);
  29. }
  30.  
  31. /*
  32. @@ -1350,6 +1354,7 @@ static int apple_nvme_probe(struct platform_device *pdev)
  33. INIT_WORK(&anv->ctrl.reset_work, apple_nvme_reset_work);
  34. INIT_WORK(&anv->remove_work, apple_nvme_remove_dead_ctrl_work);
  35. spin_lock_init(&anv->lock);
  36. + spin_lock_init(&anv->sq_lock);
  37.  
  38. ret = apple_nvme_queue_alloc(anv, &anv->adminq);
  39. if (ret)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement