mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Hongyan Xu <getshell@seu.edu.cn>
Cc: mahesh@linux.ibm.com, andrew+kernel@donnellan.id.au,
	arnd@arndb.de, kees@kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, jianhao.xu@seu.edu.cn
Subject: Re: [PATCH] misc: ocxl: cancel XSL fault work before freeing SPA
Date: Thu, 1 Oct 2026 13:46:10 +0200	[thread overview]
Message-ID: <2026100102-clerical-underrate-cc5d@gregkh> (raw)
In-Reply-To: <20260928134110.227-1-getshell@seu.edu.cn>

On Mon, Sep 28, 2026 at 09:41:10PM +0800, Hongyan Xu wrote:
> The XSL fault interrupt takes an mm reference and queues fault_work
> embedded in the SPA. free_irq() stops new interrupt handlers but does
> not drain an already queued worker, allowing free_spa() to release its
> container first.
> 
> Cancel the work after freeing the interrupt. When cancellation removes a
> pending instance, also drop the mm reference that the worker would have
> released.
> 
> Fixes: 5ef3166e8a32 ("ocxl: Driver code for 'generic' opencapi devices")
> Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
> ---
>  drivers/misc/ocxl/link.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c
> index 7749dcd16117..8146e98e77e7 100644
> --- a/drivers/misc/ocxl/link.c
> +++ b/drivers/misc/ocxl/link.c
> @@ -335,6 +335,8 @@ static void release_xsl_irq(struct ocxl_link *link)
>  
>  	if (spa->virq) {
>  		free_irq(spa->virq, link);
> +		if (cancel_work_sync(&spa->xsl_fault.fault_work))
> +			mmput(spa->xsl_fault.pe_data.mm);
>  		irq_dispose_mapping(spa->virq);
>  	}
>  	kfree(spa->irq_name);
> -- 
> 2.50.1.windows.1
> 

How was this found and tested?

thanks,

greg k-h

      reply	other threads:[~2026-10-01 12:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 13:41 Hongyan Xu
2026-10-01 11:46 ` Greg KH [this message]

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=2026100102-clerical-underrate-cc5d@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew+kernel@donnellan.id.au \
    --cc=arnd@arndb.de \
    --cc=getshell@seu.edu.cn \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.ibm.com \
    /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

all inboxes | Powered by JetHome®