Commit 2b9f28d5 authored by Jason Wang's avatar Jason Wang Committed by Michael S. Tsirkin

vdpa: ifcvf: free config irq in ifcvf_free_irq()

We don't free config irq in ifcvf_free_irq() which will trigger a
BUG() in pci core since we try to free the vectors that has an
action. Fixing this by recording the config irq in ifcvf_hw structure
and free it in ifcvf_free_irq().

Fixes: e7991f37 ("ifcvf: implement config interrupt in IFCVF")
Cc: Zhu Lingshan <lingshan.zhu@intel.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20200723091254.20617-2-jasowang@redhat.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarZhu Lingshan <lingshan.zhu@intel.com>
Fixes: e7991f37 ("ifcvf: implement config interrupt in IFCVF")
Cc: Zhu Lingshan <a class="moz-txt-link-rfc2396E" href="mailto:lingshan.zhu@intel.com">&lt;lingshan.zhu@intel.com&gt;</a>
Signed-off-by: Jason Wang <a class="moz-txt-link-rfc2396E" href="mailto:jasowang@redhat.com">&lt;jasowang@redhat.com&gt;</a>
parent 9f4ce5d7
...@@ -84,7 +84,7 @@ struct ifcvf_hw { ...@@ -84,7 +84,7 @@ struct ifcvf_hw {
void __iomem * const *base; void __iomem * const *base;
char config_msix_name[256]; char config_msix_name[256];
struct vdpa_callback config_cb; struct vdpa_callback config_cb;
unsigned int config_irq;
}; };
struct ifcvf_adapter { struct ifcvf_adapter {
......
...@@ -55,6 +55,7 @@ static void ifcvf_free_irq(struct ifcvf_adapter *adapter, int queues) ...@@ -55,6 +55,7 @@ static void ifcvf_free_irq(struct ifcvf_adapter *adapter, int queues)
vf->vring[i].irq = -EINVAL; vf->vring[i].irq = -EINVAL;
} }
devm_free_irq(&pdev->dev, vf->config_irq, vf);
ifcvf_free_irq_vectors(pdev); ifcvf_free_irq_vectors(pdev);
} }
...@@ -74,8 +75,8 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter) ...@@ -74,8 +75,8 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
snprintf(vf->config_msix_name, 256, "ifcvf[%s]-config\n", snprintf(vf->config_msix_name, 256, "ifcvf[%s]-config\n",
pci_name(pdev)); pci_name(pdev));
vector = 0; vector = 0;
irq = pci_irq_vector(pdev, vector); vf->config_irq = pci_irq_vector(pdev, vector);
ret = devm_request_irq(&pdev->dev, irq, ret = devm_request_irq(&pdev->dev, vf->config_irq,
ifcvf_config_changed, 0, ifcvf_config_changed, 0,
vf->config_msix_name, vf); vf->config_msix_name, vf);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment