]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: pm8001: Increase request sg length to support 4MiB requests
authorIgor Pylypiv <ipylypiv@google.com>
Fri, 25 Oct 2024 18:50:09 +0000 (18:50 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 7 Nov 2024 01:45:20 +0000 (20:45 -0500)
Increasing the per-request size maximum to 4MiB (8192 sectors x 512
bytes) runs into the per-device DMA scatter gather list limit
(max_segments) for users of the io vector system calls (e.g. readv and
writev).

Increase the max scatter gather list length to 1024 to enable kernel to
send 4MiB (1024 * 4KiB page size) requests.

Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Link: https://lore.kernel.org/r/20241025185009.3278297-1-ipylypiv@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pm8001/pm8001_defs.h
drivers/scsi/pm8001/pm8001_init.c

index 501b574239e8b1077e1e58e9690db00c46f8de9f..7871e29a820a09fcf0e7e04fbeb0629be100fdb4 100644 (file)
@@ -92,8 +92,11 @@ enum port_type {
 #define        PM8001_MAX_MSIX_VEC      64     /* max msi-x int for spcv/ve */
 #define        PM8001_RESERVE_SLOT      8
 
-#define        CONFIG_SCSI_PM8001_MAX_DMA_SG   528
-#define PM8001_MAX_DMA_SG      CONFIG_SCSI_PM8001_MAX_DMA_SG
+#define PM8001_SECTOR_SIZE     512
+#define PM8001_PAGE_SIZE_4K    4096
+#define PM8001_MAX_IO_SIZE     (4 * 1024 * 1024)
+#define PM8001_MAX_DMA_SG      (PM8001_MAX_IO_SIZE / PM8001_PAGE_SIZE_4K)
+#define PM8001_MAX_SECTORS     (PM8001_MAX_IO_SIZE / PM8001_SECTOR_SIZE)
 
 enum memory_region_num {
        AAP1 = 0x0, /* application acceleration processor */
index dce40d02b73c3d12323685de54422d183b25fd4d..f8c81e53e93f7849bbe7fe9cbc861f22b964bc39 100644 (file)
@@ -121,6 +121,7 @@ static const struct scsi_host_template pm8001_sht = {
        .scan_start             = pm8001_scan_start,
        .can_queue              = 1,
        .sg_tablesize           = PM8001_MAX_DMA_SG,
+       .max_sectors            = PM8001_MAX_SECTORS,
        .shost_groups           = pm8001_host_groups,
        .sdev_groups            = pm8001_sdev_groups,
        .track_queue_depth      = 1,