Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.

Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.

From: Sergey Isakov <isakov-sl@bk.ru>

To: edk2-devel@lists.sourceforge.net

Date: 2011-11-12 03:09:16

I think this
--------------
    Status = WaitForBSYClear (PciIo, IdeRegisters, 350000000);
    if (EFI_ERROR (Status)) {
        DEBUG((EFI_D_ERROR, "New detecting method: Send Execute Diagnostic Command: WaitForBSYClear: Status: %d\n", Status));

-------------
means waiting for  35sec while it should be 35msec.


On 10.11.2011, at 6:05, Tian, Feng wrote:

Hello, Isakov
 
Thanks your effort.
 
From the print info, it runs at AHCI mode as the device node you dump is SATA device path. (for IDE mode, the device node type should Atapi device path). And the issue may come from device enumeration. But it need confirm. So I add some print statements at AhciMode.c and IdeMode.c in AtaAtapiPassThru to help locate issue.
 
Could you help to let those debug info to be printed?
 
Thanks
Feng
 
From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Thursday, November 10, 2011 06:43
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Hi Feng,
 
I made some tests and can continue testing if you point me what to check.
The delay is appearing in loading Duet/SataControllerDxe.efi. So I insert some Print() and see the follow
---------------------------
load: Image fs0:\efi\test\SataController.efi loaded at 7EEA8000 - Success
SataControllerStart START
SataControllerStart END status = Success
Channel 0 enabled  Count=2
CalculateBestPioMode: AdvancedPioMode = 3
IdeInitCalculateMode: PioMode = 4
IdeInitCalculateMode: UdmaMode = 2
Channel 1 enabled  Count=2
SataControllerStart START
SataControllerStart END status = Success
CalculateBestPioMode: AdvancedPioMode = 3
IdeInitCalculateMode: PioMode = 4
IdeInitCalculateMode: UdmaMode = 5
--------------------------
The delay is after red string.  So I propose that Channel 0 is HDD, Channel 1 is absent, and DVD at another bus.
PCI (00|00:1F.01) : 8086 2850 class=01018A
PCI (00|00:1F.02) : 8086 2829 class=010601
And even if I inserted DVD-disk I see no any block device corresponding to DVD drive.
--------------
  blk0    :HardDisk - Alias hd33a0a1 fs0 
           PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(1,MBR,0x223EE178,0x1,0x6689F)
  blk1    :HardDisk - Alias hd33a0a3 fs1 
           PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(3,MBR,0x223EE178,0xA0745B0,0xD096678)
  blk2    :HardDisk - Alias hd33a0a4 fs2 
           PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(4,MBR,0x223EE178,0x1710C018,0x5F5F311)
  blk3    :Removable HardDisk - Alias hd22b0b fs3 
           PcieRoot(0x0)/Pci(0x1D,0x7)/USB(0x1,0x0)/HD(1,MBR,0x00000000,0x2000,0xEF6000)
  blk4    :HardDisk - Alias (null)
           PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(2,MBR,0x223EE178,0x668A0,0xA00DD09)
  blk5    :BlockDevice - Alias (null)
           PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)
  blk6    :Removable BlockDevice - Alias (null)
           PcieRoot(0x0)/Pci(0x1D,0x7)/USB(0x1,0x0)
  hd33a0a1 :HardDisk - Alias fs0 blk0 
            PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(1,MBR,0x223EE178,0x1,0x6689F)
  hd33a0a3 :HardDisk - Alias fs1 blk1 
            PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(3,MBR,0x223EE178,0xA0745B0,0xD096678)
  hd33a0a4 :HardDisk - Alias fs2 blk2 
            PcieRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(4,MBR,0x223EE178,0x1710C018,0x5F5F311)
  hd22b0b :Removable HardDisk - Alias fs3 blk3 
           PcieRoot(0x0)/Pci(0x1D,0x7)/USB(0x1,0x0)/HD(1,MBR,0x00000000,0x2000,0xEF6000)
 
 
----------------
Sergey.
 
On 07.11.2011, at 5:13, Tian, Feng wrote:


Thanks for your info.
 
So how do you test Edk2 driver at your computer? Is it by DUET?
 
Thanks
Feng
 
From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Saturday, November 05, 2011 01:01
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Hi Feng,
I am sorry but I am not able to do debug. It's out of my skill. The test computer is Dell Inspiron and it has no serial port at all. :(
Why Tiano is proposed that all computers have serial port, floppy drive, CirrusLogic5430?! lol.
My hdd is follow
----------------
  Vendor:                               Intel
  Product:                               ICH8-M AHCI
  Link Speed:                         3 Gigabit
  Negotiated Link Speed:        1.5 Gigabit
  Description:                         AHCI Version 1.10 Supported
 
WDC WD2500BEVS-75UST0:
 
  Capacity:                                     250,06 GB (250 059 350 016 bytes)
  Model:                                        WDC WD2500BEVS-75UST0                   
  Revision:                                    01.01A01
  Serial Number:                                WD-WXE408K72369
  Native Command Queuing:         Yes
  Queue Depth:                              32
  Removable Media:                      No
  Detachable Drive:                       No
  BSD Name:                                 disk0
  Medium Type:                            Rotational
  Partition Map Type:                    MBR (Master Boot Record)
  S.M.A.R.T. status:                      Verified
  Volumes:
  Capacity:        215 MB (215 039 488 bytes)
  Writable:        Yes
  BSD Name:    disk0s1
Windows:
 
 
----------------
I may think about screen output during initialization...
 
On 04.11.2011, at 20:14, Tian, Feng wrote:



ScsiBus and ScsiDisk modules are used to manage ATAPI device. As you said unplugging DVD and only inserting a hard disk will still spend 140 seconds, then the issue should come from AtaAtapiPassThru module. ScsiBus will no influence here.
 
32bit version had ever been tested. I will confirm it again.
 
Could you provide some info? Such as which brand and how big is the hard disk? If you can help to debug into it to see where spends most of the time, it will be very appreciatedJ. Or could you add debug message and dump serial log to help us root cause the issue?
 
Best Regards
Feng
 
From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Friday, November 04, 2011 6:10 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Switched BIOS into ATA mode instead of AHCI. The same delay, or even larger.
I think the problem is in timeouts/synchronizations but not related to mode or device detection.
Do I need ScsiBus modules? Is there any influence?
 
On 04.11.2011, at 11:20, Tian, Feng wrote:




Could you help to narrow down its harddisk issue or cdrom issue? That is unplugging cdrom or harddisk to see if the boot time is changed?
 
Thanks
Feng
 
From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Friday, November 04, 2011 17:12
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Thank you Feng for your effort, but the issue still remain. 
Compiled new sources and tested. Initialization time is about 50sec in AHCI mode. Not checked IDE mode but previously it was larger.
For IDE controller I use IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe
and it works fast, without delays.
Test computer is Dell Inspiron 1525 (Core2Duo @2400, ICH8M) 
 
On 04.11.2011, at 4:15, Tian, Feng wrote:





Have confirmed with Isakov. The issue he met is at AHCI mode.
 
The patch was sent at the mail thread is just for IDE mode.
 
Isakov,
 
Could you test the latest code to see if the issue goes away? I did some enhancements for boot performance of IDE and AHCI.
 
Thanks
Feng
 
From: Tian, Feng [mailto:feng.tian@intel.com] 
Sent: Thursday, November 03, 2011 20:40
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Hi, Isakov
 
Could you provide more details? Are you using IDE mode or AHCI mode? The patch is just related with IDE enumeration when slave device is absent.
 
So whats your case?
 
Thanks
Feng
 
From: Sergey Isakov [mailto:isakov-sl@bk.ru] 
Sent: Thursday, November 03, 2011 19:47
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Hi Feng,
I have SATA AHCI HDD and SATA DVD.
Checking drives passes about 60second, it's terrible.
I tried your patch and see no improvements.
After 1 minute the driver works fine.
 
On 27.10.2011, at 13:35, Tian, Feng wrote:

 

Hi, Winddy
 
  I worked out a patch to boost IDE boot when slave device is absent.
 
Could you have a test to see if the issue goes away?
 
Thanks
Feng
 
From: Tian, Feng [mailto:feng.tian@intel.com] 
Sent: Wednesday, October 12, 2011 09:33
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Yes, now we use Identify cmd to help confirm if there is a real device because even if there is no device 1, the signature for device 1 is still valid.
 
Reducing detection time is not a good way. Some big capacity h/d may fail to response Identify cmd at short time frame.
 
Thanks
Feng
 
From: winddy [mailto:winddy_zhang@byosoft.com.cn] 
Sent: Wednesday, October 12, 2011 09:05
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] [UDK] Boot slowly under IDE mode when slave device is absent.
 
Dear Experts,
         Now I meet a problem: under IDE mode, if a channel only master has device attached, device detection will be slow.
         After trace, we found in function DetectAndConfigIdeDevice() in idemode.c, it will send IDENTIFY command to device to make sure its presence.
         According to ATA7 spec 5.16.1 (Device 0 only configurations), Even though Device 1 is not present, the register content may appear valid for Device 1.
         It means if a channel only master has device, issue Diagnostic command may see slave also has signature. And default command timeout is 3 seconds. If IDENTIFY command is failed, it will try to issue identify packet cmd. So the total time for slave will be at least 6 second.
         Could we have a way to reduce detection time under this condition such as reduce timeout value or not do double identify command?
         Thanks.
 
<IdeMode_New.c><IdeMode_Old.c>------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
 
<AhciMode.c><IdeMode.c>------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel