Skip to content

fix iommu sg list merge problem

FUJITA Tomonori linux-scsi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 27 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5add dma_max_segment_size option to scsi_host_templatedrivers/scsi/hosts.c drivers/scsi/scsi_lib.c include/scsi/scsi_host.h+12 -07 replies
2/5sata_inic162x: use dma_max_segment_size in scsi_host_templatedrivers/ata/sata_inic162x.c+7 -120 replies
3/5add sg segment limitation info to device structureinclude/linux/device.h+7 -016 replies
4/5scsi_add_host sets device max_segment_sizedrivers/scsi/hosts.c+3 -00 replies
5/5x86-64: pci-gart iommu uses max_segment_sizearch/x86_64/kernel/pci-gart.c+6 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] fix iommu sg list merge problem

iommu code merges sg lists without considering lld's restrictions so some llds need a workaround to split sg lists again. This patchset fixes iommu to handle lld's max segment size limit properly.

The problem is that iommu code can't access to the restrictions because they are in request_queue. iommu code can access to only device structure. I chose the simplest approach, adding max_segment_size to device structure.

We could remove the lld restrictions in request_queue strucutre and have a new strucutre (something like struct io_restrictions). Then somehow we could link the new structure with request_queue and device strucutres. But iommu needs only max_segment_size and seg_boundary_mask, so the simplest approach is not so bad, I think.

scsi_add_host sets shost_gendev.parent->max_segment_size for iommu code (copied form shost->dma_max_segment_size).

This patchset includes only the x86_64 iommu patch but my git tree includes x86_64, ppc, ia64, parisc, and alpha patches. As far as I know, thye are all the iommu code that merges sg lists. The iommu patchse are only compile tested.

git://git.kernel.org/pub/scm/linux/kernel/git/tomo/linux-2.6-bidi.git iommu

3 llds, aacraid, scsi_debug, and sata_inic162x sets shost->dma_max_segment_size in slave_configure hook. But dma_max_segment_size is a lld restriction. I adds dma_max_segment_size to scsi_host_template and scsi_host. llds specify dma_max_segment_size in scsi_host_template, scsi-ml sets dma_max_segment_size in devices and call blk_queue_max_segment_size. This patchset includes only the sata_inic162x patch but all the patches for llds, aacraid and scsi_debug are in the git tree.