Skip to content

Commit

Permalink
cxl: Make IRQ release idempotent
Browse files Browse the repository at this point in the history
Check if an IRQ is mapped before releasing it.

This will simplify future EEH code by allowing unconditional unmapping
of IRQs.

Acked-by: Cyril Bur <[email protected]>
Signed-off-by: Daniel Axtens <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
  • Loading branch information
daxtens authored and mpe committed Aug 14, 2015
1 parent 0515577 commit e640d2f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/misc/cxl/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ int cxl_register_psl_err_irq(struct cxl *adapter)

void cxl_release_psl_err_irq(struct cxl *adapter)
{
if (adapter->err_virq != irq_find_mapping(NULL, adapter->err_hwirq))
return;

cxl_p1_write(adapter, CXL_PSL_ErrIVTE, 0x0000000000000000);
cxl_unmap_irq(adapter->err_virq, adapter);
cxl_release_one_irq(adapter, adapter->err_hwirq);
Expand Down Expand Up @@ -374,6 +377,9 @@ int cxl_register_serr_irq(struct cxl_afu *afu)

void cxl_release_serr_irq(struct cxl_afu *afu)
{
if (afu->serr_virq != irq_find_mapping(NULL, afu->serr_hwirq))
return;

cxl_p1n_write(afu, CXL_PSL_SERR_An, 0x0000000000000000);
cxl_unmap_irq(afu->serr_virq, afu);
cxl_release_one_irq(afu->adapter, afu->serr_hwirq);
Expand All @@ -400,6 +406,9 @@ int cxl_register_psl_irq(struct cxl_afu *afu)

void cxl_release_psl_irq(struct cxl_afu *afu)
{
if (afu->psl_virq != irq_find_mapping(NULL, afu->psl_hwirq))
return;

cxl_unmap_irq(afu->psl_virq, afu);
cxl_release_one_irq(afu->adapter, afu->psl_hwirq);
kfree(afu->psl_irq_name);
Expand Down

0 comments on commit e640d2f

Please sign in to comment.