iommu/amd: Use pr_fmt()
Make use of pr_fmt instead of having the 'AMD-Vi' prefix added manually at every printk() call. Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "AMD-Vi: " fmt
|
||||
|
||||
#include <linux/pci.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/list.h>
|
||||
@@ -443,9 +445,9 @@ static void iommu_disable(struct amd_iommu *iommu)
|
||||
static u8 __iomem * __init iommu_map_mmio_space(u64 address, u64 end)
|
||||
{
|
||||
if (!request_mem_region(address, end, "amd_iommu")) {
|
||||
pr_err("AMD-Vi: Can not reserve memory region %llx-%llx for mmio\n",
|
||||
pr_err("Can not reserve memory region %llx-%llx for mmio\n",
|
||||
address, end);
|
||||
pr_err("AMD-Vi: This is a BIOS bug. Please contact your hardware vendor\n");
|
||||
pr_err("This is a BIOS bug. Please contact your hardware vendor\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -512,7 +514,7 @@ static int __init find_last_devid_from_ivhd(struct ivhd_header *h)
|
||||
u32 ivhd_size = get_ivhd_header_size(h);
|
||||
|
||||
if (!ivhd_size) {
|
||||
pr_err("AMD-Vi: Unsupported IVHD type %#x\n", h->type);
|
||||
pr_err("Unsupported IVHD type %#x\n", h->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -553,7 +555,7 @@ static int __init check_ivrs_checksum(struct acpi_table_header *table)
|
||||
checksum += p[i];
|
||||
if (checksum != 0) {
|
||||
/* ACPI table corrupt */
|
||||
pr_err(FW_BUG "AMD-Vi: IVRS invalid checksum\n");
|
||||
pr_err(FW_BUG "IVRS invalid checksum\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -1027,7 +1029,7 @@ static int __init add_special_device(u8 type, u8 id, u16 *devid, bool cmd_line)
|
||||
if (!(entry->id == id && entry->cmd_line))
|
||||
continue;
|
||||
|
||||
pr_info("AMD-Vi: Command-line override present for %s id %d - ignoring\n",
|
||||
pr_info("Command-line override present for %s id %d - ignoring\n",
|
||||
type == IVHD_SPECIAL_IOAPIC ? "IOAPIC" : "HPET", id);
|
||||
|
||||
*devid = entry->devid;
|
||||
@@ -1060,7 +1062,7 @@ static int __init add_acpi_hid_device(u8 *hid, u8 *uid, u16 *devid,
|
||||
!entry->cmd_line)
|
||||
continue;
|
||||
|
||||
pr_info("AMD-Vi: Command-line override for hid:%s uid:%s\n",
|
||||
pr_info("Command-line override for hid:%s uid:%s\n",
|
||||
hid, uid);
|
||||
*devid = entry->devid;
|
||||
return 0;
|
||||
@@ -1076,7 +1078,7 @@ static int __init add_acpi_hid_device(u8 *hid, u8 *uid, u16 *devid,
|
||||
entry->cmd_line = cmd_line;
|
||||
entry->root_devid = (entry->devid & (~0x7));
|
||||
|
||||
pr_info("AMD-Vi:%s, add hid:%s, uid:%s, rdevid:%d\n",
|
||||
pr_info("%s, add hid:%s, uid:%s, rdevid:%d\n",
|
||||
entry->cmd_line ? "cmd" : "ivrs",
|
||||
entry->hid, entry->uid, entry->root_devid);
|
||||
|
||||
@@ -1172,7 +1174,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
|
||||
*/
|
||||
ivhd_size = get_ivhd_header_size(h);
|
||||
if (!ivhd_size) {
|
||||
pr_err("AMD-Vi: Unsupported IVHD type %#x\n", h->type);
|
||||
pr_err("Unsupported IVHD type %#x\n", h->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1454,7 +1456,7 @@ static void amd_iommu_erratum_746_workaround(struct amd_iommu *iommu)
|
||||
pci_write_config_dword(iommu->dev, 0xf0, 0x90 | (1 << 8));
|
||||
|
||||
pci_write_config_dword(iommu->dev, 0xf4, value | 0x4);
|
||||
pr_info("AMD-Vi: Applying erratum 746 workaround for IOMMU at %s\n",
|
||||
pr_info("Applying erratum 746 workaround for IOMMU at %s\n",
|
||||
dev_name(&iommu->dev->dev));
|
||||
|
||||
/* Clear the enable writing bit */
|
||||
@@ -1485,7 +1487,7 @@ static void amd_iommu_ats_write_check_workaround(struct amd_iommu *iommu)
|
||||
/* Set L2_DEBUG_3[AtsIgnoreIWDis] = 1 */
|
||||
iommu_write_l2(iommu, 0x47, value | BIT(0));
|
||||
|
||||
pr_info("AMD-Vi: Applying ATS write check workaround for IOMMU at %s\n",
|
||||
pr_info("Applying ATS write check workaround for IOMMU at %s\n",
|
||||
dev_name(&iommu->dev->dev));
|
||||
}
|
||||
|
||||
@@ -1505,7 +1507,7 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
|
||||
iommu->index = amd_iommus_present++;
|
||||
|
||||
if (unlikely(iommu->index >= MAX_IOMMUS)) {
|
||||
WARN(1, "AMD-Vi: System has more IOMMUs than supported by this driver\n");
|
||||
WARN(1, "System has more IOMMUs than supported by this driver\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
@@ -1673,12 +1675,12 @@ static void init_iommu_perf_ctr(struct amd_iommu *iommu)
|
||||
if ((iommu_pc_get_set_reg(iommu, 0, 0, 0, &val, true)) ||
|
||||
(iommu_pc_get_set_reg(iommu, 0, 0, 0, &val2, false)) ||
|
||||
(val != val2)) {
|
||||
pr_err("AMD-Vi: Unable to write to IOMMU perf counter.\n");
|
||||
pr_err("Unable to write to IOMMU perf counter.\n");
|
||||
amd_iommu_pc_present = false;
|
||||
return;
|
||||
}
|
||||
|
||||
pr_info("AMD-Vi: IOMMU performance counters supported\n");
|
||||
pr_info("IOMMU performance counters supported\n");
|
||||
|
||||
val = readl(iommu->mmio_base + MMIO_CNTR_CONF_OFFSET);
|
||||
iommu->max_banks = (u8) ((val >> 12) & 0x3f);
|
||||
@@ -1839,11 +1841,11 @@ static void print_iommu_info(void)
|
||||
for_each_iommu(iommu) {
|
||||
int i;
|
||||
|
||||
pr_info("AMD-Vi: Found IOMMU at %s cap 0x%hx\n",
|
||||
pr_info("Found IOMMU at %s cap 0x%hx\n",
|
||||
dev_name(&iommu->dev->dev), iommu->cap_ptr);
|
||||
|
||||
if (iommu->cap & (1 << IOMMU_CAP_EFR)) {
|
||||
pr_info("AMD-Vi: Extended features (%#llx):\n",
|
||||
pr_info("Extended features (%#llx):\n",
|
||||
iommu->features);
|
||||
for (i = 0; i < ARRAY_SIZE(feat_str); ++i) {
|
||||
if (iommu_feature(iommu, (1ULL << i)))
|
||||
@@ -1857,11 +1859,11 @@ static void print_iommu_info(void)
|
||||
}
|
||||
}
|
||||
if (irq_remapping_enabled) {
|
||||
pr_info("AMD-Vi: Interrupt remapping enabled\n");
|
||||
pr_info("Interrupt remapping enabled\n");
|
||||
if (AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir))
|
||||
pr_info("AMD-Vi: virtual APIC enabled\n");
|
||||
pr_info("Virtual APIC enabled\n");
|
||||
if (amd_iommu_xt_mode == IRQ_REMAP_X2APIC_MODE)
|
||||
pr_info("AMD-Vi: X2APIC enabled\n");
|
||||
pr_info("X2APIC enabled\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2375,7 +2377,7 @@ static bool __init check_ioapic_information(void)
|
||||
|
||||
devid = get_ioapic_devid(id);
|
||||
if (devid < 0) {
|
||||
pr_err("%sAMD-Vi: IOAPIC[%d] not in IVRS table\n",
|
||||
pr_err("%s: IOAPIC[%d] not in IVRS table\n",
|
||||
fw_bug, id);
|
||||
ret = false;
|
||||
} else if (devid == IOAPIC_SB_DEVID) {
|
||||
@@ -2393,11 +2395,11 @@ static bool __init check_ioapic_information(void)
|
||||
* when the BIOS is buggy and provides us the wrong
|
||||
* device id for the IOAPIC in the system.
|
||||
*/
|
||||
pr_err("%sAMD-Vi: No southbridge IOAPIC found\n", fw_bug);
|
||||
pr_err("%s: No southbridge IOAPIC found\n", fw_bug);
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
pr_err("AMD-Vi: Disabling interrupt remapping\n");
|
||||
pr_err("Disabling interrupt remapping\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2452,7 +2454,7 @@ static int __init early_amd_iommu_init(void)
|
||||
return -ENODEV;
|
||||
else if (ACPI_FAILURE(status)) {
|
||||
const char *err = acpi_format_exception(status);
|
||||
pr_err("AMD-Vi: IVRS table error: %s\n", err);
|
||||
pr_err("IVRS table error: %s\n", err);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -2605,7 +2607,7 @@ static bool detect_ivrs(void)
|
||||
return false;
|
||||
else if (ACPI_FAILURE(status)) {
|
||||
const char *err = acpi_format_exception(status);
|
||||
pr_err("AMD-Vi: IVRS table error: %s\n", err);
|
||||
pr_err("IVRS table error: %s\n", err);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2640,7 +2642,7 @@ static int __init state_next(void)
|
||||
ret = early_amd_iommu_init();
|
||||
init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
|
||||
if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) {
|
||||
pr_info("AMD-Vi: AMD IOMMU disabled on kernel command-line\n");
|
||||
pr_info("AMD IOMMU disabled on kernel command-line\n");
|
||||
free_dma_resources();
|
||||
free_iommu_resources();
|
||||
init_state = IOMMU_CMDLINE_DISABLED;
|
||||
@@ -2787,7 +2789,7 @@ static bool amd_iommu_sme_check(void)
|
||||
(boot_cpu_data.microcode <= 0x080011ff))
|
||||
return true;
|
||||
|
||||
pr_notice("AMD-Vi: IOMMU not currently supported when SME is active\n");
|
||||
pr_notice("IOMMU not currently supported when SME is active\n");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2872,12 +2874,12 @@ static int __init parse_ivrs_ioapic(char *str)
|
||||
ret = sscanf(str, "[%d]=%x:%x.%x", &id, &bus, &dev, &fn);
|
||||
|
||||
if (ret != 4) {
|
||||
pr_err("AMD-Vi: Invalid command line: ivrs_ioapic%s\n", str);
|
||||
pr_err("Invalid command line: ivrs_ioapic%s\n", str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (early_ioapic_map_size == EARLY_MAP_SIZE) {
|
||||
pr_err("AMD-Vi: Early IOAPIC map overflow - ignoring ivrs_ioapic%s\n",
|
||||
pr_err("Early IOAPIC map overflow - ignoring ivrs_ioapic%s\n",
|
||||
str);
|
||||
return 1;
|
||||
}
|
||||
@@ -2902,12 +2904,12 @@ static int __init parse_ivrs_hpet(char *str)
|
||||
ret = sscanf(str, "[%d]=%x:%x.%x", &id, &bus, &dev, &fn);
|
||||
|
||||
if (ret != 4) {
|
||||
pr_err("AMD-Vi: Invalid command line: ivrs_hpet%s\n", str);
|
||||
pr_err("Invalid command line: ivrs_hpet%s\n", str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (early_hpet_map_size == EARLY_MAP_SIZE) {
|
||||
pr_err("AMD-Vi: Early HPET map overflow - ignoring ivrs_hpet%s\n",
|
||||
pr_err("Early HPET map overflow - ignoring ivrs_hpet%s\n",
|
||||
str);
|
||||
return 1;
|
||||
}
|
||||
@@ -2932,7 +2934,7 @@ static int __init parse_ivrs_acpihid(char *str)
|
||||
|
||||
ret = sscanf(str, "[%x:%x.%x]=%s", &bus, &dev, &fn, acpiid);
|
||||
if (ret != 4) {
|
||||
pr_err("AMD-Vi: Invalid command line: ivrs_acpihid(%s)\n", str);
|
||||
pr_err("Invalid command line: ivrs_acpihid(%s)\n", str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2941,7 +2943,7 @@ static int __init parse_ivrs_acpihid(char *str)
|
||||
uid = p;
|
||||
|
||||
if (!hid || !(*hid) || !uid) {
|
||||
pr_err("AMD-Vi: Invalid command line: hid or uid\n");
|
||||
pr_err("Invalid command line: hid or uid\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user