platform/x86/amd/pmc: Add dump_custom_stb module parameter
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Tue, 10 Oct 2023 14:50:03 +0000 (20:20 +0530)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 12 Oct 2023 14:00:22 +0000 (17:00 +0300)
commit3f720b21ec5af466e50e99dc517af267b67d248c
tree8881d2dac81d34d514bb9ba8d2ddd99b0f0dde5c
parentb136225746a9793bdff9c78b215eac4f64bf21f2
platform/x86/amd/pmc: Add dump_custom_stb module parameter

There have been instances when the default size (1M) of the STB is not
sufficient to get the complete traces of the failure. In such scenarios
we can use a module_param to enable full trace that shall contain more
debugging data. This is not a regular case and hence not enabling this
capability by default.

With this change, there will be two cases on how the driver fetches the
stb data:
1) A special case (proposed now) - which is required only for certain
platforms. Here, a new module param will be supplied to the driver that
will have a special PMFW supporting enhanced dram sizes for getting
the stb data. Without the special PMFW support, just setting the module
param will not help to get the enhanced stb data.

To adapt to this change, we will have a new amd_pmc_stb_handle_efr() to
handle enhanced firmware reporting mechanism. Note that, since num_samples
based r/w pointer offset calculation is not required for enhanced firmware
reporting we will have this mailbox command sent only in case of regular
STB cases.

2) Current code branch which fetches the stb data based on the parameters
like the num_samples, fsize and the r/w pointer.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Co-developed-by: Harsh Jain <Harsh.Jain@amd.com>
Signed-off-by: Harsh Jain <Harsh.Jain@amd.com>
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20231010145003.139932-3-Shyam-sundar.S-k@amd.com
[ij: Renamed flex_arr -> stb_data_arr]
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/amd/pmc/pmc.c