From nobody Sun Dec 29 01:52:16 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; dkim=fail spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1492263902326951.18186477836; Sat, 15 Apr 2017 06:45:02 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B86982194EB6D; Sat, 15 Apr 2017 06:44:57 -0700 (PDT) Received: from mail-pg0-x22f.google.com (mail-pg0-x22f.google.com [IPv6:2607:f8b0:400e:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 754E32194EB6C for ; Sat, 15 Apr 2017 06:44:56 -0700 (PDT) Received: by mail-pg0-x22f.google.com with SMTP id t187so1657919pgt.1 for ; Sat, 15 Apr 2017 06:44:56 -0700 (PDT) Received: from localhost.localdomain ([45.41.135.58]) by smtp.gmail.com with ESMTPSA id f6sm8815876pfe.57.2017.04.15.06.44.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Apr 2017 06:44:55 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=jdY0Nb+9wa+wVZ6fztTJ4f3q368SUeRPzpEpYFah7hA=; b=iVq63TfYdPA8ppJabQuCdoqMftO+Q6i89cV04PdyxWXtpyfBEbRGLRtr/huU7di2EP RxXZY3U2Kp5FvdkqrcKOVpeE7WKqf2ontrdRb/LtVfzNZKZXgImkTC0WP+9CpITChH1T BqQR3xQj0e2zUDrhvkEQtyM6qK025oAWpevxs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jdY0Nb+9wa+wVZ6fztTJ4f3q368SUeRPzpEpYFah7hA=; b=VI3lhbIZAT9idqDjIyr1Hq1gBp6JzP/det+D+bYauE6QMfj0G4cxEizZb9z1fGFJf9 x63aTIpdQIYGxKZ1XZIAFPL/kINBhwtGmTukMOGXuHitMAggStrjfIUHwD2tspnxxqyg 949vVA8Q2K+x4F1cZFgW2YeHFaLpeYdqt5NHG64ztuVIQ4cy/3/m1L7YXi6eTBQlfRG+ mN/boMzoKUXe3M+gozyPURcEMtovqaJopyeRgs1sfBLteAzDv1WRjiteR1q976SMcgaa t7n+TtpS/IfMI9QCjXh4Zs0LTO/yJvrgR1VVecyuSU51u5aNCoUqvmJpXBhmR4f6sENP UBew== X-Gm-Message-State: AN3rC/4vzoBumyhd2Ydv0qrgE4YuNvaqZlFGfbmt95i1KL8VIEwB0i+d thQ0LB7X5egOJeEw X-Received: by 10.99.111.138 with SMTP id k132mr2854834pgc.138.1492263896119; Sat, 15 Apr 2017 06:44:56 -0700 (PDT) From: Haojian Zhuang To: hao.a.wu@intel.com, feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Date: Sat, 15 Apr 2017 21:44:46 +0800 Message-Id: <1492263886-17209-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [PATCH] MdeModulePkg: ScsiDiskDxe: fix to support EFI_ERASE_BLOCK_PROTOCOL X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haojian Zhuang MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If bit TPZ and bit TPRZ are set, the erase feature is implemented. If bit TPZ is set and bit TPRZ is clear, the discard feature is implemented. And discard is a non-secure variant of the erase functionality. So the detecting operation of EFI_ERASE_BLOCK_PROTOCOL, we should consider to support both functionality. Since discard functionality is only supported in some UFS devices. And both of these two features are relied on UNMAP command. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bu= s/Scsi/ScsiDiskDxe/ScsiDisk.c index b5eff25..6e12e4f 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -5400,11 +5400,11 @@ DetermineInstallEraseBlock ( if (CommandStatus =3D=3D EFI_SUCCESS) { // // Universal Flash Storage (UFS) Version 2.0 - // Section 11.3.9.2 + // Section 11.3.9.2 & Section 12.2.3 // Bits TPE and TPRZ should both be set to enable the erase feature on= UFS. + // Setting bit TPE and clearing bit TPRZ to enable the discard feature= on UFS. // - if (((CapacityData16->LowestAlignLogic2 & BIT7) =3D=3D 0) || - ((CapacityData16->LowestAlignLogic2 & BIT6) =3D=3D 0)) { + if ((CapacityData16->LowestAlignLogic2 & BIT7) =3D=3D 0) { DEBUG (( EFI_D_VERBOSE, "ScsiDisk EraseBlock: Either TPE or TPRZ is not set: 0x%x.\n", --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel