]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ahci: Fix a wrong parameter pass
authorTang Yuantian <Yuantian.Tang@freescale.com>
Tue, 31 Mar 2015 07:02:43 +0000 (15:02 +0800)
committerTom Rini <trini@konsulko.com>
Tue, 7 Apr 2015 12:41:10 +0000 (08:41 -0400)
In stead of user_buffer_size, transfer_size should be used to pass to
ahci_device_data_io(). transfer_size is the length that we want the
low level function to transfer each time.
If we use user_buffer_size which is the totally data length as parameter,
low level function will actually create many SGs to transfer as many data
as possible each time. That will produce many redundant data transfer.

Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/block/ahci.c

index c908fab4506e5c6400dc91150cbc23234c0ed9e3..88b90e02035766a00dc624f49a12edb0a4237cd9 100644 (file)
@@ -785,7 +785,7 @@ static int ata_scsiop_read_write(ccb *pccb, u8 is_write)
 
                /* Read/Write from ahci */
                if (ahci_device_data_io(pccb->target, (u8 *) &fis, sizeof(fis),
-                                       user_buffer, user_buffer_size,
+                                       user_buffer, transfer_size,
                                        is_write)) {
                        debug("scsi_ahci: SCSI %s10 command failure.\n",
                              is_write ? "WRITE" : "READ");