Re: [edk2] UsbMassStorage

Subject: Re: [edk2] UsbMassStorage

From: "Tian, Feng" <feng.tian@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2010-04-15 20:30:20

Hi, Kanaya
	We planned to discuss the topic internally this week. But due to time schedule, the discussion is delayed to next week.
So the earliest time to solve it should be at the middle of next week.

Thanks
Tian Feng
-----Original Message-----
From: M.Kanaya [mailto:kanaya.manabu@jp.fujitsu.com] 
Sent: Thursday, April 15, 2010 12:26 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] UsbMassStorage

Tian Feng

Did you have a chance to fix of this problem?
I know you are busy, but I hope that it is done fix as soon as possible.
Your help would be appreciated.

Kanaya

> In fact, the usb unplug event can happen at any time. For those usb device driver, the best way is to use TPL to guard these functions which use the resources that will release at Stop().
> 
> Tian Feng
> -----Original Message-----
> From: M.Kanaya [mailto:kanaya.manabu@jp.fujitsu.com] 
> Sent: Thursday, April 08, 2010 2:53 PM
> To: edk2-devel@lists.sourceforge.net
> Subject: Re: [edk2] UsbMassStorage
> 
> Tian Feng
> 
> I have a question in a solution to the partition driver. 
> 
> If a device error happened, then jump out the loop.
> I think that this points at a loop of mPartitionDetectRoutineTable of Start().
> However, there is the function that do not return to 
> by a device error in child handles.
> 
> For example, there is a PartitionValidGptTable() function in child handle of GPT.
> ReadDisk is used by this function, but the error return value is FALSE fixation.
> Therefore, I cannot jump out the loop even if a device error happens 
> by a PartitionValidGptTable() function.
> 
> As other solutions, there is a solution to guard by a TPL change in Start() 
> in the same way as an UsbMassStrage driver.
> Is there a problem by this solution?
> 
> Kanaya
> 
> 
>> Tian Feng
>>
>> Thank you for giving a solution. 
>> If this problem does Fix, I want to confirm it as soon as possible here. 
>> I expect it.
>>
>> Kanaya
>>
>>> Hi, Kanaya
>>> Thanks for your info. I will fix it as soon as possible.
>>> As a tentative solution, you can:
>>> 1.For UsbMassStorage driver, raise TPL in Start() to CallBack level. It can avoid usb enumeration happens at this time. Then if there is a disconnect event, Stop() will not be invoked during the executing. This way can avoid invalid UsbIo interface is used.
>>>
>>> 2.For PartitionDriver, you can judge the return value. If it's device error, then jump out the loop. Or you can change usbmassstorage BlockIo interface return value, if status is EFI_DEVICE_ERROR, then forcedly convert it to EFI_MEDIA_CHANGED.
>>>
>>> Tian Feng
>>> -----Original Message-----
>>> From: M.Kanaya [mailto:kanaya.manabu@jp.fujitsu.com] 
>>> Sent: 201045 14:45
>>> To: edk2-devel@lists.sourceforge.net
>>> Subject: Re: [edk2] UsbMassStorage
>>>
>>> Dear,
>>>
>>> UsbMassStorage driver has a problem same as a Partition driver.
>>>
>>> UsbMassStorage driver will send out an Inquiry command 
>>> in DriverBinding.Start() to get device information.
>>> This Inquiry command repeats five times of retry processing by the error.
>>>
>>> During this retry processing, usb enumeration may happen at this time with 
>>> a higher TPL.
>>>
>>> If usb enumeration found there is usb disconnect event, it will release 
>>> all related driver stack.
>>> UsbIo interface installed at the usb handle is freed and invalid.
>>> After the usb enumeration finished, it will go on executing 
>>> get device information operation of UsbMassStorage driver.
>>> It brings the issue.
>>>
>>> I want to know the solution of these two issues 
>>> (a Partition driver and an UsbMassStorage driver).
>>>
>>> Regards,
>>>
>>>
>>>> Hi, Kanaya
>>>> 	I think the issue you met is we ever met...
>>>> 	There is a known issue on Partition driver, in which its DriverBinding.Stop() may be invoked when DriverBinding.Start() runs.
>>>>
>>>> 	Partition driver will read given blocks to judge whether the block contains Gpt, eltorito or Mbr. The read operation is slow and usb enumeration may happen at this time with a 	higher TPL.
>>>>
>>>> 	If usb enumeration found there is usb disconnect event, it will release all related driver stack. BlockIo interface installed at the usb handle is freed and invalid.
>>>> 	After the usb enumeration finished, it will go on executing read block operation of partition driver. It brings the issue you encounter.
>>>>
>>>> Thanks
>>>> Tian Feng
>>>> -----Original Message-----
>>>> From: M.Kanaya [mailto:kanaya.manabu@jp.fujitsu.com] 
>>>> Sent: Friday, April 02, 2010 4:08 PM
>>>> To: edk2-devel@lists.sourceforge.net
>>>> Subject: [edk2] UsbMassStorage
>>>>
>>>> Dear,
>>>>
>>>> I found a problem in the USB mass storage device connection processing,
>>>>
>>>> When a controller detects an error during connection processing, retry
>>>> processing is executed.
>>>> If the disconnection processing is executed during the retry processing,
>>>> the USB I/O protocol is released, and an invalid operation code
>>>> exception occurs.
>>>>
>>>> The error message displayed at that time is the following.
>>>> ----
>>>> EhcExecTransfer: transfer failed with 40
>>>> EhcBulkTransfer: error - Device Error, transfer - 40
>>>> UsbEnumeratePort: Device Connect/Discount Normally
>>>> EhcExecTransfer: transfer failed with 40
>>>> EhcBulkTransfer: error - Device Error, transfer - 40
>>>>
>>>> !!!! X64 Exception Type - 0000000000000006 !!!!
>>>>
>>>> ----
>>>> Regards,
>>>>
>>> ------------------------------------------------------------------------------
>>> Download Intel® Parallel Studio Eval
>>> Try the new software tools for yourself. Speed compiling, find bugs
>>> proactively, and fine-tune applications for parallel performance.
>>> See why Intel Parallel Studio got high marks during beta.
>>> http://p.sf.net/sfu/intel-sw-dev
>>> _______________________________________________
>>> edk2-devel mailing list
>>> edk2-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>> ------------------------------------------------------------------------------
>>> Download Intel® Parallel Studio Eval
>>> Try the new software tools for yourself. Speed compiling, find bugs
>>> proactively, and fine-tune applications for parallel performance.
>>> See why Intel Parallel Studio got high marks during beta.
>>> http://p.sf.net/sfu/intel-sw-dev
>>> _______________________________________________
>>> edk2-devel mailing list
>>> edk2-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> 
> 
> 
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel



------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel