Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: mpt3sas: set an unlimited max_segment_size for SAS 3.0 HBAs

When using a virt_boundary_mask, as done for NVMe devices attached to
mpt3sas controllers, we require an unlimited max_segment_size as the virt
boundary merging code assumes that. But we also need to propagate that to
the DMA mapping layer to make dma-debug happy. The SCSI layer takes care
of that when using the per-host virt_boundary setting, but given that
mpt3sas only wants to set the virt_boundary for actual NVMe devices, we
can't rely on that. The DMA layer maximum segment is global to the HBA
however, so we have to set it explicitly. This patch assumes that mpt3sas
does not have a segment size limitation, which seems true based on the SGL
format, but will need to be verified.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Suganath Prabu <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Christoph Hellwig and committed by
Martin K. Petersen
ce0ad853 8c175d31

+1
+1
drivers/scsi/mpt3sas/mpt3sas_scsih.c
··· 10238 10238 .this_id = -1, 10239 10239 .sg_tablesize = MPT3SAS_SG_DEPTH, 10240 10240 .max_sectors = 32767, 10241 + .max_segment_size = 0xffffffff, 10241 10242 .cmd_per_lun = 7, 10242 10243 .shost_attrs = mpt3sas_host_attrs, 10243 10244 .sdev_attrs = mpt3sas_dev_attrs,