aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c43
-rw-r--r--drivers/ata/libata-eh.c2
-rw-r--r--drivers/ata/pata_ali.c40
-rw-r--r--drivers/ata/pata_sil680.c6
-rw-r--r--drivers/ata/sata_fsl.c8
5 files changed, 88 insertions, 11 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c4248b37ff64..be95fdb69726 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -326,6 +326,44 @@ static void ata_force_horkage(struct ata_device *dev)
326} 326}
327 327
328/** 328/**
329 * atapi_cmd_type - Determine ATAPI command type from SCSI opcode
330 * @opcode: SCSI opcode
331 *
332 * Determine ATAPI command type from @opcode.
333 *
334 * LOCKING:
335 * None.
336 *
337 * RETURNS:
338 * ATAPI_{READ|WRITE|READ_CD|PASS_THRU|MISC}
339 */
340int atapi_cmd_type(u8 opcode)
341{
342 switch (opcode) {
343 case GPCMD_READ_10:
344 case GPCMD_READ_12:
345 return ATAPI_READ;
346
347 case GPCMD_WRITE_10:
348 case GPCMD_WRITE_12:
349 case GPCMD_WRITE_AND_VERIFY_10:
350 return ATAPI_WRITE;
351
352 case GPCMD_READ_CD:
353 case GPCMD_READ_CD_MSF:
354 return ATAPI_READ_CD;
355
356 case ATA_16:
357 case ATA_12:
358 if (atapi_passthru16)
359 return ATAPI_PASS_THRU;
360 /* fall thru */
361 default:
362 return ATAPI_MISC;
363 }
364}
365
366/**
329 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure 367 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
330 * @tf: Taskfile to convert 368 * @tf: Taskfile to convert
331 * @pmp: Port multiplier port 369 * @pmp: Port multiplier port
@@ -972,7 +1010,7 @@ static void ata_dev_disable_pm(struct ata_device *dev)
972void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy) 1010void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy)
973{ 1011{
974 ap->pm_policy = policy; 1012 ap->pm_policy = policy;
975 ap->link.eh_info.action |= ATA_EHI_LPM; 1013 ap->link.eh_info.action |= ATA_EH_LPM;
976 ap->link.eh_info.flags |= ATA_EHI_NO_AUTOPSY; 1014 ap->link.eh_info.flags |= ATA_EHI_NO_AUTOPSY;
977 ata_port_schedule_eh(ap); 1015 ata_port_schedule_eh(ap);
978} 1016}
@@ -2660,7 +2698,7 @@ int ata_bus_probe(struct ata_port *ap)
2660 specific sequence bass-ackwards so that PDIAG- is released by 2698 specific sequence bass-ackwards so that PDIAG- is released by
2661 the slave device */ 2699 the slave device */
2662 2700
2663 ata_link_for_each_dev(dev, &ap->link) { 2701 ata_link_for_each_dev_reverse(dev, &ap->link) {
2664 if (tries[dev->devno]) 2702 if (tries[dev->devno])
2665 dev->class = classes[dev->devno]; 2703 dev->class = classes[dev->devno];
2666 2704
@@ -7774,6 +7812,7 @@ EXPORT_SYMBOL_GPL(ata_tf_read);
7774EXPORT_SYMBOL_GPL(ata_noop_dev_select); 7812EXPORT_SYMBOL_GPL(ata_noop_dev_select);
7775EXPORT_SYMBOL_GPL(ata_std_dev_select); 7813EXPORT_SYMBOL_GPL(ata_std_dev_select);
7776EXPORT_SYMBOL_GPL(sata_print_link_status); 7814EXPORT_SYMBOL_GPL(sata_print_link_status);
7815EXPORT_SYMBOL_GPL(atapi_cmd_type);
7777EXPORT_SYMBOL_GPL(ata_tf_to_fis); 7816EXPORT_SYMBOL_GPL(ata_tf_to_fis);
7778EXPORT_SYMBOL_GPL(ata_tf_from_fis); 7817EXPORT_SYMBOL_GPL(ata_tf_from_fis);
7779EXPORT_SYMBOL_GPL(ata_pack_xfermask); 7818EXPORT_SYMBOL_GPL(ata_pack_xfermask);
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 681252fd8143..a5830329eda4 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2748,7 +2748,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
2748 ehc->i.flags &= ~ATA_EHI_SETMODE; 2748 ehc->i.flags &= ~ATA_EHI_SETMODE;
2749 } 2749 }
2750 2750
2751 if (ehc->i.action & ATA_EHI_LPM) 2751 if (ehc->i.action & ATA_EH_LPM)
2752 ata_link_for_each_dev(dev, link) 2752 ata_link_for_each_dev(dev, link)
2753 ata_dev_enable_pm(dev, ap->pm_policy); 2753 ata_dev_enable_pm(dev, ap->pm_policy);
2754 2754
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 8786455c901d..ce830fe3a362 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -36,6 +36,10 @@
36#define DRV_NAME "pata_ali" 36#define DRV_NAME "pata_ali"
37#define DRV_VERSION "0.7.5" 37#define DRV_VERSION "0.7.5"
38 38
39int ali_atapi_dma = 0;
40module_param_named(atapi_dma, ali_atapi_dma, int, 0644);
41MODULE_PARM_DESC(atapi_dma, "Enable ATAPI DMA (0=disable, 1=enable)");
42
39/* 43/*
40 * Cable special cases 44 * Cable special cases
41 */ 45 */
@@ -270,6 +274,27 @@ static void ali_set_dmamode(struct ata_port *ap, struct ata_device *adev)
270} 274}
271 275
272/** 276/**
277 * ali_warn_atapi_dma - Warn about ATAPI DMA disablement
278 * @adev: Device
279 *
280 * Whine about ATAPI DMA disablement if @adev is an ATAPI device.
281 * Can be used as ->dev_config.
282 */
283
284static void ali_warn_atapi_dma(struct ata_device *adev)
285{
286 struct ata_eh_context *ehc = &adev->link->eh_context;
287 int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
288
289 if (print_info && adev->class == ATA_DEV_ATAPI && !ali_atapi_dma) {
290 ata_dev_printk(adev, KERN_WARNING,
291 "WARNING: ATAPI DMA disabled for reliablity issues. It can be enabled\n");
292 ata_dev_printk(adev, KERN_WARNING,
293 "WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.\n");
294 }
295}
296
297/**
273 * ali_lock_sectors - Keep older devices to 255 sector mode 298 * ali_lock_sectors - Keep older devices to 255 sector mode
274 * @adev: Device 299 * @adev: Device
275 * 300 *
@@ -283,6 +308,7 @@ static void ali_set_dmamode(struct ata_port *ap, struct ata_device *adev)
283static void ali_lock_sectors(struct ata_device *adev) 308static void ali_lock_sectors(struct ata_device *adev)
284{ 309{
285 adev->max_sectors = 255; 310 adev->max_sectors = 255;
311 ali_warn_atapi_dma(adev);
286} 312}
287 313
288/** 314/**
@@ -294,6 +320,18 @@ static void ali_lock_sectors(struct ata_device *adev)
294 320
295static int ali_check_atapi_dma(struct ata_queued_cmd *qc) 321static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
296{ 322{
323 if (!ali_atapi_dma) {
324 /* FIXME: pata_ali can't do ATAPI DMA reliably but the
325 * IDE alim15x3 driver can. I tried lots of things
326 * but couldn't find what the actual difference was.
327 * If you got an idea, please write it to
328 * linux-ide@vger.kernel.org and cc htejun@gmail.com.
329 *
330 * Disable ATAPI DMA for now.
331 */
332 return -EOPNOTSUPP;
333 }
334
297 /* If its not a media command, its not worth it */ 335 /* If its not a media command, its not worth it */
298 if (atapi_cmd_type(qc->cdb[0]) == ATAPI_MISC) 336 if (atapi_cmd_type(qc->cdb[0]) == ATAPI_MISC)
299 return -EOPNOTSUPP; 337 return -EOPNOTSUPP;
@@ -359,6 +397,7 @@ static struct ata_port_operations ali_20_port_ops = {
359 397
360 .tf_load = ata_tf_load, 398 .tf_load = ata_tf_load,
361 .tf_read = ata_tf_read, 399 .tf_read = ata_tf_read,
400 .check_atapi_dma = ali_check_atapi_dma,
362 .check_status = ata_check_status, 401 .check_status = ata_check_status,
363 .exec_command = ata_exec_command, 402 .exec_command = ata_exec_command,
364 .dev_select = ata_std_dev_select, 403 .dev_select = ata_std_dev_select,
@@ -438,6 +477,7 @@ static struct ata_port_operations ali_c5_port_ops = {
438 .check_status = ata_check_status, 477 .check_status = ata_check_status,
439 .exec_command = ata_exec_command, 478 .exec_command = ata_exec_command,
440 .dev_select = ata_std_dev_select, 479 .dev_select = ata_std_dev_select,
480 .dev_config = ali_warn_atapi_dma,
441 481
442 .freeze = ata_bmdma_freeze, 482 .freeze = ata_bmdma_freeze,
443 .thaw = ata_bmdma_thaw, 483 .thaw = ata_bmdma_thaw,
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 503245a1eafa..7c5b2dd9a1a1 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -269,7 +269,11 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
269 dev_dbg(&pdev->dev, "sil680: BA5_EN = %d clock = %02X\n", 269 dev_dbg(&pdev->dev, "sil680: BA5_EN = %d clock = %02X\n",
270 tmpbyte & 1, tmpbyte & 0x30); 270 tmpbyte & 1, tmpbyte & 0x30);
271 271
272 *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5); 272 *try_mmio = 0;
273#ifdef CONFIG_PPC_MERGE
274 if (machine_is(cell))
275 *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);
276#endif
273 277
274 switch(tmpbyte & 0x30) { 278 switch(tmpbyte & 0x30) {
275 case 0x00: 279 case 0x00:
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 07791a7a48a5..9d1e3cad4aa9 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1256,7 +1256,6 @@ static int sata_fsl_probe(struct of_device *ofdev,
1256 void __iomem *ssr_base = NULL; 1256 void __iomem *ssr_base = NULL;
1257 void __iomem *csr_base = NULL; 1257 void __iomem *csr_base = NULL;
1258 struct sata_fsl_host_priv *host_priv = NULL; 1258 struct sata_fsl_host_priv *host_priv = NULL;
1259 struct resource *r;
1260 int irq; 1259 int irq;
1261 struct ata_host *host; 1260 struct ata_host *host;
1262 1261
@@ -1266,8 +1265,6 @@ static int sata_fsl_probe(struct of_device *ofdev,
1266 dev_printk(KERN_INFO, &ofdev->dev, 1265 dev_printk(KERN_INFO, &ofdev->dev,
1267 "Sata FSL Platform/CSB Driver init\n"); 1266 "Sata FSL Platform/CSB Driver init\n");
1268 1267
1269 r = kmalloc(sizeof(struct resource), GFP_KERNEL);
1270
1271 hcr_base = of_iomap(ofdev->node, 0); 1268 hcr_base = of_iomap(ofdev->node, 0);
1272 if (!hcr_base) 1269 if (!hcr_base)
1273 goto error_exit_with_cleanup; 1270 goto error_exit_with_cleanup;
@@ -1348,10 +1345,7 @@ static int sata_fsl_remove(struct of_device *ofdev)
1348 1345
1349static struct of_device_id fsl_sata_match[] = { 1346static struct of_device_id fsl_sata_match[] = {
1350 { 1347 {
1351 .compatible = "fsl,mpc8315-sata", 1348 .compatible = "fsl,pq-sata",
1352 },
1353 {
1354 .compatible = "fsl,mpc8379-sata",
1355 }, 1349 },
1356 {}, 1350 {},
1357}; 1351};