linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, albertcc@tw.ibm.com, linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 2/7] libata: convert dev->id to pointer
Date: Wed, 15 Feb 2006 18:24:09 +0900	[thread overview]
Message-ID: <11399954493649-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11399954493467-git-send-email-htejun@gmail.com>

Convert dev->id from array to pointer.  This is to accomodate
revalidation.  During revalidation, both old and new IDENTIFY pages
should be accessible and single ->id array doesn't cut it.

Signed-off-by: Tejun Heo <htejun@gmail.com>

---

 drivers/scsi/libata-core.c |   11 +++++++++--
 include/linux/libata.h     |    2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

437d923fd2bb8020b4a5cdaa8080bcf9f20698cd
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index f97ead8..a435454 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -953,6 +953,10 @@ static void ata_dev_identify(struct ata_
 
 	ata_dev_select(ap, device, 1, 1); /* select device 0/1 */
 
+	dev->id = kmalloc(sizeof(dev->id[0]) * ATA_ID_WORDS, GFP_KERNEL);
+	if (dev->id == NULL)
+		goto err_out;
+
 retry:
 	ata_tf_init(ap, &tf, device);
 
@@ -967,7 +971,7 @@ retry:
 	tf.protocol = ATA_PROT_PIO;
 
 	err_mask = ata_exec_internal(ap, dev, &tf, DMA_FROM_DEVICE,
-				     dev->id, sizeof(dev->id));
+				     dev->id, sizeof(dev->id[0]) * ATA_ID_WORDS);
 
 	if (err_mask) {
 		if (err_mask & ~AC_ERR_DEV)
@@ -2515,7 +2519,7 @@ static void ata_dev_reread_id(struct ata
 	tf.protocol = ATA_PROT_PIO;
 
 	if (ata_exec_internal(ap, dev, &tf, DMA_FROM_DEVICE,
-			      dev->id, sizeof(dev->id)))
+			      dev->id, sizeof(dev->id[0]) * ATA_ID_WORDS))
 		goto err_out;
 
 	swap_buf_le16(dev->id, ATA_ID_WORDS);
@@ -4722,11 +4726,14 @@ void ata_host_set_remove(struct ata_host
 int ata_scsi_release(struct Scsi_Host *host)
 {
 	struct ata_port *ap = (struct ata_port *) &host->hostdata[0];
+	int i;
 
 	DPRINTK("ENTER\n");
 
 	ap->ops->port_disable(ap);
 	ata_host_remove(ap, 0);
+	for (i = 0; i < ATA_MAX_DEVICES; i++)
+		kfree(ap->device[i].id);
 
 	DPRINTK("EXIT\n");
 	return 1;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 0d6bf50..1f15666 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -339,7 +339,7 @@ struct ata_device {
 	unsigned long		flags;		/* ATA_DFLAG_xxx */
 	unsigned int		class;		/* ATA_DEV_xxx */
 	unsigned int		devno;		/* 0 or 1 */
-	u16			id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
+	u16			*id;		/* IDENTIFY xxx DEVICE data */
 	u8			pio_mode;
 	u8			dma_mode;
 	u8			xfer_mode;
-- 
1.1.5



  parent reply	other threads:[~2006-02-15  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-15  9:24 [PATCHSET] libata: reorganize ata_dev_identify() Tejun Heo
2006-02-15  9:24 ` [PATCH 6/7] libata: fold ata_dev_config() into ata_dev_configure() Tejun Heo
2006-02-20 10:41   ` Jeff Garzik
2006-02-15  9:24 ` Tejun Heo [this message]
2006-02-15  9:24 ` [PATCH 7/7] libata: reorganize ata_bus_probe() Tejun Heo
2006-02-20 10:43   ` Jeff Garzik
2006-02-20 15:16     ` Tejun Heo
2006-02-15  9:24 ` [PATCH 4/7] libata: kill ata_dev_reread_id() Tejun Heo
2006-02-20 10:35   ` Jeff Garzik
2006-02-15  9:24 ` [PATCH 5/7] libata: separate out ata_dev_configure() Tejun Heo
2006-02-20 10:37   ` Jeff Garzik

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=11399954493649-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=albertcc@tw.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /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).