Skip to content

Commit 4b55dda

Browse files
Kan Liangmngyadam
authored andcommitted
perf/x86/uncore: Don't WARN_ON_ONCE() for a broken discovery table
Commit 5d515ee upstream. The kernel warning message is triggered, when SPR MCC is used. [ 17.945331] ------------[ cut here ]------------ [ 17.946305] WARNING: CPU: 65 PID: 1 at arch/x86/events/intel/uncore_discovery.c:184 intel_uncore_has_discovery_tables+0x4c0/0x65c [ 17.946305] Modules linked in: [ 17.946305] CPU: 65 PID: 1 Comm: swapper/0 Not tainted 5.4.17-2136.313.1-X10-2c+ #4 It's caused by the broken discovery table of UPI. The discovery tables are from hardware. Except for dropping the broken information, there is nothing Linux can do. Using WARN_ON_ONCE() is overkilled. Use the pr_info() to replace WARN_ON_ONCE(), and specify what uncore unit is dropped and the reason. Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Michael Petlan <mpetlan@redhat.com> Link: https://lore.kernel.org/r/20230112200105.733466-6-kan.liang@linux.intel.com Signed-off-by: Mahmoud Adam <mngyadam@amazon.com>
1 parent 1a0eead commit 4b55dda

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

arch/x86/events/intel/uncore_discovery.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,21 @@ uncore_insert_box_info(struct uncore_unit_discovery *unit,
140140
unsigned int *box_offset, *ids;
141141
int i;
142142

143-
if (WARN_ON_ONCE(!unit->ctl || !unit->ctl_offset || !unit->ctr_offset))
143+
if (!unit->ctl || !unit->ctl_offset || !unit->ctr_offset) {
144+
pr_info("Invalid address is detected for uncore type %d box %d, "
145+
"Disable the uncore unit.\n",
146+
unit->box_type, unit->box_id);
144147
return;
148+
}
145149

146150
if (parsed) {
147151
type = search_uncore_discovery_type(unit->box_type);
148-
if (WARN_ON_ONCE(!type))
152+
if (!type) {
153+
pr_info("A spurious uncore type %d is detected, "
154+
"Disable the uncore type.\n",
155+
unit->box_type);
149156
return;
157+
}
150158
/* Store the first box of each die */
151159
if (!type->box_ctrl_die[die])
152160
type->box_ctrl_die[die] = unit->ctl;
@@ -181,8 +189,12 @@ uncore_insert_box_info(struct uncore_unit_discovery *unit,
181189
ids[i] = type->ids[i];
182190
box_offset[i] = type->box_offset[i];
183191

184-
if (WARN_ON_ONCE(unit->box_id == ids[i]))
192+
if (unit->box_id == ids[i]) {
193+
pr_info("Duplicate uncore type %d box ID %d is detected, "
194+
"Drop the duplicate uncore unit.\n",
195+
unit->box_type, unit->box_id);
185196
goto free_ids;
197+
}
186198
}
187199
ids[i] = unit->box_id;
188200
box_offset[i] = unit->ctl - type->box_ctrl;

0 commit comments

Comments
 (0)