powerpc/fsl_sata: Properly clamp maxio to pessimized size

The CAM 'maxio' is a 'pessimized' size, assuming 4k pages and one page
per segment.  Since there are at most 63 segments in a transaction with
this driver, and one would necessarily be the indirect segment marker,
clamp the maxio to the minimum of maxphys (tunable) or (63 - 1) pages
(248k).

MFC after:	3 days
This commit is contained in:
Justin Hibbits 2022-08-04 21:28:21 -04:00
parent e24c5c60d7
commit c0665d5c82

View File

@ -1871,7 +1871,7 @@ fsl_sataaction(struct cam_sim *sim, union ccb *ccb)
cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
cpi->protocol = PROTO_ATA;
cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;
cpi->maxio = maxphys;
cpi->maxio = (FSL_SATA_SG_ENTRIES - 1) * PAGE_SIZE;
cpi->ccb_h.status = CAM_REQ_CMP;
break;
}