]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'master'
authorJeff Garzik <jgarzik@pobox.com>
Sun, 30 Oct 2005 06:56:31 +0000 (01:56 -0500)
committerJeff Garzik <jgarzik@pobox.com>
Sun, 30 Oct 2005 06:56:31 +0000 (01:56 -0500)
1  2 
drivers/scsi/libata-core.c

index d2f71a2331bb0a638422c091dcdc5be25ff0606f,5ca97605ff3565ac914cd92c3ed934f739d56297..771bc7d376bc2e73a7861ce76fae9f8f37663f1a
@@@ -49,6 -49,7 +49,7 @@@
  #include <linux/suspend.h>
  #include <linux/workqueue.h>
  #include <linux/jiffies.h>
+ #include <linux/scatterlist.h>
  #include <scsi/scsi.h>
  #include "scsi.h"
  #include "scsi_priv.h"
@@@ -371,7 -372,7 +372,7 @@@ static void ata_tf_read_pio(struct ata_
        struct ata_ioports *ioaddr = &ap->ioaddr;
  
        tf->command = ata_check_status(ap);
 -      tf->feature = ata_chk_err(ap);
 +      tf->feature = inb(ioaddr->error_addr);
        tf->nsect = inb(ioaddr->nsect_addr);
        tf->lbal = inb(ioaddr->lbal_addr);
        tf->lbam = inb(ioaddr->lbam_addr);
@@@ -405,7 -406,7 +406,7 @@@ static void ata_tf_read_mmio(struct ata
        struct ata_ioports *ioaddr = &ap->ioaddr;
  
        tf->command = ata_check_status(ap);
 -      tf->feature = ata_chk_err(ap);
 +      tf->feature = readb((void __iomem *)ioaddr->error_addr);
        tf->nsect = readb((void __iomem *)ioaddr->nsect_addr);
        tf->lbal = readb((void __iomem *)ioaddr->lbal_addr);
        tf->lbam = readb((void __iomem *)ioaddr->lbam_addr);
@@@ -525,6 -526,30 +526,6 @@@ u8 ata_altstatus(struct ata_port *ap
  }
  
  
 -/**
 - *    ata_chk_err - Read device error reg
 - *    @ap: port where the device is
 - *
 - *    Reads ATA taskfile error register for
 - *    currently-selected device and return its value.
 - *
 - *    Note: may NOT be used as the check_err() entry in
 - *    ata_port_operations.
 - *
 - *    LOCKING:
 - *    Inherited from caller.
 - */
 -u8 ata_chk_err(struct ata_port *ap)
 -{
 -      if (ap->ops->check_err)
 -              return ap->ops->check_err(ap);
 -
 -      if (ap->flags & ATA_FLAG_MMIO) {
 -              return readb((void __iomem *) ap->ioaddr.error_addr);
 -      }
 -      return inb(ap->ioaddr.error_addr);
 -}
 -
  /**
   *    ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
   *    @tf: Taskfile to convert
@@@ -877,8 -902,8 +878,8 @@@ static u8 ata_dev_try_classify(struct a
  
        memset(&tf, 0, sizeof(tf));
  
 -      err = ata_chk_err(ap);
        ap->ops->tf_read(ap, &tf);
 +      err = tf.feature;
  
        dev->class = ATA_DEV_NONE;
  
@@@ -1115,6 -1140,7 +1116,6 @@@ static void ata_dev_identify(struct ata
        unsigned int major_version;
        u16 tmp;
        unsigned long xfer_modes;
 -      u8 status;
        unsigned int using_edd;
        DECLARE_COMPLETION(wait);
        struct ata_queued_cmd *qc;
@@@ -1168,11 -1194,8 +1169,11 @@@ retry
        else
                wait_for_completion(&wait);
  
 -      status = ata_chk_status(ap);
 -      if (status & ATA_ERR) {
 +      spin_lock_irqsave(&ap->host_set->lock, flags);
 +      ap->ops->tf_read(ap, &qc->tf);
 +      spin_unlock_irqrestore(&ap->host_set->lock, flags);
 +
 +      if (qc->tf.command & ATA_ERR) {
                /*
                 * arg!  EDD works for all test cases, but seems to return
                 * the ATA signature for some ATAPI devices.  Until the
                 * to have this problem.
                 */
                if ((using_edd) && (qc->tf.command == ATA_CMD_ID_ATA)) {
 -                      u8 err = ata_chk_err(ap);
 +                      u8 err = qc->tf.feature;
                        if (err & ATA_ABORTED) {
                                dev->class = ATA_DEV_ATAPI;
                                qc->cursg = 0;
@@@ -2554,19 -2577,12 +2555,12 @@@ void ata_qc_prep(struct ata_queued_cmd 
  
  void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
  {
-       struct scatterlist *sg;
        qc->flags |= ATA_QCFLAG_SINGLE;
  
-       memset(&qc->sgent, 0, sizeof(qc->sgent));
        qc->sg = &qc->sgent;
        qc->n_elem = 1;
        qc->buf_virt = buf;
-       sg = qc->sg;
-       sg->page = virt_to_page(buf);
-       sg->offset = (unsigned long) buf & ~PAGE_MASK;
-       sg->length = buflen;
+       sg_init_one(qc->sg, buf, buflen);
  }
  
  /**
@@@ -4851,6 -4867,7 +4845,6 @@@ EXPORT_SYMBOL_GPL(ata_tf_to_fis)
  EXPORT_SYMBOL_GPL(ata_tf_from_fis);
  EXPORT_SYMBOL_GPL(ata_check_status);
  EXPORT_SYMBOL_GPL(ata_altstatus);
 -EXPORT_SYMBOL_GPL(ata_chk_err);
  EXPORT_SYMBOL_GPL(ata_exec_command);
  EXPORT_SYMBOL_GPL(ata_port_start);
  EXPORT_SYMBOL_GPL(ata_port_stop);