Skip to content

Commit 9b81d51

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull more block layer fixes from Jens Axboe: "I wasn't going to send off a new pull before next week, but the blk flush fix from Jan from the other day introduced a regression. It's rare enough not to have hit during testing, since it requires both a device that rejects the first flush, and bad timing while it does that. But since someone did hit it, let's get the revert into 4.4-rc3 so we don't have a released rc with that known issue. Apart from that revert, three other fixes: - From Christoph, a fix for a missing unmap in NVMe request preparation. - An NVMe fix from Nishanth that fixes data corruption on powerpc. - Also from Christoph, fix a list_del() attempt on blk-mq that didn't have a matching list_add() at timer start" * 'for-linus' of git://git.kernel.dk/linux-block: Revert "blk-flush: Queue through IO scheduler when flush not required" block: fix blk_abort_request for blk-mq drivers nvme: add missing unmaps in nvme_queue_rq NVMe: default to 4k device page size
2 parents 4cf193b + dcd8376 commit 9b81d51

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

block/blk-flush.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void blk_insert_flush(struct request *rq)
422422
if (q->mq_ops) {
423423
blk_mq_insert_request(rq, false, false, true);
424424
} else
425-
q->elevator->type->ops.elevator_add_req_fn(q, rq);
425+
list_add_tail(&rq->queuelist, &q->queue_head);
426426
return;
427427
}
428428

block/blk-timeout.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ void blk_abort_request(struct request *req)
158158
{
159159
if (blk_mark_rq_complete(req))
160160
return;
161-
blk_delete_timer(req);
162-
if (req->q->mq_ops)
161+
162+
if (req->q->mq_ops) {
163163
blk_mq_rq_timed_out(req, false);
164-
else
164+
} else {
165+
blk_delete_timer(req);
165166
blk_rq_timed_out(req);
167+
}
166168
}
167169
EXPORT_SYMBOL_GPL(blk_abort_request);
168170

drivers/nvme/host/pci.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -896,19 +896,28 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
896896
goto retry_cmd;
897897
}
898898
if (blk_integrity_rq(req)) {
899-
if (blk_rq_count_integrity_sg(req->q, req->bio) != 1)
899+
if (blk_rq_count_integrity_sg(req->q, req->bio) != 1) {
900+
dma_unmap_sg(dev->dev, iod->sg, iod->nents,
901+
dma_dir);
900902
goto error_cmd;
903+
}
901904

902905
sg_init_table(iod->meta_sg, 1);
903906
if (blk_rq_map_integrity_sg(
904-
req->q, req->bio, iod->meta_sg) != 1)
907+
req->q, req->bio, iod->meta_sg) != 1) {
908+
dma_unmap_sg(dev->dev, iod->sg, iod->nents,
909+
dma_dir);
905910
goto error_cmd;
911+
}
906912

907913
if (rq_data_dir(req))
908914
nvme_dif_remap(req, nvme_dif_prep);
909915

910-
if (!dma_map_sg(nvmeq->q_dmadev, iod->meta_sg, 1, dma_dir))
916+
if (!dma_map_sg(nvmeq->q_dmadev, iod->meta_sg, 1, dma_dir)) {
917+
dma_unmap_sg(dev->dev, iod->sg, iod->nents,
918+
dma_dir);
911919
goto error_cmd;
920+
}
912921
}
913922
}
914923

@@ -1728,9 +1737,13 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev)
17281737
u32 aqa;
17291738
u64 cap = lo_hi_readq(&dev->bar->cap);
17301739
struct nvme_queue *nvmeq;
1731-
unsigned page_shift = PAGE_SHIFT;
1740+
/*
1741+
* default to a 4K page size, with the intention to update this
1742+
* path in the future to accomodate architectures with differing
1743+
* kernel and IO page sizes.
1744+
*/
1745+
unsigned page_shift = 12;
17321746
unsigned dev_page_min = NVME_CAP_MPSMIN(cap) + 12;
1733-
unsigned dev_page_max = NVME_CAP_MPSMAX(cap) + 12;
17341747

17351748
if (page_shift < dev_page_min) {
17361749
dev_err(dev->dev,
@@ -1739,13 +1752,6 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev)
17391752
1 << page_shift);
17401753
return -ENODEV;
17411754
}
1742-
if (page_shift > dev_page_max) {
1743-
dev_info(dev->dev,
1744-
"Device maximum page size (%u) smaller than "
1745-
"host (%u); enabling work-around\n",
1746-
1 << dev_page_max, 1 << page_shift);
1747-
page_shift = dev_page_max;
1748-
}
17491755

17501756
dev->subsystem = readl(&dev->bar->vs) >= NVME_VS(1, 1) ?
17511757
NVME_CAP_NSSRC(cap) : 0;

0 commit comments

Comments
 (0)