From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933793AbcATHWv (ORCPT ); Wed, 20 Jan 2016 02:22:51 -0500 Received: from mga03.intel.com ([134.134.136.65]:61913 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933744AbcATHWX (ORCPT ); Wed, 20 Jan 2016 02:22:23 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,320,1449561600"; d="scan'208";a="885314129" Subject: Re: [PATCH v3 1/1] usb: cdc-acm: handle unlinked urb in acm read callback To: "Tang, Jianqiang" , Greg Kroah-Hartman References: <1451451548-3650-1-git-send-email-baolu.lu@linux.intel.com> <08C00E7DCA84054D93A5BD962777345A0349F9CC@shsmsx102.ccr.corp.intel.com> Cc: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Oliver Neukum From: Lu Baolu Message-ID: <569F35AA.3060403@linux.intel.com> Date: Wed, 20 Jan 2016 15:22:18 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <08C00E7DCA84054D93A5BD962777345A0349F9CC@shsmsx102.ccr.corp.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jianqiang, I think you need to wait until the release of 4.5-rc1. Thanks, Baolu On 01/20/2016 03:08 PM, Tang, Jianqiang wrote: > Hi Greg, > > Sorry to disturb you although I know you are very busy :) > One question is about this patch, does the patch already in the process of merge into kernel? > Or need modify still? > > Thanks a lot! > > -----Original Message----- > From: linux-usb-owner@vger.kernel.org [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Lu Baolu > Sent: Wednesday, December 30, 2015 12:59 PM > To: Oliver Neukum ; Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org; Lu Baolu ; Tang, Jianqiang ; stable@vger.kernel.org > Subject: [PATCH v3 1/1] usb: cdc-acm: handle unlinked urb in acm read callback > > In current acm driver, the bulk-in callback function ignores the URBs unlinked in usb core. > > This causes unexpected data loss in some cases. For example, runtime suspend entry will unlinked all urbs and set urb->status to -ENOENT even those urbs might have data not processed yet. > Hence, data loss occurs. > > This patch lets bulk-in callback function handle unlinked urbs to avoid data loss. > > Signed-off-by: Tang Jian Qiang > Signed-off-by: Lu Baolu > Cc: stable@vger.kernel.org > Acked-by: Oliver Neukum > --- > drivers/usb/class/cdc-acm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > change log: > v1->v2: > add Acked-by: Oliver Neukum . > > v2->v3: > add the change log. > > diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 26ca4f9..8cd193b 100644 > --- a/drivers/usb/class/cdc-acm.c > +++ b/drivers/usb/class/cdc-acm.c > @@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb) > set_bit(rb->index, &acm->read_urbs_free); > dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n", > __func__, status); > - return; > + if ((status != -ENOENT) || (urb->actual_length == 0)) > + return; > } > > usb_mark_last_busy(acm->dev); > -- > 2.1.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html >