From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Unregister SSO device and NPA IRQs before resizing
them.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
drivers/common/cnxk/roc_dev.c | 16 +++++++---------
drivers/common/cnxk/roc_dev_priv.h | 2 ++
drivers/common/cnxk/roc_sso.c | 7 +++++++
3 files changed, 16 insertions(+), 9 deletions(-)
@@ -1017,8 +1017,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_dev, struct dev *dev)
RVU_VF_INT_VEC_MBOX);
}
-static void
-mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev)
{
if (dev_is_vf(dev))
mbox_unregister_vf_irq(pci_dev, dev);
@@ -1096,8 +1096,8 @@ roc_pf_vf_flr_irq(void *param)
}
}
-static int
-vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
+void
+dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
{
struct plt_intr_handle *intr_handle = pci_dev->intr_handle;
int i;
@@ -1113,8 +1113,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)
dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev,
RVU_PF_INT_VEC_VFFLR1);
-
- return 0;
}
int
@@ -1600,7 +1598,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev)
iounmap:
dev_vf_mbase_put(pci_dev, vf_mbase);
mbox_unregister:
- mbox_unregister_irq(pci_dev, dev);
+ dev_mbox_unregister_irq(pci_dev, dev);
if (dev->ops)
plt_free(dev->ops);
mbox_fini:
@@ -1636,10 +1634,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *pci_dev)
if (dev->lmt_mz)
plt_memzone_free(dev->lmt_mz);
- mbox_unregister_irq(pci_dev, dev);
+ dev_mbox_unregister_irq(pci_dev, dev);
if (!dev_is_vf(dev))
- vf_flr_unregister_irqs(pci_dev, dev);
+ dev_vf_flr_unregister_irqs(pci_dev, dev);
/* Release PF - VF */
mbox = &dev->mbox_vfpf;
if (mbox->hwbase && mbox->dev)
@@ -131,6 +131,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_handle);
int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t max_intr);
int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev);
int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
+void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev);
#endif /* _ROC_DEV_PRIV_H */
@@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, uint16_t sso_vec_cnt)
return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt);
}
+ /* Before re-configuring unregister irqs */
+ dev_mbox_unregister_irq(pci_dev, dev);
+ if (!dev_is_vf(dev))
+ dev_vf_flr_unregister_irqs(pci_dev, dev);
+
npa_vec_cnt = (dev->npa.pci_dev == pci_dev) ? NPA_LF_INT_VEC_POISON + 1 : 0;
+ if (npa_vec_cnt)
+ npa_unregister_irqs(&dev->npa);
/* Re-configure to include SSO vectors */
rc = dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + npa_vec_cnt + sso_vec_cnt);