From: "Bjørn Mork" <bjorn@mork.no>
To: Oliver Neukum <oneukum@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] cdc-wdm: fix "out-of-sync" due to missing notifications
Date: Tue, 17 May 2016 21:24:46 +0200 [thread overview]
Message-ID: <87k2is1o8x.fsf@nemi.mork.no> (raw)
In-Reply-To: <1463476438.19237.3.camel@suse.com> (Oliver Neukum's message of "Tue, 17 May 2016 11:13:58 +0200")
Oliver Neukum <oneukum@suse.com> writes:
> On Fri, 2016-05-13 at 18:59 +0200, Bjørn Mork wrote:
>> Bjørn Mork <bjorn@mork.no> writes:
>>
>> > The driver enforces a strict one-to-one relationship between the
>> > received RESPONSE_AVAILABLE notifications and messages read from
>> > the device. At the same time, it will cancel the interrupt URB
>> > when there is no client holding the character device open.
>>
>> Never mind. Forget it.
>>
>> This patch breaks other devices again. The immediate and unconditional
>> reading make them barf. I guess it can be worked around by delaying the
>> flushing until at least one notification is received, but I obviously
>> have to test this theory thoroughly on all devices I have.
>
> Hi,
>
> I think the best approach would be to keep the interrupt URB always
> active. I didn't do this to conserve bandwidth, but if it makes devices
> work, it certainly would be the best option.
Yes, I considered that. But this implies purging the device message
queue without telling userspace that we did so. At least with the
current driver design, which is based on a single limited size
buffer. If the device queues a number of unsolictied messages between
two userspace requests, then we really want all those unsolicted
messages delivered to the userspace program on the second request.
And I do think the original bandwidth (and power) conservative approach
is worth keeping too. There is no point in waking up these devices
unless there actually is an interested userspace application.
FWIW, my initial analysis of the problem with the patch was too quick
imprecise. The problem is simply the -EPIPE status we inevitably will
hit when the queue is empty, as I should have anticipated. It will be
returned to userspace translated to -EIO. I am currently testing a
version taking care of that, and it seems to behave well so far. I'll
submit it as soon as I am absoltely sure that it works on all WDM, QMI
and MBIM devices I have. Might take some time, since I am running out
of mini-PCIe and m.2 adapters..
Bjørn
next prev parent reply other threads:[~2016-05-17 19:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 15:39 [PATCH] cdc-wdm: fix "out-of-sync" due to missing notifications Bjørn Mork
2016-05-13 16:59 ` Bjørn Mork
2016-05-17 9:13 ` Oliver Neukum
2016-05-17 19:24 ` Bjørn Mork [this message]
2016-05-17 21:49 ` Oliver Neukum
2016-05-17 23:39 ` Bjørn Mork
2016-05-18 8:12 ` Oliver Neukum
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=87k2is1o8x.fsf@nemi.mork.no \
--to=bjorn@mork.no \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
--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