Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-2.6.git

+19 -7
+7 -5
drivers/scsi/libata-core.c
··· 1253 1253 unsigned long timeout = jiffies + (HZ * 5); 1254 1254 1255 1255 if (ap->flags & ATA_FLAG_SATA_RESET) { 1256 - scr_write(ap, SCR_CONTROL, 0x301); /* issue phy wake/reset */ 1257 - scr_read(ap, SCR_STATUS); /* dummy read; flush */ 1256 + /* issue phy wake/reset */ 1257 + scr_write_flush(ap, SCR_CONTROL, 0x301); 1258 1258 udelay(400); /* FIXME: a guess */ 1259 1259 } 1260 - scr_write(ap, SCR_CONTROL, 0x300); /* issue phy wake/clear reset */ 1260 + scr_write_flush(ap, SCR_CONTROL, 0x300); /* phy wake/clear reset */ 1261 1261 1262 1262 /* wait for phy to become ready, if necessary */ 1263 1263 do { ··· 2539 2539 ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer)); 2540 2540 qc->dma_dir = DMA_FROM_DEVICE; 2541 2541 2542 - memset(&qc->cdb, 0, sizeof(ap->cdb_len)); 2542 + memset(&qc->cdb, 0, ap->cdb_len); 2543 2543 qc->cdb[0] = REQUEST_SENSE; 2544 2544 qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; 2545 2545 ··· 2811 2811 2812 2812 /* call completion callback */ 2813 2813 rc = qc->complete_fn(qc, drv_stat); 2814 + qc->flags &= ~ATA_QCFLAG_ACTIVE; 2814 2815 2815 2816 /* if callback indicates not to complete command (non-zero), 2816 2817 * return immediately ··· 3230 3229 struct ata_queued_cmd *qc; 3231 3230 3232 3231 qc = ata_qc_from_tag(ap, ap->active_tag); 3233 - if (qc && (!(qc->tf.ctl & ATA_NIEN))) 3232 + if (qc && (!(qc->tf.ctl & ATA_NIEN)) && 3233 + (qc->flags & ATA_QCFLAG_ACTIVE)) 3234 3234 handled |= ata_host_intr(ap, qc); 3235 3235 } 3236 3236 }
+4 -1
drivers/scsi/libata-scsi.c
··· 347 347 */ 348 348 if ((dev->flags & ATA_DFLAG_LBA48) && 349 349 ((dev->flags & ATA_DFLAG_LOCK_SECTORS) == 0)) { 350 - sdev->host->max_sectors = 2048; 350 + /* 351 + * do not overwrite sdev->host->max_sectors, since 352 + * other drives on this host may not support LBA48 353 + */ 351 354 blk_queue_max_sectors(sdev->request_queue, 2048); 352 355 } 353 356 }
+1 -1
drivers/scsi/sata_svw.c
··· 395 395 396 396 /* Clear a magic bit in SCR1 according to Darwin, those help 397 397 * some funky seagate drives (though so far, those were already 398 - * set by the firmware on the machines I had access to 398 + * set by the firmware on the machines I had access to) 399 399 */ 400 400 writel(readl(mmio_base + K2_SATA_SICR1_OFFSET) & ~0x00040000, 401 401 mmio_base + K2_SATA_SICR1_OFFSET);
+7
include/linux/libata.h
··· 584 584 ap->ops->scr_write(ap, reg, val); 585 585 } 586 586 587 + static inline void scr_write_flush(struct ata_port *ap, unsigned int reg, 588 + u32 val) 589 + { 590 + ap->ops->scr_write(ap, reg, val); 591 + (void) ap->ops->scr_read(ap, reg); 592 + } 593 + 587 594 static inline unsigned int sata_dev_present(struct ata_port *ap) 588 595 { 589 596 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;