Skip to content

Add Firmware Info, Warn, and Bug messages

Prarit Bhargava lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Introduce FW_INFO* functions and messagesarch/x86/pci/mmconfig-shared.c include/asm-generic/bug.h include/linux/printk.h +2 more+98 -199 replies
2/3Introduce FW_WARN* functions and messagesarch/x86/kernel/cpu/amd.c arch/x86/kernel/cpu/mtrr/generic.c drivers/acpi/apei/apei-base.c +9 more+60 -460 replies
3/3Introduce FW_BUG* functions and messagesarch/x86/kernel/apic/apic.c arch/x86/kernel/cpu/amd.c arch/x86/kernel/cpu/mcheck/mce.c +26 more+149 -1530 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Add Firmware Info, Warn, and Bug messages

Logging and tracking firmware bugs in the kernel has long been an issue for system administrators. The current kernel does not have a good uniform method of reporting firmware bugs and the code in the kernel is a mix of printk's and WARN_ONs. This causes problems for both system administrators and QA engineers who attempt to diagnose problems within the kernel.

Using printk's is somewhat effective but lacks information useful for reporting a bug such as the system vendor or model, BIOS revision, etc. Using WARN_ONs is also questionable because the data like the backtrace and the list of modules is usually unnecessary for firmware issues as the warning stems from one call path during system or driver initialization. We have heard many complaints from users about the excess verbosity and confusing stacktraces for these messages.

I'm proposing with this patch to do something similar to the WARN() mechanism that is currently implemented in the kernel. This patchset introduces FW_* functions which logs output like:

[  230.661137] [Firmware Info]: pci_bus 0000:00: at
/home/prarit_modules/prarit.c:21 Your BIOS is broken because it is
-ENOWORKY.
[  230.671076] [Firmware Info]: Intel Corporation SandyBridge Platform/To

be filled by O.E.M., BIOS RMLCRB.86I.R3.27.D685.1305151733 05/15/2013

instead of the verbose back traces we are currently seeing. These messages can be easily gleaned from /var/log/messages, etc., by automatic bug reporting tools and system administrators to properly report bugs to hardware vendors.

Cc Arnd Bergmann <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

Prarit Bhargava (3):
Introduce FW_INFO* functions and messages
Introduce FW_WARN* functions and messages
Introduce FW_BUG* functions and messages

 arch/x86/kernel/apic/apic.c              |    8 +--
 arch/x86/kernel/cpu/amd.c                |    9 ++--
 arch/x86/kernel/cpu/mcheck/mce.c         |    2 +-
 arch/x86/kernel/cpu/mcheck/mce_amd.c     |   12 ++---
 arch/x86/kernel/cpu/mtrr/generic.c       |    4 +-
 arch/x86/kernel/cpu/perf_event.c         |    8 ++-
 arch/x86/kernel/cpu/perf_event_amd_ibs.c |   10 ++--
 arch/x86/pci/mmconfig-shared.c           |   18 ++-----
 drivers/acpi/apei/apei-base.c            |   40 +++++++--------
 drivers/acpi/apei/einj.c                 |    9 ++--
 drivers/acpi/apei/erst.c                 |   17 +++----
 drivers/acpi/apei/ghes.c                 |   42 ++++++++--------
 drivers/acpi/apei/hest.c                 |   15 +++---
 drivers/acpi/battery.c                   |   12 +++--
 drivers/acpi/osl.c                       |    6 +--
 drivers/acpi/pci_root.c                  |    4 +-
 drivers/acpi/processor_perflib.c         |   16 +++---
 drivers/acpi/thermal.c                   |    5 +-
 drivers/acpi/video.c                     |   17 +++----
 drivers/acpi/video_detect.c              |    4 +-
 drivers/cpufreq/acpi-cpufreq.c           |    4 +-
 drivers/cpufreq/powernow-k8.c            |   56 +++++++++++----------
 drivers/firmware/dmi_scan.c              |    2 +-
 drivers/firmware/efi/cper.c              |    2 +-
 drivers/iommu/amd_iommu_init.c           |   24 +++++----
 drivers/iommu/dmar.c                     |    3 +-
 drivers/iommu/intel_irq_remapping.c      |    4 +-
 drivers/pci/quirks.c                     |    2 +-
 drivers/pnp/quirks.c                     |    4 +-
 include/asm-generic/bug.h                |   78 ++++++++++++++++++++++++++++++
 include/linux/printk.h                   |   30 +++---------
 kernel/panic.c                           |   42 ++++++++++++++++
 kernel/printk/printk.c                   |   12 +++++
 33 files changed, 305 insertions(+), 216 deletions(-)
Signature · 1 line
1.7.9.3