diff options
author | Tejun Heo <htejun@gmail.com> | 2006-08-10 03:59:07 -0400 |
---|---|---|
committer | Tejun Heo <htejun@gmail.com> | 2006-08-10 03:59:07 -0400 |
commit | 37deecb5139ee431233781a9a093d9fcaab54c5b (patch) | |
tree | ddc3d31e2517619437dfefd311a6d978ba246ae9 /drivers | |
parent | 6d0500df5b37c94b779ac2c3f522ff917e039f99 (diff) |
[PATCH] libata: implement per-dev xfermask
Implement per-dev xfermask. libata used to determine xfermask
per-port - the fastest mode of the slowest device on the port. This
patch enables per-dev xfermask.
Original patch is from Alan Cox <alan@redhat.com>. The following
changes are made by me.
* simplex warning message is added
* remove disabled device handling code which is never invoked
(originally for choosing port-wide lowest PIO mode)
Cc: Alan Cox <alan@redhat.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libata-core.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 38fc75d6b39c..4e6c2e8ac0f6 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -3040,10 +3040,6 @@ static int ata_dma_blacklisted(const struct ata_device *dev) | |||
3040 | * known limits including host controller limits, device | 3040 | * known limits including host controller limits, device |
3041 | * blacklist, etc... | 3041 | * blacklist, etc... |
3042 | * | 3042 | * |
3043 | * FIXME: The current implementation limits all transfer modes to | ||
3044 | * the fastest of the lowested device on the port. This is not | ||
3045 | * required on most controllers. | ||
3046 | * | ||
3047 | * LOCKING: | 3043 | * LOCKING: |
3048 | * None. | 3044 | * None. |
3049 | */ | 3045 | */ |
@@ -3052,8 +3048,8 @@ static void ata_dev_xfermask(struct ata_device *dev) | |||
3052 | struct ata_port *ap = dev->ap; | 3048 | struct ata_port *ap = dev->ap; |
3053 | struct ata_host_set *hs = ap->host_set; | 3049 | struct ata_host_set *hs = ap->host_set; |
3054 | unsigned long xfer_mask; | 3050 | unsigned long xfer_mask; |
3055 | int i; | ||
3056 | 3051 | ||
3052 | /* controller modes available */ | ||
3057 | xfer_mask = ata_pack_xfermask(ap->pio_mask, | 3053 | xfer_mask = ata_pack_xfermask(ap->pio_mask, |
3058 | ap->mwdma_mask, ap->udma_mask); | 3054 | ap->mwdma_mask, ap->udma_mask); |
3059 | 3055 | ||
@@ -3063,34 +3059,20 @@ static void ata_dev_xfermask(struct ata_device *dev) | |||
3063 | if (ap->cbl == ATA_CBL_PATA40) | 3059 | if (ap->cbl == ATA_CBL_PATA40) |
3064 | xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); | 3060 | xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); |
3065 | 3061 | ||
3066 | /* FIXME: Use port-wide xfermask for now */ | 3062 | xfer_mask &= ata_pack_xfermask(dev->pio_mask, |
3067 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 3063 | dev->mwdma_mask, dev->udma_mask); |
3068 | struct ata_device *d = &ap->device[i]; | 3064 | xfer_mask &= ata_id_xfermask(dev->id); |
3069 | |||
3070 | if (ata_dev_absent(d)) | ||
3071 | continue; | ||
3072 | 3065 | ||
3073 | if (ata_dev_disabled(d)) { | 3066 | if (ata_dma_blacklisted(dev)) { |
3074 | /* to avoid violating device selection timing */ | 3067 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); |
3075 | xfer_mask &= ata_pack_xfermask(d->pio_mask, | ||
3076 | UINT_MAX, UINT_MAX); | ||
3077 | continue; | ||
3078 | } | ||
3079 | |||
3080 | xfer_mask &= ata_pack_xfermask(d->pio_mask, | ||
3081 | d->mwdma_mask, d->udma_mask); | ||
3082 | xfer_mask &= ata_id_xfermask(d->id); | ||
3083 | if (ata_dma_blacklisted(d)) | ||
3084 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); | ||
3085 | } | ||
3086 | |||
3087 | if (ata_dma_blacklisted(dev)) | ||
3088 | ata_dev_printk(dev, KERN_WARNING, | 3068 | ata_dev_printk(dev, KERN_WARNING, |
3089 | "device is on DMA blacklist, disabling DMA\n"); | 3069 | "device is on DMA blacklist, disabling DMA\n"); |
3070 | } | ||
3090 | 3071 | ||
3091 | if (hs->flags & ATA_HOST_SIMPLEX) { | 3072 | if ((hs->flags & ATA_HOST_SIMPLEX) && hs->simplex_claimed) { |
3092 | if (hs->simplex_claimed) | 3073 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); |
3093 | xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); | 3074 | ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " |
3075 | "other device, disabling DMA\n"); | ||
3094 | } | 3076 | } |
3095 | 3077 | ||
3096 | if (ap->ops->mode_filter) | 3078 | if (ap->ops->mode_filter) |