aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
committerJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
commit4b7bd364700d9ac8372eff48832062b936d0793b (patch)
tree0dbf78c95456a0b02d07fcd473281f04a87e266d /drivers/ata
parentc0d8768af260e2cbb4bf659ae6094a262c86b085 (diff)
parent90a8a73c06cc32b609a880d48449d7083327e11a (diff)
Merge branch 'master' into for-next
Conflicts: MAINTAINERS arch/arm/mach-omap2/pm24xx.c drivers/scsi/bfa/bfa_fcpim.c Needed to update to apply fixes for which the old branch was too outdated.
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-scsi.c24
-rw-r--r--drivers/ata/pata_legacy.c2
-rw-r--r--drivers/ata/pata_octeon_cf.c2
-rw-r--r--drivers/ata/sata_via.c9
4 files changed, 19 insertions, 18 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index d050e073e570..66aa4bee80a6 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2552,8 +2552,11 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
2552 * 2552 *
2553 * If door lock fails, always clear sdev->locked to 2553 * If door lock fails, always clear sdev->locked to
2554 * avoid this infinite loop. 2554 * avoid this infinite loop.
2555 *
2556 * This may happen before SCSI scan is complete. Make
2557 * sure qc->dev->sdev isn't NULL before dereferencing.
2555 */ 2558 */
2556 if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL) 2559 if (qc->cdb[0] == ALLOW_MEDIUM_REMOVAL && qc->dev->sdev)
2557 qc->dev->sdev->locked = 0; 2560 qc->dev->sdev->locked = 0;
2558 2561
2559 qc->scsicmd->result = SAM_STAT_CHECK_CONDITION; 2562 qc->scsicmd->result = SAM_STAT_CHECK_CONDITION;
@@ -3163,8 +3166,8 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
3163 3166
3164/** 3167/**
3165 * ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device 3168 * ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device
3169 * @shost: SCSI host of command to be sent
3166 * @cmd: SCSI command to be sent 3170 * @cmd: SCSI command to be sent
3167 * @done: Completion function, called when command is complete
3168 * 3171 *
3169 * In some cases, this function translates SCSI commands into 3172 * In some cases, this function translates SCSI commands into
3170 * ATA taskfiles, and queues the taskfiles to be sent to 3173 * ATA taskfiles, and queues the taskfiles to be sent to
@@ -3174,37 +3177,36 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
3174 * ATA and ATAPI devices appearing as SCSI devices. 3177 * ATA and ATAPI devices appearing as SCSI devices.
3175 * 3178 *
3176 * LOCKING: 3179 * LOCKING:
3177 * Releases scsi-layer-held lock, and obtains host lock. 3180 * ATA host lock
3178 * 3181 *
3179 * RETURNS: 3182 * RETURNS:
3180 * Return value from __ata_scsi_queuecmd() if @cmd can be queued, 3183 * Return value from __ata_scsi_queuecmd() if @cmd can be queued,
3181 * 0 otherwise. 3184 * 0 otherwise.
3182 */ 3185 */
3183int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 3186int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
3184{ 3187{
3185 struct ata_port *ap; 3188 struct ata_port *ap;
3186 struct ata_device *dev; 3189 struct ata_device *dev;
3187 struct scsi_device *scsidev = cmd->device; 3190 struct scsi_device *scsidev = cmd->device;
3188 struct Scsi_Host *shost = scsidev->host;
3189 int rc = 0; 3191 int rc = 0;
3192 unsigned long irq_flags;
3190 3193
3191 ap = ata_shost_to_port(shost); 3194 ap = ata_shost_to_port(shost);
3192 3195
3193 spin_unlock(shost->host_lock); 3196 spin_lock_irqsave(ap->lock, irq_flags);
3194 spin_lock(ap->lock);
3195 3197
3196 ata_scsi_dump_cdb(ap, cmd); 3198 ata_scsi_dump_cdb(ap, cmd);
3197 3199
3198 dev = ata_scsi_find_dev(ap, scsidev); 3200 dev = ata_scsi_find_dev(ap, scsidev);
3199 if (likely(dev)) 3201 if (likely(dev))
3200 rc = __ata_scsi_queuecmd(cmd, done, dev); 3202 rc = __ata_scsi_queuecmd(cmd, cmd->scsi_done, dev);
3201 else { 3203 else {
3202 cmd->result = (DID_BAD_TARGET << 16); 3204 cmd->result = (DID_BAD_TARGET << 16);
3203 done(cmd); 3205 cmd->scsi_done(cmd);
3204 } 3206 }
3205 3207
3206 spin_unlock(ap->lock); 3208 spin_unlock_irqrestore(ap->lock, irq_flags);
3207 spin_lock(shost->host_lock); 3209
3208 return rc; 3210 return rc;
3209} 3211}
3210 3212
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index eaf194138f21..6bd9425ba5ab 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -142,7 +142,7 @@ static int autospeed; /* Chip present which snoops speed changes */
142static int pio_mask = ATA_PIO4; /* PIO range for autospeed devices */ 142static int pio_mask = ATA_PIO4; /* PIO range for autospeed devices */
143static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ 143static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */
144 144
145#ifdef PATA_WINBOND_VLB_MODULE 145#ifdef CONFIG_PATA_WINBOND_VLB_MODULE
146static int winbond = 1; /* Set to probe Winbond controllers, 146static int winbond = 1; /* Set to probe Winbond controllers,
147 give I/O port if non standard */ 147 give I/O port if non standard */
148#else 148#else
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 74b829817891..fa1b95a9a7ff 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -653,8 +653,6 @@ static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance)
653 653
654 ap = host->ports[i]; 654 ap = host->ports[i];
655 ocd = ap->dev->platform_data; 655 ocd = ap->dev->platform_data;
656
657 ocd = ap->dev->platform_data;
658 cf_port = ap->private_data; 656 cf_port = ap->private_data;
659 dma_int.u64 = 657 dma_int.u64 =
660 cvmx_read_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine)); 658 cvmx_read_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine));
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index c21589986c69..8b677bbf2d37 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -538,7 +538,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
538 return 0; 538 return 0;
539} 539}
540 540
541static void svia_configure(struct pci_dev *pdev) 541static void svia_configure(struct pci_dev *pdev, int board_id)
542{ 542{
543 u8 tmp8; 543 u8 tmp8;
544 544
@@ -577,7 +577,7 @@ static void svia_configure(struct pci_dev *pdev)
577 } 577 }
578 578
579 /* 579 /*
580 * vt6421 has problems talking to some drives. The following 580 * vt6420/1 has problems talking to some drives. The following
581 * is the fix from Joseph Chan <JosephChan@via.com.tw>. 581 * is the fix from Joseph Chan <JosephChan@via.com.tw>.
582 * 582 *
583 * When host issues HOLD, device may send up to 20DW of data 583 * When host issues HOLD, device may send up to 20DW of data
@@ -596,8 +596,9 @@ static void svia_configure(struct pci_dev *pdev)
596 * 596 *
597 * https://bugzilla.kernel.org/show_bug.cgi?id=15173 597 * https://bugzilla.kernel.org/show_bug.cgi?id=15173
598 * http://article.gmane.org/gmane.linux.ide/46352 598 * http://article.gmane.org/gmane.linux.ide/46352
599 * http://thread.gmane.org/gmane.linux.kernel/1062139
599 */ 600 */
600 if (pdev->device == 0x3249) { 601 if (board_id == vt6420 || board_id == vt6421) {
601 pci_read_config_byte(pdev, 0x52, &tmp8); 602 pci_read_config_byte(pdev, 0x52, &tmp8);
602 tmp8 |= 1 << 2; 603 tmp8 |= 1 << 2;
603 pci_write_config_byte(pdev, 0x52, tmp8); 604 pci_write_config_byte(pdev, 0x52, tmp8);
@@ -652,7 +653,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
652 if (rc) 653 if (rc)
653 return rc; 654 return rc;
654 655
655 svia_configure(pdev); 656 svia_configure(pdev, board_id);
656 657
657 pci_set_master(pdev); 658 pci_set_master(pdev);
658 return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt, 659 return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,