From nobody Sun Apr 28 02:07:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54721+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54721+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1582337515; cv=none; d=zohomail.com; s=zohoarc; b=lO4M/q5NZOMPbJnFU9LA7Oy69fgyw2k5nOF3KLpwochy4tvGm6GUYeMOlNuQvwiJnIdUMMBHUBTH3igJtXNhyOP/MnOfNnsFRDXDr5+bADN95OOgs5T4MT1tCSa2NBxqREajFv/sr3JFfsIhonNs0oadOoAOzP+3n37NWDGQwKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582337515; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=8aXc09t53W/1HaLEj9Y5NQAVJToymnzYB9PwxOV3Oa0=; b=V5IoNf2bMBcEaaWoacz0cvmYmWMOX+q5fRrKXWnjvVXmBmxl7cWouCz+MrAG+/Y9ePL5dcWB7UichO1rrwR2l55iSccl39B+fD5NRXGIQfqghdvLftevVE1dmu3BUmj1CdgQWUvJLrNmKNcVP1wNMnGI7aM5MpEAJ8S6goN05ys= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54721+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158233751540574.6771055655895; Fri, 21 Feb 2020 18:11:55 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Qk7bYY1788612xhP5VeBcpqc; Fri, 21 Feb 2020 18:11:54 -0800 X-Received: from mga14.intel.com (mga14.intel.com []) by mx.groups.io with SMTP id smtpd.web11.1997.1582337513724814393 for ; Fri, 21 Feb 2020 18:11:54 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2020 18:11:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,470,1574150400"; d="scan'208";a="270202773" X-Received: from cjzurch-desk.amr.corp.intel.com ([10.9.70.181]) by fmsmga002.fm.intel.com with ESMTP; 21 Feb 2020 18:11:53 -0800 From: "Zurcher, Christopher J" To: devel@edk2.groups.io Cc: Michael D Kinney , Jian J Wang , Liming Gao Subject: [edk2-devel] [PATCH 1/1] MdePkg/UefiScsiLib: Set FUA bit for synchronous SCSI Write operations Date: Fri, 21 Feb 2020 18:11:52 -0800 Message-Id: <20200222021152.23016-2-christopher.j.zurcher@intel.com> In-Reply-To: <20200222021152.23016-1-christopher.j.zurcher@intel.com> References: <20200222021152.23016-1-christopher.j.zurcher@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,christopher.j.zurcher@intel.com X-Gm-Message-State: 7aPE83zBh5TY2hDf0tSq35Bmx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582337514; bh=5yJMojTGdNIMx+onQZVWZexeHHYWJlkpstHEkF/V5LI=; h=Cc:Date:From:Reply-To:Subject:To; b=Gr0L/k3x9pXiEY10Qwr5u3KOZuLfRwC8eS3vb4eUpvvnO18opkicWiPSD6/iA1x10WJ jStpfukUU05HY7CS2CEB0EPiZBHJ8Qw/58LjQc5gU6u7L5jjvfJz0fN+t6nYuKjHRieq+ V6zoKQogvqpvWCZ3/MEh6YvD4DIDDb1UjY8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The FUA (Force Unit Access) bit forces data to be written directly to disk instead of the write cache. This prevents data from being lost if a shutdown or reset is requested immediately after a SCSI write operation. Cc: Michael D Kinney Cc: Jian J Wang Cc: Liming Gao Signed-off-by: Christopher J Zurcher --- MdePkg/Library/UefiScsiLib/UefiScsiLib.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c b/MdePkg/Library/Uefi= ScsiLib/UefiScsiLib.c index 13a2a1912c..cf78f131bd 100644 --- a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c +++ b/MdePkg/Library/UefiScsiLib/UefiScsiLib.c @@ -1,7 +1,7 @@ /** @file UEFI SCSI Library implementation =20 - Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -1055,15 +1055,16 @@ ScsiWrite10Command ( ZeroMem (&CommandPacket, sizeof (EFI_SCSI_IO_SCSI_REQUEST_PACKET)); ZeroMem (Cdb, EFI_SCSI_OP_LENGTH_TEN); =20 - CommandPacket.Timeout =3D Timeout; - CommandPacket.OutDataBuffer =3D DataBuffer; - CommandPacket.SenseData =3D SenseData; - CommandPacket.OutTransferLength=3D *DataLength; - CommandPacket.Cdb =3D Cdb; + CommandPacket.Timeout =3D Timeout; + CommandPacket.OutDataBuffer =3D DataBuffer; + CommandPacket.SenseData =3D SenseData; + CommandPacket.OutTransferLength =3D *DataLength; + CommandPacket.Cdb =3D Cdb; // // Fill Cdb for Write (10) Command // Cdb[0] =3D EFI_SCSI_OP_WRITE10; + Cdb[1] =3D BIT3; //FUA bit (Force Unit Access) WriteUnaligned32 ((UINT32 *)&Cdb[2], SwapBytes32 (StartLba)); WriteUnaligned16 ((UINT16 *)&Cdb[7], SwapBytes16 ((UINT16) SectorSize)); =20 @@ -1263,6 +1264,7 @@ ScsiWrite16Command ( // Fill Cdb for Write (16) Command // Cdb[0] =3D EFI_SCSI_OP_WRITE16; + Cdb[1] =3D BIT3; //FUA bit (Force Unit Access) WriteUnaligned64 ((UINT64 *)&Cdb[2], SwapBytes64 (StartLba)); WriteUnaligned32 ((UINT32 *)&Cdb[10], SwapBytes32 (SectorSize)); =20 --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54721): https://edk2.groups.io/g/devel/message/54721 Mute This Topic: https://groups.io/mt/71464107/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-