From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH for-4.22 v2 4/4] char/ns16550: bound execution time of ns16550_interrupt()
Date: Mon, 29 Jun 2026 16:44:20 +0200 [thread overview]
Message-ID: <akKExHlTunGnNngj@macbook.local> (raw)
In-Reply-To: <f8251836-4b7a-4fab-9f1c-e95d4444b989@suse.com>
On Mon, Jun 29, 2026 at 12:39:45PM +0200, Jan Beulich wrote:
> On 29.06.2026 11:45, Roger Pau Monne wrote:
> > --- a/xen/common/irq.c
> > +++ b/xen/common/irq.c
> > @@ -54,3 +54,15 @@ unsigned int cf_check irq_startup_none(struct irq_desc *desc)
> > {
> > return 0;
> > }
> > +
> > +void disable_irq(unsigned int irq)
> > +{
> > + struct irq_desc *desc = irq_to_desc(irq);
> > + unsigned long flags;
> > +
> > + spin_lock_irqsave(&desc->lock, flags);
> > + desc->status |= IRQ_DISABLED;
> > + if ( desc->handler->disable )
> > + desc->handler->disable(desc);
>
> I'd like to point out that __pirq_guest_unbind() has this the other way around:
> Call ->disable(), then set flag. Similarly move_native_irq() only calls the
> hook with the flag clear. Whereas fixup_irqs() doesn't care about the flag at
> all. Also considering the wording "disable" vs "disabled", I think setting the
> flag afterwards is better.
As this was done inside of the locked region I didn't think it
mattered much, but yes, the ->disable() handler might itself rely on
the previous state.
> > @@ -190,12 +191,38 @@ static void cf_check ns16550_interrupt(int irq, void *dev_id)
> > {
> > struct serial_port *port = dev_id;
> > struct ns16550 *uart = port->uart;
> > + /*
> > + * Set quite arbitrarily as 4x the time to drain the TX or fill RX FIFOs,
> > + * set the upper bound as 5ms or the timeout_ms value, whatever is higher.
> > + */
> > + const unsigned int delta = min(uart->timeout_ms * 4,
> > + max(5u, uart->timeout_ms));
>
> You may want to also update the description accordingly.
>
> Preferably with respective adjustments:
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
Thanks, I've applied the comments.
Regards, Roger.
next prev parent reply other threads:[~2026-06-29 14:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 9:45 [PATCH for-4.22 v2 0/4] ns16550: bound interrupt handler execution time Roger Pau Monne
2026-06-29 9:45 ` [PATCH for-4.22 v2 1/4] riscv/irq: define a per-arch irq_to_desc() Roger Pau Monne
2026-06-29 10:01 ` Oleksii Kurochko
2026-06-29 10:06 ` Jan Beulich
2026-06-29 9:45 ` [PATCH for-4.22 v2 2/4] xen/ppc: introduce a dummy irq_to_desc() Roger Pau Monne
2026-06-29 10:07 ` Jan Beulich
2026-06-29 10:09 ` Oleksii Kurochko
2026-06-29 14:26 ` Oleksii Kurochko
2026-06-29 9:45 ` [PATCH for-4.22 v2 3/4] xen/irq: handle IRQ being disabled while executing its handler Roger Pau Monne
2026-06-29 10:31 ` Jan Beulich
2026-06-29 14:29 ` Roger Pau Monné
2026-06-29 14:31 ` Jan Beulich
2026-06-29 13:37 ` Oleksii Kurochko
2026-06-29 9:45 ` [PATCH for-4.22 v2 4/4] char/ns16550: bound execution time of ns16550_interrupt() Roger Pau Monne
2026-06-29 10:39 ` Jan Beulich
2026-06-29 14:44 ` Roger Pau Monné [this message]
2026-06-29 13:49 ` Oleksii Kurochko
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=akKExHlTunGnNngj@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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