Linux CXL
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Anisa Su" <anisa.su887@gmail.com>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2 4/4] cxl/events: Return IRQ_NONE when no events were processed
Date: Tue, 01 Sep 2026 00:38:52 +0000	[thread overview]
Message-ID: <20260901003852.6D2DD1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260901002912.958-5-anisa.su@samsung.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Concurrent execution of the shared IRQ thread for different CXL event vectors will incorrectly return IRQ_NONE, causing the kernel to permanently disable the IRQ.
--

commit e4fb9fa2ad67f892cc6a1e121480e607bbf7ed82
Author: Anisa Su <anisa.su887@gmail.com>

cxl/events: Return IRQ_NONE when no events were processed

This commit changes cxl_event_thread() to return IRQ_NONE when no events
are processed, rather than always returning IRQ_HANDLED. The stated intent
is to allow the kernel to detect devices flooding their MSI vectors.

> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index 239df18c9c87b..94ff2b7d1f09a 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -528,6 +528,7 @@ static irqreturn_t cxl_event_thread(int irq, void *id)
>  	struct cxl_memdev_state *mds = to_cxl_memdev_state(cxlds);
>  	u32 mask = CXLDEV_EVENT_STATUS_ALL;
>  	int attempts = CXL_EVENT_DRAIN_ATTEMPTS;
> +	bool handled = false;
>  
>  	while (mask) {
>  		u32 status, drained, stuck;
[ ... ]
> @@ -542,6 +543,7 @@ static irqreturn_t cxl_event_thread(int irq, void *id)
>  		status &= mask;
>  		if (!status)
>  			break;
> +		handled = true;
>  
>  		rc = cxl_mem_get_event_records(mds, status, &drained);
>  		if (rc) {
[ ... ]
> @@ -579,7 +581,7 @@ static irqreturn_t cxl_event_thread(int irq, void *id)
>  		cond_resched();
>  	}
>  
> -	return IRQ_HANDLED;
> +	return handled ? IRQ_HANDLED : IRQ_NONE;
>  }

[Severity: High]
Will this cause concurrent event interrupts on multi-vector devices to be
permanently disabled?

If a CXL device maps different event logs to different MSI vectors (for
example, Info to vector 1 and Warn to vector 2), and both events occur in
quick succession, the first handler thread will drain both logs because
mask is initialized to CXLDEV_EVENT_STATUS_ALL.

When the second handler thread wakes up, it will read a status of 0, break
the loop without setting handled to true, and return IRQ_NONE.

Could this trigger the kernel's spurious interrupt detector during normal
operation under load, causing it to permanently disable the IRQ and break
hardware event reporting?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260901002912.958-1-anisa.su@samsung.com?part=4

  reply	other threads:[~2026-09-01  0:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  0:26 [PATCH v2 0/4] cxl/events: Robustify event interrupt handling Anisa Su
2026-09-01  0:26 ` [PATCH v2 1/4] cxl/events: Bound get records loop in cxl_event_thread() Anisa Su
2026-09-01  0:41   ` sashiko-bot
2026-09-01 11:48   ` Li Ming
2026-09-01 17:59     ` Anisa Su
2026-09-01 19:17   ` Cheatham, Benjamin
2026-09-01  0:26 ` [PATCH v2 2/4] cxl/events: Validate the record count reported by the device Anisa Su
2026-09-01 19:19   ` Cheatham, Benjamin
2026-09-01  0:26 ` [PATCH v2 3/4] cxl/events: Bound the per-log Get Event Records loop Anisa Su
2026-09-01  0:43   ` sashiko-bot
2026-09-01 19:19   ` Cheatham, Benjamin
2026-09-01  0:26 ` [PATCH v2 4/4] cxl/events: Return IRQ_NONE when no events were processed Anisa Su
2026-09-01  0:38   ` sashiko-bot [this message]
2026-09-01 19:19   ` Cheatham, Benjamin
2026-09-02  8:27 ` [PATCH v2 0/4] cxl/events: Robustify event interrupt handling Anisa Su
2026-09-02 19:06   ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260901003852.6D2DD1F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=anisa.su887@gmail.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox