From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756896AbcHBOj0 (ORCPT ); Tue, 2 Aug 2016 10:39:26 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:56929 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756833AbcHBOiw (ORCPT ); Tue, 2 Aug 2016 10:38:52 -0400 Subject: Re: [PACTH v1] cdc-wdm: Clear read pipeline in case of error To: Oliver Neukum References: <1469729992-6228-1-git-send-email-robert.foss@collabora.com> <1470140595.30985.20.camel@suse.com> <04ca38d7-6538-d220-3fe7-7ece503ce4ad@collabora.com> <1470146394.30985.25.camel@suse.com> Cc: pprabhu@chromium.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org From: Robert Foss Message-ID: Date: Tue, 2 Aug 2016 10:37:32 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1470146394.30985.25.camel@suse.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-08-02 09:59 AM, Oliver Neukum wrote: > On Tue, 2016-08-02 at 09:54 -0400, Robert Foss wrote: >> >> On 2016-08-02 08:23 AM, Oliver Neukum wrote: >>> On Thu, 2016-07-28 at 14:19 -0400, robert.foss@collabora.com wrote: >>>> From: Prathmesh Prabhu >>>> >>>> Implemented queued response handling. This queue is processed every >>>> time the >>>> WDM_READ flag is cleared. >>>> >>>> In case of a read error, userspace may not actually read the data, >>>> since the >>>> driver returns an error through wdm_poll. After this, the underlying >>>> device may >>>> attempt to send us more data, but the queue is not processed. While >>>> userspace is >>>> also blocked, because the read error is never cleared. >>> >>> Could you explain why user space cannot just read more data? >>> That will clear the error. >> >> Userspace certainly could read more data, but for the case when >> userspace doesn't read and clear a potential an error, we still would >> like to not be stuck if the device sends more data. >> >> I hope that answers your question, if not I'll try to be more elaborate. > > Clear, but why does that require the suppression of an error condition? > errors should always be delivered. The goal is not to clear the error condition, but that is required to not stay stuck. Maintaining the error condition and not staying stuck if the device sends more data are mutually exclusive as far as I understand it. Rob.