[U-Boot] [PATCH 3/3] ahci: support LBA48 data reads for 2+TB drives

Anatolij Gustschin agust at denx.de
Fri Nov 8 21:11:49 CET 2013


On Tue, 10 Sep 2013 15:19:17 -0500
Mark Langsdorf <mark.langsdorf at calxeda.com> wrote:
...
> diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
> index 8cc9379..c5c942f 100644
> --- a/drivers/block/ahci.c
> +++ b/drivers/block/ahci.c

...
> @@ -689,10 +696,13 @@ static int ata_scsiop_read_write(ccb *pccb, u8 is_write)
>  	 *
>  	 * WARNING: one or two older ATA drives treat 0 as 0...
>  	 */
> -	blocks = (((u16)pccb->cmd[7]) << 8) | ((u16) pccb->cmd[8]);
> +	if (pccb->cmd[0] == SCSI_READ16)
> +		blocks = (((u16)pccb->cmd[13]) << 8) | ((u16) pccb->cmd[14]);
> +	else
> +		blocks = (((u16)pccb->cmd[7]) << 8) | ((u16) pccb->cmd[8]);
>  
> -	debug("scsi_ahci: %s %d blocks starting from lba 0x%x\n",
> -	      is_write ?  "write" : "read", (unsigned)lba, blocks);
> +	debug("scsi_ahci: %s %u blocks starting from lba 0x" LBAFU "\n",
> +	      is_write ?  "write" : "read", blocks, lba);

LBAFU is defined as "%llu" or "%lu", so " 0x" in the debug string
will suggest that the lba value is in hexadecimal notation, but
the format specifier outputs as decimal. Please remove "0x" when
applying this patch. Thanks!

Anatolij


More information about the U-Boot mailing list