From patchwork Wed Jun 10 05:36:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanley Chu X-Patchwork-Id: 213791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4912C433E0 for ; Wed, 10 Jun 2020 05:37:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CBDA207F9 for ; Wed, 10 Jun 2020 05:37:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="AjMqbccN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726148AbgFJFg7 (ORCPT ); Wed, 10 Jun 2020 01:36:59 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:18501 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726040AbgFJFg6 (ORCPT ); Wed, 10 Jun 2020 01:36:58 -0400 X-UUID: 5ace7ee9103c4bdfbecfc2424025e79d-20200610 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=zpPOwXJySmLsu0FQDgDIwWd9GLxAzFlyAq88sb7rQiY=; b=AjMqbccN73ofkKtgthu+bF7a2TB1Csg3Ysvb7aZjPjCDHkDJTw8l2SUAk92wszugG7kMF+3ilbz4EyEVBMU0F+OBMklJaN4kD0aJy9uB90fG+B8PexDw8X8SvDoa7eMj6rICGyR895phNy7f9WNEDQAWbpWoxC9yM8A15wWWtYk=; X-UUID: 5ace7ee9103c4bdfbecfc2424025e79d-20200610 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 907488388; Wed, 10 Jun 2020 13:36:55 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 10 Jun 2020 13:36:54 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 10 Jun 2020 13:36:52 +0800 From: Stanley Chu To: , , , , , CC: , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v1 1/2] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices Date: Wed, 10 Jun 2020 13:36:44 +0800 Message-ID: <20200610053645.19975-2-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200610053645.19975-1-stanley.chu@mediatek.com> References: <20200610053645.19975-1-stanley.chu@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org It is confirmed that Micron device needs DELAY_BEFORE_LPM quirk to have a delay before VCC is powered off. So add Micron vendor ID and this quirk for Micron devices. Signed-off-by: Stanley Chu --- drivers/scsi/ufs/ufs_quirks.h | 1 + drivers/scsi/ufs/ufshcd.c | 2 ++ 2 files changed, 3 insertions(+) -- 2.18.0 diff --git a/drivers/scsi/ufs/ufs_quirks.h b/drivers/scsi/ufs/ufs_quirks.h index e3175a63c676..e80d5f26a442 100644 --- a/drivers/scsi/ufs/ufs_quirks.h +++ b/drivers/scsi/ufs/ufs_quirks.h @@ -12,6 +12,7 @@ #define UFS_ANY_VENDOR 0xFFFF #define UFS_ANY_MODEL "ANY_MODEL" +#define UFS_VENDOR_MICRON 0x12C #define UFS_VENDOR_TOSHIBA 0x198 #define UFS_VENDOR_SAMSUNG 0x1CE #define UFS_VENDOR_SKHYNIX 0x1AD diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 04b79ca66fdf..dea4fddf9332 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -216,6 +216,8 @@ ufs_get_desired_pm_lvl_for_dev_link_state(enum ufs_dev_pwr_mode dev_state, static struct ufs_dev_fix ufs_fixups[] = { /* UFS cards deviations table */ + UFS_FIX(UFS_VENDOR_MICRON, UFS_ANY_MODEL, + UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL,