* Re: [PATCH] thunderbolt: stream: Make read return framing error to the userspace [not found] <20260921111921.3289289-1-mika.westerberg@linux.intel.com> @ 2026-09-22 0:17 ` Ivy Lopez 2026-09-22 4:11 ` Mika Westerberg 0 siblings, 1 reply; 2+ messages in thread From: Ivy Lopez @ 2026-09-22 0:17 UTC (permalink / raw) To: westeri; +Cc: andreas.noever, YehezkelShB, linux-usb, linux-kernel On Mon, Sep 21, 2026 at 11:19 AM UTC, Mika Westerberg wrote: > + if (!nbytes) { > + pr_warn("corrupted frame received, flags %#x\n", > + sf->frame.flags); > + tbstream_dev_consume_rx(sdev); > + ret = -EIO; > + } > + break; One question: EPOLLIN is set unconditionally in the rx callback regardless of frame flags, and tbstream_dev_fops_poll() only checks tbstream_ring_available() (pure ring depth), never frame flags. EPOLLERR is used elsewhere in this file but only for device-level invalidity, not per-frame corruption. So userspace still has no way to learn a corrupted frame is queued via poll() before calling read() and getting -EIO. I'm just wondering, is this intentional, or worth a follow-up? Also, fwiw, this doesn't apply cleanly against current usb-next for me, git apply fails on the rx_callback hunk. Looks like it's against a tree predating the busy-polling changes. Not a blocker either way. Reviewed-by: Ivy Lopez <skunkolee@gmail.com> ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] thunderbolt: stream: Make read return framing error to the userspace 2026-09-22 0:17 ` [PATCH] thunderbolt: stream: Make read return framing error to the userspace Ivy Lopez @ 2026-09-22 4:11 ` Mika Westerberg 0 siblings, 0 replies; 2+ messages in thread From: Mika Westerberg @ 2026-09-22 4:11 UTC (permalink / raw) To: Ivy Lopez; +Cc: westeri, andreas.noever, YehezkelShB, linux-usb, linux-kernel Hi, On Mon, Sep 21, 2026 at 06:17:42PM -0600, Ivy Lopez wrote: > On Mon, Sep 21, 2026 at 11:19 AM UTC, Mika Westerberg wrote: > > + if (!nbytes) { > > + pr_warn("corrupted frame received, flags %#x\n", > > + sf->frame.flags); > > + tbstream_dev_consume_rx(sdev); > > + ret = -EIO; > > + } > > + break; > > One question: EPOLLIN is set unconditionally in the rx callback > regardless of frame flags, and tbstream_dev_fops_poll() only checks > tbstream_ring_available() (pure ring depth), never frame flags. > EPOLLERR is used elsewhere in this file but only for device-level > invalidity, not per-frame corruption. So userspace still has no way > to learn a corrupted frame is queued via poll() before calling > read() and getting -EIO. I'm just wondering, is this intentional, > or worth a follow-up? It's intentional. EPOLLERR is used to indicate that this file is "finished". A single framing error would allow the userspace still to continue. > Also, fwiw, this doesn't apply cleanly against current usb-next for > me, git apply fails on the rx_callback hunk. Looks like it's against > a tree predating the busy-polling changes. It'a against thunderbolt.git/next [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git/log/?h=next > Not a blocker either way. > > Reviewed-by: Ivy Lopez <skunkolee@gmail.com> Thanks! ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-22 4:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20260921111921.3289289-1-mika.westerberg@linux.intel.com>
2026-09-22 0:17 ` [PATCH] thunderbolt: stream: Make read return framing error to the userspace Ivy Lopez
2026-09-22 4:11 ` Mika Westerberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®