Received: by 10.213.65.68 with SMTP id h4csp1682306imn; Mon, 19 Mar 2018 10:25:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELvkz+RosyObTJkdZt4WTt9tRlVbOuUub+ZJ07/59lYLXtE3z/hLXoKVVlrJ/TVXpcIsMbiD X-Received: by 2002:a17:902:b10c:: with SMTP id q12-v6mr13589224plr.197.1521480349646; Mon, 19 Mar 2018 10:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521480349; cv=none; d=google.com; s=arc-20160816; b=ap7IG758f1tY3YQU//cpZKdtwk9Zxdh3hmy1q2R3CUZUDfpMZNHXPBAYKl5WCWS7vR i8l0eC4e0EZ8yH6xaCy5XrDwTDdRuKuxaZ+DN+mYaTj2aflNI7dBea4jTueu9E4/CUNk QXi6az24HYSa7+Y3c5gf9/0lhWqASgBNbTsL0+d5K96qyVbSYCA8TLxYCQcPrgwmgoOj nc438CwhHNy4G/2U6b/QNtQe0dgnkcQXKPrfFQeueaJAUtc9ygs6vSIiLCNAbE8e7J86 /7tg0Q2qKZ8gEGegIrekHy7Nc9BzzJERPCJTlKftQo5Xb2n9ri10RPyN8OwX60DlkGZN Gy5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Rwm+BuYCibpo8y/7Y+YkrGC9rybd3XB+mepLCGJIsJ0=; b=xmcz+lTQxYQq2B0pRT2BcLcsTVhXvjUkLBylK5hT6ZJwq8y06Bywkj1wWXUFcj14yP qbqZXpPl7UARVU/oQfus6ZZjS9VAYIDY0w9xTClAxifXtykwxlxW4p+/LymTFU1oKzJ8 Wk4a2Z7ipujH5m/X9PoKpnqyfMYKjS6RbMm4itQA+B+Hdxf5Ctp6h1QkIuPSG3mOD+RL Ry/tW3TlbcxDEgM34JqWVoNm0mo6efucgQ/aA0NOcYLidmT1PnRQVgfWAPQ/h0hCODGG Sb0oy6Kl08c2Tqse/6BsITEnnWcEkjnI+wK7HR5gVZINyFYamw6LhzGci1HcF4jvignp ajFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jqKziJxD; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13si245143pgc.35.2018.03.19.10.25.35; Mon, 19 Mar 2018 10:25:49 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jqKziJxD; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965962AbeCSQIn (ORCPT + 99 others); Mon, 19 Mar 2018 12:08:43 -0400 Received: from mail-dm3nam03on0131.outbound.protection.outlook.com ([104.47.41.131]:49502 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965811AbeCSQIT (ORCPT ); Mon, 19 Mar 2018 12:08:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Rwm+BuYCibpo8y/7Y+YkrGC9rybd3XB+mepLCGJIsJ0=; b=jqKziJxD4h7WZLBl7WEjFcSHOj9iGRpkZ1gROiDMfBoE4n4UuYttrm4grJSunQ/Y61Q8Y+wYKvI+S9npv3tzSZPCxaEZ9tG8bF1ASWz9l3vqITKfdtC+k2YYiYrAW1QSlLIyOhiuOh/pwYMBauIkw1aNzJ9iVTcoS21DdBhR3r0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0805.namprd21.prod.outlook.com (10.167.105.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.2; Mon, 19 Mar 2018 16:08:17 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:08:17 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Alan Stern , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 047/167] USB: ene_usb6250: fix SCSI residue overwriting Thread-Topic: [PATCH AUTOSEL for 4.4 047/167] USB: ene_usb6250: fix SCSI residue overwriting Thread-Index: AQHTv5w3cI+dxQpNk0CtOspbydstGQ== Date: Mon, 19 Mar 2018 16:06:19 +0000 Message-ID: <20180319160513.16384-47-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0805;7:QPiE84lmRuPx1Q8FGXj5wpHlvDRDPgUHZAVVh15KJ5X64SG3dQx6fYoN4/x1+C7nZhOh4ZWO35m2mfzdBqDheRvGLmPdPE0AUv2xmlO5yRbSlk0gp9bZxMawmKnYsh/al9uwtHQrs39Q3ik0RB+PAiKYS0WskqWd3d/S4tB9KbeRPwMLdGLIdnyBQ7ek0y7KD3pZyNbxCr2t2n7J7JMz/xKQryvxyqPAPT3nd0pelMt0U4SQCxWOqLntNGd0yVf+;20:UUiqzzmhkIOGoae4Sgf7ymFOpCRy3CtSJPlEJCkf1/Yto5lU7fJjCs0+/YlQoXw+abFY7tsAqdjtDNXf+Mfgt1wySYztJceKZ7D+FehP7AHbWUp9po/dJJnLO61UKSomFSQjrbTKjiJzLoF7pE7Mh3Af7JeQzajtMmzs8wAAisA= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c5beafd1-fef0-4c9f-dd8c-08d58db3a075 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0805; x-ms-traffictypediagnostic: DM5PR2101MB0805: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(35762410373642); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0805;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0805; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(376002)(346002)(366004)(396003)(39860400002)(199004)(189003)(575784001)(2950100002)(305945005)(186003)(86362001)(6506007)(3660700001)(5660300001)(6116002)(8936002)(3846002)(1076002)(26005)(7736002)(6486002)(2900100001)(6436002)(2906002)(86612001)(68736007)(81166006)(81156014)(10090500001)(102836004)(59450400001)(8676002)(14454004)(105586002)(107886003)(25786009)(478600001)(2501003)(5250100002)(53936002)(3280700002)(316002)(54906003)(4326008)(6512007)(72206003)(66066001)(22452003)(10290500003)(99286004)(76176011)(36756003)(97736004)(106356001)(110136005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0805;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: fg8h4cFbfl+f05R1u/UyT+UXQR4emty8de9L+Q4q7aJqAgJmp0xsp65/qd2toKg1VdSVHT+xWoRL+pl4GTy8Qq/03lc/wY7GHlSDP/yDkZPgGpwKpKOsYCKNntLMaPy/r+ycNmfOcDbIWJWI/bymmJTIglfTOQbKu9p5S2VroKVjRJsDsKnLe5fBMgYH0rvbXNScLCAyEwu/LxWrk6FbJKdWRwQz0MuAlfIYtS9y6ARqfgxusoldPF91Eg/takTprSY8NjjJV0T6+WzBHUGckPNDrIPbJFHUWMOQuZ8Ua8gfzn3yH4AS4Ji5FSegVuMa4G91bW993ZN0K7hkIknAmQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5beafd1-fef0-4c9f-dd8c-08d58db3a075 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:06:19.9302 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0805 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alan Stern [ Upstream commit aa18c4b6e0e39bfb00af48734ec24bc189ac9909 ] In the ene_usb6250 sub-driver for usb-storage, the SCSI residue is not reported correctly. The residue is initialized to 0, but this value is overwritten whenever the driver sends firmware to the card reader before performing the current command. As a result, a valid READ or WRITE operation appears to have failed, causing the SCSI core to retry the command multiple times and eventually fail. This patch fixes the problem by resetting the SCSI residue to 0 after sending firmware to the device. Signed-off-by: Alan Stern Reported-and-tested-by: Andreas Hartmann Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/storage/ene_ub6250.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6= 250.c index eebfa09bccc1..962bb6376b0c 100644 --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c @@ -1953,6 +1953,8 @@ static int ene_load_bincode(struct us_data *us, unsig= ned char flag) bcb->CDB[0] =3D 0xEF; =20 result =3D ene_send_scsi_cmd(us, FDIR_WRITE, buf, 0); + if (us->srb !=3D NULL) + scsi_set_resid(us->srb, 0); info->BIN_FLAG =3D flag; kfree(buf); =20 --=20 2.14.1