From patchwork Fri Mar 22 16:17:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 160945 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp994019jan; Fri, 22 Mar 2019 09:18:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeiKfZm8iP20kVzu6mPmxoJy1DHGzxSMpAM92YfNwaDSvik6PuuizKD3keWyehr4sBC+wo X-Received: by 2002:a63:1912:: with SMTP id z18mr9967335pgl.115.1553271503332; Fri, 22 Mar 2019 09:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553271503; cv=none; d=google.com; s=arc-20160816; b=wYh+O1TtwSI+zziRCF+c5jEOfxS/8cjk0la0vx9puwc6gLWBQ87xQKmErfsxXzTYUU QF+9ZY7+l38I7C792JbsH2OT8PgNGhVaLDJBtOCRp/PQPGXgMqNVoZNKOLpgjP+a+vLc gVKXWBe4uQSkrunglulE8ALfv3IR/en//V1V3cEQp7mFDg6GoSZcnHu9WxVzVYFgoiVw oS8Vv809kMxBrcOBDhCg5T96OcNQE/+Diph6schVX3U1yJEwxCNYrIcdB/5/rqVZjQBe FI7jBnuAn6L9daQd/Hc0aRgWnCK4MkwaNsf3iYsQ3JAkaC7dWqTOKo3Tnbs+jXCggeg7 0MKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=aWSEAS+EKEKn17gXxhCNaHJyIzTIZvtlX4CZP1I7mhs=; b=YopyrAShz1rtBKSa4bQuQFY30ZtI4D0QfTqgA17nroa1PRnEw/JAIAtTPUvpnU/xQa 24erEUcewzjMaEkkRntWw92WGAXbWx7cTdI0eJxHgBZ+8cImGNtGTgGVdhyOrzMJQNuH VipnWSInAqoGsMBMmWPkiXhdRYrTvxD9UGRgdbtUeVr1Pu6dYRqO+z/WShMGiz8vvOIH AdKv/+S9CO1mpYNnqys8AspNGpVME4K3vSyAg39CyCyyE5wotr5IckLLTvvNPdzCJehm S/NDw2xza6m47DDD7khgg9gRuvZ0v8Ak/A+8xomjspQKko/siu9w82hVGy+VyrQ3uovD owYQ== 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 h21si6992593pgl.346.2019.03.22.09.18.23; Fri, 22 Mar 2019 09:18:23 -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 S1729636AbfCVQSV (ORCPT + 31 others); Fri, 22 Mar 2019 12:18:21 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50465 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729578AbfCVQST (ORCPT ); Fri, 22 Mar 2019 12:18:19 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1N0o7f-1gkDsW0R1h-00wn6V; Fri, 22 Mar 2019 17:17:49 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Vinayak Holikatti , "James E.J. Bottomley" , "Martin K. Petersen" Cc: kehuanlin , kehuanlin , Subhash Jadavani , Arnd Bergmann , Sasha Levin , Asutosh Das , Greg Kroah-Hartman , Maya Erez , Sujit Reddy Thumma , Stanley Chu , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y 1/8] scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1 Date: Fri, 22 Mar 2019 17:17:16 +0100 Message-Id: <20190322161727.1153278-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322161727.1153278-1-arnd@arndb.de> References: <20190322161727.1153278-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:DQlMCpJq4PR8SX1i9vhvGY3ghVKzEGEX4UNI41mNwMXOlOUcY0e SfpgpjyUeBxjMOhfpHLrelxp/8KlGgS/kgcYAg42QMNrm7dkZOOlXWvN0mAiAejEGIgghXZ 1+Zs5W00Wsyi04W0iRPQAmmHekXt3RL7A/sebYtWKNOm5sbZWDKTssDu/D194jSgKMjw5QA QvHfVD9hsGn0gKTjYNK+Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:ekf+x/GTjO8=:GM4+kKL4fwPtKRIPKs76/l unwfqjjdv2iaabjHDTMLcwTbpXcQq4mFMviJdssiG8OlOT1ErYPeDdp4rSydWm1x4HprtNBKL USkt9wFp0s7oIVSF3eQ1ygPSdGPDxUgc9VAIObcrmkVErUbw2TsNOn1b3pW252Ews6uBC6LyM a2+sa8XJ3LGbAKyqMiFciPlfEBCaE3z9JDHzjcWKumgI3/80xGNoPVjYbeRSXBDJeFt5K/izW gUpi3Py2ZLLS+XoPP+o4hzzzsP1+bAvDY0Av+yA+lpvwYZtQrKniKWTYv4yEe8jFgsq9AbMGW btyPOAqhKekVOpg3jZeMfEJmFZ+zQYPctOeYGDNrFwtZDRZX/mGjZEHPVszUCKPvy+Zhop/zR tizypOFHrOcCr5NCTTHCxEMfZUZ1FPrZ/JzgbpnKQbC6umtGSTa1z6aGX287regbzHewxIsPj 2bVUokuKlZal/cb1cDcqKW7hO/vRd7rl7DvcdMCPz4G4JlSD/EzxR6E4mAQ65n4RzdF2ZmLhN vjpq9rJOliKWfg+ytCX3LZapnZBBjLoJ12p04DO9qzuYVNcqvDkUJAuVo3K5BNhm/u6lzIP6S JvhkT5wCgKmOiG9FBt0gn1tD2CYKnMxfACNxCH6fkiaedSRlAwZrb9UnEzsv0AsOVF6NBxI6P 9degZBJRoTRzscs7AslRa06GJqQWzsrnoh2hbsAXKFYu2sJcr7HqBSzviECIYVu61qI9WlrcU 13AxDMkgpgm14YBqGVg8necg0u0lhs9NOHZ7PA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kehuanlin Since the command type of UTRD in UFS 2.1 specification is the same with UFS 2.0. And it assumes the future UFS specification will follow the same definition. Signed-off-by: kehuanlin Reviewed-by: Subhash Jadavani Signed-off-by: Martin K. Petersen (cherry picked from commit 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff) Signed-off-by: Arnd Bergmann --- drivers/scsi/ufs/ufshcd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.20.0 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 66540491839e..581571de2461 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2195,10 +2195,11 @@ static int ufshcd_comp_devman_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) u32 upiu_flags; int ret = 0; - if (hba->ufs_version == UFSHCI_VERSION_20) - lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; - else + if ((hba->ufs_version == UFSHCI_VERSION_10) || + (hba->ufs_version == UFSHCI_VERSION_11)) lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE; + else + lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE); if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY) @@ -2222,10 +2223,11 @@ static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) u32 upiu_flags; int ret = 0; - if (hba->ufs_version == UFSHCI_VERSION_20) - lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; - else + if ((hba->ufs_version == UFSHCI_VERSION_10) || + (hba->ufs_version == UFSHCI_VERSION_11)) lrbp->command_type = UTP_CMD_TYPE_SCSI; + else + lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; if (likely(lrbp->cmd)) { ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,