Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Elson Serrao" <elson.serrao@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 7/9] usb: misc: qcom_eud: fix virtual attach/detach event handling
Date: Tue, 11 Aug 2026 22:00:23 +0000	[thread overview]
Message-ID: <20260811220023.D0F801F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260811213610.2956147-8-elson.serrao@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] The top-half interrupt handler attempts to sleep by calling `readl_poll_timeout()`, which relies on `usleep_range()` and will trigger a scheduling-while-atomic BUG.
- [High] The hardirq handler silently ignores concurrent interrupts because it uses a `switch` statement on a bitmask, falling through to `default` when multiple bits are set.
--

--- Patch [7]: [PATCH v6 7/9] usb: misc: qcom_eud: fix virtual attach/detach event handling ---
Note: The format of this report has been altered to provide a free-form summary of the findings due to recitation restrictions. The inline quoting style has been omitted.

commit a8a02ef8fd7fc3586fa115aa0dd7a40742fbcfe8
Author: Elson Serrao <elson.serrao@oss.qualcomm.com>

usb: misc: qcom_eud: Fix virtual detach USB role
    
This commit fixes the EUD virtual detach handling by setting the USB role
to NONE instead of HOST. This correctly represents the disconnected state
when a virtual detach event occurs.

[Severity: High]
This isn't a bug introduced by this patch, but looking at the top-half
interrupt handler handle_eud_irq() in drivers/usb/misc/qcom_eud.c, it
calls pet_eud() for the EUD_INT_SAFE_MODE case. The pet_eud() function uses
readl_poll_timeout() with a delay of 1us, which relies on usleep_range()
and might sleep. Is it safe to call this sleeping function from a hardirq
context, or should it use readl_poll_timeout_atomic() instead to avoid a
scheduling-while-atomic BUG?

[Severity: High]
This is also a pre-existing issue, but does the switch statement in
handle_eud_irq() in drivers/usb/misc/qcom_eud.c correctly handle concurrent
interrupts? It switches on the bitmask (reg & EUD_INT_ALL). If both
EUD_INT_VBUS and EUD_INT_SAFE_MODE are asserted simultaneously, the value
won't match either case, falling through to the default label and returning
IRQ_NONE without clearing the device interrupt. Could this leave the
interrupts unhandled and potentially lead to an interrupt storm where the
kernel disables the IRQ line?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260811213610.2956147-1-elson.serrao@oss.qualcomm.com?part=7

  reply	other threads:[~2026-08-11 22:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 21:36 [PATCH v6 0/9] Improve Qualcomm EUD driver and platform support Elson Serrao
2026-08-11 21:36 ` [PATCH v6 1/9] dt-bindings: soc: qcom: eud: Add per-path child nodes for UTMI routing Elson Serrao
2026-08-11 21:50   ` sashiko-bot
2026-08-11 21:36 ` [PATCH v6 2/9] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
2026-08-11 21:54   ` sashiko-bot
2026-08-11 21:36 ` [PATCH v6 3/9] usb: misc: qcom_eud: add per-path High-Speed PHY control Elson Serrao
2026-08-11 21:56   ` sashiko-bot
2026-08-11 21:36 ` [PATCH v6 4/9] usb: misc: qcom_eud: add per-path role switch support Elson Serrao
2026-08-11 21:57   ` sashiko-bot
2026-08-11 21:36 ` [PATCH v6 5/9] usb: misc: qcom_eud: improve enable_store API Elson Serrao
2026-08-11 21:56   ` sashiko-bot
2026-08-11 21:36 ` [PATCH v6 6/9] usb: misc: qcom_eud: add role-based EUD control Elson Serrao
2026-08-11 21:54   ` sashiko-bot
2026-08-11 21:36 ` [PATCH v6 7/9] usb: misc: qcom_eud: fix virtual attach/detach event handling Elson Serrao
2026-08-11 22:00   ` sashiko-bot [this message]
2026-08-11 21:36 ` [PATCH v6 8/9] arm64: dts: qcom: kodiak: Describe EUD UTMI path using child node Elson Serrao
2026-08-11 22:05   ` sashiko-bot
2026-08-11 21:36 ` [PATCH v6 9/9] arm64: dts: qcom: Map USB connector to EUD on Kodiak boards Elson Serrao
2026-08-11 22:06   ` sashiko-bot

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=20260811220023.D0F801F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=elson.serrao@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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