All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 3/4] libata: move dev->max_sectors configuration into ata_dev_configure()
Date: Thu, 19 Oct 2006 14:51:39 +0900	[thread overview]
Message-ID: <11612370993739-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <1161237098656-git-send-email-htejun@gmail.com>

Move dev->max_sectors configuration from ata_scsi_dev_config() to
ata_dev_configure().

* more consistent.
* allows LLDs to peek at the default dev->max_sectors value.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/libata-core.c |    5 +++++
 drivers/ata/libata-scsi.c |   19 +++----------------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index f5164db..4ef68f3 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1530,6 +1530,11 @@ int ata_dev_configure(struct ata_device 
 				       cdb_intr_string);
 	}
 
+	/* determine max_sectors */
+	dev->max_sectors = ATA_MAX_SECTORS;
+	if (dev->flags & ATA_DFLAG_LBA48)
+		dev->max_sectors = ATA_MAX_SECTORS_LBA48;
+
 	if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) {
 		/* Let the user know. We don't want to disallow opens for
 		   rescue purposes, or in case the vendor is just a blithering
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 7af2a4b..d10f249 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -807,23 +807,10 @@ static void ata_scsi_sdev_config(struct 
 static void ata_scsi_dev_config(struct scsi_device *sdev,
 				struct ata_device *dev)
 {
-	unsigned int max_sectors;
+	/* configure max sectors */
+	blk_queue_max_sectors(sdev->request_queue, dev->max_sectors);
 
-	/* TODO: 2048 is an arbitrary number, not the
-	 * hardware maximum.  This should be increased to
-	 * 65534 when Jens Axboe's patch for dynamically
-	 * determining max_sectors is merged.
-	 */
-	max_sectors = ATA_MAX_SECTORS;
-	if (dev->flags & ATA_DFLAG_LBA48)
-		max_sectors = ATA_MAX_SECTORS_LBA48;
-	if (dev->max_sectors)
-		max_sectors = dev->max_sectors;
-
-	blk_queue_max_sectors(sdev->request_queue, max_sectors);
-
-	/*
-	 * SATA DMA transfers must be multiples of 4 byte, so
+	/* SATA DMA transfers must be multiples of 4 byte, so
 	 * we need to pad ATAPI transfers using an extra sg.
 	 * Decrement max hw segments accordingly.
 	 */
-- 
1.4.2.3



  parent reply	other threads:[~2006-10-19  5:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19  5:51 [PATCHSET] sata_sil: implement Mod15Write workaround by split request processing Tejun Heo
2006-10-19  5:51 ` [PATCH 1/4] libata: implement ATA_EHI_PRINTINFO Tejun Heo
2006-11-01  1:57   ` Jeff Garzik
2006-10-19  5:51 ` [PATCH 2/4] libata: implement ATA_EHI_SETMODE and ATA_EHI_POST_SETMODE Tejun Heo
2006-10-19  5:51 ` Tejun Heo [this message]
2006-10-19  5:51 ` [PATCH 4/4] sata_sil: implement Mod15Write workaround by split request processing Tejun Heo
2006-11-01  1:59   ` Jeff Garzik
2006-11-01  2:17     ` Tejun Heo
2006-11-01  2:31       ` Jeff Garzik
2006-11-01  9:16         ` Tejun Heo

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=11612370993739-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.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 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.