Received: by 10.192.165.156 with SMTP id m28csp1112223imm; Wed, 11 Apr 2018 12:39:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+xqN0SUNG796pMp6Hi+suAVWJQi83BOEQKnPyvUA8nHqASwYiEW39x7kyEdcg7oiwF+Yzq X-Received: by 10.98.232.2 with SMTP id c2mr5145831pfi.187.1523475544376; Wed, 11 Apr 2018 12:39:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523475544; cv=none; d=google.com; s=arc-20160816; b=YIXyqfkqmAf4Spo3K714EMA18Ee3r9MrOfx7BNXsl9dwvDWFdxkS40L88QmK+aROXC 1kOb6TTKto7q+6WUtIrO1z4s5opbBM7sy9P1w4p6BGPZgi4ApR/9y6zzuJVsW6FRIEEa C+TG/YqGs146TfOSNfw4EpzcV0N/x2DECyWmBk90CNnsBEPsWGjSnsx4wqmxxsSyPHhj FiHllJ6hUtv1A7BeGnNIzi+mdrx+d4wlIBjR82DmLYg8P5uaE1gtrd26x/cMPNpJZNSk +HWLsdy9/WcOqkZWMQAAOftmzBfJ0s5kHeJxuDNHxk64LhO9HTa1hKD2t+l5n0olYNSC zABg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ljnk4gec1UgNJAOMF5NSX/ehofgQAjsSLa8AJqd60P8=; b=PHsnxjC4nMzRUrp8UaqQvU93EL3CeTNOFqM3tpfP1x5L/78yoYdEOdbfdYkmaQD3mV gR1TLAsBm3YlKIKmZM3HXlJ03g4PVPX2XezxzUqWuxufXzPtQC+RUY3eSyydQ2Un6vEP PV8bL4NJeVd1nwdYnXNcCdk7AOu8ijlR8Jys6jsl3lAeWB1sfh/WaNIn+zYr19t7uEmW Vu+uJ7nBpbT8dax2GtssXOAxEucvZWllG50p4mlL766P97kCEvcPogG2fZOxFcLJEtpT oDZBTsCdN4vGFn36f0Ahs689dyTRCX8BsBH2eVcqpDa9NWinw36fk/7LzEhEtZKouzO4 lZIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si1169600pgr.117.2018.04.11.12.38.27; Wed, 11 Apr 2018 12:39:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757219AbeDKTfs (ORCPT + 99 others); Wed, 11 Apr 2018 15:35:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38472 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934415AbeDKTCP (ORCPT ); Wed, 11 Apr 2018 15:02:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D0CE7E3C; Wed, 11 Apr 2018 19:02:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, A Sun , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.9 209/310] [media] mceusb: sporadic RX truncation corruption fix Date: Wed, 11 Apr 2018 20:35:48 +0200 Message-Id: <20180411183631.559421963@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: A Sun [ Upstream commit 8e175b22e8640bf3a58e071af54190b909e4a944 ] Intermittent RX truncation and loss of IR received data. This resulted in receive stream synchronization errors where driver attempted to incorrectly parse IR data (eg 0x90 below) as command response. [ 3969.139898] mceusb 1-1.2:1.0: processed IR data [ 3969.151315] mceusb 1-1.2:1.0: rx data: 00 90 (length=2) [ 3969.151321] mceusb 1-1.2:1.0: Unknown command 0x00 0x90 [ 3969.151336] mceusb 1-1.2:1.0: rx data: 98 0a 8d 0a 8e 0a 8e 0a 8e 0a 8e 0a 9a 0a 8e 0a 0b 3a 8e 00 80 41 59 00 00 (length=25) [ 3969.151341] mceusb 1-1.2:1.0: Raw IR data, 24 pulse/space samples [ 3969.151348] mceusb 1-1.2:1.0: Storing space with duration 500000 Bug trigger appears to be normal, but heavy, IR receiver use. Signed-off-by: A Sun Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/rc/mceusb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1381,8 +1381,13 @@ static int mceusb_dev_probe(struct usb_i goto rc_dev_fail; /* wire up inbound data handler */ - usb_fill_int_urb(ir->urb_in, dev, pipe, ir->buf_in, maxp, - mceusb_dev_recv, ir, ep_in->bInterval); + if (usb_endpoint_xfer_int(ep_in)) + usb_fill_int_urb(ir->urb_in, dev, pipe, ir->buf_in, maxp, + mceusb_dev_recv, ir, ep_in->bInterval); + else + usb_fill_bulk_urb(ir->urb_in, dev, pipe, ir->buf_in, maxp, + mceusb_dev_recv, ir); + ir->urb_in->transfer_dma = ir->dma_in; ir->urb_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;