From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ziheng Wei <zihengw03@163.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] parport: do not re-enable interrupts in parport_claim()
Date: Wed, 18 Nov 2026 09:11:37 +0100 [thread overview]
Message-ID: <2026111853-raffle-entwine-0b64@gregkh> (raw)
In-Reply-To: <20261118075816.2323688-1-zihengw03@163.com>
Wait, your subject makes no sense.
On Wed, Nov 18, 2026 at 03:58:16PM +0800, Ziheng Wei wrote:
> When the claiming device was on the wait list, parport_claim() takes
> it off the list with spin_lock_irq()/spin_unlock_irq() while it holds
> cad_lock with interrupts disabled:
>
> parport_claim()
> |
> | write_lock_irqsave(&port->cad_lock) <- IRQs off, cad_lock held
> | spin_lock_irq(&port->waitlist_lock)
> | spin_unlock_irq(&port->waitlist_lock) <- IRQs on too early
but that's not why spin_lock/unlock_irq() is being called, it's because
this lock could be held _during_ an irq path, right?
Are you saying that this lock is never held in irq context?
> |
> +---- port interrupt on this CPU ----+
> | |
> | v
> | parport_irq_handler()
> | read_lock(&port->cad_lock)
> | spins forever: cad_lock is held
> | by the code it interrupted
> |
> | write_unlock_irqrestore(&port->cad_lock) <- never reached
Ok, but again, you have to look at the lock itself, is the
waitlist_lock() ever held in irq context?
thanks,
greg k-h
next prev parent reply other threads:[~2026-11-18 8:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 7:58 [PATCH v2] parport: do not re-enable interrupts in parport_claim() Ziheng Wei
2026-11-18 8:09 ` Greg Kroah-Hartman
2026-11-18 8:11 ` Greg Kroah-Hartman [this message]
2026-11-18 8:48 ` Ziheng Wei
2026-11-18 9:25 ` Greg Kroah-Hartman
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=2026111853-raffle-entwine-0b64@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
--cc=zihengw03@163.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