From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <htejun@gmail.com>
Cc: albertcc@tw.ibm.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH 3/4] libata: add per-device max_sectors
Date: Sun, 12 Feb 2006 14:37:05 -0500 [thread overview]
Message-ID: <43EF8E61.5040409@pobox.com> (raw)
In-Reply-To: <1139754779159-git-send-email-htejun@gmail.com>
Tejun Heo wrote:
> If a low level driver wants to control max_sectors, it had to adjust
> ap->host->max_sectors and set ATA_DFLAG_LOCK_SECTORS to tell
> ata_scsi_slave_config not to override the limit. This is not only
> cumbersome but also incorrect for hosts which support more than one
> devices per port.
>
> This patch adds per-device ->max_sectors. If the field is unset
> (zero), libata core layer will adjust ->max_sectors according to
> default rules. If the field is set, libata honors the setting.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
>
> ---
>
> drivers/scsi/libata-core.c | 4 +---
> drivers/scsi/libata-scsi.c | 18 +++++++++---------
> drivers/scsi/sata_sil.c | 4 +---
> include/linux/libata.h | 4 ++--
> 4 files changed, 13 insertions(+), 17 deletions(-)
>
> 43ec393ac52f72d2a45f93ee2abf5255bed1d8db
> diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
> index c62798c..4db3db0 100644
> --- a/drivers/scsi/libata-core.c
> +++ b/drivers/scsi/libata-core.c
> @@ -1147,9 +1147,7 @@ void ata_dev_config(struct ata_port *ap,
> printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
> ap->id, i);
> ap->udma_mask &= ATA_UDMA5;
> - ap->host->max_sectors = ATA_MAX_SECTORS;
> - ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
> - ap->device[i].flags |= ATA_DFLAG_LOCK_SECTORS;
> + ap->device[i].max_sectors = ATA_MAX_SECTORS;
> }
>
> if (ap->ops->dev_config)
> diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
> index 3628fed..86da465 100644
> --- a/drivers/scsi/libata-scsi.c
> +++ b/drivers/scsi/libata-scsi.c
> @@ -684,23 +684,23 @@ int ata_scsi_slave_config(struct scsi_de
> if (sdev->id < ATA_MAX_DEVICES) {
> struct ata_port *ap;
> struct ata_device *dev;
> + unsigned int max_sectors;
>
> ap = (struct ata_port *) &sdev->host->hostdata[0];
> dev = &ap->device[sdev->id];
>
> - /* TODO: 1024 is an arbitrary number, not the
> + /* 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.
> */
> - if ((dev->flags & ATA_DFLAG_LBA48) &&
> - ((dev->flags & ATA_DFLAG_LOCK_SECTORS) == 0)) {
> - /*
> - * do not overwrite sdev->host->max_sectors, since
> - * other drives on this host may not support LBA48
> - */
> - blk_queue_max_sectors(sdev->request_queue, 2048);
> - }
> + max_sectors = ATA_MAX_SECTORS;
> + if (dev->flags & ATA_DFLAG_LBA48)
> + max_sectors = 2048;
> + if (dev->max_sectors)
> + max_sectors = dev->max_sectors;
applied 3-4, though note that the Axboe code mentioned in the comment is
now in the kernel, so lba48 can be fixed properly.
Jeff
next prev parent reply other threads:[~2006-02-12 19:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-12 14:32 [PATCHSET] libata: make some configurations per-dev Tejun Heo
2006-02-12 14:32 ` [PATCH 1/4] libata: make ata_dev_knobble() per-device Tejun Heo
2006-02-12 19:29 ` Jeff Garzik
2006-02-12 14:32 ` [PATCH 2/4] libata: move cdb_len for host to device Tejun Heo
2006-02-12 14:32 ` [PATCH 4/4] libata: kill sht->max_sectors Tejun Heo
2006-02-12 14:32 ` [PATCH 3/4] libata: add per-device max_sectors Tejun Heo
2006-02-12 19:37 ` Jeff Garzik [this message]
2006-02-13 0:47 ` Tejun Heo
2006-02-13 4:58 ` Jeff Garzik
2006-02-15 7:24 ` [PATCH] libata: increase LBA48 max sectors to 65535 Tejun Heo
2006-02-15 13:07 ` Jens Axboe
2006-02-15 15:04 ` Tejun Heo
2006-02-15 15:12 ` Jens Axboe
2006-02-15 15:30 ` Tejun Heo
2006-02-15 19:03 ` Mark Lord
2006-02-15 20:21 ` Jeff Garzik
2006-02-15 23:05 ` Mark Lord
2006-02-20 11:23 ` Jeff Garzik
2006-02-20 13:54 ` Mark Lord
2006-02-20 13:58 ` Jens Axboe
2006-02-16 7:42 ` Jens Axboe
2006-02-20 11:25 ` Jeff Garzik
2006-02-20 11:44 ` Jens Axboe
2006-02-20 21:59 ` 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=43EF8E61.5040409@pobox.com \
--to=jgarzik@pobox.com \
--cc=albertcc@tw.ibm.com \
--cc=htejun@gmail.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).