Skip to content

MdeModulePkg/Bus/Usb/UsbMassStorageDxe: USBMass Storage Enhancements DXE #11202

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

karunakarpoosapalli
Copy link

Certain USB Mass Storage devices were
experiencing command failures, initialization delays, and intermittent failures. These issues affected the compatibility and stability of the USB Mass Storage DXE phase.

[Suggested Solution]
USB Mass Storage Enhancements DXE Phase
Error handling improvements were implemented to address command failures observed in specific USB Mass Storage devices. Additionally, device-specific timing adjustments were introduced to mitigate initialization delays and intermittent failures, improving overall compatibility and stability.

Certain USB Mass Storage devices were
experiencing command failures, initialization delays,
and intermittent failures. These issues affected the compatibility
and stability of the USB Mass Storage DXE phase.

[Suggested Solution]
USB Mass Storage Enhancements DXE Phase
Error handling improvements were implemented to address command
failures observed in specific USB Mass Storage devices.
Additionally, device-specific timing adjustments were introduced to
mitigate initialization delays and intermittent failures, improving
overall compatibility and stability.

Signed-off-by: karunakar_poosapalli <[email protected]>
[Suggested Solution]
Fix uncrustify errors in CI build.

Signed-off-by: karunakar_poosapalli <[email protected]>
//
// Device fw issue.
// There are no delay requirement from UsbMassBulk spec and USB spec.
// DW316 need delay for UsbClearEndpointStall and there might be other devices also need this delay,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What means DW316? What problem will be resolved by this Delay?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What means DW316? What problem will be resolved by this Delay?

Thanks for your response.
DW316 is a DELL optical drive and it looks like the clear endpoint stall will need some delay on it before the endpoint is usable.
Otherwise, the next transaction will be still failed to execute .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lgao4 ,Can you please share your feedback if any ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is the right way to add the delay for the specific device in the common UsbMassStorageDxe module.

@leiflindholm , could you share your comment for this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgao4 I'm no USB expert, but I'll try to loop in someone

Reflexively, this doesn't feel like a clean way to deal with a quirk in a single device.

I think ultimately we will need to revisit the conversation from #6526 : how do we integrate quirks in a TianoCore context?

@@ -39,6 +39,7 @@ extern USB_MASS_TRANSPORT mUsbBotTransport;
// Usb Bot wait device reset complete, set by experience
//
#define USB_BOT_RESET_DEVICE_STALL (100 * USB_MASS_1_MILLISECOND)
#define USB_BOT_CLR_STALL_EP_STALL (10 * USB_MASS_1_MILLISECOND)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think such small delay works. The minimal delay should be 20 ms。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think such small delay works. The minimal delay should be 20 ms。

Thanks for your response.
I can NOT find the reference timing for clear endpoint stall.
So that I used the Reset Recovery timing for this.
If there is any specific value for it, please help to share it and then it might refactor with more proper value.
Thanks a lot.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lgao4 ,Can you please share your feedback if any ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we absolutely sure what is needed is a delay and not a barrier/memory fence?

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

Successfully merging this pull request may close these issues.

3 participants