Reporting Issues
Bug 4016 - SCT StorageSecurityCommandProtocolTest ReceiveData_Conf failed with latest edk2 code base
Summary: SCT StorageSecurityCommandProtocolTest ReceiveData_Conf failed with latest ed...
Status: RESOLVED WONTFIX
Alias: None
Product: EDK2 Test
Classification: Unclassified
Component: UEFI-SCT (show other bugs)
Version: Current
Hardware: All All
: Lowest normal
Assignee: Fu Siyuan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-08 22:55 UTC by Fu Siyuan
Modified: 2022-12-11 20:56 UTC (History)
4 users (show)

See Also:
EDK II Code First industry standard specifications: ---
Branch URL:
Release(s) the issue is observed: EDK II Master
The OS the target platform is running: ---
Package:
Release(s) the issues must be fixed: EDK II Master
Tianocore documents:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fu Siyuan 2022-08-08 22:55:13 UTC
In SctPkg/TestCase/UEFI/EFI/Protocol/StorageSecurityCommand/BlackBoxTest/StorageSecurityCommandBBTestConformance.c

test case SCT_Log/MediaAccessTest/StorageSecurityCommandProtocolTest0/
ReceiveData_Conf 

It tries to pass a 10 bytes length buffer to StorageSecurityCommand protocol and expect it return an error because "for ATA8-ACS SecurityProtocol, 512 byte is a request".

This works with edk2 AtaAtapiPassThru driver before the SATA recovery flow was introduced. However after the recovery is implemented, the ATA passthru will recover the port error and return an EFI_SUCCESS, then the SCT test will fail.

I've no idea if it's the AtaAtapiPassThru driver's bug (if it should return success when command execute is actually failed then port recovered), or the SCT test case should update align with edk2 implementation.
Comment 1 Edhay 2022-09-01 10:24:25 UTC
Does the new recovery code follow the specification?
Consult the implementer from Intel for the details of the recovery code. 
According to spec, does 10 bytes denote failure?



To Fu Siyuan: 
Please give the complete output of the failing test?
Which line number causes the error ?
Comment 2 Mateusz Albecki 2022-09-01 10:57:29 UTC
I think it is a bug in SATA driver. The bug is that the Status variable is used to store ErrorRecovery data and overrides packet transfer status on last iteration of the retry loop:

in
https://github.com/tianocore/edk2/commit/64e25d4b062c907dab2dd30b686de9219d8e372c

AhciMode.c:976

The correct flow should be to return packet transfer/operation status. Bug is present in both PIO and DMA transfer.
Comment 3 Fu Siyuan 2022-09-01 21:58:10 UTC
(In reply to Mateusz Albecki from comment #2)
> I think it is a bug in SATA driver. The bug is that the Status variable is
> used to store ErrorRecovery data and overrides packet transfer status on
> last iteration of the retry loop:
> 
> in
> https://github.com/tianocore/edk2/commit/
> 64e25d4b062c907dab2dd30b686de9219d8e372c
> 
> AhciMode.c:976
> 
> The correct flow should be to return packet transfer/operation status. Bug
> is present in both PIO and DMA transfer.

I hold the same opinion. The recovery result status override the failed transfer status.

It failed in SctPkg/TestCase/UEFI/EFI/Protocol/StorageSecurityCommand/BlackBoxTest/StorageSecurityCommandBBTestConformance.c:235: Status: Success ExpectedStatus:DeviceError
Comment 4 Edhay 2022-10-06 10:18:59 UTC
Hi Fu Siyan,

  Since this an issue in the firmware, can we close the ticket in edk2-test without fix?
Comment 5 Mateusz Albecki 2022-10-11 10:52:37 UTC
I am actually planning to fix this in EDK2. I had different priorities until now but I have some spare time so I will fix it by end of week.
Comment 7 Edhay 2022-11-03 10:13:09 UTC
Hi Fu Siyuan,

   Can we close this ticket on edk2-test since the solution raised in edk2 code base?
Comment 8 Fu Siyuan 2022-11-04 01:59:22 UTC
(In reply to Edhay from comment #7)
> Hi Fu Siyuan,
> 
>    Can we close this ticket on edk2-test since the solution raised in edk2
> code base?

Yes please close This, thanks