[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, October 16, 2023 #cal-reminder

2023-10-15 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, October 16, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4NmMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-6e1c-450d-b917-d9d674eb3cb6%22%7d

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=2059938 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109618): https://edk2.groups.io/g/devel/message/109618
Mute This Topic: https://groups.io/mt/101986538/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after port reset

2023-10-15 Thread Wu, Hao A
Please grant me some time to review this patch.
Really sorry that I am not able to provide an estimated time for the review.

Best Regards,
Hao Wu

From: Ashish Singhal 
Sent: Friday, October 13, 2023 10:13 AM
To: Rick Tseng ; devel@edk2.groups.io; Wu, Hao A 
; Ni, Ray ; Wang, Jian J 
; Gao, Liming 
Cc: Jeff Brasen 
Subject: Re: [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after 
port reset

Hello Hao/Ray/Jian/Gao,

Any feedback on this patch?

Thanks
Ashish

From: Rick Tseng mailto:rts...@nvidia.com>>
Sent: Sunday, September 24, 2023 7:54 PM
To: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>
Cc: hao.a...@intel.com 
mailto:hao.a...@intel.com>>; 
ray...@intel.com 
mailto:ray...@intel.com>>; 
jian.j.w...@intel.com 
mailto:jian.j.w...@intel.com>>; 
gaolim...@byosoft.com.cn 
mailto:gaolim...@byosoft.com.cn>>; Ashish Singhal 
mailto:ashishsin...@nvidia.com>>; Jeff Brasen 
mailto:jbra...@nvidia.com>>; Rick Tseng 
mailto:rts...@nvidia.com>>
Subject: [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after port 
reset

To fix the assert due to ASSERT(TrsRing !=NULL) in XhcSyncTrsRing.

There is a recovery in usb mass stroage driver to do port reset after
fail in transfer. And port reset operation makes that all memory
resources(descriptors, endpoint memory) belonging to this device are
reclaimed in underlying Xhci driver.

Because USB descriptors are reclaimed in underlying Xhci driver, the
next "set config" would not trigger the "Configuration Endpoint"
command in Xhci driver as there is no existing configuation
descriptor. It would prevent from allocating memory from xhci for
endpoints.

Thus there is no memmory allocated for transfering on non-default
endpoint, it makes the assert happens when usb mass stroage tries
to transfer after reset.

This change is to refetch the device and config descriptor after
port reset, it would rebuild device and configuration descriptor in
Xhci driver. So the "set config" command would trigger the
"Configuration Endpoint" in xhci and allocate memory for endpoints.

Signed-off-by: Rick Tseng mailto:rts...@nvidia.com>>
---
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c  | 77 ++--
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h | 25 
 2 files changed, 96 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c 
b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
index c25f3cc2f2..f6e1f88b3d 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
@@ -815,12 +815,16 @@ UsbIoPortReset (
   IN EFI_USB_IO_PROTOCOL  *This
   )
 {
-  USB_INTERFACE  *UsbIf;
-  USB_INTERFACE  *HubIf;
-  USB_DEVICE *Dev;
-  EFI_TPLOldTpl;
-  EFI_STATUS Status;
-  UINT8  DevAddress;
+  USB_INTERFACE*UsbIf;
+  USB_INTERFACE*HubIf;
+  USB_DEVICE   *Dev;
+  EFI_TPL  OldTpl;
+  EFI_STATUS   Status;
+  UINT8DevAddress;
+  USB_DEVICE_DESC  DevDesc;
+  UINT8NumConfig;
+  VOID *Buf;
+  UINT8Index;

   OldTpl = gBS->RaiseTPL (USB_BUS_TPL);

@@ -882,6 +886,67 @@ UsbIoPortReset (
   // is in CONFIGURED state.
   //
   if (Dev->ActiveConfig != NULL) {
+//
+// We just do a port reset, so we need to do as a new device enumeration.
+// Need to get the device descriptor, configuration descriptor before set 
config
+//
+Status = UsbCtrlGetDesc (Dev, USB_DESC_TYPE_DEVICE, 0, 0, &DevDesc, sizeof 
(DevDesc));
+if (EFI_ERROR (Status)) {
+  DEBUG ((
+DEBUG_ERROR,
+"UsbIoPortReset: failed to get device desc for device %d - %r\n",
+Dev->Address,
+Status
+));
+  goto ON_EXIT;
+}
+
+NumConfig = Dev->DevDesc->Desc.NumConfigurations;
+if (NumConfig == 0) {
+  DEBUG ((
+DEBUG_ERROR,
+"UsbIoPortReset: no configuration descriptor for device %d - %r\n",
+Dev->Address,
+Status
+));
+  goto ON_EXIT;
+}
+
+for (Index = 0; Index < NumConfig; Index++) {
+  if (Dev->DevDesc->Configs[Index] == NULL) {
+DEBUG ((
+  DEBUG_ERROR,
+  "UsbIoPortReset: no configuration descriptor for index %d - %r\n",
+  Index,
+  Status
+  ));
+goto ON_EXIT;
+  }
+
+  Buf = AllocateZeroPool (Dev->DevDesc->Configs[Index]->Desc.TotalLength);
+  if (Buf == NULL) {
+DEBUG ((
+  DEBUG_ERROR,
+  "UsbIoPortReset: allocation memory fail for configuration desc - 
%r\n",
+  Status
+  ));
+goto ON_EXIT;
+  }
+
+  Status = UsbCtrlGetDesc (Dev, USB_DESC_TYPE_CONFIG, Index, 0, Buf, 
Dev->DevDesc->Configs[Index]->Desc.TotalLength);
+  FreePool (Buf);
+
+  if (EFI_ERROR (Status)) {
+DEBUG ((
+  DEBUG_ERROR,
+  "UsbIoPortRese

[edk2-devel] About the feasibility of detaching Fdt16550SerialProtHookLib from ArmVirtPkg

2023-10-15 Thread Chao Li

Hi Ard,

I'm porting the LoongArch virt-machine to edk2. LoongArch virt-machine 
uses Fdt16550SerialPortHookLib to handle the UartBase, and the 
gEarly16550UartBaseAddressGuid is defined in ArmVirtPkg.dec.


I think this library can be used in other Arch, like RISC-V LoongArch 
and so on, so can we feasibility this library into OvmfPkg?


Hope to hear back from you.


Thanks,
Chao


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109620): https://edk2.groups.io/g/devel/message/109620
Mute This Topic: https://groups.io/mt/101989244/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] About the feasibility of detaching Fdt16550SerialProtHookLib from ArmVirtPkg

2023-10-15 Thread Chao Li
Sorry, the last mail was misspelled, what I meant was: can we detaching 
the Fdt16550SerialPortHookLib into OvmfPkg?



Thanks,
Chao
在 2023/10/16 10:58, Chao Li 写道:


Hi Ard,

I'm porting the LoongArch virt-machine to edk2. LoongArch virt-machine 
uses Fdt16550SerialPortHookLib to handle the UartBase, and the 
gEarly16550UartBaseAddressGuid is defined in ArmVirtPkg.dec.


I think this library can be used in other Arch, like RISC-V LoongArch 
and so on, so can we feasibility this library into OvmfPkg?


Hope to hear back from you.




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109621): https://edk2.groups.io/g/devel/message/109621
Mute This Topic: https://groups.io/mt/101989244/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-