]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h
MdeModulePkg/UfsPassThruDxe: Fix unaligned data transfer handling
authorAlbecki, Mateusz <mateusz.albecki@intel.com>
Tue, 25 Jun 2019 09:44:28 +0000 (17:44 +0800)
committerHao A Wu <hao.a.wu@intel.com>
Mon, 1 Jul 2019 01:05:13 +0000 (09:05 +0800)
commita37e18f6fc108f9f19678b2c9920713a6dd92d94
tree8943f2383ef815004e3bffaa2f08d64233f74243
parentffe048a0807b56c2def74f8280d55e2aa8865c20
MdeModulePkg/UfsPassThruDxe: Fix unaligned data transfer handling

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1341

Since UFS specification requires the data buffer specified
in PRDT to be DWORD aligned in size we had a code in
UfsInitUtpPrdt that aligned the data buffer by rounding down
the buffer size to DWORD boundary. This meant that for SCSI
commands that wanted to perform unaligned data transfer(such as
SENSE command) we specified to small buffer for the data to fit
and transfer was aborted. This change introduces code that allocates
auxiliary DWORD aligned data buffer for unaligned transfer. Device
transfers data to aligned buffer and when data transfer is over driver
copies data from aligned buffer to data buffer passed by user.

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h
MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c