Re: USB output in ucom

Emmanuel Dreyfus <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Wed, Oct 01, 2025 at 07:44:45AM +0100, Nick Hudson wrote:
> > Asynchronous transfers in polling mode panic in usbd_transfer() here:
> >           while (!xfer->ux_done) {
> >                if (pipe->up_dev->ud_bus->ub_usepolling)
> >                        panic("usbd_transfer: not done");
> 
> Err, think that's for synchronous transfers

Yes, sorry, I meant synchronous, but you fixed it on your own.

In polling mode, I use async transfer because it is required otherwise
we panic.

In normal mode, in ucom_cnlwp(), I use sync transfer because it
makes the code simplier. Since I use a single struct usbd_xfer, 
I must wait for output completion before reusing it, otherwise
I corrupt the output queue by queing the same struct usbd_xfer
twice. Synchronous transfer enforces that without the need for
extra code.

-- 
Emmanuel Dreyfus
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.