| From ec8c8055c86c20a766c68041df146438c84a1229 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Mon, 9 Jun 2025 14:46:43 -0700 |
| Subject: ionic: clean dbpage in de-init |
| |
| From: Shannon Nelson <shannon.nelson@amd.com> |
| |
| [ Upstream commit c9080abea1e69b8b1408ec7dec0acdfdc577a3e2 ] |
| |
| Since the kern_dbpage gets set up in ionic_lif_init() and that |
| function's error path will clean it if needed, the kern_dbpage |
| on teardown should be cleaned in ionic_lif_deinit(), not in |
| ionic_lif_free(). As it is currently we get a double call |
| to iounmap() on kern_dbpage if the PCI ionic fails setting up |
| the lif. One example of this is when firmware isn't responding |
| to AdminQ requests and ionic's first AdminQ call fails to |
| setup the NotifyQ. |
| |
| Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> |
| Reviewed-by: Simon Horman <horms@kernel.org> |
| Reviewed-by: Joe Damato <joe@dama.to> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/net/ethernet/pensando/ionic/ionic_lif.c | 7 +++---- |
| 1 file changed, 3 insertions(+), 4 deletions(-) |
| |
| diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c |
| index b746944bcd2a..7ed77a8304e6 100644 |
| --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c |
| +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c |
| @@ -3142,10 +3142,6 @@ void ionic_lif_free(struct ionic_lif *lif) |
| lif->info = NULL; |
| lif->info_pa = 0; |
| |
| - /* unmap doorbell page */ |
| - ionic_bus_unmap_dbpage(lif->ionic, lif->kern_dbpage); |
| - lif->kern_dbpage = NULL; |
| - |
| mutex_destroy(&lif->config_lock); |
| mutex_destroy(&lif->queue_lock); |
| |
| @@ -3171,6 +3167,9 @@ void ionic_lif_deinit(struct ionic_lif *lif) |
| ionic_lif_qcq_deinit(lif, lif->notifyqcq); |
| ionic_lif_qcq_deinit(lif, lif->adminqcq); |
| |
| + ionic_bus_unmap_dbpage(lif->ionic, lif->kern_dbpage); |
| + lif->kern_dbpage = NULL; |
| + |
| ionic_lif_reset(lif); |
| } |
| |
| -- |
| 2.39.5 |
| |