Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe: Improve rebar log messages

Some minor improvements to the log messages in the rebar logic:
use xe-oriented printk, switch unit from M to MiB in a few places for
consistency and use ilog2(SZ_1M) for clarity.

Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patch.msgid.link/20251219211650.1908961-6-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

authored by

Lucas De Marchi and committed by
Matt Roper
0b075f82 382876af

+11 -13
+11 -13
drivers/gpu/drm/xe/xe_pci_rebar.c
··· 6 6 #include <linux/pci.h> 7 7 #include <linux/types.h> 8 8 9 - #include <drm/drm_print.h> 10 - 11 9 #include "regs/xe_bars.h" 12 10 #include "xe_device_types.h" 13 11 #include "xe_module.h" 14 12 #include "xe_pci_rebar.h" 13 + #include "xe_printk.h" 15 14 16 15 static void resize_bar(struct xe_device *xe, int resno, resource_size_t size) 17 16 { ··· 20 21 21 22 ret = pci_resize_resource(pdev, resno, bar_size, 0); 22 23 if (ret) { 23 - drm_info(&xe->drm, "Failed to resize BAR%d to %dM (%pe). Consider enabling 'Resizable BAR' support in your BIOS\n", 24 - resno, 1 << bar_size, ERR_PTR(ret)); 24 + xe_info(xe, "Failed to resize BAR%d to %dMiB (%pe). Consider enabling 'Resizable BAR' support in your BIOS\n", 25 + resno, 1 << bar_size, ERR_PTR(ret)); 25 26 return; 26 27 } 27 28 28 - drm_info(&xe->drm, "BAR%d resized to %dM\n", resno, 1 << bar_size); 29 + xe_info(xe, "BAR%d resized to %dMiB\n", resno, 1 << bar_size); 29 30 } 30 31 31 32 /* ··· 58 59 (resource_size_t)SZ_1M); 59 60 60 61 if (!pci_rebar_size_supported(pdev, LMEM_BAR, rebar_size)) { 61 - drm_info(&xe->drm, 62 - "Requested size: %lluMiB is not supported by rebar sizes: 0x%llx. Leaving default: %lluMiB\n", 63 - (u64)pci_rebar_size_to_bytes(rebar_size) >> 20, 64 - pci_rebar_get_possible_sizes(pdev, LMEM_BAR), 65 - (u64)current_size >> 20); 62 + xe_info(xe, "Requested size %lluMiB is not supported by rebar sizes: 0x%llx. Leaving default: %lluMiB\n", 63 + (u64)pci_rebar_size_to_bytes(rebar_size) >> ilog2(SZ_1M), 64 + pci_rebar_get_possible_sizes(pdev, LMEM_BAR), 65 + (u64)current_size >> ilog2(SZ_1M)); 66 66 return; 67 67 } 68 68 ··· 79 81 return; 80 82 } 81 83 82 - drm_info(&xe->drm, "Attempting to resize bar from %lluMiB -> %lluMiB\n", 83 - (u64)current_size >> 20, (u64)rebar_size >> 20); 84 + xe_info(xe, "Attempting to resize bar from %lluMiB -> %lluMiB\n", 85 + (u64)current_size >> ilog2(SZ_1M), (u64)rebar_size >> ilog2(SZ_1M)); 84 86 85 87 while (root->parent) 86 88 root = root->parent; ··· 92 94 } 93 95 94 96 if (!root_res) { 95 - drm_info(&xe->drm, "Can't resize VRAM BAR - platform support is missing. Consider enabling 'Resizable BAR' support in your BIOS\n"); 97 + xe_info(xe, "Can't resize VRAM BAR - platform support is missing. Consider enabling 'Resizable BAR' support in your BIOS\n"); 96 98 return; 97 99 } 98 100