@@ -180,13 +180,15 @@ static int ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
static int ghes_read_estatus(struct ghes *ghes, int silent)
{
struct acpi_hest_generic *g = ghes->generic;
+ /* Not more than 2 messages every 5 seconds */
+ static DEFINE_RATELIMIT_STATE(ratelimit, 5*HZ, 2);
u64 buf_paddr;
u32 len;
int rc;
rc = acpi_atomic_read(&buf_paddr, &g->error_status_address);
if (rc) {
- if (!silent && printk_ratelimit())
+ if (!silent && __ratelimit(&ratelimit))
pr_warning(FW_WARN GHES_PFX
"Failed to read error status block address for hardware error source: %d.\n",
g->header.source_id);