From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Fri, 8 Nov 2013 21:11:49 +0100 Subject: [U-Boot] [PATCH 3/3] ahci: support LBA48 data reads for 2+TB drives In-Reply-To: <1378844357-15389-4-git-send-email-mark.langsdorf@calxeda.com> References: <1378844357-15389-1-git-send-email-mark.langsdorf@calxeda.com> <1378844357-15389-4-git-send-email-mark.langsdorf@calxeda.com> Message-ID: <20131108211149.6f7f62c4@crub> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 10 Sep 2013 15:19:17 -0500 Mark Langsdorf 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