Skip to content

Commit b06f2ee

Browse files
keithbuschkawasaki
authored andcommitted
blk-mq: remove REQ_P2PDMA flag
It's not serving any particular purpose. pci_p2pdma_state() already has all the appropriate checks, so the config and flag checks are not guarding anything. Signed-off-by: Keith Busch <[email protected]>
1 parent d2974d5 commit b06f2ee

3 files changed

Lines changed: 15 additions & 18 deletions

File tree

block/bio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ void __bio_add_page(struct bio *bio, struct page *page,
981981
WARN_ON_ONCE(bio_full(bio, len));
982982

983983
if (is_pci_p2pdma_page(page))
984-
bio->bi_opf |= REQ_P2PDMA | REQ_NOMERGE;
984+
bio->bi_opf |= REQ_NOMERGE;
985985

986986
bvec_set_page(&bio->bi_io_vec[bio->bi_vcnt], page, len, off);
987987
bio->bi_iter.bi_size += len;

block/blk-mq-dma.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,22 +173,20 @@ bool blk_rq_dma_map_iter_start(struct request *req, struct device *dma_dev,
173173
if (!blk_map_iter_next(req, &iter->iter))
174174
return false;
175175

176-
if (IS_ENABLED(CONFIG_PCI_P2PDMA) && (req->cmd_flags & REQ_P2PDMA)) {
177-
switch (pci_p2pdma_state(&iter->p2pdma, dma_dev,
178-
phys_to_page(iter->iter.paddr))) {
179-
case PCI_P2PDMA_MAP_BUS_ADDR:
180-
return blk_dma_map_bus(iter);
181-
case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE:
182-
/*
183-
* P2P transfers through the host bridge are treated the
184-
* same as non-P2P transfers below and during unmap.
185-
*/
186-
req->cmd_flags &= ~REQ_P2PDMA;
187-
break;
188-
default:
189-
iter->status = BLK_STS_INVAL;
190-
return false;
191-
}
176+
switch (pci_p2pdma_state(&iter->p2pdma, dma_dev,
177+
phys_to_page(iter->iter.paddr))) {
178+
case PCI_P2PDMA_MAP_BUS_ADDR:
179+
return blk_dma_map_bus(iter);
180+
case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE:
181+
/*
182+
* P2P transfers through the host bridge are treated the
183+
* same as non-P2P transfers below and during unmap.
184+
*/
185+
case PCI_P2PDMA_MAP_NONE:
186+
break;
187+
default:
188+
iter->status = BLK_STS_INVAL;
189+
return false;
192190
}
193191

194192
if (blk_can_dma_map_iova(req, dma_dev) &&

include/linux/blk_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ enum req_flag_bits {
419419
#define REQ_DRV (__force blk_opf_t)(1ULL << __REQ_DRV)
420420
#define REQ_FS_PRIVATE (__force blk_opf_t)(1ULL << __REQ_FS_PRIVATE)
421421
#define REQ_ATOMIC (__force blk_opf_t)(1ULL << __REQ_ATOMIC)
422-
#define REQ_P2PDMA (__force blk_opf_t)(1ULL << __REQ_P2PDMA)
423422

424423
#define REQ_NOUNMAP (__force blk_opf_t)(1ULL << __REQ_NOUNMAP)
425424

0 commit comments

Comments
 (0)