All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Michal Pecio <michal.pecio@gmail.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Niklas Neronin <niklas.neronin@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: xhci: Simplify clearing the Event Interrupt bit
Date: Thu, 19 Mar 2026 22:33:49 +0200	[thread overview]
Message-ID: <408ff4ce-1020-472c-9526-312ba8ea2ae1@linux.intel.com> (raw)
In-Reply-To: <20260304114224.62814449.michal.pecio@gmail.com>

On 3/4/26 12:42, Michal Pecio wrote:
> USBSTS is mostly RW1C, so to clear EINT we should write just this
> one bit. Remove pointless code which ORs the bit with current value
> of the register, even though the bit is already known to be set,
> and writes the result back, which clears all active RW1C flags.
> 
> We used to inadvertently clear PCD and SRE in this way. PCD isn't
> used by the driver and SRE is only used at resume, so clearing them
> should make no difference. Don't clear them anymore.
> 
> Tested by connecting and mounting a storage device on a few HCs.
> 
> Before: xhci_irq USBSTS 0x00000018 EINT PCD -> 0x00000000
>          xhci_irq USBSTS 0x00000008 EINT -> 0x00000000
> After:  xhci_irq USBSTS 0x00000018 EINT PCD -> 0x00000010 PCD
>          xhci_irq USBSTS 0x00000018 EINT PCD -> 0x00000010 PCD
> 
> Some flags are RsvdZ - should be written as zero regardless of the
> value read, so technically it was a bug. But no problems are known.
> 

Thanks for cleaning this up.

Leaving the Port Change Detectd (PCD) bit uncleared worries me a bit.
Did suspend and resume still work properly after this?
especially something like wakeup from suspend (D3) on usb port connect

Thanks
Mathias


  reply	other threads:[~2026-03-19 20:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 10:42 [PATCH] usb: xhci: Simplify clearing the Event Interrupt bit Michal Pecio
2026-03-19 20:33 ` Mathias Nyman [this message]
2026-03-20 20:18   ` Michal Pecio
2026-03-20 20:28     ` Michal Pecio
2026-03-25 12:27       ` Mathias Nyman

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=408ff4ce-1020-472c-9526-312ba8ea2ae1@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=michal.pecio@gmail.com \
    --cc=niklas.neronin@linux.intel.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 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.