]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge /spare/repo/linux-2.6/
authorJeff Garzik <jgarzik@pretzel.yyz.us>
Sat, 18 Jun 2005 17:21:24 +0000 (13:21 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Sat, 18 Jun 2005 17:21:24 +0000 (13:21 -0400)
1  2 
drivers/scsi/libata-core.c

index 84c4770e5bb486be797286a4ef2cb440236f9b4f,9e58f134f68bf45767813d249220b322a33b005b..36b401fee1f184d0ba6edcebd48a21e463bab89f
@@@ -1295,37 -1295,6 +1295,37 @@@ err_out
        DPRINTK("EXIT, err\n");
  }
  
 +
 +static inline u8 ata_dev_knobble(struct ata_port *ap)
 +{
 +      return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id)));
 +}
 +
 +/**
 + *    ata_dev_config - Run device specific handlers and check for
 + *                     SATA->PATA bridges
 + *    @ap: Bus 
 + *    @i:  Device
 + *
 + *    LOCKING:
 + */
 + 
 +void ata_dev_config(struct ata_port *ap, unsigned int i)
 +{
 +      /* limit bridge transfers to udma5, 200 sectors */
 +      if (ata_dev_knobble(ap)) {
 +              printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
 +                      ap->id, ap->device->devno);
 +              ap->udma_mask &= ATA_UDMA5;
 +              ap->host->max_sectors = ATA_MAX_SECTORS;
 +              ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
 +              ap->device->flags |= ATA_DFLAG_LOCK_SECTORS;
 +      }
 +
 +      if (ap->ops->dev_config)
 +              ap->ops->dev_config(ap, &ap->device[i]);
 +}
 +
  /**
   *    ata_bus_probe - Reset and probe ATA bus
   *    @ap: Bus to probe
@@@ -1353,7 -1322,8 +1353,7 @@@ static int ata_bus_probe(struct ata_por
                ata_dev_identify(ap, i);
                if (ata_dev_present(&ap->device[i])) {
                        found = 1;
 -                      if (ap->ops->dev_config)
 -                              ap->ops->dev_config(ap, &ap->device[i]);
 +                      ata_dev_config(ap,i);
                }
        }
  
@@@ -2607,7 -2577,6 +2607,6 @@@ static void __atapi_pio_bytes(struct at
  next_sg:
        sg = &qc->sg[qc->cursg];
  
- next_page:
        page = sg->page;
        offset = sg->offset + qc->cursg_ofs;
  
        page = nth_page(page, (offset >> PAGE_SHIFT));
        offset %= PAGE_SIZE;
  
+       /* don't overrun current sg */
        count = min(sg->length - qc->cursg_ofs, bytes);
  
        /* don't cross page boundaries */
        kunmap(page);
  
        if (bytes) {
-               if (qc->cursg_ofs < sg->length)
-                       goto next_page;
                goto next_sg;
        }
  }
@@@ -4438,7 -4406,6 +4436,7 @@@ EXPORT_SYMBOL_GPL(ata_scsi_release)
  EXPORT_SYMBOL_GPL(ata_host_intr);
  EXPORT_SYMBOL_GPL(ata_dev_classify);
  EXPORT_SYMBOL_GPL(ata_dev_id_string);
 +EXPORT_SYMBOL_GPL(ata_dev_config);
  EXPORT_SYMBOL_GPL(ata_scsi_simulate);
  
  #ifdef CONFIG_PCI