Skip to content

Commit 8ea9c33

Browse files
Davidlohr Buesodjbw
authored andcommitted
cxl/mbox: Allow for IRQ_NONE case in the isr
For cases when the mailbox background operation is not complete, do not "handle" the interrupt, as it was not from this device. And furthermore there are no racy scenarios such as the hw being out of sync with the driver and starting a new background op behind its back. Reported-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com> Fixes: ccadf13 (cxl/mbox: Add background cmd handling machinery) Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230612181038.14421-2-dave@stgolabs.net Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent ccadf13 commit 8ea9c33

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/cxl/pci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ static irqreturn_t cxl_pci_mbox_irq(int irq, void *id)
118118
struct cxl_dev_id *dev_id = id;
119119
struct cxl_dev_state *cxlds = dev_id->cxlds;
120120

121+
if (!cxl_mbox_background_complete(cxlds))
122+
return IRQ_NONE;
123+
121124
/* short-circuit the wait in __cxl_pci_mbox_send_cmd() */
122-
if (cxl_mbox_background_complete(cxlds))
123-
rcuwait_wake_up(&cxlds->mbox_wait);
125+
rcuwait_wake_up(&cxlds->mbox_wait);
124126

125127
return IRQ_HANDLED;
126128
}

0 commit comments

Comments
 (0)