Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Frode Isaksen <fisaksen@baylibre.com>
To: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Frode Isaksen <frode@meta.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2] usb: dwc3: gadget: check that event count does not exceed event buffer length
Date: Wed, 2 Apr 2025 09:50:55 +0200	[thread overview]
Message-ID: <5c428f8d-8c8e-42a4-9650-f731ff5ea16a@baylibre.com> (raw)
In-Reply-To: <4d9226a9-d89d-4441-9dbf-f76ebce49a9e@oss.qualcomm.com>

On 4/2/25 6:42 AM, Krishna Kurapati wrote:
>> I still wonder what's current behavior of the HW to properly respond
>> here. If the device is dead, register read often returns all Fs, which
>> may be the case you're seeing here. If so, we should properly prevent
>> the driver from accessing the device and properly teardown the driver.
>>
>> If this is a momentary bleep/lost of power in the device, perhaps your
>> change here is sufficient and the driver can continue to access the
>> device.
>>
>> With the difficulty of reproducing this issue, can you confirm that the
>> device still operates properly after this change?
>
> Unfortunately, I did not test this particular change of returning when 
> ev count is invalid. I stress tested the change of copying only 4K 
> [1], but didn't see any issue. I suspect we didn't hit the issue later 
> again in the course of 14 day testing.
>
> [1]: 
> https://lore.kernel.org/all/20230521100330.22478-1-quic_kriskura@quicinc.com/ 
>
>
> Regards,
> Krishna,
>
I have been running my fix for over a year with millions of Quest 3 
devices, and no strange bugs caused by this has been seen. Without the 
fix, there were 1 to 2 crashes per week.

So I think it's safe to just return with IRQ_NONE when the count exceeds 
the event length.

Thanks,

Frode


  reply	other threads:[~2025-04-02  7:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 10:44 [PATCH v2] usb: dwc3: gadget: check that event count does not exceed event buffer length Frode Isaksen
2025-04-01  5:43 ` Krishna Kurapati
2025-04-01 12:08   ` Frode Isaksen
2025-04-01 12:26     ` Krishna Kurapati
2025-04-01 23:36       ` Thinh Nguyen
2025-04-02  4:42         ` Krishna Kurapati
2025-04-02  7:50           ` Frode Isaksen [this message]
2025-04-02 22:22             ` Thinh Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2025-04-01 12:53 Frode Isaksen
2025-04-01 13:49 ` Greg KH
2025-04-01 23:43 ` Thinh Nguyen

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=5c428f8d-8c8e-42a4-9650-f731ff5ea16a@baylibre.com \
    --to=fisaksen@baylibre.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=frode@meta.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krishna.kurapati@oss.qualcomm.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.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