All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ahci: Fix a wrong parameter pass
@ 2015-03-31  7:02 Yuantian.Tang at freescale.com
  2015-04-03 23:26 ` Simon Glass
  2015-04-07 17:58 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Yuantian.Tang at freescale.com @ 2015-03-31  7:02 UTC (permalink / raw)
  To: u-boot

From: Tang Yuantian <Yuantian.Tang@freescale.com>

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>
---
 drivers/block/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index c908fab..88b90e0 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -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");
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] ahci: Fix a wrong parameter pass
  2015-03-31  7:02 [U-Boot] [PATCH] ahci: Fix a wrong parameter pass Yuantian.Tang at freescale.com
@ 2015-04-03 23:26 ` Simon Glass
  2015-04-07 17:58 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2015-04-03 23:26 UTC (permalink / raw)
  To: u-boot

On 31 March 2015 at 01:02,  <Yuantian.Tang@freescale.com> wrote:
> From: Tang Yuantian <Yuantian.Tang@freescale.com>
>
> 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>
> ---
>  drivers/block/ahci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I'm not an expert here but this looks right.

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] ahci: Fix a wrong parameter pass
  2015-03-31  7:02 [U-Boot] [PATCH] ahci: Fix a wrong parameter pass Yuantian.Tang at freescale.com
  2015-04-03 23:26 ` Simon Glass
@ 2015-04-07 17:58 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2015-04-07 17:58 UTC (permalink / raw)
  To: u-boot

On Tue, Mar 31, 2015 at 03:02:43PM +0800, tang yuantian wrote:

> From: Tang Yuantian <Yuantian.Tang@freescale.com>
> 
> 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>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150407/001bf279/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-07 17:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31  7:02 [U-Boot] [PATCH] ahci: Fix a wrong parameter pass Yuantian.Tang at freescale.com
2015-04-03 23:26 ` Simon Glass
2015-04-07 17:58 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.