All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: "Robert Hodaszi" <robert.hodaszi@digi.com>,
	"Oliver Neukum" <oneukum@suse.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"Bjørn Mork" <bjorn@mork.no>
Subject: Re: Handling incoming ZLP in cdc-wdm
Date: Mon, 31 Mar 2025 11:59:33 +0200	[thread overview]
Message-ID: <d1a9bfca-0c94-4770-b5a9-c7d0432dd476@suse.com> (raw)
In-Reply-To: <a9bc14f2-7f07-44c0-96fa-0616402792e7@digi.com>

(Adding Bjørn)

On 27.03.25 16:27, Robert Hodaszi wrote:
> On Thursday, 27.03.2025 at 14:24 +0100, Oliver Neukum <oneukum@suse.com> wrote:
>>
>> Why do you wish to react to this like an error?
>> It seems to me that we indeed need to wait for the device in this case.
>>
>>         Regards
>>                 Oliver
>>
> See my previous response to your patch. Because:
> 
>      1. we have to submit another read URB is resp_count != 0 (call service_outstanding_interrupt), otherwise receiving gets stuck

Now that you mention that I am not sure that the resp_count
logic in general is correct. I see no reason user space cannot
exhaust the buffer and get resp_count out of sync.

>      2. we should not set WDM_READ, to not confuse userspace

We agree on that.

>      3. we should not set res_length to 0, otherwise  we get stuck again (actually, should we clear the "if (!desc->reslength)" in wdm_read(), since that's is no longer possible anymore?

AFAICT it can happen if two threads are racing on wdm_read()

	Regards
		Oliver


  reply	other threads:[~2025-03-31  9:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26 16:03 Handling incoming ZLP in cdc-wdm Hodaszi, Robert
2025-03-27 13:01 ` Robert Hodaszi
2025-03-27 13:24   ` Oliver Neukum
2025-03-27 15:27     ` Robert Hodaszi
2025-03-31  9:59       ` Oliver Neukum [this message]
2025-04-02 11:57         ` Robert Hodaszi
2025-04-02 14:01           ` Oliver Neukum
2025-04-02 15:01             ` Robert Hodaszi
2025-04-02 19:13               ` Oliver Neukum
2025-04-03 12:25                 ` Robert Hodaszi
     [not found]                 ` <898977f7-3882-4ffe-8833-c44f06914337@digi.com>
2025-04-03 12:58                   ` Oliver Neukum
2025-04-03 14:42                     ` Robert Hodaszi
  -- strict thread matches above, loose matches on Subject: below --
2025-03-26 15:50 Robert Hodaszi
2025-03-27 13:21 ` Oliver Neukum
2025-03-27 15:23   ` Robert Hodaszi

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=d1a9bfca-0c94-4770-b5a9-c7d0432dd476@suse.com \
    --to=oneukum@suse.com \
    --cc=bjorn@mork.no \
    --cc=linux-usb@vger.kernel.org \
    --cc=robert.hodaszi@digi.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.