Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial console is not re-connected after SerialIo tests (Bugzilla Bug 3866) #229

Open
tianocore-issues opened this issue Mar 11, 2022 · 11 comments

Comments

@tianocore-issues
Copy link

This issue was created automatically with bugzilla2github

Bugzilla Bug 3866

Date: 2022-03-11T06:54:26+00:00
From: Felix <>
To: Gayathri Thunuguntla <>
CC: edhaya.chandran, gaojie, gayathrit, sundaresans

Last updated: 2024-02-27T01:11:12+00:00

@tianocore-issues
Copy link
Author

Comment 18597

Date: 2022-03-11 06:54:26 +0000
From: Felix <>

  • Industry Specification: ---
  • Release Observed: EDK II Master
  • Releases to Fix: EDK II Master
  • Target OS: ---
  • Bugzilla Assignee(s): Gayathri Thunuguntla <>

SCT disconnects serial console (TerminalDxe) before running SerialIo tests and does not connect it back once execution as completed. As a result, it's impossible to run SCT via the serial console.

@tianocore-issues
Copy link
Author

Comment 18777

Date: 2022-04-07 10:19:18 +0000
From: Edhay <<edhaya.chandran>>

Hi Felix,
Could you please give details of the point of disconnection and when it should be reconnected. Also please provide the logs for this case.

@tianocore-issues
Copy link
Author

Comment 18889

Date: 2022-04-21 18:11:02 +0000
From: Felix <>

(In reply to Edhay from comment #1)
> Hi Felix,
> Could you please give details of the point of disconnection and when it
> should be reconnected. Also please provide the logs for this case.

Edhay,

The logs look fine, no errors, warnings or anything like this is reported.
The serial console is disconnected write before the tests. The last message I'm seeing my serial terminal is "Remaining test cases: 8". After that I can see another non-printable character. The VGA console keeps working fine. Once SCT test execution is completed I can re-connect serial terminal by running "connect -r" in Shell using USB keyboard.

@tianocore-issues
Copy link
Author

Comment 18933

Date: 2022-05-05 10:13:44 +0000
From: Barton Gao <>

Hi Felix,
We have sct tests on multiple platforms and never see this issue. Could you provide more information regarding your test environment ?

@tianocore-issues
Copy link
Author

Comment 18948

Date: 2022-05-11 04:55:56 +0000
From: sundaresans

Hi Barton,

In SCT tool source, before performing EfiSerialIoProtocol test ,SCT code invokes OpenProtocol() on SerialIo Handle with EXCLUSIVE attribute. As Terminal driver already opened SerialIo protocol with BY_DRIVER attribute, it will get disconnected as EXCLUSIVE attribute is passed for OpenProtocol().

After completion of test, CloseProtocol() is invoked but no attempt made to reconnect the SerialIo Handle. After closing the protocol, Serial I/O protocol handle should be connected recursively.

Same issue was reproduced with PciSioSerialDxe & TerminalDxe from EDK2 source.

SCT code:
// Add one new logic to filter the SerialIo Protocol
//
if (SctCompareGuid (Guid, &gEfiSerialIoProtocolGuid) == 0) {
Status = tBS->OpenProtocol (
HandleBuffer[HandleIndex],
Guid,
(VOID **) &Interface,
HandleBuffer[HandleIndex],
NULL,
0x00000020 //EXCLUSIVE
);

Referred edk2-test-edk2-test-stable202108 source code.
edk2-test-edk2-test-stable202108\uefi-sct\SctPkg\TestInfrastructure\SCT\Framework\Execute\Execute.c (ExecuteBbTestCase())

@tianocore-issues
Copy link
Author

Comment 19022

Date: 2022-06-02 10:20:05 +0000
From: Edhay <<edhaya.chandran>>

Thank you Sundaresan for your inputs.
We will analyse further by reproducing this issue.

@tianocore-issues
Copy link
Author

Comment 19929

Date: 2022-11-03 10:55:07 +0000
From: Edhay <<edhaya.chandran>>

@sundaresan: Can AMI provide a patch for the solution?

@tianocore-issues
Copy link
Author

Comment 21761

Date: 2023-07-21 09:52:52 +0000
From: Gayathri Thunuguntla <>

Created attachment 1385
Saved the Driver binding handle that connects SerialIo handle before SCT tool takes exclusive ownership. Passed the saved Driver binding handle to ConnectController() in order to connect back serial.

  1. Changes to save the Driver binding handle that connects SerialIo handle before SCT tool takes exclusive ownership of the SerialIo handle.
  2. Passed the saved Driver binding handle to ConnectController() in order to connect back serial Io handle to the old driver.

Attachment: BZ-1385-SCT_SerialIo.zip

@tianocore-issues
Copy link
Author

Comment 21762

Date: 2023-07-21 09:54:55 +0000
From: Gayathri Thunuguntla <>

Comment on attachment 1385
Saved the Driver binding handle that connects SerialIo handle before SCT tool takes exclusive ownership. Passed the saved Driver binding handle to ConnectController() in order to connect back serial.

Attached the changes to save the driver binding handle that binds the SerialIo handle before SCT tools exclusive take ownership of the SerialIo handle.

After SerialIo test, passed the saved driver binding handle to ConnectController in order to connect back serial Io handle to the old driver.

Unit Test:

Verified after SCT serial Io test, SerialIo handle got connected to the Terminal driver and verified redirection works fine.

Attachment: BZ-1385-SCT_SerialIo.zip

@tianocore-issues
Copy link
Author

Comment 22518

Date: 2024-02-04 13:31:18 +0000
From: Edhay <<edhaya.chandran>>

Thank you, Gayathri for the patch and verification results.

Could you please send the patch in https://edk2.groups.io/g/devel for review.
Also mention the link of the message in this ticket.

@tianocore-issues
Copy link
Author

Comment 22657

Date: 2024-02-27 01:11:12 +0000
From: Edhay <<edhaya.chandran>>

Hi Gayathri,
The solution must be provided as a patch.
The attachment contains the actual source files.

Could you please provide the same.
Also could you please send the patch in https://edk2.groups.io/g/devel for review.

Please refer to https://github.com/tianocore/tianocore.github.io/wiki/Laszlo%27s-unkempt-git-guide-for-edk2-contributors-and-maintainers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant