Skip to content

Commit

Permalink
Merge tag 'nvme-6.3-2023-02-15' of git://git.infradead.org/nvme into …
Browse files Browse the repository at this point in the history
…for-6.3/block

Pull NVMe fixes from Christoph:

"nvme fixes for Linux 6.3

 - fix and cleanup freeing single sgl (Keith Busch)"

* tag 'nvme-6.3-2023-02-15' of git://git.infradead.org/nvme:
  nvme-pci: remove iod use_sgls
  nvme-pci: fix freeing single sgl
  • Loading branch information
Jens Axboe committed Feb 15, 2023
2 parents a06377c + b6c0c23 commit d2ad8f0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ union nvme_descriptor {
struct nvme_iod {
struct nvme_request req;
struct nvme_command cmd;
bool use_sgl;
bool aborted;
s8 nr_allocations; /* PRP list pool allocations. 0 means small
pool in use */
Expand Down Expand Up @@ -556,7 +555,7 @@ static void nvme_unmap_data(struct nvme_dev *dev, struct request *req)
if (iod->nr_allocations == 0)
dma_pool_free(dev->prp_small_pool, iod->list[0].sg_list,
iod->first_dma);
else if (iod->use_sgl)
else if (iod->nr_allocations == 1)
dma_pool_free(dev->prp_page_pool, iod->list[0].sg_list,
iod->first_dma);
else
Expand Down Expand Up @@ -808,8 +807,7 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
goto out_free_sg;
}

iod->use_sgl = nvme_pci_use_sgls(dev, req, iod->sgt.nents);
if (iod->use_sgl)
if (nvme_pci_use_sgls(dev, req, iod->sgt.nents))
ret = nvme_pci_setup_sgls(dev, req, &cmnd->rw);
else
ret = nvme_pci_setup_prps(dev, req, &cmnd->rw);
Expand Down

0 comments on commit d2ad8f0

Please sign in to comment.