Commit b5a73bf4 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

scsi: check that busses support the DMA API before setting dma parameters



We'll start throwing warnings soon when dma_set_seg_boundary and
dma_set_max_seg_size are called on devices for buses that don't fully
support the DMA API.  Prepare for that by making the calls in the SCSI
midlayer conditional.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 833bd284
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1988,9 +1988,16 @@ void scsi_init_limits(struct Scsi_Host *shost, struct queue_limits *lim)
	if (shost->no_highmem)
		lim->features |= BLK_FEAT_BOUNCE_HIGH;

	/*
	 * Propagate the DMA formation properties to the dma-mapping layer as
	 * a courtesy service to the LLDDs.  This needs to check that the buses
	 * actually support the DMA API first, though.
	 */
	if (dev->dma_parms) {
		dma_set_seg_boundary(dev, shost->dma_boundary);
		dma_set_max_seg_size(dev, shost->max_segment_size);
	}
}
EXPORT_SYMBOL_GPL(scsi_init_limits);

static const struct blk_mq_ops scsi_mq_ops_no_commit = {