linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Albert Lee" <albertcc@tw.ibm.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Doug Maxey <dwm@maxeymade.com>,
	IDE Linux <linux-ide@vger.kernel.org>,
	"Mudama, Eric" <eric_mudama@Maxtor.com>,
	Mark Lord <mlord@pobox.com>
Subject: Re: [PATCH libata-dev-2.6 1/3] Add CHS support
Date: Mon, 14 Feb 2005 19:09:13 +0800	[thread overview]
Message-ID: <007f01c51285$a3612450$6401a8c0@tw.ibm.com> (raw)
In-Reply-To: 4205B886.4070005@pobox.com

[-- Attachment #1: Type: text/plain, Size: 3547 bytes --]

Dear all:

> 
> Comments:
> 
> 1) Patches #1 and #2 look OK.
> 
> 2) Patch #3 needs to be split up into three patches:
> a) rename variables (s/sector/block/),
> b) reorganize read/write translation
> c) add CHS support
> 

Happy lunar new year.

Attached pls find the split patch #3 for your review.

Patch 3-1: 
 - rename variables (s/sector/block/) in ata_scsi_verify_xlat()

Albert

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
----------------------------------------------------------------------------
--- libata-dev-2.6/drivers/scsi/libata-scsi.c 2005-02-14 16:26:44.000000000 +0800
+++ libata-dev-2.6-mod/drivers/scsi/libata-scsi.c 2005-02-14 16:45:33.000000000 +0800
@@ -691,75 +691,75 @@
  struct ata_taskfile *tf = &qc->tf;
  unsigned int lba48 = tf->flags & ATA_TFLAG_LBA48;
  u64 dev_sectors = qc->dev->n_sectors;
- u64 sect = 0;
- u32 n_sect = 0;
+ u64 block = 0;
+ u32 n_block = 0;
 
  tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
  tf->protocol = ATA_PROT_NODATA;
  tf->device |= ATA_LBA;
 
  if (scsicmd[0] == VERIFY) {
-  sect |= ((u64)scsicmd[2]) << 24;
-  sect |= ((u64)scsicmd[3]) << 16;
-  sect |= ((u64)scsicmd[4]) << 8;
-  sect |= ((u64)scsicmd[5]);
+  block |= ((u64)scsicmd[2]) << 24;
+  block |= ((u64)scsicmd[3]) << 16;
+  block |= ((u64)scsicmd[4]) << 8;
+  block |= ((u64)scsicmd[5]);
 
-  n_sect |= ((u32)scsicmd[7]) << 8;
-  n_sect |= ((u32)scsicmd[8]);
+  n_block |= ((u32)scsicmd[7]) << 8;
+  n_block |= ((u32)scsicmd[8]);
  }
 
  else if (scsicmd[0] == VERIFY_16) {
-  sect |= ((u64)scsicmd[2]) << 56;
-  sect |= ((u64)scsicmd[3]) << 48;
-  sect |= ((u64)scsicmd[4]) << 40;
-  sect |= ((u64)scsicmd[5]) << 32;
-  sect |= ((u64)scsicmd[6]) << 24;
-  sect |= ((u64)scsicmd[7]) << 16;
-  sect |= ((u64)scsicmd[8]) << 8;
-  sect |= ((u64)scsicmd[9]);
-
-  n_sect |= ((u32)scsicmd[10]) << 24;
-  n_sect |= ((u32)scsicmd[11]) << 16;
-  n_sect |= ((u32)scsicmd[12]) << 8;
-  n_sect |= ((u32)scsicmd[13]);
+  block |= ((u64)scsicmd[2]) << 56;
+  block |= ((u64)scsicmd[3]) << 48;
+  block |= ((u64)scsicmd[4]) << 40;
+  block |= ((u64)scsicmd[5]) << 32;
+  block |= ((u64)scsicmd[6]) << 24;
+  block |= ((u64)scsicmd[7]) << 16;
+  block |= ((u64)scsicmd[8]) << 8;
+  block |= ((u64)scsicmd[9]);
+
+  n_block |= ((u32)scsicmd[10]) << 24;
+  n_block |= ((u32)scsicmd[11]) << 16;
+  n_block |= ((u32)scsicmd[12]) << 8;
+  n_block |= ((u32)scsicmd[13]);
  }
 
  else
   return 1;
 
- if (!n_sect)
+ if (!n_block)
   return 1;
- if (sect >= dev_sectors)
+ if (block >= dev_sectors)
   return 1;
- if ((sect + n_sect) > dev_sectors)
+ if ((block + n_block) > dev_sectors)
   return 1;
  if (lba48) {
-  if (n_sect > (64 * 1024))
+  if (n_block > (64 * 1024))
    return 1;
  } else {
-  if (n_sect > 256)
+  if (n_block > 256)
    return 1;
  }
 
  if (lba48) {
   tf->command = ATA_CMD_VERIFY_EXT;
 
-  tf->hob_nsect = (n_sect >> 8) & 0xff;
+  tf->hob_nsect = (n_block >> 8) & 0xff;
 
-  tf->hob_lbah = (sect >> 40) & 0xff;
-  tf->hob_lbam = (sect >> 32) & 0xff;
-  tf->hob_lbal = (sect >> 24) & 0xff;
+  tf->hob_lbah = (block >> 40) & 0xff;
+  tf->hob_lbam = (block >> 32) & 0xff;
+  tf->hob_lbal = (block >> 24) & 0xff;
  } else {
   tf->command = ATA_CMD_VERIFY;
 
-  tf->device |= (sect >> 24) & 0xf;
+  tf->device |= (block >> 24) & 0xf;
  }
 
- tf->nsect = n_sect & 0xff;
+ tf->nsect = n_block & 0xff;
 
- tf->lbah = (sect >> 16) & 0xff;
- tf->lbam = (sect >> 8) & 0xff;
- tf->lbal = sect & 0xff;
+ tf->lbah = (block >> 16) & 0xff;
+ tf->lbam = (block >> 8) & 0xff;
+ tf->lbal = block & 0xff;
 
  return 0;
 }

[-- Attachment #2: chs3-1.diff --]
[-- Type: application/octet-stream, Size: 3148 bytes --]

--- libata-dev-2.6/drivers/scsi/libata-scsi.c	2005-02-14 16:26:44.000000000 +0800
+++ libata-dev-2.6-mod/drivers/scsi/libata-scsi.c	2005-02-14 16:45:33.000000000 +0800
@@ -691,75 +691,75 @@
 	struct ata_taskfile *tf = &qc->tf;
 	unsigned int lba48 = tf->flags & ATA_TFLAG_LBA48;
 	u64 dev_sectors = qc->dev->n_sectors;
-	u64 sect = 0;
-	u32 n_sect = 0;
+	u64 block = 0;
+	u32 n_block = 0;
 
 	tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
 	tf->protocol = ATA_PROT_NODATA;
 	tf->device |= ATA_LBA;
 
 	if (scsicmd[0] == VERIFY) {
-		sect |= ((u64)scsicmd[2]) << 24;
-		sect |= ((u64)scsicmd[3]) << 16;
-		sect |= ((u64)scsicmd[4]) << 8;
-		sect |= ((u64)scsicmd[5]);
+		block |= ((u64)scsicmd[2]) << 24;
+		block |= ((u64)scsicmd[3]) << 16;
+		block |= ((u64)scsicmd[4]) << 8;
+		block |= ((u64)scsicmd[5]);
 
-		n_sect |= ((u32)scsicmd[7]) << 8;
-		n_sect |= ((u32)scsicmd[8]);
+		n_block |= ((u32)scsicmd[7]) << 8;
+		n_block |= ((u32)scsicmd[8]);
 	}
 
 	else if (scsicmd[0] == VERIFY_16) {
-		sect |= ((u64)scsicmd[2]) << 56;
-		sect |= ((u64)scsicmd[3]) << 48;
-		sect |= ((u64)scsicmd[4]) << 40;
-		sect |= ((u64)scsicmd[5]) << 32;
-		sect |= ((u64)scsicmd[6]) << 24;
-		sect |= ((u64)scsicmd[7]) << 16;
-		sect |= ((u64)scsicmd[8]) << 8;
-		sect |= ((u64)scsicmd[9]);
-
-		n_sect |= ((u32)scsicmd[10]) << 24;
-		n_sect |= ((u32)scsicmd[11]) << 16;
-		n_sect |= ((u32)scsicmd[12]) << 8;
-		n_sect |= ((u32)scsicmd[13]);
+		block |= ((u64)scsicmd[2]) << 56;
+		block |= ((u64)scsicmd[3]) << 48;
+		block |= ((u64)scsicmd[4]) << 40;
+		block |= ((u64)scsicmd[5]) << 32;
+		block |= ((u64)scsicmd[6]) << 24;
+		block |= ((u64)scsicmd[7]) << 16;
+		block |= ((u64)scsicmd[8]) << 8;
+		block |= ((u64)scsicmd[9]);
+
+		n_block |= ((u32)scsicmd[10]) << 24;
+		n_block |= ((u32)scsicmd[11]) << 16;
+		n_block |= ((u32)scsicmd[12]) << 8;
+		n_block |= ((u32)scsicmd[13]);
 	}
 
 	else
 		return 1;
 
-	if (!n_sect)
+	if (!n_block)
 		return 1;
-	if (sect >= dev_sectors)
+	if (block >= dev_sectors)
 		return 1;
-	if ((sect + n_sect) > dev_sectors)
+	if ((block + n_block) > dev_sectors)
 		return 1;
 	if (lba48) {
-		if (n_sect > (64 * 1024))
+		if (n_block > (64 * 1024))
 			return 1;
 	} else {
-		if (n_sect > 256)
+		if (n_block > 256)
 			return 1;
 	}
 
 	if (lba48) {
 		tf->command = ATA_CMD_VERIFY_EXT;
 
-		tf->hob_nsect = (n_sect >> 8) & 0xff;
+		tf->hob_nsect = (n_block >> 8) & 0xff;
 
-		tf->hob_lbah = (sect >> 40) & 0xff;
-		tf->hob_lbam = (sect >> 32) & 0xff;
-		tf->hob_lbal = (sect >> 24) & 0xff;
+		tf->hob_lbah = (block >> 40) & 0xff;
+		tf->hob_lbam = (block >> 32) & 0xff;
+		tf->hob_lbal = (block >> 24) & 0xff;
 	} else {
 		tf->command = ATA_CMD_VERIFY;
 
-		tf->device |= (sect >> 24) & 0xf;
+		tf->device |= (block >> 24) & 0xf;
 	}
 
-	tf->nsect = n_sect & 0xff;
+	tf->nsect = n_block & 0xff;
 
-	tf->lbah = (sect >> 16) & 0xff;
-	tf->lbam = (sect >> 8) & 0xff;
-	tf->lbal = sect & 0xff;
+	tf->lbah = (block >> 16) & 0xff;
+	tf->lbam = (block >> 8) & 0xff;
+	tf->lbal = block & 0xff;
 
 	return 0;
 }

  parent reply	other threads:[~2005-02-14 11:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-06  6:02 [PATCH libata-dev-2.6 1/3] Add CHS support Albert Lee
2005-02-06  6:26 ` Jeff Garzik
2005-02-06 14:41   ` Mark Lord
2005-02-06 15:00     ` Jeff Garzik
2005-02-06 22:02       ` Mark Lord
2005-02-14 11:09   ` Albert Lee [this message]
2005-02-14 11:17     ` Albert Lee
2005-02-14 11:23       ` Albert Lee
2005-02-18 23:40 ` Jeff Garzik
2005-02-22  3:35   ` Albert Lee
2005-02-23 11:25   ` [PATCH libata-dev-2.6] Issue INITIALIZE DEVICE PARAMETERS for CHS only devices Albert Lee
2005-02-23 14:48     ` Mark Lord
2005-02-24  2:36       ` Albert Lee
2005-02-24  2:53         ` Jeff Garzik
2005-02-24  5:29           ` Albert Lee
2005-02-24  5:35             ` Jeff Garzik
2005-02-24  6:41               ` Albert Lee
2005-02-24  6:48                 ` Jeff Garzik
2005-02-24  7:01                   ` Albert Lee
2005-02-24  7:48                     ` Jeff Garzik
2005-02-25  5:01                       ` Albert Lee
2005-02-25  5:22                         ` Albert Lee
2005-02-25  5:40                         ` Jeff Garzik
2005-02-24  3:10         ` Mark Lord
2005-02-24  3:15           ` Jeff Garzik
2005-02-24  3:35             ` Mark Lord
2005-02-23 16:50     ` Bartlomiej Zolnierkiewicz
2005-02-24  3:05       ` Albert Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='007f01c51285$a3612450$6401a8c0@tw.ibm.com' \
    --to=albertcc@tw.ibm.com \
    --cc=bzolnier@gmail.com \
    --cc=dwm@maxeymade.com \
    --cc=eric_mudama@Maxtor.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=mlord@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).