Merge tag 'gvt-fixes-2022-01-13' of https://github.com/intel/gvt-linux into drm-intel...
[linux-2.6-microblaze.git] / drivers / ata / libata-acpi.c
index 7a7d664..8cfa8c9 100644 (file)
@@ -402,7 +402,6 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm);
  */
 static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
 {
-       struct ata_port *ap = dev->link->ap;
        acpi_status status;
        struct acpi_buffer output;
        union acpi_object *out_obj;
@@ -418,10 +417,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
        output.length = ACPI_ALLOCATE_BUFFER;
        output.pointer = NULL;  /* ACPI-CA sets this; save/free it later */
 
-       if (ata_msg_probe(ap))
-               ata_dev_dbg(dev, "%s: ENTER: port#: %d\n",
-                           __func__, ap->port_no);
-
        /* _GTF has no input parameters */
        status = acpi_evaluate_object(ata_dev_acpi_handle(dev), "_GTF", NULL,
                                      &output);
@@ -437,11 +432,9 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
        }
 
        if (!output.length || !output.pointer) {
-               if (ata_msg_probe(ap))
-                       ata_dev_dbg(dev, "%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n",
-                                   __func__,
-                                   (unsigned long long)output.length,
-                                   output.pointer);
+               ata_dev_dbg(dev, "Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n",
+                           (unsigned long long)output.length,
+                           output.pointer);
                rc = -EINVAL;
                goto out_free;
        }
@@ -464,9 +457,8 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf)
        rc = out_obj->buffer.length / REGS_PER_GTF;
        if (gtf) {
                *gtf = (void *)out_obj->buffer.pointer;
-               if (ata_msg_probe(ap))
-                       ata_dev_dbg(dev, "%s: returning gtf=%p, gtf_count=%d\n",
-                                   __func__, *gtf, rc);
+               ata_dev_dbg(dev, "returning gtf=%p, gtf_count=%d\n",
+                           *gtf, rc);
        }
        return rc;
 
@@ -650,9 +642,7 @@ static int ata_acpi_run_tf(struct ata_device *dev,
        struct ata_taskfile *pptf = NULL;
        struct ata_taskfile tf, ptf, rtf;
        unsigned int err_mask;
-       const char *level;
        const char *descr;
-       char msg[60];
        int rc;
 
        if ((gtf->tf[0] == 0) && (gtf->tf[1] == 0) && (gtf->tf[2] == 0)
@@ -666,6 +656,8 @@ static int ata_acpi_run_tf(struct ata_device *dev,
                pptf = &ptf;
        }
 
+       descr = ata_get_cmd_name(tf.command);
+
        if (!ata_acpi_filter_tf(dev, &tf, pptf)) {
                rtf = tf;
                err_mask = ata_exec_internal(dev, &rtf, NULL,
@@ -673,40 +665,42 @@ static int ata_acpi_run_tf(struct ata_device *dev,
 
                switch (err_mask) {
                case 0:
-                       level = KERN_DEBUG;
-                       snprintf(msg, sizeof(msg), "succeeded");
+                       ata_dev_dbg(dev,
+                               "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+                               "(%s) succeeded\n",
+                               tf.command, tf.feature, tf.nsect, tf.lbal,
+                               tf.lbam, tf.lbah, tf.device, descr);
                        rc = 1;
                        break;
 
                case AC_ERR_DEV:
-                       level = KERN_INFO;
-                       snprintf(msg, sizeof(msg),
-                                "rejected by device (Stat=0x%02x Err=0x%02x)",
-                                rtf.command, rtf.feature);
+                       ata_dev_info(dev,
+                               "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+                               "(%s) rejected by device (Stat=0x%02x Err=0x%02x)",
+                               tf.command, tf.feature, tf.nsect, tf.lbal,
+                               tf.lbam, tf.lbah, tf.device, descr,
+                               rtf.command, rtf.feature);
                        rc = 0;
                        break;
 
                default:
-                       level = KERN_ERR;
-                       snprintf(msg, sizeof(msg),
-                                "failed (Emask=0x%x Stat=0x%02x Err=0x%02x)",
-                                err_mask, rtf.command, rtf.feature);
+                       ata_dev_err(dev,
+                               "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+                               "(%s) failed (Emask=0x%x Stat=0x%02x Err=0x%02x)",
+                               tf.command, tf.feature, tf.nsect, tf.lbal,
+                               tf.lbam, tf.lbah, tf.device, descr,
+                               err_mask, rtf.command, rtf.feature);
                        rc = -EIO;
                        break;
                }
        } else {
-               level = KERN_INFO;
-               snprintf(msg, sizeof(msg), "filtered out");
+               ata_dev_info(dev,
+                       "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x"
+                       "(%s) filtered out\n",
+                       tf.command, tf.feature, tf.nsect, tf.lbal,
+                       tf.lbam, tf.lbah, tf.device, descr);
                rc = 0;
        }
-       descr = ata_get_cmd_descript(tf.command);
-
-       ata_dev_printk(dev, level,
-                      "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x (%s) %s\n",
-                      tf.command, tf.feature, tf.nsect, tf.lbal,
-                      tf.lbam, tf.lbah, tf.device,
-                      (descr ? descr : "unknown"), msg);
-
        return rc;
 }
 
@@ -776,9 +770,8 @@ static int ata_acpi_push_id(struct ata_device *dev)
        struct acpi_object_list input;
        union acpi_object in_params[1];
 
-       if (ata_msg_probe(ap))
-               ata_dev_dbg(dev, "%s: ix = %d, port#: %d\n",
-                           __func__, dev->devno, ap->port_no);
+       ata_dev_dbg(dev, "%s: ix = %d, port#: %d\n",
+                   __func__, dev->devno, ap->port_no);
 
        /* Give the drive Identify data to the drive via the _SDD method */
        /* _SDD: set up input parameters */