From b2f853cae705107f29f8901e39f107df939227ef Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sun, 12 Nov 2023 19:15:40 -0800 Subject: [PATCH] Warn if the application BAR didn't get enumerated Signed-off-by: Alex Forencich --- lib/mqnic/mqnic.c | 4 ++++ modules/mqnic/mqnic_main.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/mqnic/mqnic.c b/lib/mqnic/mqnic.c index b94284771..a82ec70c7 100644 --- a/lib/mqnic/mqnic.c +++ b/lib/mqnic/mqnic.c @@ -405,6 +405,10 @@ open: if (rb) { dev->app_id = mqnic_reg_read32(rb->regs, MQNIC_RB_APP_INFO_REG_ID); + + if (!dev->app_regs) { + fprintf(stderr, "Warning: application section present, but application BAR not mapped\n"); + } } mqnic_stats_init(dev); diff --git a/modules/mqnic/mqnic_main.c b/modules/mqnic/mqnic_main.c index 1e0f1efe8..5e95491f8 100644 --- a/modules/mqnic/mqnic_main.c +++ b/modules/mqnic/mqnic_main.c @@ -309,6 +309,10 @@ static int mqnic_common_probe(struct mqnic_dev *mqnic) if (rb) { mqnic->app_id = ioread32(rb->regs + MQNIC_RB_APP_INFO_REG_ID); dev_info(dev, "Application ID: 0x%08x", mqnic->app_id); + + if (!mqnic->app_hw_addr) { + dev_warn(dev, "Warning: application section present, but application BAR not mapped"); + } } mqnic_clk_info_init(mqnic);