From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752167AbcHHOit (ORCPT ); Mon, 8 Aug 2016 10:38:49 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38916 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbcHHOis (ORCPT ); Mon, 8 Aug 2016 10:38:48 -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> <1470220742.4612.7.camel@suse.com> <1775d53f-0129-4e94-b08c-7d4c58fa9fa6@collabora.com> <1470560360.2014.1.camel@suse.com> Cc: Ben Chan , pprabhu@chromium.org, Guenter Roeck , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org From: Robert Foss Message-ID: <1543c694-0f17-3a7a-89a3-a7c5b0bf7a38@collabora.com> Date: Mon, 8 Aug 2016 10:38:42 -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: <1470560360.2014.1.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-07 04:59 AM, Oliver Neukum wrote: > On Thu, 2016-08-04 at 13:44 -0400, Robert Foss wrote: >> >> On 2016-08-03 06:39 AM, Oliver Neukum wrote: >>> On Tue, 2016-08-02 at 10:37 -0400, Robert Foss wrote: > >>> How can that depend on what we return to user space? >>> In the driver we can continue just ignoring errors. >>> Now, if user space stops reading because we reported an error, >>> that is the decision user space has made. We cannot ignore errors >>> in the kernel because we don't like what user space does when it >>> sees the error. >> >> So perhaps the better solution is to be more intelligent about how >> desc->rerr is written to during after an error to be able to maintain >> the error condition? > > Yes, good idea. I think an error condition should never be overwritten. > So we go to the current behaviour only if a second error before > user space has seen the3 first error arises. Would that fix your > issue? Excellent! As long as the device is able to keep pushing data during an -EPIPE error condition, I think my issues would be solved.