Skip to content

Commit f21a350

Browse files
committed
ACPI: CPPC: Change default error code and clean up debug messages in probe
Change the default error code returned by acpi_cppc_processor_probe() from -EFAULT (which is completely inadequate) to -ENODATA and change the debug messages printed by it to contain more information and be more consistent. While at it, format some white space to follow the coding style. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Huang Rui <ray.huang@amd.com>
1 parent 40d8abf commit f21a350

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

drivers/acpi/cppc_acpi.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
654654
unsigned int num_ent, i, cpc_rev;
655655
int pcc_subspace_id = -1;
656656
acpi_status status;
657-
int ret = -EFAULT;
657+
int ret = -ENODATA;
658658

659659
if (osc_sb_cppc_not_supported)
660660
return -ENODEV;
@@ -685,8 +685,8 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
685685
goto out_free;
686686
}
687687
} else {
688-
pr_debug("Unexpected entry type(%d) for NumEntries\n",
689-
cpc_obj->type);
688+
pr_debug("Unexpected _CPC NumEntries entry type (%d) for CPU:%d\n",
689+
cpc_obj->type, pr->id);
690690
goto out_free;
691691
}
692692
cpc_ptr->num_entries = num_ent;
@@ -696,8 +696,8 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
696696
if (cpc_obj->type == ACPI_TYPE_INTEGER) {
697697
cpc_rev = cpc_obj->integer.value;
698698
} else {
699-
pr_debug("Unexpected entry type(%d) for Revision\n",
700-
cpc_obj->type);
699+
pr_debug("Unexpected _CPC Revision entry type (%d) for CPU:%d\n",
700+
cpc_obj->type, pr->id);
701701
goto out_free;
702702
}
703703
cpc_ptr->version = cpc_rev;
@@ -728,7 +728,8 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
728728
if (pcc_data_alloc(pcc_subspace_id))
729729
goto out_free;
730730
} else if (pcc_subspace_id != gas_t->access_width) {
731-
pr_debug("Mismatched PCC ids.\n");
731+
pr_debug("Mismatched PCC ids in _CPC for CPU:%d\n",
732+
pr->id);
732733
goto out_free;
733734
}
734735
} else if (gas_t->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
@@ -747,28 +748,30 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
747748
* SystemIO doesn't implement 64-bit
748749
* registers.
749750
*/
750-
pr_debug("Invalid access width %d for SystemIO register\n",
751-
gas_t->access_width);
751+
pr_debug("Invalid access width %d for SystemIO register in _CPC\n",
752+
gas_t->access_width);
752753
goto out_free;
753754
}
754755
if (gas_t->address & OVER_16BTS_MASK) {
755756
/* SystemIO registers use 16-bit integer addresses */
756-
pr_debug("Invalid IO port %llu for SystemIO register\n",
757-
gas_t->address);
757+
pr_debug("Invalid IO port %llu for SystemIO register in _CPC\n",
758+
gas_t->address);
758759
goto out_free;
759760
}
760761
} else {
761762
if (gas_t->space_id != ACPI_ADR_SPACE_FIXED_HARDWARE || !cpc_ffh_supported()) {
762763
/* Support only PCC, SystemMemory, SystemIO, and FFH type regs. */
763-
pr_debug("Unsupported register type: %d\n", gas_t->space_id);
764+
pr_debug("Unsupported register type (%d) in _CPC\n",
765+
gas_t->space_id);
764766
goto out_free;
765767
}
766768
}
767769

768770
cpc_ptr->cpc_regs[i-2].type = ACPI_TYPE_BUFFER;
769771
memcpy(&cpc_ptr->cpc_regs[i-2].cpc_entry.reg, gas_t, sizeof(*gas_t));
770772
} else {
771-
pr_debug("Err in entry:%d in CPC table of CPU:%d\n", i, pr->id);
773+
pr_debug("Invalid entry type (%d) in _CPC for CPU:%d\n",
774+
i, pr->id);
772775
goto out_free;
773776
}
774777
}

0 commit comments

Comments
 (0)