aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-04-15 18:51:59 -0400
committerJeff Garzik <jgarzik@pobox.com>2011-07-23 17:57:36 -0400
commita9a79dfec239568bdbf778242f8fcd10bcc5b9e2 (patch)
tree620648585f89cdb589d1625431f8c21ef70a9258 /drivers
parenta44fec1fce5d5d14cc3ac4545b8da346394de666 (diff)
ata: Convert ata_<foo>_printk(KERN_<LEVEL> to ata_<foo>_<level>
Saves text by removing nearly duplicated text format strings by creating ata_<foo>_printk functions and printf extension %pV. ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB) Format string duplication comes from: #define ata_link_printk(link, lv, fmt, args...) do { \ if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ (link)->pmp , ##args); \ else \ printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \ } while(0) Coalesce long formats. $ size drivers/ata/built-in.* text data bss dec hex filename 544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o 558429 73893 117864 750186 b726a drivers/ata/built-in.allyesconfig.dev_level.o 141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o 149567 14689 4220 168476 2921c drivers/ata/built-in.defconfig.dev_level.o Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ahci.c5
-rw-r--r--drivers/ata/ata_generic.c5
-rw-r--r--drivers/ata/libahci.c24
-rw-r--r--drivers/ata/libata-acpi.c66
-rw-r--r--drivers/ata/libata-core.c381
-rw-r--r--drivers/ata/libata-eh.c143
-rw-r--r--drivers/ata/libata-pmp.c123
-rw-r--r--drivers/ata/libata-scsi.c22
-rw-r--r--drivers/ata/libata-sff.c32
-rw-r--r--drivers/ata/pata_ali.c8
-rw-r--r--drivers/ata/pata_amd.c2
-rw-r--r--drivers/ata/pata_bf54x.c4
-rw-r--r--drivers/ata/pata_icside.c4
-rw-r--r--drivers/ata/pata_it821x.c14
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c2
-rw-r--r--drivers/ata/pata_legacy.c2
-rw-r--r--drivers/ata/pata_macio.c5
-rw-r--r--drivers/ata/pata_octeon_cf.c2
-rw-r--r--drivers/ata/pata_pcmcia.c5
-rw-r--r--drivers/ata/pata_platform.c2
-rw-r--r--drivers/ata/pata_rz1000.c2
-rw-r--r--drivers/ata/pata_samsung_cf.c2
-rw-r--r--drivers/ata/pata_scc.c3
-rw-r--r--drivers/ata/pata_via.c4
-rw-r--r--drivers/ata/sata_fsl.c29
-rw-r--r--drivers/ata/sata_inic162x.c15
-rw-r--r--drivers/ata/sata_mv.c41
-rw-r--r--drivers/ata/sata_nv.c69
-rw-r--r--drivers/ata/sata_sil.c8
-rw-r--r--drivers/ata/sata_sil24.c17
-rw-r--r--drivers/ata/sata_via.c6
31 files changed, 526 insertions, 521 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index dda85116343e..85f7b148f1a1 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -540,9 +540,8 @@ static int ahci_sb600_softreset(struct ata_link *link, unsigned int *class,
540 if (rc == -EIO) { 540 if (rc == -EIO) {
541 irq_sts = readl(port_mmio + PORT_IRQ_STAT); 541 irq_sts = readl(port_mmio + PORT_IRQ_STAT);
542 if (irq_sts & PORT_IRQ_BAD_PMP) { 542 if (irq_sts & PORT_IRQ_BAD_PMP) {
543 ata_link_printk(link, KERN_WARNING, 543 ata_link_warn(link,
544 "applying SB600 PMP SRST workaround " 544 "applying SB600 PMP SRST workaround and retrying\n");
545 "and retrying\n");
546 rc = ahci_do_softreset(link, class, 0, deadline, 545 rc = ahci_do_softreset(link, class, 0, deadline,
547 ahci_check_ready); 546 ahci_check_ready);
548 } 547 }
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 721d38bfa339..7df56ec31819 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -81,14 +81,13 @@ static int generic_set_mode(struct ata_link *link, struct ata_device **unused)
81 xfer_mask |= ata_xfer_mode2mask(XFER_MW_DMA_0); 81 xfer_mask |= ata_xfer_mode2mask(XFER_MW_DMA_0);
82 } 82 }
83 83
84 ata_dev_printk(dev, KERN_INFO, "configured for %s\n", 84 ata_dev_info(dev, "configured for %s\n", name);
85 name);
86 85
87 dev->xfer_mode = ata_xfer_mask2mode(xfer_mask); 86 dev->xfer_mode = ata_xfer_mask2mode(xfer_mask);
88 dev->xfer_shift = ata_xfer_mode2shift(dev->xfer_mode); 87 dev->xfer_shift = ata_xfer_mode2shift(dev->xfer_mode);
89 dev->flags &= ~ATA_DFLAG_PIO; 88 dev->flags &= ~ATA_DFLAG_PIO;
90 } else { 89 } else {
91 ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); 90 ata_dev_info(dev, "configured for PIO\n");
92 dev->xfer_mode = XFER_PIO_0; 91 dev->xfer_mode = XFER_PIO_0;
93 dev->xfer_shift = ATA_SHIFT_PIO; 92 dev->xfer_shift = ATA_SHIFT_PIO;
94 dev->flags |= ATA_DFLAG_PIO; 93 dev->flags |= ATA_DFLAG_PIO;
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 39761f50a3e2..c102d7d64282 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -286,10 +286,10 @@ static ssize_t ahci_read_em_buffer(struct device *dev,
286 /* the count should not be larger than PAGE_SIZE */ 286 /* the count should not be larger than PAGE_SIZE */
287 if (count > PAGE_SIZE) { 287 if (count > PAGE_SIZE) {
288 if (printk_ratelimit()) 288 if (printk_ratelimit())
289 ata_port_printk(ap, KERN_WARNING, 289 ata_port_warn(ap,
290 "EM read buffer size too large: " 290 "EM read buffer size too large: "
291 "buffer size %u, page size %lu\n", 291 "buffer size %u, page size %lu\n",
292 hpriv->em_buf_sz, PAGE_SIZE); 292 hpriv->em_buf_sz, PAGE_SIZE);
293 count = PAGE_SIZE; 293 count = PAGE_SIZE;
294 } 294 }
295 295
@@ -1124,8 +1124,8 @@ static void ahci_dev_config(struct ata_device *dev)
1124 1124
1125 if (hpriv->flags & AHCI_HFLAG_SECT255) { 1125 if (hpriv->flags & AHCI_HFLAG_SECT255) {
1126 dev->max_sectors = 255; 1126 dev->max_sectors = 255;
1127 ata_dev_printk(dev, KERN_INFO, 1127 ata_dev_info(dev,
1128 "SB600 AHCI: limiting to 255 sectors per cmd\n"); 1128 "SB600 AHCI: limiting to 255 sectors per cmd\n");
1129 } 1129 }
1130} 1130}
1131 1131
@@ -1249,8 +1249,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
1249 /* prepare for SRST (AHCI-1.1 10.4.1) */ 1249 /* prepare for SRST (AHCI-1.1 10.4.1) */
1250 rc = ahci_kick_engine(ap); 1250 rc = ahci_kick_engine(ap);
1251 if (rc && rc != -EOPNOTSUPP) 1251 if (rc && rc != -EOPNOTSUPP)
1252 ata_link_printk(link, KERN_WARNING, 1252 ata_link_warn(link, "failed to reset engine (errno=%d)\n", rc);
1253 "failed to reset engine (errno=%d)\n", rc);
1254 1253
1255 ata_tf_init(link->device, &tf); 1254 ata_tf_init(link->device, &tf);
1256 1255
@@ -1283,8 +1282,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
1283 * be trusted. Treat device readiness timeout as link 1282 * be trusted. Treat device readiness timeout as link
1284 * offline. 1283 * offline.
1285 */ 1284 */
1286 ata_link_printk(link, KERN_INFO, 1285 ata_link_info(link, "device not ready, treating as offline\n");
1287 "device not ready, treating as offline\n");
1288 *class = ATA_DEV_NONE; 1286 *class = ATA_DEV_NONE;
1289 } else if (rc) { 1287 } else if (rc) {
1290 /* link occupied, -ENODEV too is an error */ 1288 /* link occupied, -ENODEV too is an error */
@@ -1297,7 +1295,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
1297 return 0; 1295 return 0;
1298 1296
1299 fail: 1297 fail:
1300 ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); 1298 ata_link_err(link, "softreset failed (%s)\n", reason);
1301 return rc; 1299 return rc;
1302} 1300}
1303 1301
@@ -1966,7 +1964,7 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
1966 if (rc == 0) 1964 if (rc == 0)
1967 ahci_power_down(ap); 1965 ahci_power_down(ap);
1968 else { 1966 else {
1969 ata_port_printk(ap, KERN_ERR, "%s (%d)\n", emsg, rc); 1967 ata_port_err(ap, "%s (%d)\n", emsg, rc);
1970 ahci_start_port(ap); 1968 ahci_start_port(ap);
1971 } 1969 }
1972 1970
@@ -2061,7 +2059,7 @@ static void ahci_port_stop(struct ata_port *ap)
2061 /* de-initialize port */ 2059 /* de-initialize port */
2062 rc = ahci_deinit_port(ap, &emsg); 2060 rc = ahci_deinit_port(ap, &emsg);
2063 if (rc) 2061 if (rc)
2064 ata_port_printk(ap, KERN_WARNING, "%s (%d)\n", emsg, rc); 2062 ata_port_warn(ap, "%s (%d)\n", emsg, rc);
2065} 2063}
2066 2064
2067void ahci_print_info(struct ata_host *host, const char *scc_s) 2065void ahci_print_info(struct ata_host *host, const char *scc_s)
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index a791b8ce6294..e0a5b555cee1 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -332,25 +332,22 @@ int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm)
332 332
333 rc = -EINVAL; 333 rc = -EINVAL;
334 if (ACPI_FAILURE(status)) { 334 if (ACPI_FAILURE(status)) {
335 ata_port_printk(ap, KERN_ERR, 335 ata_port_err(ap, "ACPI get timing mode failed (AE 0x%x)\n",
336 "ACPI get timing mode failed (AE 0x%x)\n", 336 status);
337 status);
338 goto out_free; 337 goto out_free;
339 } 338 }
340 339
341 out_obj = output.pointer; 340 out_obj = output.pointer;
342 if (out_obj->type != ACPI_TYPE_BUFFER) { 341 if (out_obj->type != ACPI_TYPE_BUFFER) {
343 ata_port_printk(ap, KERN_WARNING, 342 ata_port_warn(ap, "_GTM returned unexpected object type 0x%x\n",
344 "_GTM returned unexpected object type 0x%x\n", 343 out_obj->type);
345 out_obj->type);
346 344
347 goto out_free; 345 goto out_free;
348 } 346 }
349 347
350 if (out_obj->buffer.length != sizeof(struct ata_acpi_gtm)) { 348 if (out_obj->buffer.length != sizeof(struct ata_acpi_gtm)) {
351 ata_port_printk(ap, KERN_ERR, 349 ata_port_err(ap, "_GTM returned invalid length %d\n",
352 "_GTM returned invalid length %d\n", 350 out_obj->buffer.length);
353 out_obj->buffer.length);
354 goto out_free; 351 goto out_free;
355 } 352 }
356 353
@@ -402,8 +399,8 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm)
402 if (status == AE_NOT_FOUND) 399 if (status == AE_NOT_FOUND)
403 return -ENOENT; 400 return -ENOENT;
404 if (ACPI_FAILURE(status)) { 401 if (ACPI_FAILURE(status)) {
405 ata_port_printk(ap, KERN_ERR, 402 ata_port_err(ap, "ACPI set timing mode failed (status=0x%x)\n",
406 "ACPI set timing mode failed (status=0x%x)\n", status); 403 status);
407 return -EINVAL; 404 return -EINVAL;
408 } 405 }
409 return 0; 406 return 0;
@@ -450,8 +447,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
450 output.pointer = NULL; /* ACPI-CA sets this; save/free it later */ 447 output.pointer = NULL; /* ACPI-CA sets this; save/free it later */
451 448
452 if (ata_msg_probe(ap)) 449 if (ata_msg_probe(ap))
453 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", 450 ata_dev_dbg(dev, "%s: ENTER: port#: %d\n",
454 __func__, ap->port_no); 451 __func__, ap->port_no);
455 452
456 /* _GTF has no input parameters */ 453 /* _GTF has no input parameters */
457 status = acpi_evaluate_object(dev->acpi_handle, "_GTF", NULL, &output); 454 status = acpi_evaluate_object(dev->acpi_handle, "_GTF", NULL, &output);
@@ -459,9 +456,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
459 456
460 if (ACPI_FAILURE(status)) { 457 if (ACPI_FAILURE(status)) {
461 if (status != AE_NOT_FOUND) { 458 if (status != AE_NOT_FOUND) {
462 ata_dev_printk(dev, KERN_WARNING, 459 ata_dev_warn(dev, "_GTF evaluation failed (AE 0x%x)\n",
463 "_GTF evaluation failed (AE 0x%x)\n", 460 status);
464 status);
465 rc = -EINVAL; 461 rc = -EINVAL;
466 } 462 }
467 goto out_free; 463 goto out_free;
@@ -469,27 +465,24 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
469 465
470 if (!output.length || !output.pointer) { 466 if (!output.length || !output.pointer) {
471 if (ata_msg_probe(ap)) 467 if (ata_msg_probe(ap))
472 ata_dev_printk(dev, KERN_DEBUG, "%s: Run _GTF: " 468 ata_dev_dbg(dev, "%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n",
473 "length or ptr is NULL (0x%llx, 0x%p)\n", 469 __func__,
474 __func__, 470 (unsigned long long)output.length,
475 (unsigned long long)output.length, 471 output.pointer);
476 output.pointer);
477 rc = -EINVAL; 472 rc = -EINVAL;
478 goto out_free; 473 goto out_free;
479 } 474 }
480 475
481 if (out_obj->type != ACPI_TYPE_BUFFER) { 476 if (out_obj->type != ACPI_TYPE_BUFFER) {
482 ata_dev_printk(dev, KERN_WARNING, 477 ata_dev_warn(dev, "_GTF unexpected object type 0x%x\n",
483 "_GTF unexpected object type 0x%x\n", 478 out_obj->type);
484 out_obj->type);
485 rc = -EINVAL; 479 rc = -EINVAL;
486 goto out_free; 480 goto out_free;
487 } 481 }
488 482
489 if (out_obj->buffer.length % REGS_PER_GTF) { 483 if (out_obj->buffer.length % REGS_PER_GTF) {
490 ata_dev_printk(dev, KERN_WARNING, 484 ata_dev_warn(dev, "unexpected _GTF length (%d)\n",
491 "unexpected _GTF length (%d)\n", 485 out_obj->buffer.length);
492 out_obj->buffer.length);
493 rc = -EINVAL; 486 rc = -EINVAL;
494 goto out_free; 487 goto out_free;
495 } 488 }
@@ -499,9 +492,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
499 if (gtf) { 492 if (gtf) {
500 *gtf = (void *)out_obj->buffer.pointer; 493 *gtf = (void *)out_obj->buffer.pointer;
501 if (ata_msg_probe(ap)) 494 if (ata_msg_probe(ap))
502 ata_dev_printk(dev, KERN_DEBUG, 495 ata_dev_dbg(dev, "%s: returning gtf=%p, gtf_count=%d\n",
503 "%s: returning gtf=%p, gtf_count=%d\n", 496 __func__, *gtf, rc);
504 __func__, *gtf, rc);
505 } 497 }
506 return rc; 498 return rc;
507 499
@@ -811,8 +803,8 @@ static int ata_acpi_push_id(struct ata_device *dev)
811 union acpi_object in_params[1]; 803 union acpi_object in_params[1];
812 804
813 if (ata_msg_probe(ap)) 805 if (ata_msg_probe(ap))
814 ata_dev_printk(dev, KERN_DEBUG, "%s: ix = %d, port#: %d\n", 806 ata_dev_dbg(dev, "%s: ix = %d, port#: %d\n",
815 __func__, dev->devno, ap->port_no); 807 __func__, dev->devno, ap->port_no);
816 808
817 /* Give the drive Identify data to the drive via the _SDD method */ 809 /* Give the drive Identify data to the drive via the _SDD method */
818 /* _SDD: set up input parameters */ 810 /* _SDD: set up input parameters */
@@ -832,8 +824,7 @@ static int ata_acpi_push_id(struct ata_device *dev)
832 return -ENOENT; 824 return -ENOENT;
833 825
834 if (ACPI_FAILURE(status)) { 826 if (ACPI_FAILURE(status)) {
835 ata_dev_printk(dev, KERN_WARNING, 827 ata_dev_warn(dev, "ACPI _SDD failed (AE 0x%x)\n", status);
836 "ACPI _SDD failed (AE 0x%x)\n", status);
837 return -EIO; 828 return -EIO;
838 } 829 }
839 830
@@ -983,8 +974,8 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
983 if (nr_executed) { 974 if (nr_executed) {
984 rc = ata_dev_reread_id(dev, 0); 975 rc = ata_dev_reread_id(dev, 0);
985 if (rc < 0) { 976 if (rc < 0) {
986 ata_dev_printk(dev, KERN_ERR, "failed to IDENTIFY " 977 ata_dev_err(dev,
987 "after ACPI commands\n"); 978 "failed to IDENTIFY after ACPI commands\n");
988 return rc; 979 return rc;
989 } 980 }
990 } 981 }
@@ -1002,8 +993,7 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
1002 return rc; 993 return rc;
1003 } 994 }
1004 995
1005 ata_dev_printk(dev, KERN_WARNING, 996 ata_dev_warn(dev, "ACPI: failed the second time, disabled\n");
1006 "ACPI: failed the second time, disabled\n");
1007 dev->acpi_handle = NULL; 997 dev->acpi_handle = NULL;
1008 998
1009 /* We can safely continue if no _GTF command has been executed 999 /* We can safely continue if no _GTF command has been executed
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 481089c85a94..ef5612e42881 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -335,8 +335,7 @@ void ata_force_cbl(struct ata_port *ap)
335 continue; 335 continue;
336 336
337 ap->cbl = fe->param.cbl; 337 ap->cbl = fe->param.cbl;
338 ata_port_printk(ap, KERN_NOTICE, 338 ata_port_notice(ap, "FORCE: cable set to %s\n", fe->param.name);
339 "FORCE: cable set to %s\n", fe->param.name);
340 return; 339 return;
341 } 340 }
342} 341}
@@ -378,8 +377,7 @@ static void ata_force_link_limits(struct ata_link *link)
378 /* only honor the first spd limit */ 377 /* only honor the first spd limit */
379 if (!did_spd && fe->param.spd_limit) { 378 if (!did_spd && fe->param.spd_limit) {
380 link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1; 379 link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1;
381 ata_link_printk(link, KERN_NOTICE, 380 ata_link_notice(link, "FORCE: PHY spd limit set to %s\n",
382 "FORCE: PHY spd limit set to %s\n",
383 fe->param.name); 381 fe->param.name);
384 did_spd = true; 382 did_spd = true;
385 } 383 }
@@ -387,7 +385,7 @@ static void ata_force_link_limits(struct ata_link *link)
387 /* let lflags stack */ 385 /* let lflags stack */
388 if (fe->param.lflags) { 386 if (fe->param.lflags) {
389 link->flags |= fe->param.lflags; 387 link->flags |= fe->param.lflags;
390 ata_link_printk(link, KERN_NOTICE, 388 ata_link_notice(link,
391 "FORCE: link flag 0x%x forced -> 0x%x\n", 389 "FORCE: link flag 0x%x forced -> 0x%x\n",
392 fe->param.lflags, link->flags); 390 fe->param.lflags, link->flags);
393 } 391 }
@@ -442,8 +440,8 @@ static void ata_force_xfermask(struct ata_device *dev)
442 dev->pio_mask = pio_mask; 440 dev->pio_mask = pio_mask;
443 } 441 }
444 442
445 ata_dev_printk(dev, KERN_NOTICE, 443 ata_dev_notice(dev, "FORCE: xfer_mask set to %s\n",
446 "FORCE: xfer_mask set to %s\n", fe->param.name); 444 fe->param.name);
447 return; 445 return;
448 } 446 }
449} 447}
@@ -486,8 +484,8 @@ static void ata_force_horkage(struct ata_device *dev)
486 dev->horkage |= fe->param.horkage_on; 484 dev->horkage |= fe->param.horkage_on;
487 dev->horkage &= ~fe->param.horkage_off; 485 dev->horkage &= ~fe->param.horkage_off;
488 486
489 ata_dev_printk(dev, KERN_NOTICE, 487 ata_dev_notice(dev, "FORCE: horkage modified (%s)\n",
490 "FORCE: horkage modified (%s)\n", fe->param.name); 488 fe->param.name);
491 } 489 }
492} 490}
493 491
@@ -711,8 +709,8 @@ u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev)
711 sect = tf->lbal; 709 sect = tf->lbal;
712 710
713 if (!sect) { 711 if (!sect) {
714 ata_dev_printk(dev, KERN_WARNING, "device reported " 712 ata_dev_warn(dev,
715 "invalid CHS sector 0\n"); 713 "device reported invalid CHS sector 0\n");
716 sect = 1; /* oh well */ 714 sect = 1; /* oh well */
717 } 715 }
718 716
@@ -1230,8 +1228,9 @@ static int ata_read_native_max_address(struct ata_device *dev, u64 *max_sectors)
1230 1228
1231 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 1229 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
1232 if (err_mask) { 1230 if (err_mask) {
1233 ata_dev_printk(dev, KERN_WARNING, "failed to read native " 1231 ata_dev_warn(dev,
1234 "max address (err_mask=0x%x)\n", err_mask); 1232 "failed to read native max address (err_mask=0x%x)\n",
1233 err_mask);
1235 if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED)) 1234 if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
1236 return -EACCES; 1235 return -EACCES;
1237 return -EIO; 1236 return -EIO;
@@ -1292,8 +1291,9 @@ static int ata_set_max_sectors(struct ata_device *dev, u64 new_sectors)
1292 1291
1293 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 1292 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
1294 if (err_mask) { 1293 if (err_mask) {
1295 ata_dev_printk(dev, KERN_WARNING, "failed to set " 1294 ata_dev_warn(dev,
1296 "max address (err_mask=0x%x)\n", err_mask); 1295 "failed to set max address (err_mask=0x%x)\n",
1296 err_mask);
1297 if (err_mask == AC_ERR_DEV && 1297 if (err_mask == AC_ERR_DEV &&
1298 (tf.feature & (ATA_ABORTED | ATA_IDNF))) 1298 (tf.feature & (ATA_ABORTED | ATA_IDNF)))
1299 return -EACCES; 1299 return -EACCES;
@@ -1336,8 +1336,8 @@ static int ata_hpa_resize(struct ata_device *dev)
1336 * be unlocked, skip HPA resizing. 1336 * be unlocked, skip HPA resizing.
1337 */ 1337 */
1338 if (rc == -EACCES || !unlock_hpa) { 1338 if (rc == -EACCES || !unlock_hpa) {
1339 ata_dev_printk(dev, KERN_WARNING, "HPA support seems " 1339 ata_dev_warn(dev,
1340 "broken, skipping HPA handling\n"); 1340 "HPA support seems broken, skipping HPA handling\n");
1341 dev->horkage |= ATA_HORKAGE_BROKEN_HPA; 1341 dev->horkage |= ATA_HORKAGE_BROKEN_HPA;
1342 1342
1343 /* we can continue if device aborted the command */ 1343 /* we can continue if device aborted the command */
@@ -1355,14 +1355,13 @@ static int ata_hpa_resize(struct ata_device *dev)
1355 return 0; 1355 return 0;
1356 1356
1357 if (native_sectors > sectors) 1357 if (native_sectors > sectors)
1358 ata_dev_printk(dev, KERN_INFO, 1358 ata_dev_info(dev,
1359 "HPA detected: current %llu, native %llu\n", 1359 "HPA detected: current %llu, native %llu\n",
1360 (unsigned long long)sectors, 1360 (unsigned long long)sectors,
1361 (unsigned long long)native_sectors); 1361 (unsigned long long)native_sectors);
1362 else if (native_sectors < sectors) 1362 else if (native_sectors < sectors)
1363 ata_dev_printk(dev, KERN_WARNING, 1363 ata_dev_warn(dev,
1364 "native sectors (%llu) is smaller than " 1364 "native sectors (%llu) is smaller than sectors (%llu)\n",
1365 "sectors (%llu)\n",
1366 (unsigned long long)native_sectors, 1365 (unsigned long long)native_sectors,
1367 (unsigned long long)sectors); 1366 (unsigned long long)sectors);
1368 return 0; 1367 return 0;
@@ -1372,10 +1371,10 @@ static int ata_hpa_resize(struct ata_device *dev)
1372 rc = ata_set_max_sectors(dev, native_sectors); 1371 rc = ata_set_max_sectors(dev, native_sectors);
1373 if (rc == -EACCES) { 1372 if (rc == -EACCES) {
1374 /* if device aborted the command, skip HPA resizing */ 1373 /* if device aborted the command, skip HPA resizing */
1375 ata_dev_printk(dev, KERN_WARNING, "device aborted resize " 1374 ata_dev_warn(dev,
1376 "(%llu -> %llu), skipping HPA handling\n", 1375 "device aborted resize (%llu -> %llu), skipping HPA handling\n",
1377 (unsigned long long)sectors, 1376 (unsigned long long)sectors,
1378 (unsigned long long)native_sectors); 1377 (unsigned long long)native_sectors);
1379 dev->horkage |= ATA_HORKAGE_BROKEN_HPA; 1378 dev->horkage |= ATA_HORKAGE_BROKEN_HPA;
1380 return 0; 1379 return 0;
1381 } else if (rc) 1380 } else if (rc)
@@ -1384,14 +1383,14 @@ static int ata_hpa_resize(struct ata_device *dev)
1384 /* re-read IDENTIFY data */ 1383 /* re-read IDENTIFY data */
1385 rc = ata_dev_reread_id(dev, 0); 1384 rc = ata_dev_reread_id(dev, 0);
1386 if (rc) { 1385 if (rc) {
1387 ata_dev_printk(dev, KERN_ERR, "failed to re-read IDENTIFY " 1386 ata_dev_err(dev,
1388 "data after HPA resizing\n"); 1387 "failed to re-read IDENTIFY data after HPA resizing\n");
1389 return rc; 1388 return rc;
1390 } 1389 }
1391 1390
1392 if (print_info) { 1391 if (print_info) {
1393 u64 new_sectors = ata_id_n_sectors(dev->id); 1392 u64 new_sectors = ata_id_n_sectors(dev->id);
1394 ata_dev_printk(dev, KERN_INFO, 1393 ata_dev_info(dev,
1395 "HPA unlocked: %llu -> %llu, native %llu\n", 1394 "HPA unlocked: %llu -> %llu, native %llu\n",
1396 (unsigned long long)sectors, 1395 (unsigned long long)sectors,
1397 (unsigned long long)new_sectors, 1396 (unsigned long long)new_sectors,
@@ -1655,8 +1654,8 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
1655 ata_qc_complete(qc); 1654 ata_qc_complete(qc);
1656 1655
1657 if (ata_msg_warn(ap)) 1656 if (ata_msg_warn(ap))
1658 ata_dev_printk(dev, KERN_WARNING, 1657 ata_dev_warn(dev, "qc timeout (cmd 0x%x)\n",
1659 "qc timeout (cmd 0x%x)\n", command); 1658 command);
1660 } 1659 }
1661 1660
1662 spin_unlock_irqrestore(ap->lock, flags); 1661 spin_unlock_irqrestore(ap->lock, flags);
@@ -1870,7 +1869,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
1870 int rc; 1869 int rc;
1871 1870
1872 if (ata_msg_ctl(ap)) 1871 if (ata_msg_ctl(ap))
1873 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__); 1872 ata_dev_dbg(dev, "%s: ENTER\n", __func__);
1874 1873
1875retry: 1874retry:
1876 ata_tf_init(dev, &tf); 1875 ata_tf_init(dev, &tf);
@@ -1909,14 +1908,13 @@ retry:
1909 1908
1910 if (err_mask) { 1909 if (err_mask) {
1911 if (err_mask & AC_ERR_NODEV_HINT) { 1910 if (err_mask & AC_ERR_NODEV_HINT) {
1912 ata_dev_printk(dev, KERN_DEBUG, 1911 ata_dev_dbg(dev, "NODEV after polling detection\n");
1913 "NODEV after polling detection\n");
1914 return -ENOENT; 1912 return -ENOENT;
1915 } 1913 }
1916 1914
1917 if (is_semb) { 1915 if (is_semb) {
1918 ata_dev_printk(dev, KERN_INFO, "IDENTIFY failed on " 1916 ata_dev_info(dev,
1919 "device w/ SEMB sig, disabled\n"); 1917 "IDENTIFY failed on device w/ SEMB sig, disabled\n");
1920 /* SEMB is not supported yet */ 1918 /* SEMB is not supported yet */
1921 *p_class = ATA_DEV_SEMB_UNSUP; 1919 *p_class = ATA_DEV_SEMB_UNSUP;
1922 return 0; 1920 return 0;
@@ -1942,8 +1940,8 @@ retry:
1942 * both flavors of IDENTIFYs which happens 1940 * both flavors of IDENTIFYs which happens
1943 * sometimes with phantom devices. 1941 * sometimes with phantom devices.
1944 */ 1942 */
1945 ata_dev_printk(dev, KERN_DEBUG, 1943 ata_dev_dbg(dev,
1946 "both IDENTIFYs aborted, assuming NODEV\n"); 1944 "both IDENTIFYs aborted, assuming NODEV\n");
1947 return -ENOENT; 1945 return -ENOENT;
1948 } 1946 }
1949 1947
@@ -1953,9 +1951,9 @@ retry:
1953 } 1951 }
1954 1952
1955 if (dev->horkage & ATA_HORKAGE_DUMP_ID) { 1953 if (dev->horkage & ATA_HORKAGE_DUMP_ID) {
1956 ata_dev_printk(dev, KERN_DEBUG, "dumping IDENTIFY data, " 1954 ata_dev_dbg(dev, "dumping IDENTIFY data, "
1957 "class=%d may_fallback=%d tried_spinup=%d\n", 1955 "class=%d may_fallback=%d tried_spinup=%d\n",
1958 class, may_fallback, tried_spinup); 1956 class, may_fallback, tried_spinup);
1959 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 1957 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET,
1960 16, 2, id, ATA_ID_WORDS * sizeof(*id), true); 1958 16, 2, id, ATA_ID_WORDS * sizeof(*id), true);
1961 } 1959 }
@@ -2034,8 +2032,8 @@ retry:
2034 2032
2035 err_out: 2033 err_out:
2036 if (ata_msg_warn(ap)) 2034 if (ata_msg_warn(ap))
2037 ata_dev_printk(dev, KERN_WARNING, "failed to IDENTIFY " 2035 ata_dev_warn(dev, "failed to IDENTIFY (%s, err_mask=0x%x)\n",
2038 "(%s, err_mask=0x%x)\n", reason, err_mask); 2036 reason, err_mask);
2039 return rc; 2037 return rc;
2040} 2038}
2041 2039
@@ -2065,9 +2063,8 @@ static int ata_do_link_spd_horkage(struct ata_device *dev)
2065 * guaranteed by setting sata_spd_limit to target_limit above. 2063 * guaranteed by setting sata_spd_limit to target_limit above.
2066 */ 2064 */
2067 if (plink->sata_spd > target) { 2065 if (plink->sata_spd > target) {
2068 ata_dev_printk(dev, KERN_INFO, 2066 ata_dev_info(dev, "applying link speed limit horkage to %s\n",
2069 "applying link speed limit horkage to %s\n", 2067 sata_spd_string(target));
2070 sata_spd_string(target));
2071 return -EAGAIN; 2068 return -EAGAIN;
2072 } 2069 }
2073 return 0; 2070 return 0;
@@ -2110,8 +2107,9 @@ static int ata_dev_config_ncq(struct ata_device *dev,
2110 err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE, 2107 err_mask = ata_dev_set_feature(dev, SETFEATURES_SATA_ENABLE,
2111 SATA_FPDMA_AA); 2108 SATA_FPDMA_AA);
2112 if (err_mask) { 2109 if (err_mask) {
2113 ata_dev_printk(dev, KERN_ERR, "failed to enable AA" 2110 ata_dev_err(dev,
2114 "(error_mask=0x%x)\n", err_mask); 2111 "failed to enable AA (error_mask=0x%x)\n",
2112 err_mask);
2115 if (err_mask != AC_ERR_DEV) { 2113 if (err_mask != AC_ERR_DEV) {
2116 dev->horkage |= ATA_HORKAGE_BROKEN_FPDMA_AA; 2114 dev->horkage |= ATA_HORKAGE_BROKEN_FPDMA_AA;
2117 return -EIO; 2115 return -EIO;
@@ -2154,31 +2152,28 @@ int ata_dev_configure(struct ata_device *dev)
2154 int rc; 2152 int rc;
2155 2153
2156 if (!ata_dev_enabled(dev) && ata_msg_info(ap)) { 2154 if (!ata_dev_enabled(dev) && ata_msg_info(ap)) {
2157 ata_dev_printk(dev, KERN_INFO, "%s: ENTER/EXIT -- nodev\n", 2155 ata_dev_info(dev, "%s: ENTER/EXIT -- nodev\n", __func__);
2158 __func__);
2159 return 0; 2156 return 0;
2160 } 2157 }
2161 2158
2162 if (ata_msg_probe(ap)) 2159 if (ata_msg_probe(ap))
2163 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__); 2160 ata_dev_dbg(dev, "%s: ENTER\n", __func__);
2164 2161
2165 /* set horkage */ 2162 /* set horkage */
2166 dev->horkage |= ata_dev_blacklisted(dev); 2163 dev->horkage |= ata_dev_blacklisted(dev);
2167 ata_force_horkage(dev); 2164 ata_force_horkage(dev);
2168 2165
2169 if (dev->horkage & ATA_HORKAGE_DISABLE) { 2166 if (dev->horkage & ATA_HORKAGE_DISABLE) {
2170 ata_dev_printk(dev, KERN_INFO, 2167 ata_dev_info(dev, "unsupported device, disabling\n");
2171 "unsupported device, disabling\n");
2172 ata_dev_disable(dev); 2168 ata_dev_disable(dev);
2173 return 0; 2169 return 0;
2174 } 2170 }
2175 2171
2176 if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) && 2172 if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) &&
2177 dev->class == ATA_DEV_ATAPI) { 2173 dev->class == ATA_DEV_ATAPI) {
2178 ata_dev_printk(dev, KERN_WARNING, 2174 ata_dev_warn(dev, "WARNING: ATAPI is %s, device ignored\n",
2179 "WARNING: ATAPI is %s, device ignored.\n", 2175 atapi_enabled ? "not supported with this driver"
2180 atapi_enabled ? "not supported with this driver" 2176 : "disabled");
2181 : "disabled");
2182 ata_dev_disable(dev); 2177 ata_dev_disable(dev);
2183 return 0; 2178 return 0;
2184 } 2179 }
@@ -2199,12 +2194,12 @@ int ata_dev_configure(struct ata_device *dev)
2199 2194
2200 /* print device capabilities */ 2195 /* print device capabilities */
2201 if (ata_msg_probe(ap)) 2196 if (ata_msg_probe(ap))
2202 ata_dev_printk(dev, KERN_DEBUG, 2197 ata_dev_dbg(dev,
2203 "%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x " 2198 "%s: cfg 49:%04x 82:%04x 83:%04x 84:%04x "
2204 "85:%04x 86:%04x 87:%04x 88:%04x\n", 2199 "85:%04x 86:%04x 87:%04x 88:%04x\n",
2205 __func__, 2200 __func__,
2206 id[49], id[82], id[83], id[84], 2201 id[49], id[82], id[83], id[84],
2207 id[85], id[86], id[87], id[88]); 2202 id[85], id[86], id[87], id[88]);
2208 2203
2209 /* initialize to-be-configured parameters */ 2204 /* initialize to-be-configured parameters */
2210 dev->flags &= ~ATA_DFLAG_CFG_MASK; 2205 dev->flags &= ~ATA_DFLAG_CFG_MASK;
@@ -2238,17 +2233,15 @@ int ata_dev_configure(struct ata_device *dev)
2238 if (ata_id_is_cfa(id)) { 2233 if (ata_id_is_cfa(id)) {
2239 /* CPRM may make this media unusable */ 2234 /* CPRM may make this media unusable */
2240 if (id[ATA_ID_CFA_KEY_MGMT] & 1) 2235 if (id[ATA_ID_CFA_KEY_MGMT] & 1)
2241 ata_dev_printk(dev, KERN_WARNING, 2236 ata_dev_warn(dev,
2242 "supports DRM functions and may " 2237 "supports DRM functions and may not be fully accessible\n");
2243 "not be fully accessible.\n");
2244 snprintf(revbuf, 7, "CFA"); 2238 snprintf(revbuf, 7, "CFA");
2245 } else { 2239 } else {
2246 snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id)); 2240 snprintf(revbuf, 7, "ATA-%d", ata_id_major_version(id));
2247 /* Warn the user if the device has TPM extensions */ 2241 /* Warn the user if the device has TPM extensions */
2248 if (ata_id_has_tpm(id)) 2242 if (ata_id_has_tpm(id))
2249 ata_dev_printk(dev, KERN_WARNING, 2243 ata_dev_warn(dev,
2250 "supports DRM functions and may " 2244 "supports DRM functions and may not be fully accessible\n");
2251 "not be fully accessible.\n");
2252 } 2245 }
2253 2246
2254 dev->n_sectors = ata_id_n_sectors(id); 2247 dev->n_sectors = ata_id_n_sectors(id);
@@ -2285,12 +2278,11 @@ int ata_dev_configure(struct ata_device *dev)
2285 2278
2286 /* print device info to dmesg */ 2279 /* print device info to dmesg */
2287 if (ata_msg_drv(ap) && print_info) { 2280 if (ata_msg_drv(ap) && print_info) {
2288 ata_dev_printk(dev, KERN_INFO, 2281 ata_dev_info(dev, "%s: %s, %s, max %s\n",
2289 "%s: %s, %s, max %s\n", 2282 revbuf, modelbuf, fwrevbuf,
2290 revbuf, modelbuf, fwrevbuf, 2283 ata_mode_string(xfer_mask));
2291 ata_mode_string(xfer_mask)); 2284 ata_dev_info(dev,
2292 ata_dev_printk(dev, KERN_INFO, 2285 "%llu sectors, multi %u: %s %s\n",
2293 "%Lu sectors, multi %u: %s %s\n",
2294 (unsigned long long)dev->n_sectors, 2286 (unsigned long long)dev->n_sectors,
2295 dev->multi_count, lba_desc, ncq_desc); 2287 dev->multi_count, lba_desc, ncq_desc);
2296 } 2288 }
@@ -2311,15 +2303,14 @@ int ata_dev_configure(struct ata_device *dev)
2311 2303
2312 /* print device info to dmesg */ 2304 /* print device info to dmesg */
2313 if (ata_msg_drv(ap) && print_info) { 2305 if (ata_msg_drv(ap) && print_info) {
2314 ata_dev_printk(dev, KERN_INFO, 2306 ata_dev_info(dev, "%s: %s, %s, max %s\n",
2315 "%s: %s, %s, max %s\n", 2307 revbuf, modelbuf, fwrevbuf,
2316 revbuf, modelbuf, fwrevbuf, 2308 ata_mode_string(xfer_mask));
2317 ata_mode_string(xfer_mask)); 2309 ata_dev_info(dev,
2318 ata_dev_printk(dev, KERN_INFO, 2310 "%llu sectors, multi %u, CHS %u/%u/%u\n",
2319 "%Lu sectors, multi %u, CHS %u/%u/%u\n", 2311 (unsigned long long)dev->n_sectors,
2320 (unsigned long long)dev->n_sectors, 2312 dev->multi_count, dev->cylinders,
2321 dev->multi_count, dev->cylinders, 2313 dev->heads, dev->sectors);
2322 dev->heads, dev->sectors);
2323 } 2314 }
2324 } 2315 }
2325 2316
@@ -2336,8 +2327,7 @@ int ata_dev_configure(struct ata_device *dev)
2336 rc = atapi_cdb_len(id); 2327 rc = atapi_cdb_len(id);
2337 if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { 2328 if ((rc < 12) || (rc > ATAPI_CDB_LEN)) {
2338 if (ata_msg_warn(ap)) 2329 if (ata_msg_warn(ap))
2339 ata_dev_printk(dev, KERN_WARNING, 2330 ata_dev_warn(dev, "unsupported CDB len\n");
2340 "unsupported CDB len\n");
2341 rc = -EINVAL; 2331 rc = -EINVAL;
2342 goto err_out_nosup; 2332 goto err_out_nosup;
2343 } 2333 }
@@ -2358,9 +2348,9 @@ int ata_dev_configure(struct ata_device *dev)
2358 err_mask = ata_dev_set_feature(dev, 2348 err_mask = ata_dev_set_feature(dev,
2359 SETFEATURES_SATA_ENABLE, SATA_AN); 2349 SETFEATURES_SATA_ENABLE, SATA_AN);
2360 if (err_mask) 2350 if (err_mask)
2361 ata_dev_printk(dev, KERN_ERR, 2351 ata_dev_err(dev,
2362 "failed to enable ATAPI AN " 2352 "failed to enable ATAPI AN (err_mask=0x%x)\n",
2363 "(err_mask=0x%x)\n", err_mask); 2353 err_mask);
2364 else { 2354 else {
2365 dev->flags |= ATA_DFLAG_AN; 2355 dev->flags |= ATA_DFLAG_AN;
2366 atapi_an_string = ", ATAPI AN"; 2356 atapi_an_string = ", ATAPI AN";
@@ -2379,12 +2369,12 @@ int ata_dev_configure(struct ata_device *dev)
2379 2369
2380 /* print device info to dmesg */ 2370 /* print device info to dmesg */
2381 if (ata_msg_drv(ap) && print_info) 2371 if (ata_msg_drv(ap) && print_info)
2382 ata_dev_printk(dev, KERN_INFO, 2372 ata_dev_info(dev,
2383 "ATAPI: %s, %s, max %s%s%s%s\n", 2373 "ATAPI: %s, %s, max %s%s%s%s\n",
2384 modelbuf, fwrevbuf, 2374 modelbuf, fwrevbuf,
2385 ata_mode_string(xfer_mask), 2375 ata_mode_string(xfer_mask),
2386 cdb_intr_string, atapi_an_string, 2376 cdb_intr_string, atapi_an_string,
2387 dma_dir_string); 2377 dma_dir_string);
2388 } 2378 }
2389 2379
2390 /* determine max_sectors */ 2380 /* determine max_sectors */
@@ -2396,8 +2386,7 @@ int ata_dev_configure(struct ata_device *dev)
2396 200 sectors */ 2386 200 sectors */
2397 if (ata_dev_knobble(dev)) { 2387 if (ata_dev_knobble(dev)) {
2398 if (ata_msg_drv(ap) && print_info) 2388 if (ata_msg_drv(ap) && print_info)
2399 ata_dev_printk(dev, KERN_INFO, 2389 ata_dev_info(dev, "applying bridge limits\n");
2400 "applying bridge limits\n");
2401 dev->udma_mask &= ATA_UDMA5; 2390 dev->udma_mask &= ATA_UDMA5;
2402 dev->max_sectors = ATA_MAX_SECTORS; 2391 dev->max_sectors = ATA_MAX_SECTORS;
2403 } 2392 }
@@ -2423,26 +2412,23 @@ int ata_dev_configure(struct ata_device *dev)
2423 bugs */ 2412 bugs */
2424 2413
2425 if (print_info) { 2414 if (print_info) {
2426 ata_dev_printk(dev, KERN_WARNING, 2415 ata_dev_warn(dev,
2427"Drive reports diagnostics failure. This may indicate a drive\n"); 2416"Drive reports diagnostics failure. This may indicate a drive\n");
2428 ata_dev_printk(dev, KERN_WARNING, 2417 ata_dev_warn(dev,
2429"fault or invalid emulation. Contact drive vendor for information.\n"); 2418"fault or invalid emulation. Contact drive vendor for information.\n");
2430 } 2419 }
2431 } 2420 }
2432 2421
2433 if ((dev->horkage & ATA_HORKAGE_FIRMWARE_WARN) && print_info) { 2422 if ((dev->horkage & ATA_HORKAGE_FIRMWARE_WARN) && print_info) {
2434 ata_dev_printk(dev, KERN_WARNING, "WARNING: device requires " 2423 ata_dev_warn(dev, "WARNING: device requires firmware update to be fully functional\n");
2435 "firmware update to be fully functional.\n"); 2424 ata_dev_warn(dev, " contact the vendor or visit http://ata.wiki.kernel.org\n");
2436 ata_dev_printk(dev, KERN_WARNING, " contact the vendor "
2437 "or visit http://ata.wiki.kernel.org.\n");
2438 } 2425 }
2439 2426
2440 return 0; 2427 return 0;
2441 2428
2442err_out_nosup: 2429err_out_nosup:
2443 if (ata_msg_probe(ap)) 2430 if (ata_msg_probe(ap))
2444 ata_dev_printk(dev, KERN_DEBUG, 2431 ata_dev_dbg(dev, "%s: EXIT, err\n", __func__);
2445 "%s: EXIT, err\n", __func__);
2446 return rc; 2432 return rc;
2447} 2433}
2448 2434
@@ -2663,13 +2649,11 @@ static void sata_print_link_status(struct ata_link *link)
2663 2649
2664 if (ata_phys_link_online(link)) { 2650 if (ata_phys_link_online(link)) {
2665 tmp = (sstatus >> 4) & 0xf; 2651 tmp = (sstatus >> 4) & 0xf;
2666 ata_link_printk(link, KERN_INFO, 2652 ata_link_info(link, "SATA link up %s (SStatus %X SControl %X)\n",
2667 "SATA link up %s (SStatus %X SControl %X)\n", 2653 sata_spd_string(tmp), sstatus, scontrol);
2668 sata_spd_string(tmp), sstatus, scontrol);
2669 } else { 2654 } else {
2670 ata_link_printk(link, KERN_INFO, 2655 ata_link_info(link, "SATA link down (SStatus %X SControl %X)\n",
2671 "SATA link down (SStatus %X SControl %X)\n", 2656 sstatus, scontrol);
2672 sstatus, scontrol);
2673 } 2657 }
2674} 2658}
2675 2659
@@ -2758,8 +2742,8 @@ int sata_down_spd_limit(struct ata_link *link, u32 spd_limit)
2758 2742
2759 link->sata_spd_limit = mask; 2743 link->sata_spd_limit = mask;
2760 2744
2761 ata_link_printk(link, KERN_WARNING, "limiting SATA link speed to %s\n", 2745 ata_link_warn(link, "limiting SATA link speed to %s\n",
2762 sata_spd_string(fls(mask))); 2746 sata_spd_string(fls(mask)));
2763 2747
2764 return 0; 2748 return 0;
2765} 2749}
@@ -3136,8 +3120,7 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
3136 snprintf(buf, sizeof(buf), "%s", 3120 snprintf(buf, sizeof(buf), "%s",
3137 ata_mode_string(xfer_mask)); 3121 ata_mode_string(xfer_mask));
3138 3122
3139 ata_dev_printk(dev, KERN_WARNING, 3123 ata_dev_warn(dev, "limiting speed to %s\n", buf);
3140 "limiting speed to %s\n", buf);
3141 } 3124 }
3142 3125
3143 ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask, 3126 ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask,
@@ -3164,9 +3147,9 @@ static int ata_dev_set_mode(struct ata_device *dev)
3164 dev_err_whine = " (SET_XFERMODE skipped)"; 3147 dev_err_whine = " (SET_XFERMODE skipped)";
3165 else { 3148 else {
3166 if (nosetxfer) 3149 if (nosetxfer)
3167 ata_dev_printk(dev, KERN_WARNING, 3150 ata_dev_warn(dev,
3168 "NOSETXFER but PATA detected - can't " 3151 "NOSETXFER but PATA detected - can't "
3169 "skip SETXFER, might malfunction\n"); 3152 "skip SETXFER, might malfunction\n");
3170 err_mask = ata_dev_set_xfermode(dev); 3153 err_mask = ata_dev_set_xfermode(dev);
3171 } 3154 }
3172 3155
@@ -3216,15 +3199,14 @@ static int ata_dev_set_mode(struct ata_device *dev)
3216 DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n", 3199 DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
3217 dev->xfer_shift, (int)dev->xfer_mode); 3200 dev->xfer_shift, (int)dev->xfer_mode);
3218 3201
3219 ata_dev_printk(dev, KERN_INFO, "configured for %s%s\n", 3202 ata_dev_info(dev, "configured for %s%s\n",
3220 ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)), 3203 ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
3221 dev_err_whine); 3204 dev_err_whine);
3222 3205
3223 return 0; 3206 return 0;
3224 3207
3225 fail: 3208 fail:
3226 ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " 3209 ata_dev_err(dev, "failed to set xfermode (err_mask=0x%x)\n", err_mask);
3227 "(err_mask=0x%x)\n", err_mask);
3228 return -EIO; 3210 return -EIO;
3229} 3211}
3230 3212
@@ -3286,7 +3268,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev)
3286 /* step 2: always set host PIO timings */ 3268 /* step 2: always set host PIO timings */
3287 ata_for_each_dev(dev, link, ENABLED) { 3269 ata_for_each_dev(dev, link, ENABLED) {
3288 if (dev->pio_mode == 0xff) { 3270 if (dev->pio_mode == 0xff) {
3289 ata_dev_printk(dev, KERN_WARNING, "no PIO support\n"); 3271 ata_dev_warn(dev, "no PIO support\n");
3290 rc = -EINVAL; 3272 rc = -EINVAL;
3291 goto out; 3273 goto out;
3292 } 3274 }
@@ -3404,7 +3386,7 @@ int ata_wait_ready(struct ata_link *link, unsigned long deadline,
3404 3386
3405 if (!warned && time_after(now, start + 5 * HZ) && 3387 if (!warned && time_after(now, start + 5 * HZ) &&
3406 (deadline - now > 3 * HZ)) { 3388 (deadline - now > 3 * HZ)) {
3407 ata_link_printk(link, KERN_WARNING, 3389 ata_link_warn(link,
3408 "link is slow to respond, please be patient " 3390 "link is slow to respond, please be patient "
3409 "(ready=%d)\n", tmp); 3391 "(ready=%d)\n", tmp);
3410 warned = 1; 3392 warned = 1;
@@ -3552,16 +3534,14 @@ int sata_link_resume(struct ata_link *link, const unsigned long *params,
3552 } while ((scontrol & 0xf0f) != 0x300 && --tries); 3534 } while ((scontrol & 0xf0f) != 0x300 && --tries);
3553 3535
3554 if ((scontrol & 0xf0f) != 0x300) { 3536 if ((scontrol & 0xf0f) != 0x300) {
3555 ata_link_printk(link, KERN_ERR, 3537 ata_link_err(link, "failed to resume link (SControl %X)\n",
3556 "failed to resume link (SControl %X)\n", 3538 scontrol);
3557 scontrol);
3558 return 0; 3539 return 0;
3559 } 3540 }
3560 3541
3561 if (tries < ATA_LINK_RESUME_TRIES) 3542 if (tries < ATA_LINK_RESUME_TRIES)
3562 ata_link_printk(link, KERN_WARNING, 3543 ata_link_warn(link, "link resume succeeded after %d retries\n",
3563 "link resume succeeded after %d retries\n", 3544 ATA_LINK_RESUME_TRIES - tries);
3564 ATA_LINK_RESUME_TRIES - tries);
3565 3545
3566 if ((rc = sata_link_debounce(link, params, deadline))) 3546 if ((rc = sata_link_debounce(link, params, deadline)))
3567 return rc; 3547 return rc;
@@ -3678,8 +3658,9 @@ int ata_std_prereset(struct ata_link *link, unsigned long deadline)
3678 rc = sata_link_resume(link, timing, deadline); 3658 rc = sata_link_resume(link, timing, deadline);
3679 /* whine about phy resume failure but proceed */ 3659 /* whine about phy resume failure but proceed */
3680 if (rc && rc != -EOPNOTSUPP) 3660 if (rc && rc != -EOPNOTSUPP)
3681 ata_link_printk(link, KERN_WARNING, "failed to resume " 3661 ata_link_warn(link,
3682 "link for reset (errno=%d)\n", rc); 3662 "failed to resume link for reset (errno=%d)\n",
3663 rc);
3683 } 3664 }
3684 3665
3685 /* no point in trying softreset on offline link */ 3666 /* no point in trying softreset on offline link */
@@ -3795,8 +3776,7 @@ int sata_link_hardreset(struct ata_link *link, const unsigned long *timing,
3795 /* online is set iff link is online && reset succeeded */ 3776 /* online is set iff link is online && reset succeeded */
3796 if (online) 3777 if (online)
3797 *online = false; 3778 *online = false;
3798 ata_link_printk(link, KERN_ERR, 3779 ata_link_err(link, "COMRESET failed (errno=%d)\n", rc);
3799 "COMRESET failed (errno=%d)\n", rc);
3800 } 3780 }
3801 DPRINTK("EXIT, rc=%d\n", rc); 3781 DPRINTK("EXIT, rc=%d\n", rc);
3802 return rc; 3782 return rc;
@@ -3880,8 +3860,8 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3880 unsigned char serial[2][ATA_ID_SERNO_LEN + 1]; 3860 unsigned char serial[2][ATA_ID_SERNO_LEN + 1];
3881 3861
3882 if (dev->class != new_class) { 3862 if (dev->class != new_class) {
3883 ata_dev_printk(dev, KERN_INFO, "class mismatch %d != %d\n", 3863 ata_dev_info(dev, "class mismatch %d != %d\n",
3884 dev->class, new_class); 3864 dev->class, new_class);
3885 return 0; 3865 return 0;
3886 } 3866 }
3887 3867
@@ -3891,14 +3871,14 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
3891 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1])); 3871 ata_id_c_string(new_id, serial[1], ATA_ID_SERNO, sizeof(serial[1]));
3892 3872
3893 if (strcmp(model[0], model[1])) { 3873 if (strcmp(model[0], model[1])) {
3894 ata_dev_printk(dev, KERN_INFO, "model number mismatch " 3874 ata_dev_info(dev, "model number mismatch '%s' != '%s'\n",
3895 "'%s' != '%s'\n", model[0], model[1]); 3875 model[0], model[1]);
3896 return 0; 3876 return 0;
3897 } 3877 }
3898 3878
3899 if (strcmp(serial[0], serial[1])) { 3879 if (strcmp(serial[0], serial[1])) {
3900 ata_dev_printk(dev, KERN_INFO, "serial number mismatch " 3880 ata_dev_info(dev, "serial number mismatch '%s' != '%s'\n",
3901 "'%s' != '%s'\n", serial[0], serial[1]); 3881 serial[0], serial[1]);
3902 return 0; 3882 return 0;
3903 } 3883 }
3904 3884
@@ -3968,8 +3948,8 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
3968 new_class != ATA_DEV_ATA && 3948 new_class != ATA_DEV_ATA &&
3969 new_class != ATA_DEV_ATAPI && 3949 new_class != ATA_DEV_ATAPI &&
3970 new_class != ATA_DEV_SEMB) { 3950 new_class != ATA_DEV_SEMB) {
3971 ata_dev_printk(dev, KERN_INFO, "class mismatch %u != %u\n", 3951 ata_dev_info(dev, "class mismatch %u != %u\n",
3972 dev->class, new_class); 3952 dev->class, new_class);
3973 rc = -ENODEV; 3953 rc = -ENODEV;
3974 goto fail; 3954 goto fail;
3975 } 3955 }
@@ -3990,9 +3970,9 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
3990 return 0; 3970 return 0;
3991 3971
3992 /* n_sectors has changed */ 3972 /* n_sectors has changed */
3993 ata_dev_printk(dev, KERN_WARNING, "n_sectors mismatch %llu != %llu\n", 3973 ata_dev_warn(dev, "n_sectors mismatch %llu != %llu\n",
3994 (unsigned long long)n_sectors, 3974 (unsigned long long)n_sectors,
3995 (unsigned long long)dev->n_sectors); 3975 (unsigned long long)dev->n_sectors);
3996 3976
3997 /* 3977 /*
3998 * Something could have caused HPA to be unlocked 3978 * Something could have caused HPA to be unlocked
@@ -4001,9 +3981,9 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4001 */ 3981 */
4002 if (dev->n_native_sectors == n_native_sectors && 3982 if (dev->n_native_sectors == n_native_sectors &&
4003 dev->n_sectors > n_sectors && dev->n_sectors == n_native_sectors) { 3983 dev->n_sectors > n_sectors && dev->n_sectors == n_native_sectors) {
4004 ata_dev_printk(dev, KERN_WARNING, 3984 ata_dev_warn(dev,
4005 "new n_sectors matches native, probably " 3985 "new n_sectors matches native, probably "
4006 "late HPA unlock, n_sectors updated\n"); 3986 "late HPA unlock, n_sectors updated\n");
4007 /* use the larger n_sectors */ 3987 /* use the larger n_sectors */
4008 return 0; 3988 return 0;
4009 } 3989 }
@@ -4017,9 +3997,9 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4017 if (dev->n_native_sectors == n_native_sectors && 3997 if (dev->n_native_sectors == n_native_sectors &&
4018 dev->n_sectors < n_sectors && n_sectors == n_native_sectors && 3998 dev->n_sectors < n_sectors && n_sectors == n_native_sectors &&
4019 !(dev->horkage & ATA_HORKAGE_BROKEN_HPA)) { 3999 !(dev->horkage & ATA_HORKAGE_BROKEN_HPA)) {
4020 ata_dev_printk(dev, KERN_WARNING, 4000 ata_dev_warn(dev,
4021 "old n_sectors matches native, probably " 4001 "old n_sectors matches native, probably "
4022 "late HPA lock, will try to unlock HPA\n"); 4002 "late HPA lock, will try to unlock HPA\n");
4023 /* try unlocking HPA */ 4003 /* try unlocking HPA */
4024 dev->flags |= ATA_DFLAG_UNLOCK_HPA; 4004 dev->flags |= ATA_DFLAG_UNLOCK_HPA;
4025 rc = -EIO; 4005 rc = -EIO;
@@ -4030,7 +4010,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
4030 dev->n_native_sectors = n_native_sectors; 4010 dev->n_native_sectors = n_native_sectors;
4031 dev->n_sectors = n_sectors; 4011 dev->n_sectors = n_sectors;
4032 fail: 4012 fail:
4033 ata_dev_printk(dev, KERN_ERR, "revalidation failed (errno=%d)\n", rc); 4013 ata_dev_err(dev, "revalidation failed (errno=%d)\n", rc);
4034 return rc; 4014 return rc;
4035} 4015}
4036 4016
@@ -4358,15 +4338,15 @@ static void ata_dev_xfermask(struct ata_device *dev)
4358 4338
4359 if (ata_dma_blacklisted(dev)) { 4339 if (ata_dma_blacklisted(dev)) {
4360 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 4340 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
4361 ata_dev_printk(dev, KERN_WARNING, 4341 ata_dev_warn(dev,
4362 "device is on DMA blacklist, disabling DMA\n"); 4342 "device is on DMA blacklist, disabling DMA\n");
4363 } 4343 }
4364 4344
4365 if ((host->flags & ATA_HOST_SIMPLEX) && 4345 if ((host->flags & ATA_HOST_SIMPLEX) &&
4366 host->simplex_claimed && host->simplex_claimed != ap) { 4346 host->simplex_claimed && host->simplex_claimed != ap) {
4367 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 4347 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
4368 ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " 4348 ata_dev_warn(dev,
4369 "other device, disabling DMA\n"); 4349 "simplex DMA is claimed by other device, disabling DMA\n");
4370 } 4350 }
4371 4351
4372 if (ap->flags & ATA_FLAG_NO_IORDY) 4352 if (ap->flags & ATA_FLAG_NO_IORDY)
@@ -4386,8 +4366,8 @@ static void ata_dev_xfermask(struct ata_device *dev)
4386 if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA)) 4366 if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA))
4387 /* UDMA/44 or higher would be available */ 4367 /* UDMA/44 or higher would be available */
4388 if (cable_is_40wire(ap)) { 4368 if (cable_is_40wire(ap)) {
4389 ata_dev_printk(dev, KERN_WARNING, 4369 ata_dev_warn(dev,
4390 "limited to UDMA/33 due to 40-wire cable\n"); 4370 "limited to UDMA/33 due to 40-wire cable\n");
4391 xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); 4371 xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA);
4392 } 4372 }
4393 4373
@@ -4954,8 +4934,8 @@ int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active)
4954 done_mask = ap->qc_active ^ qc_active; 4934 done_mask = ap->qc_active ^ qc_active;
4955 4935
4956 if (unlikely(done_mask & qc_active)) { 4936 if (unlikely(done_mask & qc_active)) {
4957 ata_port_printk(ap, KERN_ERR, "illegal qc_active transition " 4937 ata_port_err(ap, "illegal qc_active transition (%08x->%08x)\n",
4958 "(%08x->%08x)\n", ap->qc_active, qc_active); 4938 ap->qc_active, qc_active);
4959 return -EINVAL; 4939 return -EINVAL;
4960 } 4940 }
4961 4941
@@ -6022,14 +6002,13 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
6022 ap->udma_mask); 6002 ap->udma_mask);
6023 6003
6024 if (!ata_port_is_dummy(ap)) { 6004 if (!ata_port_is_dummy(ap)) {
6025 ata_port_printk(ap, KERN_INFO, 6005 ata_port_info(ap, "%cATA max %s %s\n",
6026 "%cATA max %s %s\n", 6006 (ap->flags & ATA_FLAG_SATA) ? 'S' : 'P',
6027 (ap->flags & ATA_FLAG_SATA) ? 'S' : 'P', 6007 ata_mode_string(xfer_mask),
6028 ata_mode_string(xfer_mask), 6008 ap->link.eh_info.desc);
6029 ap->link.eh_info.desc);
6030 ata_ehi_clear_desc(&ap->link.eh_info); 6009 ata_ehi_clear_desc(&ap->link.eh_info);
6031 } else 6010 } else
6032 ata_port_printk(ap, KERN_INFO, "DUMMY\n"); 6011 ata_port_info(ap, "DUMMY\n");
6033 } 6012 }
6034 6013
6035 /* perform each probe asynchronously */ 6014 /* perform each probe asynchronously */
@@ -6599,6 +6578,76 @@ const struct ata_port_info ata_dummy_port_info = {
6599}; 6578};
6600 6579
6601/* 6580/*
6581 * Utility print functions
6582 */
6583int ata_port_printk(const struct ata_port *ap, const char *level,
6584 const char *fmt, ...)
6585{
6586 struct va_format vaf;
6587 va_list args;
6588 int r;
6589
6590 va_start(args, fmt);
6591
6592 vaf.fmt = fmt;
6593 vaf.va = &args;
6594
6595 r = printk("%sata%u: %pV", level, ap->print_id, &vaf);
6596
6597 va_end(args);
6598
6599 return r;
6600}
6601EXPORT_SYMBOL(ata_port_printk);
6602
6603int ata_link_printk(const struct ata_link *link, const char *level,
6604 const char *fmt, ...)
6605{
6606 struct va_format vaf;
6607 va_list args;
6608 int r;
6609
6610 va_start(args, fmt);
6611
6612 vaf.fmt = fmt;
6613 vaf.va = &args;
6614
6615 if (sata_pmp_attached(link->ap) || link->ap->slave_link)
6616 r = printk("%sata%u.%02u: %pV",
6617 level, link->ap->print_id, link->pmp, &vaf);
6618 else
6619 r = printk("%sata%u: %pV",
6620 level, link->ap->print_id, &vaf);
6621
6622 va_end(args);
6623
6624 return r;
6625}
6626EXPORT_SYMBOL(ata_link_printk);
6627
6628int ata_dev_printk(const struct ata_device *dev, const char *level,
6629 const char *fmt, ...)
6630{
6631 struct va_format vaf;
6632 va_list args;
6633 int r;
6634
6635 va_start(args, fmt);
6636
6637 vaf.fmt = fmt;
6638 vaf.va = &args;
6639
6640 r = printk("%sata%u.%02u: %pV",
6641 level, dev->link->ap->print_id, dev->link->pmp + dev->devno,
6642 &vaf);
6643
6644 va_end(args);
6645
6646 return r;
6647}
6648EXPORT_SYMBOL(ata_dev_printk);
6649
6650/*
6602 * libata is essentially a library of internal helper functions for 6651 * libata is essentially a library of internal helper functions for
6603 * low-level ATA host controller drivers. As such, the API/ABI is 6652 * low-level ATA host controller drivers. As such, the API/ABI is
6604 * likely to change as new drivers are added and updated. 6653 * likely to change as new drivers are added and updated.
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7f099d6e4e0b..16fa45755c18 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -782,8 +782,9 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
782 spin_unlock_irqrestore(ap->lock, flags); 782 spin_unlock_irqrestore(ap->lock, flags);
783 goto repeat; 783 goto repeat;
784 } 784 }
785 ata_port_printk(ap, KERN_ERR, "EH pending after %d " 785 ata_port_err(ap,
786 "tries, giving up\n", ATA_EH_MAX_TRIES); 786 "EH pending after %d tries, giving up\n",
787 ATA_EH_MAX_TRIES);
787 ap->pflags &= ~ATA_PFLAG_EH_PENDING; 788 ap->pflags &= ~ATA_PFLAG_EH_PENDING;
788 } 789 }
789 790
@@ -816,7 +817,7 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
816 schedule_delayed_work(&ap->hotplug_task, 0); 817 schedule_delayed_work(&ap->hotplug_task, 0);
817 818
818 if (ap->pflags & ATA_PFLAG_RECOVERED) 819 if (ap->pflags & ATA_PFLAG_RECOVERED)
819 ata_port_printk(ap, KERN_INFO, "EH complete\n"); 820 ata_port_info(ap, "EH complete\n");
820 821
821 ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED); 822 ap->pflags &= ~(ATA_PFLAG_SCSI_HOTPLUG | ATA_PFLAG_RECOVERED);
822 823
@@ -1310,7 +1311,7 @@ void ata_dev_disable(struct ata_device *dev)
1310 return; 1311 return;
1311 1312
1312 if (ata_msg_drv(dev->link->ap)) 1313 if (ata_msg_drv(dev->link->ap))
1313 ata_dev_printk(dev, KERN_WARNING, "disabled\n"); 1314 ata_dev_warn(dev, "disabled\n");
1314 ata_acpi_on_disable(dev); 1315 ata_acpi_on_disable(dev);
1315 ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET); 1316 ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET);
1316 dev->class++; 1317 dev->class++;
@@ -1515,8 +1516,8 @@ static int ata_eh_read_log_10h(struct ata_device *dev,
1515 for (i = 0; i < ATA_SECT_SIZE; i++) 1516 for (i = 0; i < ATA_SECT_SIZE; i++)
1516 csum += buf[i]; 1517 csum += buf[i];
1517 if (csum) 1518 if (csum)
1518 ata_dev_printk(dev, KERN_WARNING, 1519 ata_dev_warn(dev, "invalid checksum 0x%x on log page 10h\n",
1519 "invalid checksum 0x%x on log page 10h\n", csum); 1520 csum);
1520 1521
1521 if (buf[0] & 0x80) 1522 if (buf[0] & 0x80)
1522 return -ENOENT; 1523 return -ENOENT;
@@ -1716,14 +1717,14 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
1716 memset(&tf, 0, sizeof(tf)); 1717 memset(&tf, 0, sizeof(tf));
1717 rc = ata_eh_read_log_10h(dev, &tag, &tf); 1718 rc = ata_eh_read_log_10h(dev, &tag, &tf);
1718 if (rc) { 1719 if (rc) {
1719 ata_link_printk(link, KERN_ERR, "failed to read log page 10h " 1720 ata_link_err(link, "failed to read log page 10h (errno=%d)\n",
1720 "(errno=%d)\n", rc); 1721 rc);
1721 return; 1722 return;
1722 } 1723 }
1723 1724
1724 if (!(link->sactive & (1 << tag))) { 1725 if (!(link->sactive & (1 << tag))) {
1725 ata_link_printk(link, KERN_ERR, "log page 10h reported " 1726 ata_link_err(link, "log page 10h reported inactive tag %d\n",
1726 "inactive tag %d\n", tag); 1727 tag);
1727 return; 1728 return;
1728 } 1729 }
1729 1730
@@ -1988,8 +1989,7 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev,
1988 (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ | 1989 (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ |
1989 ATA_DFLAG_NCQ_OFF)) == ATA_DFLAG_NCQ) { 1990 ATA_DFLAG_NCQ_OFF)) == ATA_DFLAG_NCQ) {
1990 dev->flags |= ATA_DFLAG_NCQ_OFF; 1991 dev->flags |= ATA_DFLAG_NCQ_OFF;
1991 ata_dev_printk(dev, KERN_WARNING, 1992 ata_dev_warn(dev, "NCQ disabled due to excessive errors\n");
1992 "NCQ disabled due to excessive errors\n");
1993 goto done; 1993 goto done;
1994 } 1994 }
1995 1995
@@ -2374,24 +2374,24 @@ static void ata_eh_link_report(struct ata_link *link)
2374 ap->eh_tries); 2374 ap->eh_tries);
2375 2375
2376 if (ehc->i.dev) { 2376 if (ehc->i.dev) {
2377 ata_dev_printk(ehc->i.dev, KERN_ERR, "exception Emask 0x%x " 2377 ata_dev_err(ehc->i.dev, "exception Emask 0x%x "
2378 "SAct 0x%x SErr 0x%x action 0x%x%s%s\n", 2378 "SAct 0x%x SErr 0x%x action 0x%x%s%s\n",
2379 ehc->i.err_mask, link->sactive, ehc->i.serror, 2379 ehc->i.err_mask, link->sactive, ehc->i.serror,
2380 ehc->i.action, frozen, tries_buf); 2380 ehc->i.action, frozen, tries_buf);
2381 if (desc) 2381 if (desc)
2382 ata_dev_printk(ehc->i.dev, KERN_ERR, "%s\n", desc); 2382 ata_dev_err(ehc->i.dev, "%s\n", desc);
2383 } else { 2383 } else {
2384 ata_link_printk(link, KERN_ERR, "exception Emask 0x%x " 2384 ata_link_err(link, "exception Emask 0x%x "
2385 "SAct 0x%x SErr 0x%x action 0x%x%s%s\n", 2385 "SAct 0x%x SErr 0x%x action 0x%x%s%s\n",
2386 ehc->i.err_mask, link->sactive, ehc->i.serror, 2386 ehc->i.err_mask, link->sactive, ehc->i.serror,
2387 ehc->i.action, frozen, tries_buf); 2387 ehc->i.action, frozen, tries_buf);
2388 if (desc) 2388 if (desc)
2389 ata_link_printk(link, KERN_ERR, "%s\n", desc); 2389 ata_link_err(link, "%s\n", desc);
2390 } 2390 }
2391 2391
2392#ifdef CONFIG_ATA_VERBOSE_ERROR 2392#ifdef CONFIG_ATA_VERBOSE_ERROR
2393 if (ehc->i.serror) 2393 if (ehc->i.serror)
2394 ata_link_printk(link, KERN_ERR, 2394 ata_link_err(link,
2395 "SError: { %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s}\n", 2395 "SError: { %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s}\n",
2396 ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "", 2396 ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "",
2397 ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "", 2397 ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "",
@@ -2456,11 +2456,11 @@ static void ata_eh_link_report(struct ata_link *link)
2456 } else { 2456 } else {
2457 const char *descr = ata_get_cmd_descript(cmd->command); 2457 const char *descr = ata_get_cmd_descript(cmd->command);
2458 if (descr) 2458 if (descr)
2459 ata_dev_printk(qc->dev, KERN_ERR, 2459 ata_dev_err(qc->dev, "failed command: %s\n",
2460 "failed command: %s\n", descr); 2460 descr);
2461 } 2461 }
2462 2462
2463 ata_dev_printk(qc->dev, KERN_ERR, 2463 ata_dev_err(qc->dev,
2464 "cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x " 2464 "cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
2465 "tag %d%s\n %s" 2465 "tag %d%s\n %s"
2466 "res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x " 2466 "res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
@@ -2481,11 +2481,9 @@ static void ata_eh_link_report(struct ata_link *link)
2481 if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | 2481 if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ |
2482 ATA_ERR)) { 2482 ATA_ERR)) {
2483 if (res->command & ATA_BUSY) 2483 if (res->command & ATA_BUSY)
2484 ata_dev_printk(qc->dev, KERN_ERR, 2484 ata_dev_err(qc->dev, "status: { Busy }\n");
2485 "status: { Busy }\n");
2486 else 2485 else
2487 ata_dev_printk(qc->dev, KERN_ERR, 2486 ata_dev_err(qc->dev, "status: { %s%s%s%s}\n",
2488 "status: { %s%s%s%s}\n",
2489 res->command & ATA_DRDY ? "DRDY " : "", 2487 res->command & ATA_DRDY ? "DRDY " : "",
2490 res->command & ATA_DF ? "DF " : "", 2488 res->command & ATA_DF ? "DF " : "",
2491 res->command & ATA_DRQ ? "DRQ " : "", 2489 res->command & ATA_DRQ ? "DRQ " : "",
@@ -2495,8 +2493,7 @@ static void ata_eh_link_report(struct ata_link *link)
2495 if (cmd->command != ATA_CMD_PACKET && 2493 if (cmd->command != ATA_CMD_PACKET &&
2496 (res->feature & (ATA_ICRC | ATA_UNC | ATA_IDNF | 2494 (res->feature & (ATA_ICRC | ATA_UNC | ATA_IDNF |
2497 ATA_ABORTED))) 2495 ATA_ABORTED)))
2498 ata_dev_printk(qc->dev, KERN_ERR, 2496 ata_dev_err(qc->dev, "error: { %s%s%s%s}\n",
2499 "error: { %s%s%s%s}\n",
2500 res->feature & ATA_ICRC ? "ICRC " : "", 2497 res->feature & ATA_ICRC ? "ICRC " : "",
2501 res->feature & ATA_UNC ? "UNC " : "", 2498 res->feature & ATA_UNC ? "UNC " : "",
2502 res->feature & ATA_IDNF ? "IDNF " : "", 2499 res->feature & ATA_IDNF ? "IDNF " : "",
@@ -2650,8 +2647,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
2650 2647
2651 if (rc) { 2648 if (rc) {
2652 if (rc == -ENOENT) { 2649 if (rc == -ENOENT) {
2653 ata_link_printk(link, KERN_DEBUG, 2650 ata_link_dbg(link, "port disabled--ignoring\n");
2654 "port disabled. ignoring.\n");
2655 ehc->i.action &= ~ATA_EH_RESET; 2651 ehc->i.action &= ~ATA_EH_RESET;
2656 2652
2657 ata_for_each_dev(dev, link, ALL) 2653 ata_for_each_dev(dev, link, ALL)
@@ -2659,8 +2655,9 @@ int ata_eh_reset(struct ata_link *link, int classify,
2659 2655
2660 rc = 0; 2656 rc = 0;
2661 } else 2657 } else
2662 ata_link_printk(link, KERN_ERR, 2658 ata_link_err(link,
2663 "prereset failed (errno=%d)\n", rc); 2659 "prereset failed (errno=%d)\n",
2660 rc);
2664 goto out; 2661 goto out;
2665 } 2662 }
2666 2663
@@ -2689,8 +2686,8 @@ int ata_eh_reset(struct ata_link *link, int classify,
2689 2686
2690 if (reset) { 2687 if (reset) {
2691 if (verbose) 2688 if (verbose)
2692 ata_link_printk(link, KERN_INFO, "%s resetting link\n", 2689 ata_link_info(link, "%s resetting link\n",
2693 reset == softreset ? "soft" : "hard"); 2690 reset == softreset ? "soft" : "hard");
2694 2691
2695 /* mark that this EH session started with reset */ 2692 /* mark that this EH session started with reset */
2696 ehc->last_reset = jiffies; 2693 ehc->last_reset = jiffies;
@@ -2710,8 +2707,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
2710 int tmp; 2707 int tmp;
2711 2708
2712 if (verbose) 2709 if (verbose)
2713 ata_link_printk(slave, KERN_INFO, 2710 ata_link_info(slave, "hard resetting link\n");
2714 "hard resetting link\n");
2715 2711
2716 ata_eh_about_to_do(slave, NULL, ATA_EH_RESET); 2712 ata_eh_about_to_do(slave, NULL, ATA_EH_RESET);
2717 tmp = ata_do_reset(slave, reset, classes, deadline, 2713 tmp = ata_do_reset(slave, reset, classes, deadline,
@@ -2734,9 +2730,8 @@ int ata_eh_reset(struct ata_link *link, int classify,
2734 reset = softreset; 2730 reset = softreset;
2735 2731
2736 if (!reset) { 2732 if (!reset) {
2737 ata_link_printk(link, KERN_ERR, 2733 ata_link_err(link,
2738 "follow-up softreset required " 2734 "follow-up softreset required but no softreset available\n");
2739 "but no softreset available\n");
2740 failed_link = link; 2735 failed_link = link;
2741 rc = -EINVAL; 2736 rc = -EINVAL;
2742 goto fail; 2737 goto fail;
@@ -2751,8 +2746,8 @@ int ata_eh_reset(struct ata_link *link, int classify,
2751 } 2746 }
2752 } else { 2747 } else {
2753 if (verbose) 2748 if (verbose)
2754 ata_link_printk(link, KERN_INFO, "no reset method " 2749 ata_link_info(link,
2755 "available, skipping reset\n"); 2750 "no reset method available, skipping reset\n");
2756 if (!(lflags & ATA_LFLAG_ASSUME_CLASS)) 2751 if (!(lflags & ATA_LFLAG_ASSUME_CLASS))
2757 lflags |= ATA_LFLAG_ASSUME_ATA; 2752 lflags |= ATA_LFLAG_ASSUME_ATA;
2758 } 2753 }
@@ -2830,36 +2825,35 @@ int ata_eh_reset(struct ata_link *link, int classify,
2830 ata_for_each_dev(dev, link, ALL) { 2825 ata_for_each_dev(dev, link, ALL) {
2831 if (ata_phys_link_online(ata_dev_phys_link(dev))) { 2826 if (ata_phys_link_online(ata_dev_phys_link(dev))) {
2832 if (classes[dev->devno] == ATA_DEV_UNKNOWN) { 2827 if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
2833 ata_dev_printk(dev, KERN_DEBUG, "link online " 2828 ata_dev_dbg(dev, "link online but device misclassified\n");
2834 "but device misclassifed\n");
2835 classes[dev->devno] = ATA_DEV_NONE; 2829 classes[dev->devno] = ATA_DEV_NONE;
2836 nr_unknown++; 2830 nr_unknown++;
2837 } 2831 }
2838 } else if (ata_phys_link_offline(ata_dev_phys_link(dev))) { 2832 } else if (ata_phys_link_offline(ata_dev_phys_link(dev))) {
2839 if (ata_class_enabled(classes[dev->devno])) 2833 if (ata_class_enabled(classes[dev->devno]))
2840 ata_dev_printk(dev, KERN_DEBUG, "link offline, " 2834 ata_dev_dbg(dev,
2841 "clearing class %d to NONE\n", 2835 "link offline, clearing class %d to NONE\n",
2842 classes[dev->devno]); 2836 classes[dev->devno]);
2843 classes[dev->devno] = ATA_DEV_NONE; 2837 classes[dev->devno] = ATA_DEV_NONE;
2844 } else if (classes[dev->devno] == ATA_DEV_UNKNOWN) { 2838 } else if (classes[dev->devno] == ATA_DEV_UNKNOWN) {
2845 ata_dev_printk(dev, KERN_DEBUG, "link status unknown, " 2839 ata_dev_dbg(dev,
2846 "clearing UNKNOWN to NONE\n"); 2840 "link status unknown, clearing UNKNOWN to NONE\n");
2847 classes[dev->devno] = ATA_DEV_NONE; 2841 classes[dev->devno] = ATA_DEV_NONE;
2848 } 2842 }
2849 } 2843 }
2850 2844
2851 if (classify && nr_unknown) { 2845 if (classify && nr_unknown) {
2852 if (try < max_tries) { 2846 if (try < max_tries) {
2853 ata_link_printk(link, KERN_WARNING, "link online but " 2847 ata_link_warn(link,
2854 "%d devices misclassified, retrying\n", 2848 "link online but %d devices misclassified, retrying\n",
2855 nr_unknown); 2849 nr_unknown);
2856 failed_link = link; 2850 failed_link = link;
2857 rc = -EAGAIN; 2851 rc = -EAGAIN;
2858 goto fail; 2852 goto fail;
2859 } 2853 }
2860 ata_link_printk(link, KERN_WARNING, 2854 ata_link_warn(link,
2861 "link online but %d devices misclassified, " 2855 "link online but %d devices misclassified, "
2862 "device detection might fail\n", nr_unknown); 2856 "device detection might fail\n", nr_unknown);
2863 } 2857 }
2864 2858
2865 /* reset successful, schedule revalidation */ 2859 /* reset successful, schedule revalidation */
@@ -2896,7 +2890,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
2896 if (time_before(now, deadline)) { 2890 if (time_before(now, deadline)) {
2897 unsigned long delta = deadline - now; 2891 unsigned long delta = deadline - now;
2898 2892
2899 ata_link_printk(failed_link, KERN_WARNING, 2893 ata_link_warn(failed_link,
2900 "reset failed (errno=%d), retrying in %u secs\n", 2894 "reset failed (errno=%d), retrying in %u secs\n",
2901 rc, DIV_ROUND_UP(jiffies_to_msecs(delta), 1000)); 2895 rc, DIV_ROUND_UP(jiffies_to_msecs(delta), 1000));
2902 2896
@@ -2987,7 +2981,7 @@ static void ata_eh_park_issue_cmd(struct ata_device *dev, int park)
2987 tf.protocol |= ATA_PROT_NODATA; 2981 tf.protocol |= ATA_PROT_NODATA;
2988 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 2982 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
2989 if (park && (err_mask || tf.lbal != 0xc4)) { 2983 if (park && (err_mask || tf.lbal != 0xc4)) {
2990 ata_dev_printk(dev, KERN_ERR, "head unload failed!\n"); 2984 ata_dev_err(dev, "head unload failed!\n");
2991 ehc->unloaded_mask &= ~(1 << dev->devno); 2985 ehc->unloaded_mask &= ~(1 << dev->devno);
2992 } 2986 }
2993} 2987}
@@ -3198,8 +3192,9 @@ static int atapi_eh_clear_ua(struct ata_device *dev)
3198 3192
3199 err_mask = atapi_eh_tur(dev, &sense_key); 3193 err_mask = atapi_eh_tur(dev, &sense_key);
3200 if (err_mask != 0 && err_mask != AC_ERR_DEV) { 3194 if (err_mask != 0 && err_mask != AC_ERR_DEV) {
3201 ata_dev_printk(dev, KERN_WARNING, "TEST_UNIT_READY " 3195 ata_dev_warn(dev,
3202 "failed (err_mask=0x%x)\n", err_mask); 3196 "TEST_UNIT_READY failed (err_mask=0x%x)\n",
3197 err_mask);
3203 return -EIO; 3198 return -EIO;
3204 } 3199 }
3205 3200
@@ -3208,14 +3203,14 @@ static int atapi_eh_clear_ua(struct ata_device *dev)
3208 3203
3209 err_mask = atapi_eh_request_sense(dev, sense_buffer, sense_key); 3204 err_mask = atapi_eh_request_sense(dev, sense_buffer, sense_key);
3210 if (err_mask) { 3205 if (err_mask) {
3211 ata_dev_printk(dev, KERN_WARNING, "failed to clear " 3206 ata_dev_warn(dev, "failed to clear "
3212 "UNIT ATTENTION (err_mask=0x%x)\n", err_mask); 3207 "UNIT ATTENTION (err_mask=0x%x)\n", err_mask);
3213 return -EIO; 3208 return -EIO;
3214 } 3209 }
3215 } 3210 }
3216 3211
3217 ata_dev_printk(dev, KERN_WARNING, 3212 ata_dev_warn(dev, "UNIT ATTENTION persists after %d tries\n",
3218 "UNIT ATTENTION persists after %d tries\n", ATA_EH_UA_TRIES); 3213 ATA_EH_UA_TRIES);
3219 3214
3220 return 0; 3215 return 0;
3221} 3216}
@@ -3266,7 +3261,7 @@ static int ata_eh_maybe_retry_flush(struct ata_device *dev)
3266 tf.flags |= ATA_TFLAG_DEVICE; 3261 tf.flags |= ATA_TFLAG_DEVICE;
3267 tf.protocol = ATA_PROT_NODATA; 3262 tf.protocol = ATA_PROT_NODATA;
3268 3263
3269 ata_dev_printk(dev, KERN_WARNING, "retrying FLUSH 0x%x Emask 0x%x\n", 3264 ata_dev_warn(dev, "retrying FLUSH 0x%x Emask 0x%x\n",
3270 tf.command, qc->err_mask); 3265 tf.command, qc->err_mask);
3271 3266
3272 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 3267 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
@@ -3281,7 +3276,7 @@ static int ata_eh_maybe_retry_flush(struct ata_device *dev)
3281 */ 3276 */
3282 qc->scsicmd->allowed = max(qc->scsicmd->allowed, 1); 3277 qc->scsicmd->allowed = max(qc->scsicmd->allowed, 1);
3283 } else { 3278 } else {
3284 ata_dev_printk(dev, KERN_WARNING, "FLUSH failed Emask 0x%x\n", 3279 ata_dev_warn(dev, "FLUSH failed Emask 0x%x\n",
3285 err_mask); 3280 err_mask);
3286 rc = -EIO; 3281 rc = -EIO;
3287 3282
@@ -3355,9 +3350,9 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
3355 err_mask = ata_dev_set_feature(dev, 3350 err_mask = ata_dev_set_feature(dev,
3356 SETFEATURES_SATA_DISABLE, SATA_DIPM); 3351 SETFEATURES_SATA_DISABLE, SATA_DIPM);
3357 if (err_mask && err_mask != AC_ERR_DEV) { 3352 if (err_mask && err_mask != AC_ERR_DEV) {
3358 ata_dev_printk(dev, KERN_WARNING, 3353 ata_dev_warn(dev,
3359 "failed to disable DIPM, Emask 0x%x\n", 3354 "failed to disable DIPM, Emask 0x%x\n",
3360 err_mask); 3355 err_mask);
3361 rc = -EIO; 3356 rc = -EIO;
3362 goto fail; 3357 goto fail;
3363 } 3358 }
@@ -3399,7 +3394,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
3399 err_mask = ata_dev_set_feature(dev, 3394 err_mask = ata_dev_set_feature(dev,
3400 SETFEATURES_SATA_ENABLE, SATA_DIPM); 3395 SETFEATURES_SATA_ENABLE, SATA_DIPM);
3401 if (err_mask && err_mask != AC_ERR_DEV) { 3396 if (err_mask && err_mask != AC_ERR_DEV) {
3402 ata_dev_printk(dev, KERN_WARNING, 3397 ata_dev_warn(dev,
3403 "failed to enable DIPM, Emask 0x%x\n", 3398 "failed to enable DIPM, Emask 0x%x\n",
3404 err_mask); 3399 err_mask);
3405 rc = -EIO; 3400 rc = -EIO;
@@ -3418,8 +3413,7 @@ fail:
3418 3413
3419 /* if no device or only one more chance is left, disable LPM */ 3414 /* if no device or only one more chance is left, disable LPM */
3420 if (!dev || ehc->tries[dev->devno] <= 2) { 3415 if (!dev || ehc->tries[dev->devno] <= 2) {
3421 ata_link_printk(link, KERN_WARNING, 3416 ata_link_warn(link, "disabling LPM on the link\n");
3422 "disabling LPM on the link\n");
3423 link->flags |= ATA_LFLAG_NO_LPM; 3417 link->flags |= ATA_LFLAG_NO_LPM;
3424 } 3418 }
3425 if (r_failed_dev) 3419 if (r_failed_dev)
@@ -3690,8 +3684,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
3690 rc = ata_eh_reset(link, ata_link_nr_vacant(link), 3684 rc = ata_eh_reset(link, ata_link_nr_vacant(link),
3691 prereset, softreset, hardreset, postreset); 3685 prereset, softreset, hardreset, postreset);
3692 if (rc) { 3686 if (rc) {
3693 ata_link_printk(link, KERN_ERR, 3687 ata_link_err(link, "reset failed, giving up\n");
3694 "reset failed, giving up\n");
3695 goto out; 3688 goto out;
3696 } 3689 }
3697 } 3690 }
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index f06b7ea590d3..3eb2b816eb2a 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -147,8 +147,8 @@ int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *r_val)
147 147
148 err_mask = sata_pmp_read(link, reg, r_val); 148 err_mask = sata_pmp_read(link, reg, r_val);
149 if (err_mask) { 149 if (err_mask) {
150 ata_link_printk(link, KERN_WARNING, "failed to read SCR %d " 150 ata_link_warn(link, "failed to read SCR %d (Emask=0x%x)\n",
151 "(Emask=0x%x)\n", reg, err_mask); 151 reg, err_mask);
152 return -EIO; 152 return -EIO;
153 } 153 }
154 return 0; 154 return 0;
@@ -178,8 +178,8 @@ int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val)
178 178
179 err_mask = sata_pmp_write(link, reg, val); 179 err_mask = sata_pmp_write(link, reg, val);
180 if (err_mask) { 180 if (err_mask) {
181 ata_link_printk(link, KERN_WARNING, "failed to write SCR %d " 181 ata_link_warn(link, "failed to write SCR %d (Emask=0x%x)\n",
182 "(Emask=0x%x)\n", reg, err_mask); 182 reg, err_mask);
183 return -EIO; 183 return -EIO;
184 } 184 }
185 return 0; 185 return 0;
@@ -231,8 +231,8 @@ static int sata_pmp_read_gscr(struct ata_device *dev, u32 *gscr)
231 231
232 err_mask = sata_pmp_read(dev->link, reg, &gscr[reg]); 232 err_mask = sata_pmp_read(dev->link, reg, &gscr[reg]);
233 if (err_mask) { 233 if (err_mask) {
234 ata_dev_printk(dev, KERN_ERR, "failed to read PMP " 234 ata_dev_err(dev, "failed to read PMP GSCR[%d] (Emask=0x%x)\n",
235 "GSCR[%d] (Emask=0x%x)\n", reg, err_mask); 235 reg, err_mask);
236 return -EIO; 236 return -EIO;
237 } 237 }
238 } 238 }
@@ -311,26 +311,25 @@ static int sata_pmp_configure(struct ata_device *dev, int print_info)
311 } 311 }
312 312
313 if (print_info) { 313 if (print_info) {
314 ata_dev_printk(dev, KERN_INFO, "Port Multiplier %s, " 314 ata_dev_info(dev, "Port Multiplier %s, "
315 "0x%04x:0x%04x r%d, %d ports, feat 0x%x/0x%x\n", 315 "0x%04x:0x%04x r%d, %d ports, feat 0x%x/0x%x\n",
316 sata_pmp_spec_rev_str(gscr), vendor, devid, 316 sata_pmp_spec_rev_str(gscr), vendor, devid,
317 sata_pmp_gscr_rev(gscr), 317 sata_pmp_gscr_rev(gscr),
318 nr_ports, gscr[SATA_PMP_GSCR_FEAT_EN], 318 nr_ports, gscr[SATA_PMP_GSCR_FEAT_EN],
319 gscr[SATA_PMP_GSCR_FEAT]); 319 gscr[SATA_PMP_GSCR_FEAT]);
320 320
321 if (!(dev->flags & ATA_DFLAG_AN)) 321 if (!(dev->flags & ATA_DFLAG_AN))
322 ata_dev_printk(dev, KERN_INFO, 322 ata_dev_info(dev,
323 "Asynchronous notification not supported, " 323 "Asynchronous notification not supported, "
324 "hotplug won't\n work on fan-out " 324 "hotplug won't work on fan-out ports. Use warm-plug instead.\n");
325 "ports. Use warm-plug instead.\n");
326 } 325 }
327 326
328 return 0; 327 return 0;
329 328
330 fail: 329 fail:
331 ata_dev_printk(dev, KERN_ERR, 330 ata_dev_err(dev,
332 "failed to configure Port Multiplier (%s, Emask=0x%x)\n", 331 "failed to configure Port Multiplier (%s, Emask=0x%x)\n",
333 reason, err_mask); 332 reason, err_mask);
334 return rc; 333 return rc;
335} 334}
336 335
@@ -485,20 +484,17 @@ int sata_pmp_attach(struct ata_device *dev)
485 484
486 /* is it hanging off the right place? */ 485 /* is it hanging off the right place? */
487 if (!sata_pmp_supported(ap)) { 486 if (!sata_pmp_supported(ap)) {
488 ata_dev_printk(dev, KERN_ERR, 487 ata_dev_err(dev, "host does not support Port Multiplier\n");
489 "host does not support Port Multiplier\n");
490 return -EINVAL; 488 return -EINVAL;
491 } 489 }
492 490
493 if (!ata_is_host_link(link)) { 491 if (!ata_is_host_link(link)) {
494 ata_dev_printk(dev, KERN_ERR, 492 ata_dev_err(dev, "Port Multipliers cannot be nested\n");
495 "Port Multipliers cannot be nested\n");
496 return -EINVAL; 493 return -EINVAL;
497 } 494 }
498 495
499 if (dev->devno) { 496 if (dev->devno) {
500 ata_dev_printk(dev, KERN_ERR, 497 ata_dev_err(dev, "Port Multiplier must be the first device\n");
501 "Port Multiplier must be the first device\n");
502 return -EINVAL; 498 return -EINVAL;
503 } 499 }
504 500
@@ -517,8 +513,7 @@ int sata_pmp_attach(struct ata_device *dev)
517 513
518 rc = sata_pmp_init_links(ap, sata_pmp_gscr_ports(dev->gscr)); 514 rc = sata_pmp_init_links(ap, sata_pmp_gscr_ports(dev->gscr));
519 if (rc) { 515 if (rc) {
520 ata_dev_printk(dev, KERN_INFO, 516 ata_dev_info(dev, "failed to initialize PMP links\n");
521 "failed to initialize PMP links\n");
522 goto fail; 517 goto fail;
523 } 518 }
524 519
@@ -562,7 +557,7 @@ static void sata_pmp_detach(struct ata_device *dev)
562 struct ata_link *tlink; 557 struct ata_link *tlink;
563 unsigned long flags; 558 unsigned long flags;
564 559
565 ata_dev_printk(dev, KERN_INFO, "Port Multiplier detaching\n"); 560 ata_dev_info(dev, "Port Multiplier detaching\n");
566 561
567 WARN_ON(!ata_is_host_link(link) || dev->devno || 562 WARN_ON(!ata_is_host_link(link) || dev->devno ||
568 link->pmp != SATA_PMP_CTRL_PORT); 563 link->pmp != SATA_PMP_CTRL_PORT);
@@ -609,23 +604,23 @@ static int sata_pmp_same_pmp(struct ata_device *dev, const u32 *new_gscr)
609 new_nr_ports = sata_pmp_gscr_ports(new_gscr); 604 new_nr_ports = sata_pmp_gscr_ports(new_gscr);
610 605
611 if (old_vendor != new_vendor) { 606 if (old_vendor != new_vendor) {
612 ata_dev_printk(dev, KERN_INFO, "Port Multiplier " 607 ata_dev_info(dev,
613 "vendor mismatch '0x%x' != '0x%x'\n", 608 "Port Multiplier vendor mismatch '0x%x' != '0x%x'\n",
614 old_vendor, new_vendor); 609 old_vendor, new_vendor);
615 return 0; 610 return 0;
616 } 611 }
617 612
618 if (old_devid != new_devid) { 613 if (old_devid != new_devid) {
619 ata_dev_printk(dev, KERN_INFO, "Port Multiplier " 614 ata_dev_info(dev,
620 "device ID mismatch '0x%x' != '0x%x'\n", 615 "Port Multiplier device ID mismatch '0x%x' != '0x%x'\n",
621 old_devid, new_devid); 616 old_devid, new_devid);
622 return 0; 617 return 0;
623 } 618 }
624 619
625 if (old_nr_ports != new_nr_ports) { 620 if (old_nr_ports != new_nr_ports) {
626 ata_dev_printk(dev, KERN_INFO, "Port Multiplier " 621 ata_dev_info(dev,
627 "nr_ports mismatch '0x%x' != '0x%x'\n", 622 "Port Multiplier nr_ports mismatch '0x%x' != '0x%x'\n",
628 old_nr_ports, new_nr_ports); 623 old_nr_ports, new_nr_ports);
629 return 0; 624 return 0;
630 } 625 }
631 626
@@ -691,8 +686,7 @@ static int sata_pmp_revalidate(struct ata_device *dev, unsigned int new_class)
691 return 0; 686 return 0;
692 687
693 fail: 688 fail:
694 ata_dev_printk(dev, KERN_ERR, 689 ata_dev_err(dev, "PMP revalidation failed (errno=%d)\n", rc);
695 "PMP revalidation failed (errno=%d)\n", rc);
696 DPRINTK("EXIT, rc=%d\n", rc); 690 DPRINTK("EXIT, rc=%d\n", rc);
697 return rc; 691 return rc;
698} 692}
@@ -716,13 +710,14 @@ static int sata_pmp_revalidate_quick(struct ata_device *dev)
716 710
717 err_mask = sata_pmp_read(dev->link, SATA_PMP_GSCR_PROD_ID, &prod_id); 711 err_mask = sata_pmp_read(dev->link, SATA_PMP_GSCR_PROD_ID, &prod_id);
718 if (err_mask) { 712 if (err_mask) {
719 ata_dev_printk(dev, KERN_ERR, "failed to read PMP product ID " 713 ata_dev_err(dev,
720 "(Emask=0x%x)\n", err_mask); 714 "failed to read PMP product ID (Emask=0x%x)\n",
715 err_mask);
721 return -EIO; 716 return -EIO;
722 } 717 }
723 718
724 if (prod_id != dev->gscr[SATA_PMP_GSCR_PROD_ID]) { 719 if (prod_id != dev->gscr[SATA_PMP_GSCR_PROD_ID]) {
725 ata_dev_printk(dev, KERN_ERR, "PMP product ID mismatch\n"); 720 ata_dev_err(dev, "PMP product ID mismatch\n");
726 /* something weird is going on, request full PMP recovery */ 721 /* something weird is going on, request full PMP recovery */
727 return -EIO; 722 return -EIO;
728 } 723 }
@@ -777,8 +772,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
777 rc = ata_eh_reset(link, 0, prereset, softreset, hardreset, 772 rc = ata_eh_reset(link, 0, prereset, softreset, hardreset,
778 postreset); 773 postreset);
779 if (rc) { 774 if (rc) {
780 ata_link_printk(link, KERN_ERR, 775 ata_link_err(link, "failed to reset PMP, giving up\n");
781 "failed to reset PMP, giving up\n");
782 goto fail; 776 goto fail;
783 } 777 }
784 778
@@ -819,9 +813,9 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
819 ehc->i.action |= ATA_EH_RESET; 813 ehc->i.action |= ATA_EH_RESET;
820 goto retry; 814 goto retry;
821 } else { 815 } else {
822 ata_dev_printk(dev, KERN_ERR, "failed to recover PMP " 816 ata_dev_err(dev,
823 "after %d tries, giving up\n", 817 "failed to recover PMP after %d tries, giving up\n",
824 ATA_EH_PMP_TRIES); 818 ATA_EH_PMP_TRIES);
825 goto fail; 819 goto fail;
826 } 820 }
827 } 821 }
@@ -867,8 +861,9 @@ static int sata_pmp_eh_handle_disabled_links(struct ata_port *ap)
867 /* unconditionally clear SError.N */ 861 /* unconditionally clear SError.N */
868 rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG); 862 rc = sata_scr_write(link, SCR_ERROR, SERR_PHYRDY_CHG);
869 if (rc) { 863 if (rc) {
870 ata_link_printk(link, KERN_ERR, "failed to clear " 864 ata_link_err(link,
871 "SError.N (errno=%d)\n", rc); 865 "failed to clear SError.N (errno=%d)\n",
866 rc);
872 return rc; 867 return rc;
873 } 868 }
874 869
@@ -890,7 +885,7 @@ static int sata_pmp_handle_link_fail(struct ata_link *link, int *link_tries)
890 885
891 /* disable this link */ 886 /* disable this link */
892 if (!(link->flags & ATA_LFLAG_DISABLED)) { 887 if (!(link->flags & ATA_LFLAG_DISABLED)) {
893 ata_link_printk(link, KERN_WARNING, 888 ata_link_warn(link,
894 "failed to recover link after %d tries, disabling\n", 889 "failed to recover link after %d tries, disabling\n",
895 ATA_EH_PMP_LINK_TRIES); 890 ATA_EH_PMP_LINK_TRIES);
896 891
@@ -974,7 +969,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
974 err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN, 969 err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN,
975 gscr[SATA_PMP_GSCR_FEAT_EN]); 970 gscr[SATA_PMP_GSCR_FEAT_EN]);
976 if (err_mask) { 971 if (err_mask) {
977 ata_link_printk(pmp_link, KERN_WARNING, 972 ata_link_warn(pmp_link,
978 "failed to disable NOTIFY (err_mask=0x%x)\n", 973 "failed to disable NOTIFY (err_mask=0x%x)\n",
979 err_mask); 974 err_mask);
980 goto pmp_fail; 975 goto pmp_fail;
@@ -1018,8 +1013,9 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
1018 err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN, 1013 err_mask = sata_pmp_write(pmp_link, SATA_PMP_GSCR_FEAT_EN,
1019 gscr[SATA_PMP_GSCR_FEAT_EN]); 1014 gscr[SATA_PMP_GSCR_FEAT_EN]);
1020 if (err_mask) { 1015 if (err_mask) {
1021 ata_dev_printk(pmp_dev, KERN_ERR, "failed to write " 1016 ata_dev_err(pmp_dev,
1022 "PMP_FEAT_EN (Emask=0x%x)\n", err_mask); 1017 "failed to write PMP_FEAT_EN (Emask=0x%x)\n",
1018 err_mask);
1023 rc = -EIO; 1019 rc = -EIO;
1024 goto pmp_fail; 1020 goto pmp_fail;
1025 } 1021 }
@@ -1028,8 +1024,9 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
1028 /* check GSCR_ERROR */ 1024 /* check GSCR_ERROR */
1029 err_mask = sata_pmp_read(pmp_link, SATA_PMP_GSCR_ERROR, &gscr_error); 1025 err_mask = sata_pmp_read(pmp_link, SATA_PMP_GSCR_ERROR, &gscr_error);
1030 if (err_mask) { 1026 if (err_mask) {
1031 ata_dev_printk(pmp_dev, KERN_ERR, "failed to read " 1027 ata_dev_err(pmp_dev,
1032 "PMP_GSCR_ERROR (Emask=0x%x)\n", err_mask); 1028 "failed to read PMP_GSCR_ERROR (Emask=0x%x)\n",
1029 err_mask);
1033 rc = -EIO; 1030 rc = -EIO;
1034 goto pmp_fail; 1031 goto pmp_fail;
1035 } 1032 }
@@ -1043,17 +1040,16 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
1043 ata_ehi_hotplugged(&link->eh_context.i); 1040 ata_ehi_hotplugged(&link->eh_context.i);
1044 cnt++; 1041 cnt++;
1045 } else { 1042 } else {
1046 ata_link_printk(link, KERN_WARNING, 1043 ata_link_warn(link,
1047 "PHY status changed but maxed out on retries, " 1044 "PHY status changed but maxed out on retries, giving up\n");
1048 "giving up\n"); 1045 ata_link_warn(link,
1049 ata_link_printk(link, KERN_WARNING, 1046 "Manually issue scan to resume this link\n");
1050 "Manully issue scan to resume this link\n");
1051 } 1047 }
1052 } 1048 }
1053 1049
1054 if (cnt) { 1050 if (cnt) {
1055 ata_port_printk(ap, KERN_INFO, "PMP SError.N set for some " 1051 ata_port_info(ap,
1056 "ports, repeating recovery\n"); 1052 "PMP SError.N set for some ports, repeating recovery\n");
1057 goto retry; 1053 goto retry;
1058 } 1054 }
1059 1055
@@ -1081,9 +1077,8 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
1081 goto retry; 1077 goto retry;
1082 } 1078 }
1083 1079
1084 ata_port_printk(ap, KERN_ERR, 1080 ata_port_err(ap, "failed to recover PMP after %d tries, giving up\n",
1085 "failed to recover PMP after %d tries, giving up\n", 1081 ATA_EH_PMP_TRIES);
1086 ATA_EH_PMP_TRIES);
1087 sata_pmp_detach(pmp_dev); 1082 sata_pmp_detach(pmp_dev);
1088 ata_dev_disable(pmp_dev); 1083 ata_dev_disable(pmp_dev);
1089 1084
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 927f968e99d9..46d087f08607 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1108,8 +1108,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
1108 /* configure draining */ 1108 /* configure draining */
1109 buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL); 1109 buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL);
1110 if (!buf) { 1110 if (!buf) {
1111 ata_dev_printk(dev, KERN_ERR, 1111 ata_dev_err(dev, "drain buffer allocation failed\n");
1112 "drain buffer allocation failed\n");
1113 return -ENOMEM; 1112 return -ENOMEM;
1114 } 1113 }
1115 1114
@@ -1127,7 +1126,7 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
1127 * IDENTIFY_PACKET is executed as ATA_PROT_PIO. 1126 * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
1128 */ 1127 */
1129 if (sdev->sector_size > PAGE_SIZE) 1128 if (sdev->sector_size > PAGE_SIZE)
1130 ata_dev_printk(dev, KERN_WARNING, 1129 ata_dev_warn(dev,
1131 "sector_size=%u > PAGE_SIZE, PIO may malfunction\n", 1130 "sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
1132 sdev->sector_size); 1131 sdev->sector_size);
1133 1132
@@ -1784,8 +1783,7 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
1784 if (cmd->sc_data_direction == DMA_FROM_DEVICE || 1783 if (cmd->sc_data_direction == DMA_FROM_DEVICE ||
1785 cmd->sc_data_direction == DMA_TO_DEVICE) { 1784 cmd->sc_data_direction == DMA_TO_DEVICE) {
1786 if (unlikely(scsi_bufflen(cmd) < 1)) { 1785 if (unlikely(scsi_bufflen(cmd) < 1)) {
1787 ata_dev_printk(dev, KERN_WARNING, 1786 ata_dev_warn(dev, "WARNING: zero len r/w req\n");
1788 "WARNING: zero len r/w req\n");
1789 goto err_did; 1787 goto err_did;
1790 } 1788 }
1791 1789
@@ -2969,9 +2967,8 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
2969 * with the cached multi_count of libata 2967 * with the cached multi_count of libata
2970 */ 2968 */
2971 if (multi_count != dev->multi_count) 2969 if (multi_count != dev->multi_count)
2972 ata_dev_printk(dev, KERN_WARNING, 2970 ata_dev_warn(dev, "invalid multi_count %u ignored\n",
2973 "invalid multi_count %u ignored\n", 2971 multi_count);
2974 multi_count);
2975 } 2972 }
2976 2973
2977 /* 2974 /*
@@ -3466,9 +3463,8 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
3466 goto repeat; 3463 goto repeat;
3467 } 3464 }
3468 3465
3469 ata_port_printk(ap, KERN_ERR, "WARNING: synchronous SCSI scan " 3466 ata_port_err(ap,
3470 "failed without making any progress,\n" 3467 "WARNING: synchronous SCSI scan failed without making any progress, switching to async\n");
3471 " switching to async\n");
3472 } 3468 }
3473 3469
3474 queue_delayed_work(system_long_wq, &ap->hotplug_task, 3470 queue_delayed_work(system_long_wq, &ap->hotplug_task,
@@ -3550,8 +3546,8 @@ static void ata_scsi_remove_dev(struct ata_device *dev)
3550 mutex_unlock(&ap->scsi_host->scan_mutex); 3546 mutex_unlock(&ap->scsi_host->scan_mutex);
3551 3547
3552 if (sdev) { 3548 if (sdev) {
3553 ata_dev_printk(dev, KERN_INFO, "detaching (SCSI %s)\n", 3549 ata_dev_info(dev, "detaching (SCSI %s)\n",
3554 dev_name(&sdev->sdev_gendev)); 3550 dev_name(&sdev->sdev_gendev));
3555 3551
3556 scsi_remove_device(sdev); 3552 scsi_remove_device(sdev);
3557 scsi_device_put(sdev); 3553 scsi_device_put(sdev);
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index e01d5cfba68a..996a7a57accc 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -227,9 +227,9 @@ int ata_sff_busy_sleep(struct ata_port *ap,
227 } 227 }
228 228
229 if (status != 0xff && (status & ATA_BUSY)) 229 if (status != 0xff && (status & ATA_BUSY))
230 ata_port_printk(ap, KERN_WARNING, 230 ata_port_warn(ap,
231 "port is slow to respond, please be patient " 231 "port is slow to respond, please be patient (Status 0x%x)\n",
232 "(Status 0x%x)\n", status); 232 status);
233 233
234 timeout = ata_deadline(timer_start, tmout); 234 timeout = ata_deadline(timer_start, tmout);
235 while (status != 0xff && (status & ATA_BUSY) && 235 while (status != 0xff && (status & ATA_BUSY) &&
@@ -242,9 +242,9 @@ int ata_sff_busy_sleep(struct ata_port *ap,
242 return -ENODEV; 242 return -ENODEV;
243 243
244 if (status & ATA_BUSY) { 244 if (status & ATA_BUSY) {
245 ata_port_printk(ap, KERN_ERR, "port failed to respond " 245 ata_port_err(ap,
246 "(%lu secs, Status 0x%x)\n", 246 "port failed to respond (%lu secs, Status 0x%x)\n",
247 DIV_ROUND_UP(tmout, 1000), status); 247 DIV_ROUND_UP(tmout, 1000), status);
248 return -EBUSY; 248 return -EBUSY;
249 } 249 }
250 250
@@ -350,8 +350,8 @@ static void ata_dev_select(struct ata_port *ap, unsigned int device,
350 unsigned int wait, unsigned int can_sleep) 350 unsigned int wait, unsigned int can_sleep)
351{ 351{
352 if (ata_msg_probe(ap)) 352 if (ata_msg_probe(ap))
353 ata_port_printk(ap, KERN_INFO, "ata_dev_select: ENTER, " 353 ata_port_info(ap, "ata_dev_select: ENTER, device %u, wait %u\n",
354 "device %u, wait %u\n", device, wait); 354 device, wait);
355 355
356 if (wait) 356 if (wait)
357 ata_wait_idle(ap); 357 ata_wait_idle(ap);
@@ -1335,7 +1335,7 @@ void ata_sff_flush_pio_task(struct ata_port *ap)
1335 ap->hsm_task_state = HSM_ST_IDLE; 1335 ap->hsm_task_state = HSM_ST_IDLE;
1336 1336
1337 if (ata_msg_ctl(ap)) 1337 if (ata_msg_ctl(ap))
1338 ata_port_printk(ap, KERN_DEBUG, "%s: EXIT\n", __func__); 1338 ata_port_dbg(ap, "%s: EXIT\n", __func__);
1339} 1339}
1340 1340
1341static void ata_sff_pio_task(struct work_struct *work) 1341static void ata_sff_pio_task(struct work_struct *work)
@@ -1513,7 +1513,7 @@ static unsigned int ata_sff_idle_irq(struct ata_port *ap)
1513 ap->ops->sff_check_status(ap); 1513 ap->ops->sff_check_status(ap);
1514 if (ap->ops->sff_irq_clear) 1514 if (ap->ops->sff_irq_clear)
1515 ap->ops->sff_irq_clear(ap); 1515 ap->ops->sff_irq_clear(ap);
1516 ata_port_printk(ap, KERN_WARNING, "irq trap\n"); 1516 ata_port_warn(ap, "irq trap\n");
1517 return 1; 1517 return 1;
1518 } 1518 }
1519#endif 1519#endif
@@ -1711,7 +1711,7 @@ void ata_sff_lost_interrupt(struct ata_port *ap)
1711 1711
1712 /* There was a command running, we are no longer busy and we have 1712 /* There was a command running, we are no longer busy and we have
1713 no interrupt. */ 1713 no interrupt. */
1714 ata_port_printk(ap, KERN_WARNING, "lost interrupt (Status 0x%x)\n", 1714 ata_port_warn(ap, "lost interrupt (Status 0x%x)\n",
1715 status); 1715 status);
1716 /* Run the host interrupt logic as if the interrupt had not been 1716 /* Run the host interrupt logic as if the interrupt had not been
1717 lost */ 1717 lost */
@@ -1798,8 +1798,9 @@ int ata_sff_prereset(struct ata_link *link, unsigned long deadline)
1798 if (!ata_link_offline(link)) { 1798 if (!ata_link_offline(link)) {
1799 rc = ata_sff_wait_ready(link, deadline); 1799 rc = ata_sff_wait_ready(link, deadline);
1800 if (rc && rc != -ENODEV) { 1800 if (rc && rc != -ENODEV) {
1801 ata_link_printk(link, KERN_WARNING, "device not ready " 1801 ata_link_warn(link,
1802 "(errno=%d), forcing hardreset\n", rc); 1802 "device not ready (errno=%d), forcing hardreset\n",
1803 rc);
1803 ehc->i.action |= ATA_EH_HARDRESET; 1804 ehc->i.action |= ATA_EH_HARDRESET;
1804 } 1805 }
1805 } 1806 }
@@ -2056,7 +2057,7 @@ int ata_sff_softreset(struct ata_link *link, unsigned int *classes,
2056 rc = ata_bus_softreset(ap, devmask, deadline); 2057 rc = ata_bus_softreset(ap, devmask, deadline);
2057 /* if link is occupied, -ENODEV too is an error */ 2058 /* if link is occupied, -ENODEV too is an error */
2058 if (rc && (rc != -ENODEV || sata_scr_valid(link))) { 2059 if (rc && (rc != -ENODEV || sata_scr_valid(link))) {
2059 ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc); 2060 ata_link_err(link, "SRST failed (errno=%d)\n", rc);
2060 return rc; 2061 return rc;
2061 } 2062 }
2062 2063
@@ -2170,8 +2171,7 @@ void ata_sff_drain_fifo(struct ata_queued_cmd *qc)
2170 2171
2171 /* Can become DEBUG later */ 2172 /* Can become DEBUG later */
2172 if (count) 2173 if (count)
2173 ata_port_printk(ap, KERN_DEBUG, 2174 ata_port_dbg(ap, "drained %d bytes to clear DRQ\n", count);
2174 "drained %d bytes to clear DRQ.\n", count);
2175 2175
2176} 2176}
2177EXPORT_SYMBOL_GPL(ata_sff_drain_fifo); 2177EXPORT_SYMBOL_GPL(ata_sff_drain_fifo);
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 794ec6e3275d..cadd67998bac 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -287,10 +287,10 @@ static void ali_warn_atapi_dma(struct ata_device *adev)
287 int print_info = ehc->i.flags & ATA_EHI_PRINTINFO; 287 int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
288 288
289 if (print_info && adev->class == ATA_DEV_ATAPI && !ali_atapi_dma) { 289 if (print_info && adev->class == ATA_DEV_ATAPI && !ali_atapi_dma) {
290 ata_dev_printk(adev, KERN_WARNING, 290 ata_dev_warn(adev,
291 "WARNING: ATAPI DMA disabled for reliability issues. It can be enabled\n"); 291 "WARNING: ATAPI DMA disabled for reliability issues. It can be enabled\n");
292 ata_dev_printk(adev, KERN_WARNING, 292 ata_dev_warn(adev,
293 "WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.\n"); 293 "WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.\n");
294 } 294 }
295} 295}
296 296
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index b741e0f73566..801554ddc59d 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -311,7 +311,7 @@ static unsigned long nv_mode_filter(struct ata_device *dev,
311 cable detection result */ 311 cable detection result */
312 limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2); 312 limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
313 313
314 ata_port_printk(ap, KERN_DEBUG, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, " 314 ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
315 "BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n", 315 "BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
316 xfer_mask, limit, xfer_mask & limit, bios_limit, 316 xfer_mask, limit, xfer_mask & limit, bios_limit,
317 saved_udma, acpi_limit, acpi_str); 317 saved_udma, acpi_limit, acpi_str);
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index ea64967000ff..bd987bb082eb 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1129,7 +1129,7 @@ static int bfin_softreset(struct ata_link *link, unsigned int *classes,
1129 /* issue bus reset */ 1129 /* issue bus reset */
1130 err_mask = bfin_bus_softreset(ap, devmask); 1130 err_mask = bfin_bus_softreset(ap, devmask);
1131 if (err_mask) { 1131 if (err_mask) {
1132 ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", 1132 ata_port_err(ap, "SRST failed (err_mask=0x%x)\n",
1133 err_mask); 1133 err_mask);
1134 return -EIO; 1134 return -EIO;
1135 } 1135 }
@@ -1382,7 +1382,7 @@ idle_irq:
1382#ifdef ATA_IRQ_TRAP 1382#ifdef ATA_IRQ_TRAP
1383 if ((ap->stats.idle_irq % 1000) == 0) { 1383 if ((ap->stats.idle_irq % 1000) == 0) {
1384 ap->ops->irq_ack(ap, 0); /* debug trap */ 1384 ap->ops->irq_ack(ap, 0); /* debug trap */
1385 ata_port_printk(ap, KERN_WARNING, "irq trap\n"); 1385 ata_port_warn(ap, "irq trap\n");
1386 return 1; 1386 return 1;
1387 } 1387 }
1388#endif 1388#endif
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index 9f2889fe43b2..52e7e7b8c74f 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -210,8 +210,8 @@ static void pata_icside_set_dmamode(struct ata_port *ap, struct ata_device *adev
210 else 210 else
211 iomd_type = 'A', cycle = 562; 211 iomd_type = 'A', cycle = 562;
212 212
213 ata_dev_printk(adev, KERN_INFO, "timings: act %dns rec %dns cyc %dns (%c)\n", 213 ata_dev_info(adev, "timings: act %dns rec %dns cyc %dns (%c)\n",
214 t.active, t.recover, t.cycle, iomd_type); 214 t.active, t.recover, t.cycle, iomd_type);
215 215
216 state->port[ap->port_no].speed[adev->devno] = cycle; 216 state->port[ap->port_no].speed[adev->devno] = cycle;
217} 217}
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 2d15f2548a10..56a1a77ff15f 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -473,12 +473,12 @@ static int it821x_smart_set_mode(struct ata_link *link, struct ata_device **unus
473 /* We do need the right mode information for DMA or PIO 473 /* We do need the right mode information for DMA or PIO
474 and this comes from the current configuration flags */ 474 and this comes from the current configuration flags */
475 if (ata_id_has_dma(dev->id)) { 475 if (ata_id_has_dma(dev->id)) {
476 ata_dev_printk(dev, KERN_INFO, "configured for DMA\n"); 476 ata_dev_info(dev, "configured for DMA\n");
477 dev->xfer_mode = XFER_MW_DMA_0; 477 dev->xfer_mode = XFER_MW_DMA_0;
478 dev->xfer_shift = ATA_SHIFT_MWDMA; 478 dev->xfer_shift = ATA_SHIFT_MWDMA;
479 dev->flags &= ~ATA_DFLAG_PIO; 479 dev->flags &= ~ATA_DFLAG_PIO;
480 } else { 480 } else {
481 ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); 481 ata_dev_info(dev, "configured for PIO\n");
482 dev->xfer_mode = XFER_PIO_0; 482 dev->xfer_mode = XFER_PIO_0;
483 dev->xfer_shift = ATA_SHIFT_PIO; 483 dev->xfer_shift = ATA_SHIFT_PIO;
484 dev->flags |= ATA_DFLAG_PIO; 484 dev->flags |= ATA_DFLAG_PIO;
@@ -508,12 +508,12 @@ static void it821x_dev_config(struct ata_device *adev)
508 508
509 if (strstr(model_num, "Integrated Technology Express")) { 509 if (strstr(model_num, "Integrated Technology Express")) {
510 /* RAID mode */ 510 /* RAID mode */
511 ata_dev_printk(adev, KERN_INFO, "%sRAID%d volume", 511 ata_dev_info(adev, "%sRAID%d volume",
512 adev->id[147]?"Bootable ":"", 512 adev->id[147] ? "Bootable " : "",
513 adev->id[129]); 513 adev->id[129]);
514 if (adev->id[129] != 1) 514 if (adev->id[129] != 1)
515 printk("(%dK stripe)", adev->id[146]); 515 pr_cont("(%dK stripe)", adev->id[146]);
516 printk(".\n"); 516 pr_cont("\n");
517 } 517 }
518 /* This is a controller firmware triggered funny, don't 518 /* This is a controller firmware triggered funny, don't
519 report the drive faulty! */ 519 report the drive faulty! */
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index ee26835124e1..fc42492439bb 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -31,7 +31,7 @@ static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error)
31 struct ata_device *dev; 31 struct ata_device *dev;
32 32
33 ata_for_each_dev(dev, link, ENABLED) { 33 ata_for_each_dev(dev, link, ENABLED) {
34 ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); 34 ata_dev_info(dev, "configured for PIO0\n");
35 dev->pio_mode = XFER_PIO_0; 35 dev->pio_mode = XFER_PIO_0;
36 dev->xfer_mode = XFER_PIO_0; 36 dev->xfer_mode = XFER_PIO_0;
37 dev->xfer_shift = ATA_SHIFT_PIO; 37 dev->xfer_shift = ATA_SHIFT_PIO;
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 6bd9425ba5ab..d960f8e9e8b1 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -213,7 +213,7 @@ static int legacy_set_mode(struct ata_link *link, struct ata_device **unused)
213 struct ata_device *dev; 213 struct ata_device *dev;
214 214
215 ata_for_each_dev(dev, link, ENABLED) { 215 ata_for_each_dev(dev, link, ENABLED) {
216 ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); 216 ata_dev_info(dev, "configured for PIO\n");
217 dev->pio_mode = XFER_PIO_0; 217 dev->pio_mode = XFER_PIO_0;
218 dev->xfer_mode = XFER_PIO_0; 218 dev->xfer_mode = XFER_PIO_0;
219 dev->xfer_shift = ATA_SHIFT_PIO; 219 dev->xfer_shift = ATA_SHIFT_PIO;
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index d39c10b61f2b..b057e3fa44bc 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -813,7 +813,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev)
813 blk_queue_update_dma_pad(sdev->request_queue, 31); 813 blk_queue_update_dma_pad(sdev->request_queue, 31);
814 814
815 /* Tell the world about it */ 815 /* Tell the world about it */
816 ata_dev_printk(dev, KERN_INFO, "OHare alignment limits applied\n"); 816 ata_dev_info(dev, "OHare alignment limits applied\n");
817 return 0; 817 return 0;
818 } 818 }
819 819
@@ -839,8 +839,7 @@ static int pata_macio_slave_config(struct scsi_device *sdev)
839 cmd | PCI_COMMAND_INVALIDATE); 839 cmd | PCI_COMMAND_INVALIDATE);
840 840
841 /* Tell the world about it */ 841 /* Tell the world about it */
842 ata_dev_printk(dev, KERN_INFO, 842 ata_dev_info(dev, "K2/Shasta alignment limits applied\n");
843 "K2/Shasta alignment limits applied\n");
844 } 843 }
845 844
846 return 0; 845 return 0;
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 220ddc90608f..c8707f03d886 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -405,7 +405,7 @@ static int octeon_cf_softreset16(struct ata_link *link, unsigned int *classes,
405 405
406 rc = ata_sff_wait_after_reset(link, 1, deadline); 406 rc = ata_sff_wait_after_reset(link, 1, deadline);
407 if (rc) { 407 if (rc) {
408 ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc); 408 ata_link_err(link, "SRST failed (errno=%d)\n", rc);
409 return rc; 409 return rc;
410 } 410 }
411 411
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 021abe6d8527..a808ba03bd7f 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -68,7 +68,7 @@ static int pcmcia_set_mode(struct ata_link *link, struct ata_device **r_failed_d
68 the same vendor - check serial */ 68 the same vendor - check serial */
69 if (memcmp(master->id + ATA_ID_SERNO, slave->id + ATA_ID_SERNO, 69 if (memcmp(master->id + ATA_ID_SERNO, slave->id + ATA_ID_SERNO,
70 ATA_ID_SERNO_LEN) == 0 && master->id[ATA_ID_SERNO] >> 8) { 70 ATA_ID_SERNO_LEN) == 0 && master->id[ATA_ID_SERNO] >> 8) {
71 ata_dev_printk(slave, KERN_WARNING, "is a ghost device, ignoring.\n"); 71 ata_dev_warn(slave, "is a ghost device, ignoring\n");
72 ata_dev_disable(slave); 72 ata_dev_disable(slave);
73 } 73 }
74 } 74 }
@@ -142,8 +142,7 @@ static void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc)
142 ioread8(ap->ioaddr.data_addr); 142 ioread8(ap->ioaddr.data_addr);
143 143
144 if (count) 144 if (count)
145 ata_port_printk(ap, KERN_WARNING, "drained %d bytes to clear DRQ.\n", 145 ata_port_warn(ap, "drained %d bytes to clear DRQ\n", count);
146 count);
147 146
148} 147}
149 148
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index 50400fa120fe..2067308f683f 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -39,7 +39,7 @@ static int pata_platform_set_mode(struct ata_link *link, struct ata_device **unu
39 dev->pio_mode = dev->xfer_mode = XFER_PIO_0; 39 dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
40 dev->xfer_shift = ATA_SHIFT_PIO; 40 dev->xfer_shift = ATA_SHIFT_PIO;
41 dev->flags |= ATA_DFLAG_PIO; 41 dev->flags |= ATA_DFLAG_PIO;
42 ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); 42 ata_dev_info(dev, "configured for PIO\n");
43 } 43 }
44 return 0; 44 return 0;
45} 45}
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c
index 4d04471794b6..ed8c90559ced 100644
--- a/drivers/ata/pata_rz1000.c
+++ b/drivers/ata/pata_rz1000.c
@@ -44,7 +44,7 @@ static int rz1000_set_mode(struct ata_link *link, struct ata_device **unused)
44 dev->xfer_mode = XFER_PIO_0; 44 dev->xfer_mode = XFER_PIO_0;
45 dev->xfer_shift = ATA_SHIFT_PIO; 45 dev->xfer_shift = ATA_SHIFT_PIO;
46 dev->flags |= ATA_DFLAG_PIO; 46 dev->flags |= ATA_DFLAG_PIO;
47 ata_dev_printk(dev, KERN_INFO, "configured for PIO\n"); 47 ata_dev_info(dev, "configured for PIO\n");
48 } 48 }
49 return 0; 49 return 0;
50} 50}
diff --git a/drivers/ata/pata_samsung_cf.c b/drivers/ata/pata_samsung_cf.c
index c446ae6055a3..1b372c297195 100644
--- a/drivers/ata/pata_samsung_cf.c
+++ b/drivers/ata/pata_samsung_cf.c
@@ -376,7 +376,7 @@ static int pata_s3c_softreset(struct ata_link *link, unsigned int *classes,
376 rc = pata_s3c_bus_softreset(ap, deadline); 376 rc = pata_s3c_bus_softreset(ap, deadline);
377 /* if link is occupied, -ENODEV too is an error */ 377 /* if link is occupied, -ENODEV too is an error */
378 if (rc && rc != -ENODEV) { 378 if (rc && rc != -ENODEV) {
379 ata_link_printk(link, KERN_ERR, "SRST failed (errno=%d)\n", rc); 379 ata_link_err(link, "SRST failed (errno=%d)\n", rc);
380 return rc; 380 return rc;
381 } 381 }
382 382
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c
index 88ea9b677b47..a72e3663dc91 100644
--- a/drivers/ata/pata_scc.c
+++ b/drivers/ata/pata_scc.c
@@ -637,8 +637,7 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,
637 DPRINTK("about to softreset, devmask=%x\n", devmask); 637 DPRINTK("about to softreset, devmask=%x\n", devmask);
638 err_mask = scc_bus_softreset(ap, devmask, deadline); 638 err_mask = scc_bus_softreset(ap, devmask, deadline);
639 if (err_mask) { 639 if (err_mask) {
640 ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", 640 ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", err_mask);
641 err_mask);
642 return -EIO; 641 return -EIO;
643 } 642 }
644 643
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index ac8d7d97e408..74763c3ee39f 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -350,8 +350,8 @@ static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask)
350 if (config->id == PCI_DEVICE_ID_VIA_82C586_0) { 350 if (config->id == PCI_DEVICE_ID_VIA_82C586_0) {
351 ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); 351 ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
352 if (strcmp(model_num, "TS64GSSD25-M") == 0) { 352 if (strcmp(model_num, "TS64GSSD25-M") == 0) {
353 ata_dev_printk(dev, KERN_WARNING, 353 ata_dev_warn(dev,
354 "disabling UDMA mode due to reported lockups with this device.\n"); 354 "disabling UDMA mode due to reported lockups with this device\n");
355 mask &= ~ ATA_MASK_UDMA; 355 mask &= ~ ATA_MASK_UDMA;
356 } 356 }
357 } 357 }
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 1cc70e33d5a3..78ae7b67b09e 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -346,12 +346,11 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
346 346
347 /* warn if each s/g element is not dword aligned */ 347 /* warn if each s/g element is not dword aligned */
348 if (sg_addr & 0x03) 348 if (sg_addr & 0x03)
349 ata_port_printk(qc->ap, KERN_ERR, 349 ata_port_err(qc->ap, "s/g addr unaligned : 0x%llx\n",
350 "s/g addr unaligned : 0x%llx\n", 350 (unsigned long long)sg_addr);
351 (unsigned long long)sg_addr);
352 if (sg_len & 0x03) 351 if (sg_len & 0x03)
353 ata_port_printk(qc->ap, KERN_ERR, 352 ata_port_err(qc->ap, "s/g len unaligned : 0x%x\n",
354 "s/g len unaligned : 0x%x\n", sg_len); 353 sg_len);
355 354
356 if (num_prde == (SATA_FSL_MAX_PRD_DIRECT - 1) && 355 if (num_prde == (SATA_FSL_MAX_PRD_DIRECT - 1) &&
357 sg_next(sg) != NULL) { 356 sg_next(sg) != NULL) {
@@ -739,8 +738,7 @@ try_offline_again:
739 1, 500); 738 1, 500);
740 739
741 if (temp & ONLINE) { 740 if (temp & ONLINE) {
742 ata_port_printk(ap, KERN_ERR, 741 ata_port_err(ap, "Hardreset failed, not off-lined %d\n", i);
743 "Hardreset failed, not off-lined %d\n", i);
744 742
745 /* 743 /*
746 * Try to offline controller atleast twice 744 * Try to offline controller atleast twice
@@ -776,8 +774,7 @@ try_offline_again:
776 temp = ata_wait_register(ap, hcr_base + HSTATUS, ONLINE, 0, 1, 500); 774 temp = ata_wait_register(ap, hcr_base + HSTATUS, ONLINE, 0, 1, 500);
777 775
778 if (!(temp & ONLINE)) { 776 if (!(temp & ONLINE)) {
779 ata_port_printk(ap, KERN_ERR, 777 ata_port_err(ap, "Hardreset failed, not on-lined\n");
780 "Hardreset failed, not on-lined\n");
781 goto err; 778 goto err;
782 } 779 }
783 780
@@ -793,9 +790,8 @@ try_offline_again:
793 790
794 temp = ata_wait_register(ap, hcr_base + HSTATUS, 0xFF, 0, 1, 500); 791 temp = ata_wait_register(ap, hcr_base + HSTATUS, 0xFF, 0, 1, 500);
795 if ((!(temp & 0x10)) || ata_link_offline(link)) { 792 if ((!(temp & 0x10)) || ata_link_offline(link)) {
796 ata_port_printk(ap, KERN_WARNING, 793 ata_port_warn(ap, "No Device OR PHYRDY change,Hstatus = 0x%x\n",
797 "No Device OR PHYRDY change,Hstatus = 0x%x\n", 794 ioread32(hcr_base + HSTATUS));
798 ioread32(hcr_base + HSTATUS));
799 *class = ATA_DEV_NONE; 795 *class = ATA_DEV_NONE;
800 return 0; 796 return 0;
801 } 797 }
@@ -808,13 +804,12 @@ try_offline_again:
808 500, jiffies_to_msecs(deadline - start_jiffies)); 804 500, jiffies_to_msecs(deadline - start_jiffies));
809 805
810 if ((temp & 0xFF) != 0x18) { 806 if ((temp & 0xFF) != 0x18) {
811 ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); 807 ata_port_warn(ap, "No Signature Update\n");
812 *class = ATA_DEV_NONE; 808 *class = ATA_DEV_NONE;
813 goto do_followup_srst; 809 goto do_followup_srst;
814 } else { 810 } else {
815 ata_port_printk(ap, KERN_INFO, 811 ata_port_info(ap, "Signature Update detected @ %d msecs\n",
816 "Signature Update detected @ %d msecs\n", 812 jiffies_to_msecs(jiffies - start_jiffies));
817 jiffies_to_msecs(jiffies - start_jiffies));
818 *class = sata_fsl_dev_classify(ap); 813 *class = sata_fsl_dev_classify(ap);
819 return 0; 814 return 0;
820 } 815 }
@@ -889,7 +884,7 @@ static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
889 884
890 temp = ata_wait_register(ap, CQ + hcr_base, 0x1, 0x1, 1, 5000); 885 temp = ata_wait_register(ap, CQ + hcr_base, 0x1, 0x1, 1, 5000);
891 if (temp & 0x1) { 886 if (temp & 0x1) {
892 ata_port_printk(ap, KERN_WARNING, "ATA_SRST issue failed\n"); 887 ata_port_warn(ap, "ATA_SRST issue failed\n");
893 888
894 DPRINTK("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n", 889 DPRINTK("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n",
895 ioread32(CQ + hcr_base), 890 ioread32(CQ + hcr_base),
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 83019e61e368..7a5667daf0d0 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -396,9 +396,8 @@ static void inic_host_intr(struct ata_port *ap)
396 } 396 }
397 397
398 spurious: 398 spurious:
399 ata_port_printk(ap, KERN_WARNING, "unhandled interrupt: " 399 ata_port_warn(ap, "unhandled interrupt: cmd=0x%x irq_stat=0x%x idma_stat=0x%x\n",
400 "cmd=0x%x irq_stat=0x%x idma_stat=0x%x\n", 400 qc ? qc->tf.command : 0xff, irq_stat, idma_stat);
401 qc ? qc->tf.command : 0xff, irq_stat, idma_stat);
402} 401}
403 402
404static irqreturn_t inic_interrupt(int irq, void *dev_instance) 403static irqreturn_t inic_interrupt(int irq, void *dev_instance)
@@ -619,8 +618,9 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class,
619 618
620 rc = sata_link_resume(link, timing, deadline); 619 rc = sata_link_resume(link, timing, deadline);
621 if (rc) { 620 if (rc) {
622 ata_link_printk(link, KERN_WARNING, "failed to resume " 621 ata_link_warn(link,
623 "link after reset (errno=%d)\n", rc); 622 "failed to resume link after reset (errno=%d)\n",
623 rc);
624 return rc; 624 return rc;
625 } 625 }
626 626
@@ -632,8 +632,9 @@ static int inic_hardreset(struct ata_link *link, unsigned int *class,
632 rc = ata_wait_after_reset(link, deadline, inic_check_ready); 632 rc = ata_wait_after_reset(link, deadline, inic_check_ready);
633 /* link occupied, -ENODEV too is an error */ 633 /* link occupied, -ENODEV too is an error */
634 if (rc) { 634 if (rc) {
635 ata_link_printk(link, KERN_WARNING, "device not ready " 635 ata_link_warn(link,
636 "after hardreset (errno=%d)\n", rc); 636 "device not ready after hardreset (errno=%d)\n",
637 rc);
637 return rc; 638 return rc;
638 } 639 }
639 640
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index bea717a22e32..b0e45d29244f 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1190,7 +1190,7 @@ static void mv_wait_for_edma_empty_idle(struct ata_port *ap)
1190 break; 1190 break;
1191 udelay(per_loop); 1191 udelay(per_loop);
1192 } 1192 }
1193 /* ata_port_printk(ap, KERN_INFO, "%s: %u+ usecs\n", __func__, i); */ 1193 /* ata_port_info(ap, "%s: %u+ usecs\n", __func__, i); */
1194} 1194}
1195 1195
1196/** 1196/**
@@ -1228,7 +1228,7 @@ static int mv_stop_edma(struct ata_port *ap)
1228 pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN; 1228 pp->pp_flags &= ~MV_PP_FLAG_EDMA_EN;
1229 mv_wait_for_edma_empty_idle(ap); 1229 mv_wait_for_edma_empty_idle(ap);
1230 if (mv_stop_edma_engine(port_mmio)) { 1230 if (mv_stop_edma_engine(port_mmio)) {
1231 ata_port_printk(ap, KERN_ERR, "Unable to stop eDMA\n"); 1231 ata_port_err(ap, "Unable to stop eDMA\n");
1232 err = -EIO; 1232 err = -EIO;
1233 } 1233 }
1234 mv_edma_cfg(ap, 0, 0); 1234 mv_edma_cfg(ap, 0, 0);
@@ -1382,7 +1382,7 @@ static void mv6_dev_config(struct ata_device *adev)
1382 if (adev->flags & ATA_DFLAG_NCQ) { 1382 if (adev->flags & ATA_DFLAG_NCQ) {
1383 if (sata_pmp_attached(adev->link->ap)) { 1383 if (sata_pmp_attached(adev->link->ap)) {
1384 adev->flags &= ~ATA_DFLAG_NCQ; 1384 adev->flags &= ~ATA_DFLAG_NCQ;
1385 ata_dev_printk(adev, KERN_INFO, 1385 ata_dev_info(adev,
1386 "NCQ disabled for command-based switching\n"); 1386 "NCQ disabled for command-based switching\n");
1387 } 1387 }
1388 } 1388 }
@@ -2225,9 +2225,8 @@ static unsigned int mv_send_fis(struct ata_port *ap, u32 *fis, int nwords)
2225 2225
2226 /* See if it worked */ 2226 /* See if it worked */
2227 if ((ifstat & 0x3000) != 0x1000) { 2227 if ((ifstat & 0x3000) != 0x1000) {
2228 ata_port_printk(ap, KERN_WARNING, 2228 ata_port_warn(ap, "%s transmission error, ifstat=%08x\n",
2229 "%s transmission error, ifstat=%08x\n", 2229 __func__, ifstat);
2230 __func__, ifstat);
2231 return AC_ERR_OTHER; 2230 return AC_ERR_OTHER;
2232 } 2231 }
2233 return 0; 2232 return 0;
@@ -2342,9 +2341,9 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
2342 */ 2341 */
2343 if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) { 2342 if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) {
2344 --limit_warnings; 2343 --limit_warnings;
2345 ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME 2344 ata_link_warn(qc->dev->link, DRV_NAME
2346 ": attempting PIO w/multiple DRQ: " 2345 ": attempting PIO w/multiple DRQ: "
2347 "this may fail due to h/w errata\n"); 2346 "this may fail due to h/w errata\n");
2348 } 2347 }
2349 /* drop through */ 2348 /* drop through */
2350 case ATA_PROT_NODATA: 2349 case ATA_PROT_NODATA:
@@ -2499,20 +2498,20 @@ static int mv_handle_fbs_ncq_dev_err(struct ata_port *ap)
2499 } 2498 }
2500 failed_links = hweight16(new_map); 2499 failed_links = hweight16(new_map);
2501 2500
2502 ata_port_printk(ap, KERN_INFO, "%s: pmp_map=%04x qc_map=%04x " 2501 ata_port_info(ap,
2503 "failed_links=%d nr_active_links=%d\n", 2502 "%s: pmp_map=%04x qc_map=%04x failed_links=%d nr_active_links=%d\n",
2504 __func__, pp->delayed_eh_pmp_map, 2503 __func__, pp->delayed_eh_pmp_map,
2505 ap->qc_active, failed_links, 2504 ap->qc_active, failed_links,
2506 ap->nr_active_links); 2505 ap->nr_active_links);
2507 2506
2508 if (ap->nr_active_links <= failed_links && mv_req_q_empty(ap)) { 2507 if (ap->nr_active_links <= failed_links && mv_req_q_empty(ap)) {
2509 mv_process_crpb_entries(ap, pp); 2508 mv_process_crpb_entries(ap, pp);
2510 mv_stop_edma(ap); 2509 mv_stop_edma(ap);
2511 mv_eh_freeze(ap); 2510 mv_eh_freeze(ap);
2512 ata_port_printk(ap, KERN_INFO, "%s: done\n", __func__); 2511 ata_port_info(ap, "%s: done\n", __func__);
2513 return 1; /* handled */ 2512 return 1; /* handled */
2514 } 2513 }
2515 ata_port_printk(ap, KERN_INFO, "%s: waiting\n", __func__); 2514 ata_port_info(ap, "%s: waiting\n", __func__);
2516 return 1; /* handled */ 2515 return 1; /* handled */
2517} 2516}
2518 2517
@@ -2554,9 +2553,8 @@ static int mv_handle_dev_err(struct ata_port *ap, u32 edma_err_cause)
2554 * and we cannot handle it here. 2553 * and we cannot handle it here.
2555 */ 2554 */
2556 if (edma_err_cause & EDMA_ERR_SELF_DIS) { 2555 if (edma_err_cause & EDMA_ERR_SELF_DIS) {
2557 ata_port_printk(ap, KERN_WARNING, 2556 ata_port_warn(ap, "%s: err_cause=0x%x pp_flags=0x%x\n",
2558 "%s: err_cause=0x%x pp_flags=0x%x\n", 2557 __func__, edma_err_cause, pp->pp_flags);
2559 __func__, edma_err_cause, pp->pp_flags);
2560 return 0; /* not handled */ 2558 return 0; /* not handled */
2561 } 2559 }
2562 return mv_handle_fbs_ncq_dev_err(ap); 2560 return mv_handle_fbs_ncq_dev_err(ap);
@@ -2567,9 +2565,8 @@ static int mv_handle_dev_err(struct ata_port *ap, u32 edma_err_cause)
2567 * and we cannot handle it here. 2565 * and we cannot handle it here.
2568 */ 2566 */
2569 if (!(edma_err_cause & EDMA_ERR_SELF_DIS)) { 2567 if (!(edma_err_cause & EDMA_ERR_SELF_DIS)) {
2570 ata_port_printk(ap, KERN_WARNING, 2568 ata_port_warn(ap, "%s: err_cause=0x%x pp_flags=0x%x\n",
2571 "%s: err_cause=0x%x pp_flags=0x%x\n", 2569 __func__, edma_err_cause, pp->pp_flags);
2572 __func__, edma_err_cause, pp->pp_flags);
2573 return 0; /* not handled */ 2570 return 0; /* not handled */
2574 } 2571 }
2575 return mv_handle_fbs_non_ncq_dev_err(ap); 2572 return mv_handle_fbs_non_ncq_dev_err(ap);
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index f215e10c11cf..b33f525df0f5 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -620,9 +620,8 @@ static void nv_adma_register_mode(struct ata_port *ap)
620 count++; 620 count++;
621 } 621 }
622 if (count == 20) 622 if (count == 20)
623 ata_port_printk(ap, KERN_WARNING, 623 ata_port_warn(ap, "timeout waiting for ADMA IDLE, stat=0x%hx\n",
624 "timeout waiting for ADMA IDLE, stat=0x%hx\n", 624 status);
625 status);
626 625
627 tmp = readw(mmio + NV_ADMA_CTL); 626 tmp = readw(mmio + NV_ADMA_CTL);
628 writew(tmp & ~NV_ADMA_CTL_GO, mmio + NV_ADMA_CTL); 627 writew(tmp & ~NV_ADMA_CTL_GO, mmio + NV_ADMA_CTL);
@@ -635,9 +634,9 @@ static void nv_adma_register_mode(struct ata_port *ap)
635 count++; 634 count++;
636 } 635 }
637 if (count == 20) 636 if (count == 20)
638 ata_port_printk(ap, KERN_WARNING, 637 ata_port_warn(ap,
639 "timeout waiting for ADMA LEGACY, stat=0x%hx\n", 638 "timeout waiting for ADMA LEGACY, stat=0x%hx\n",
640 status); 639 status);
641 640
642 pp->flags |= NV_ADMA_PORT_REGISTER_MODE; 641 pp->flags |= NV_ADMA_PORT_REGISTER_MODE;
643} 642}
@@ -665,7 +664,7 @@ static void nv_adma_mode(struct ata_port *ap)
665 count++; 664 count++;
666 } 665 }
667 if (count == 20) 666 if (count == 20)
668 ata_port_printk(ap, KERN_WARNING, 667 ata_port_warn(ap,
669 "timeout waiting for ADMA LEGACY clear and IDLE, stat=0x%hx\n", 668 "timeout waiting for ADMA LEGACY clear and IDLE, stat=0x%hx\n",
670 status); 669 status);
671 670
@@ -772,10 +771,10 @@ static int nv_adma_slave_config(struct scsi_device *sdev)
772 771
773 blk_queue_segment_boundary(sdev->request_queue, segment_boundary); 772 blk_queue_segment_boundary(sdev->request_queue, segment_boundary);
774 blk_queue_max_segments(sdev->request_queue, sg_tablesize); 773 blk_queue_max_segments(sdev->request_queue, sg_tablesize);
775 ata_port_printk(ap, KERN_INFO, 774 ata_port_info(ap,
776 "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n", 775 "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n",
777 (unsigned long long)*ap->host->dev->dma_mask, 776 (unsigned long long)*ap->host->dev->dma_mask,
778 segment_boundary, sg_tablesize); 777 segment_boundary, sg_tablesize);
779 778
780 spin_unlock_irqrestore(ap->lock, flags); 779 spin_unlock_irqrestore(ap->lock, flags);
781 780
@@ -1443,8 +1442,7 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)
1443 existing commands. */ 1442 existing commands. */
1444 if (unlikely(qc->tf.protocol == ATA_PROT_NCQ && 1443 if (unlikely(qc->tf.protocol == ATA_PROT_NCQ &&
1445 (qc->flags & ATA_QCFLAG_RESULT_TF))) { 1444 (qc->flags & ATA_QCFLAG_RESULT_TF))) {
1446 ata_dev_printk(qc->dev, KERN_ERR, 1445 ata_dev_err(qc->dev, "NCQ w/ RESULT_TF not allowed\n");
1447 "NCQ w/ RESULT_TF not allowed\n");
1448 return AC_ERR_SYSTEM; 1446 return AC_ERR_SYSTEM;
1449 } 1447 }
1450 1448
@@ -1581,15 +1579,15 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class,
1581 int rc; 1579 int rc;
1582 1580
1583 if (!(ehc->i.flags & ATA_EHI_QUIET)) 1581 if (!(ehc->i.flags & ATA_EHI_QUIET))
1584 ata_link_printk(link, KERN_INFO, "nv: skipping " 1582 ata_link_info(link,
1585 "hardreset on occupied port\n"); 1583 "nv: skipping hardreset on occupied port\n");
1586 1584
1587 /* make sure the link is online */ 1585 /* make sure the link is online */
1588 rc = sata_link_resume(link, timing, deadline); 1586 rc = sata_link_resume(link, timing, deadline);
1589 /* whine about phy resume failure but proceed */ 1587 /* whine about phy resume failure but proceed */
1590 if (rc && rc != -EOPNOTSUPP) 1588 if (rc && rc != -EOPNOTSUPP)
1591 ata_link_printk(link, KERN_WARNING, "failed to resume " 1589 ata_link_warn(link, "failed to resume link (errno=%d)\n",
1592 "link (errno=%d)\n", rc); 1590 rc);
1593 } 1591 }
1594 1592
1595 /* device signature acquisition is unreliable */ 1593 /* device signature acquisition is unreliable */
@@ -1686,7 +1684,7 @@ static void nv_adma_error_handler(struct ata_port *ap)
1686 u8 cpb_count = readb(mmio + NV_ADMA_CPB_COUNT); 1684 u8 cpb_count = readb(mmio + NV_ADMA_CPB_COUNT);
1687 u8 next_cpb_idx = readb(mmio + NV_ADMA_NEXT_CPB_IDX); 1685 u8 next_cpb_idx = readb(mmio + NV_ADMA_NEXT_CPB_IDX);
1688 1686
1689 ata_port_printk(ap, KERN_ERR, 1687 ata_port_err(ap,
1690 "EH in ADMA mode, notifier 0x%X " 1688 "EH in ADMA mode, notifier 0x%X "
1691 "notifier_error 0x%X gen_ctl 0x%X status 0x%X " 1689 "notifier_error 0x%X gen_ctl 0x%X status 0x%X "
1692 "next cpb count 0x%X next cpb idx 0x%x\n", 1690 "next cpb count 0x%X next cpb idx 0x%x\n",
@@ -1697,7 +1695,7 @@ static void nv_adma_error_handler(struct ata_port *ap)
1697 struct nv_adma_cpb *cpb = &pp->cpb[i]; 1695 struct nv_adma_cpb *cpb = &pp->cpb[i];
1698 if ((ata_tag_valid(ap->link.active_tag) && i == ap->link.active_tag) || 1696 if ((ata_tag_valid(ap->link.active_tag) && i == ap->link.active_tag) ||
1699 ap->link.sactive & (1 << i)) 1697 ap->link.sactive & (1 << i))
1700 ata_port_printk(ap, KERN_ERR, 1698 ata_port_err(ap,
1701 "CPB %d: ctl_flags 0x%x, resp_flags 0x%x\n", 1699 "CPB %d: ctl_flags 0x%x, resp_flags 0x%x\n",
1702 i, cpb->ctl_flags, cpb->resp_flags); 1700 i, cpb->ctl_flags, cpb->resp_flags);
1703 } 1701 }
@@ -1799,23 +1797,22 @@ static void nv_swncq_ncq_stop(struct ata_port *ap)
1799 u32 sactive; 1797 u32 sactive;
1800 u32 done_mask; 1798 u32 done_mask;
1801 1799
1802 ata_port_printk(ap, KERN_ERR, 1800 ata_port_err(ap, "EH in SWNCQ mode,QC:qc_active 0x%X sactive 0x%X\n",
1803 "EH in SWNCQ mode,QC:qc_active 0x%X sactive 0x%X\n", 1801 ap->qc_active, ap->link.sactive);
1804 ap->qc_active, ap->link.sactive); 1802 ata_port_err(ap,
1805 ata_port_printk(ap, KERN_ERR,
1806 "SWNCQ:qc_active 0x%X defer_bits 0x%X last_issue_tag 0x%x\n " 1803 "SWNCQ:qc_active 0x%X defer_bits 0x%X last_issue_tag 0x%x\n "
1807 "dhfis 0x%X dmafis 0x%X sdbfis 0x%X\n", 1804 "dhfis 0x%X dmafis 0x%X sdbfis 0x%X\n",
1808 pp->qc_active, pp->defer_queue.defer_bits, pp->last_issue_tag, 1805 pp->qc_active, pp->defer_queue.defer_bits, pp->last_issue_tag,
1809 pp->dhfis_bits, pp->dmafis_bits, pp->sdbfis_bits); 1806 pp->dhfis_bits, pp->dmafis_bits, pp->sdbfis_bits);
1810 1807
1811 ata_port_printk(ap, KERN_ERR, "ATA_REG 0x%X ERR_REG 0x%X\n", 1808 ata_port_err(ap, "ATA_REG 0x%X ERR_REG 0x%X\n",
1812 ap->ops->sff_check_status(ap), 1809 ap->ops->sff_check_status(ap),
1813 ioread8(ap->ioaddr.error_addr)); 1810 ioread8(ap->ioaddr.error_addr));
1814 1811
1815 sactive = readl(pp->sactive_block); 1812 sactive = readl(pp->sactive_block);
1816 done_mask = pp->qc_active ^ sactive; 1813 done_mask = pp->qc_active ^ sactive;
1817 1814
1818 ata_port_printk(ap, KERN_ERR, "tag : dhfis dmafis sdbfis sacitve\n"); 1815 ata_port_err(ap, "tag : dhfis dmafis sdbfis sactive\n");
1819 for (i = 0; i < ATA_MAX_QUEUE; i++) { 1816 for (i = 0; i < ATA_MAX_QUEUE; i++) {
1820 u8 err = 0; 1817 u8 err = 0;
1821 if (pp->qc_active & (1 << i)) 1818 if (pp->qc_active & (1 << i))
@@ -1825,13 +1822,13 @@ static void nv_swncq_ncq_stop(struct ata_port *ap)
1825 else 1822 else
1826 continue; 1823 continue;
1827 1824
1828 ata_port_printk(ap, KERN_ERR, 1825 ata_port_err(ap,
1829 "tag 0x%x: %01x %01x %01x %01x %s\n", i, 1826 "tag 0x%x: %01x %01x %01x %01x %s\n", i,
1830 (pp->dhfis_bits >> i) & 0x1, 1827 (pp->dhfis_bits >> i) & 0x1,
1831 (pp->dmafis_bits >> i) & 0x1, 1828 (pp->dmafis_bits >> i) & 0x1,
1832 (pp->sdbfis_bits >> i) & 0x1, 1829 (pp->sdbfis_bits >> i) & 0x1,
1833 (sactive >> i) & 0x1, 1830 (sactive >> i) & 0x1,
1834 (err ? "error! tag doesn't exit" : " ")); 1831 (err ? "error! tag doesn't exit" : " "));
1835 } 1832 }
1836 1833
1837 nv_swncq_pp_reinit(ap); 1834 nv_swncq_pp_reinit(ap);
@@ -1956,8 +1953,8 @@ static int nv_swncq_slave_config(struct scsi_device *sdev)
1956 1953
1957 if (strncmp(model_num, "Maxtor", 6) == 0) { 1954 if (strncmp(model_num, "Maxtor", 6) == 0) {
1958 ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT); 1955 ata_scsi_change_queue_depth(sdev, 1, SCSI_QDEPTH_DEFAULT);
1959 ata_dev_printk(dev, KERN_NOTICE, 1956 ata_dev_notice(dev, "Disabling SWNCQ mode (depth %x)\n",
1960 "Disabling SWNCQ mode (depth %x)\n", sdev->queue_depth); 1957 sdev->queue_depth);
1961 } 1958 }
1962 1959
1963 return rc; 1960 return rc;
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index fe16ee8f194b..280ba8a62dcb 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -643,8 +643,8 @@ static void sil_dev_config(struct ata_device *dev)
643 ((ap->flags & SIL_FLAG_MOD15WRITE) && 643 ((ap->flags & SIL_FLAG_MOD15WRITE) &&
644 (quirks & SIL_QUIRK_MOD15WRITE))) { 644 (quirks & SIL_QUIRK_MOD15WRITE))) {
645 if (print_info) 645 if (print_info)
646 ata_dev_printk(dev, KERN_INFO, "applying Seagate " 646 ata_dev_info(dev,
647 "errata fix (mod15write workaround)\n"); 647 "applying Seagate errata fix (mod15write workaround)\n");
648 dev->max_sectors = 15; 648 dev->max_sectors = 15;
649 return; 649 return;
650 } 650 }
@@ -652,8 +652,8 @@ static void sil_dev_config(struct ata_device *dev)
652 /* limit to udma5 */ 652 /* limit to udma5 */
653 if (quirks & SIL_QUIRK_UDMA5MAX) { 653 if (quirks & SIL_QUIRK_UDMA5MAX) {
654 if (print_info) 654 if (print_info)
655 ata_dev_printk(dev, KERN_INFO, "applying Maxtor " 655 ata_dev_info(dev, "applying Maxtor errata fix %s\n",
656 "errata fix %s\n", model_num); 656 model_num);
657 dev->udma_mask &= ATA_UDMA5; 657 dev->udma_mask &= ATA_UDMA5;
658 return; 658 return;
659 } 659 }
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 164d52ed6b62..792e93688f7e 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -694,7 +694,7 @@ static int sil24_softreset(struct ata_link *link, unsigned int *class,
694 return 0; 694 return 0;
695 695
696 err: 696 err:
697 ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason); 697 ata_link_err(link, "softreset failed (%s)\n", reason);
698 return -EIO; 698 return -EIO;
699} 699}
700 700
@@ -714,8 +714,8 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class,
714 * This happens often after PM DMA CS errata. 714 * This happens often after PM DMA CS errata.
715 */ 715 */
716 if (pp->do_port_rst) { 716 if (pp->do_port_rst) {
717 ata_port_printk(ap, KERN_WARNING, "controller in dubious " 717 ata_port_warn(ap,
718 "state, performing PORT_RST\n"); 718 "controller in dubious state, performing PORT_RST\n");
719 719
720 writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT); 720 writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT);
721 ata_msleep(ap, 10); 721 ata_msleep(ap, 10);
@@ -773,7 +773,7 @@ static int sil24_hardreset(struct ata_link *link, unsigned int *class,
773 goto retry; 773 goto retry;
774 } 774 }
775 775
776 ata_link_printk(link, KERN_ERR, "hardreset failed (%s)\n", reason); 776 ata_link_err(link, "hardreset failed (%s)\n", reason);
777 return -EIO; 777 return -EIO;
778} 778}
779 779
@@ -925,7 +925,7 @@ static void sil24_pmp_attach(struct ata_port *ap)
925 925
926 if (sata_pmp_gscr_vendor(gscr) == 0x11ab && 926 if (sata_pmp_gscr_vendor(gscr) == 0x11ab &&
927 sata_pmp_gscr_devid(gscr) == 0x4140) { 927 sata_pmp_gscr_devid(gscr) == 0x4140) {
928 ata_port_printk(ap, KERN_INFO, 928 ata_port_info(ap,
929 "disabling NCQ support due to sil24-mv4140 quirk\n"); 929 "disabling NCQ support due to sil24-mv4140 quirk\n");
930 ap->flags &= ~ATA_FLAG_NCQ; 930 ap->flags &= ~ATA_FLAG_NCQ;
931 } 931 }
@@ -946,8 +946,7 @@ static int sil24_pmp_hardreset(struct ata_link *link, unsigned int *class,
946 946
947 rc = sil24_init_port(link->ap); 947 rc = sil24_init_port(link->ap);
948 if (rc) { 948 if (rc) {
949 ata_link_printk(link, KERN_ERR, 949 ata_link_err(link, "hardreset failed (port not ready)\n");
950 "hardreset failed (port not ready)\n");
951 return rc; 950 return rc;
952 } 951 }
953 952
@@ -1141,8 +1140,8 @@ static inline void sil24_host_intr(struct ata_port *ap)
1141 1140
1142 /* spurious interrupts are expected if PCIX_IRQ_WOC */ 1141 /* spurious interrupts are expected if PCIX_IRQ_WOC */
1143 if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) 1142 if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit())
1144 ata_port_printk(ap, KERN_INFO, "spurious interrupt " 1143 ata_port_info(ap,
1145 "(slot_stat 0x%x active_tag %d sactive 0x%x)\n", 1144 "spurious interrupt (slot_stat 0x%x active_tag %d sactive 0x%x)\n",
1146 slot_stat, ap->link.active_tag, ap->link.sactive); 1145 slot_stat, ap->link.active_tag, ap->link.sactive);
1147} 1146}
1148 1147
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index 9b43ccbcc915..0fc1582005e8 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -360,9 +360,9 @@ static int vt6420_prereset(struct ata_link *link, unsigned long deadline)
360 360
361 online = (sstatus & 0xf) == 0x3; 361 online = (sstatus & 0xf) == 0x3;
362 362
363 ata_port_printk(ap, KERN_INFO, 363 ata_port_info(ap,
364 "SATA link %s 1.5 Gbps (SStatus %X SControl %X)\n", 364 "SATA link %s 1.5 Gbps (SStatus %X SControl %X)\n",
365 online ? "up" : "down", sstatus, scontrol); 365 online ? "up" : "down", sstatus, scontrol);
366 366
367 /* SStatus is read one more time */ 367 /* SStatus is read one more time */
368 svia_scr_read(link, SCR_STATUS, &sstatus); 368 svia_scr_read(link, SCR_STATUS, &sstatus);