All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: David Laight <David.Laight@aculab.com>,
	 Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] usb: ohci: Prevent missed ohci interrupts
Date: Mon, 29 Apr 2024 08:49:00 +0200	[thread overview]
Message-ID: <ef23ykui3axiwfkr4wi24abbuklvejx5r5wqem5cr4lq36x7py@kkxvsi3ibtbi> (raw)
In-Reply-To: <d434c88a-6575-4d45-ab3e-e27ac7684b07@roeck-us.net>

  Hi,

> > > +	/* repeat until all enabled interrupts are handled */
> > > +	if (ohci->rh_state != OHCI_RH_HALTED) {
> > > +		ints = ohci_readl(ohci, &regs->intrstatus);
> > > +		if (ints & ohci_readl(ohci, &regs->intrenable))
> > 
> > Doesn't the driver know which interrupts are enabled?
> > So it should be able to avoid doing two (likely) slow io reads?
> > (PCIe reads are pretty much guaranteed to be high latency.)
> 
> No, the driver does not cache intrenable.

Does the driver ever change intrenable after initialization?

PCIe reads are expensive, especially in virtual machines where this
goes vmexit to qemu, so doing that for a piece of information the
driver should have (or is able to calculate) should indeed better
be avoided.

take care,
  Gerd


  reply	other threads:[~2024-04-29  6:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 19:59 [PATCH v2] usb: ohci: Prevent missed ohci interrupts Guenter Roeck
2024-04-24 22:30 ` Alan Stern
2024-04-24 22:49   ` Greg Kroah-Hartman
2024-04-24 22:59     ` Guenter Roeck
2024-04-24 22:50   ` Guenter Roeck
2024-04-27 21:00 ` David Laight
2024-04-27 22:18   ` Guenter Roeck
2024-04-29  6:49     ` Gerd Hoffmann [this message]
2024-04-29 13:34       ` Guenter Roeck
2024-04-29 14:01         ` David Laight
2024-04-29 15:23           ` Guenter Roeck

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=ef23ykui3axiwfkr4wi24abbuklvejx5r5wqem5cr4lq36x7py@kkxvsi3ibtbi \
    --to=kraxel@redhat.com \
    --cc=David.Laight@aculab.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.