public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: Weird:  30 sec delay during early boot
@ 2004-07-05  7:21 David Balazic
  2004-07-05 11:25 ` Dave Jones
  0 siblings, 1 reply; 22+ messages in thread
From: David Balazic @ 2004-07-05  7:21 UTC (permalink / raw)
  To: Matt Domsch, Andries Brouwer
  Cc: Jeff Garzik, Pavel Machek, Linux Kernel, Andi Kleen,
	Andrew Morton, David Balazic

Wouldn't the BIOS immediatelly respond with a "no such disk" error if int13
would
try to access a non-existing disk ?
This is BIOS land, not hardware land. The BIOS already has a list of
"existing" drives.
Or maybe I'm flat out wrong ;-)

Regards,
David

> ----------
> From: 	Andries Brouwer[SMTP:aebr@win.tue.nl]
> Sent: 	5. julij 2004 1:27
> To: 	Matt Domsch
> Cc: 	Jeff Garzik; Pavel Machek; Linux Kernel; Andi Kleen; Andrew Morton;
> David Balazic
> Subject: 	Re: Weird:  30 sec delay during early boot
> 
> On Sun, Jul 04, 2004 at 03:52:51PM -0500, Matt Domsch wrote:
> 
> > Only that it's now probing more than just the first disk, but the
> > first 16 possible BIOS disks.  If the BIOS behaves badly to an int13
> > READ_SECTORS command, that'd be good to know...
> 
> I recall text fragments like
> 
>  "Any device claiming compliance to ATA-3 or later as indicated in
>   IDENTIFY DEVICE or IDENTIFY PACKET DEVICE data should properly
>   release PDIAG- after a power-on or hardware reset upon receiving
>   the first command or after 31 seconds have elapsed since the reset,
>   whichever comes first."
> 
> that seem to imply that probing a nonexistent device may take 31 sec
> before one is allowed to conclude that there is nothing there.
> 
> Andries
> 
> 
> (ide_wait_hwif_ready() used to wait 35 seconds)
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: Weird:  30 sec delay during early boot
@ 2004-07-30 12:52 David Balazic
  0 siblings, 0 replies; 22+ messages in thread
From: David Balazic @ 2004-07-30 12:52 UTC (permalink / raw)
  To: David Balazic, 'Matt Domsch'
  Cc: Dave Jones, Andries Brouwer, Jeff Garzik, Pavel Machek,
	Linux Kernel, Andi Kleen, Andrew Morton



> ----------
> From: 	Matt Domsch[SMTP:Matt_Domsch@dell.com]
> Sent: 	29. julij 2004 18:02
> To: 	David Balazic
> Cc: 	Dave Jones; Andries Brouwer; Jeff Garzik; Pavel Machek; Linux
> Kernel; Andi Kleen; Andrew Morton
> Subject: 	Re: Weird:  30 sec delay during early boot
> 
> On Thu, Jul 29, 2004 at 03:05:10PM +0200, David Balazic wrote:
> > > David, you had said before that by downgrading your BIOS you no longer
> > > saw the delay.  Is this not still true?
> > > 
> > Still true, downgrading removes the delay.
> 
> OK, then I'm inclined to believe it's a BIOS bug really...
> 
> > > You also mentioned that Grub made different calls.  I'll check that
> > > out too.
> > > 
> > Can you make a patch, that only accesses hd0 and hd1 ?
> 
> Reduce the value of
> #define EDD_MBR_SIG_MAX 16
> 
> in include/linux/edd.h  to whatever value you like, e.g. 2.
> 
I set this to "1" and got the same delay ... :-(

> > Or one which prints what is it doing, on each step ?
> > ( I tried this one myself, but it did not work :blush: , IA32 assembler
> > is not my strong side )
> 
> That's more PITA - it's in real mode, before anything's ever been
> printed.  I'd prefer not to have to figure that out if I can avoid it.
> 
> Thanks,
> Matt
> 
> -- 
> Matt Domsch
> Sr. Software Engineer, Lead Engineer
> Dell Linux Solutions linux.dell.com & www.dell.com/linux
> Linux on Dell mailing lists @ http://lists.us.dell.com
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: Weird:  30 sec delay during early boot
@ 2004-07-29 13:05 David Balazic
  2004-07-29 16:02 ` Matt Domsch
  0 siblings, 1 reply; 22+ messages in thread
From: David Balazic @ 2004-07-29 13:05 UTC (permalink / raw)
  To: David Balazic, 'Matt Domsch'
  Cc: Dave Jones, Andries Brouwer, Jeff Garzik, Pavel Machek,
	Linux Kernel, Andi Kleen, Andrew Morton


> From: 	Matt Domsch[SMTP:Matt_Domsch@dell.com]
> 
> On Wed, Jul 28, 2004 at 02:16:19PM +0200, David Balazic wrote:
> > The same delay as before.
> > 
> > I built 2.6.8-rc1 first, then patched and issued a "make bzImage";
> > maybe it did not compile all the new stuff ?
> 
> No, it didn't work for Jeff either, and I've been gone on vacation/OLS
> the past couple weeks, just now getting back into normal work mode.  I
> haven't forgotten about you.
> 
> The crazy thing is, the early real mode code has issued a "Get Disk
> Type" (int13 fn15) command for ages, so I suspect it's not being slow for
> disk 80 or 81, but for one of the higher values.  From setup.S:
> 
> # Check that there IS a hd1 :-)
>         movw    $0x01500, %ax
>         movb    $0x81, %dl
>         int     $0x13
>         jc      no_disk1
>         cmpb    $3, %ah
>         je      is_disk1
> 
> This is all I was trying to accomplish with that test patch.
> 
> David, you had said before that by downgrading your BIOS you no longer
> saw the delay.  Is this not still true?
> 
Still true, downgrading removes the delay.

> You also mentioned that Grub made different calls.  I'll check that
> out too.
> 
Can you make a patch, that only accesses hd0 and hd1 ?
Or one which prints what is it doing, on each step ?
( I tried this one myself, but it did not work :blush: , IA32 assembler
is not my strong side )

> Thanks,
> Matt
> 
> -- 
> Matt Domsch
> Sr. Software Engineer, Lead Engineer
> Dell Linux Solutions linux.dell.com & www.dell.com/linux
> Linux on Dell mailing lists @ http://lists.us.dell.com
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: Weird:  30 sec delay during early boot
@ 2004-07-28 12:16 David Balazic
  2004-07-28 12:40 ` Matt Domsch
  0 siblings, 1 reply; 22+ messages in thread
From: David Balazic @ 2004-07-28 12:16 UTC (permalink / raw)
  To: David Balazic, 'Matt Domsch'
  Cc: Dave Jones, Andries Brouwer, Jeff Garzik, Pavel Machek,
	Linux Kernel, Andi Kleen, Andrew Morton

The same delay as before.

I built 2.6.8-rc1 first, then patched and issued a "make bzImage";
maybe it did not copile all the new stuff ?


> ----------
> From: 	Matt Domsch[SMTP:Matt_Domsch@dell.com]
> Sent: 	14. julij 2004 0:16
> To: 	David Balazic
> Cc: 	Dave Jones; Andries Brouwer; Jeff Garzik; Pavel Machek; Linux
> Kernel; Andi Kleen; Andrew Morton
> Subject: 	Re: Weird:  30 sec delay during early boot
> 
> David, Jeff, would you mind trying the patch below on your systems
> which exhibit the long delays in the EDD real-mode code?
> 
> This does a few things:
> 1) it uses an int13 fn15 "Get Disk Type" command prior to doing the
> fn02 "Read Sectors" command, to try to determine if there is a disk
> present or not before reading its signature.
> 
> 2) A few registers are more fully zeroed out, in case the BIOS cared
> about things it shouldn't have.
> 
> Crossing my fingers that the delays are gone...
> -Matt
> 
> -- 
> Matt Domsch
> Sr. Software Engineer, Lead Engineer
> Dell Linux Solutions linux.dell.com & www.dell.com/linux
> Linux on Dell mailing lists @ http://lists.us.dell.com
> 
> ===== arch/i386/boot/edd.S 1.2 vs edited =====
> --- 1.2/arch/i386/boot/edd.S	2004-06-29 09:44:48 -05:00
> +++ edited/arch/i386/boot/edd.S	2004-07-13 16:48:50 -05:00
> @@ -12,13 +12,31 @@
>  #include <linux/edd.h>
>  
>  #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
> -# Read the first sector of each BIOS disk device and store the 4-byte
> signature
>  edd_mbr_sig_start:
> +	xor	%ebx, %ebx
> +	xor	%edx, %edx
>  	movb	$0, (EDD_MBR_SIG_NR_BUF)	# zero value at
> EDD_MBR_SIG_NR_BUF
> +       	movw	$EDD_MBR_SIG_BUF, %bx		# store buffer ptr
> in bx
>  	movb	$0x80, %dl			# from device 80
> -	movw	$EDD_MBR_SIG_BUF, %bx		# store buffer ptr in bx
> +
>  edd_mbr_sig_read:
> -	movl	$0xFFFFFFFF, %eax
> +# Do int13 fn15 first, as BIOS should know if a disk is present or not.
> +# This avoids long (>30s) delays waiting for the READ_SECTORS to a
> non-present disk.
> +	xor	%eax, %eax
> +	xor	%ecx, %ecx
> +       	movb	$GETDISKTYPE, %ah		# Function 15
> +	pushw	%dx				# which stomps on dx
> +	stc					# work around buggy BIOSes
> +    	int	$0x13				# make the call
> +	sti					# work around buggy BIOSes
> +	popw	%dx				# so get back dx
> +	jc	edd_mbr_sig_done		# no more BIOS devices
> +	cmpb	$HARDDRIVEPRESENT, %ah		# is hard drive present?
> +	jne	edd_mbr_sig_done		# no more BIOS devices
> +
> +# Read the first sector of each BIOS disk device and store the 4-byte
> signature
> +	xor	%ecx, %ecx
> +    	movl	$0xFFFFFFFF, %eax
>  	movl	%eax, (%bx)			# assume failure
>  	pushw	%bx
>  	movb	$READ_SECTORS, %ah
> ===== include/linux/edd.h 1.11 vs edited =====
> --- 1.11/include/linux/edd.h	2004-06-29 09:44:48 -05:00
> +++ edited/include/linux/edd.h	2004-07-13 16:05:14 -05:00
> @@ -49,6 +49,9 @@
>  #define EDD_MBR_SIG_MAX 16        /* max number of signatures to store */
>  #define EDD_MBR_SIG_NR_BUF 0x1ea  /* addr of number of MBR signtaures at
> EDD_MBR_SIG_BUF
>  				     in boot_params - treat this as 1 byte
> */
> +#define GETDISKTYPE 0x15          /* int13 AH=0x15 is Get Disk Type
> command */
> +#define HARDDRIVEPRESENT 0x03     /* int13 AH=15 return code in AH */
> +
>  #ifndef __ASSEMBLY__
>  
>  #define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: Weird:  30 sec delay during early boot
@ 2004-07-05 11:30 David Balazic
  2004-07-13 22:16 ` Matt Domsch
  0 siblings, 1 reply; 22+ messages in thread
From: David Balazic @ 2004-07-05 11:30 UTC (permalink / raw)
  To: David Balazic, Dave Jones
  Cc: Matt Domsch, Andries Brouwer, Jeff Garzik, Pavel Machek,
	Linux Kernel, Andi Kleen, Andrew Morton

Yes, but GRUB also uses BIOS to access the hard drive(s).
And it can get a list of drives and read them just fine, without any delays.
Either there is a bug in the linux code or it somehow triggers some weird
BIOS bug.

Maybe a newer BIOS call should be used in linux EDD code ( I believe GRUB
uses
a different call for reading sectors than EDD )

Regards,
David

> ----------
> From: 	Dave Jones[SMTP:davej@redhat.com]
> Sent: 	5. julij 2004 13:25
> To: 	David Balazic
> Cc: 	Matt Domsch; Andries Brouwer; Jeff Garzik; Pavel Machek; Linux
> Kernel; Andi Kleen; Andrew Morton
> Subject: 	Re: Weird:  30 sec delay during early boot
> 
> On Mon, Jul 05, 2004 at 09:21:34AM +0200, David Balazic wrote:
>  > Wouldn't the BIOS immediatelly respond with a "no such disk" error if
> int13
>  > would
>  > try to access a non-existing disk ?
>  > This is BIOS land, not hardware land.
> 
> The BIOS guys get their stash from a different dealer to the hardware
> guys.
> Screwups happen. It could just be yet another 'interesting' interpretation
> of specifications.
> 
> 		Dave
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <2e55c-392-7@gated-at.bofh.it>]
* Weird:  30 sec delay during early boot
@ 2004-07-04  2:34 Jeff Garzik
  2004-07-04  6:33 ` Pavel Machek
  0 siblings, 1 reply; 22+ messages in thread
From: Jeff Garzik @ 2004-07-04  2:34 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Andi Kleen, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]


This appeared in -bk-latest in the past day or two.

BK-current on x86-64 (config/dmesg/lspci attached) will pause for 30 
wall-clock seconds immediately after being loaded by the bootloader, 
then will proceed to boot successfully and function correctly.  This is 
reproducible on every boot.

So, 30 seconds with no printk output, then boots normally.



[-- Attachment #2: config.txt.bz2 --]
[-- Type: application/x-bzip2, Size: 4820 bytes --]

[-- Attachment #3: dmesg.txt.bz2 --]
[-- Type: application/x-bzip2, Size: 4298 bytes --]

[-- Attachment #4: lspci.txt.bz2 --]
[-- Type: application/x-bzip2, Size: 2059 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2004-07-30 12:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-05  7:21 Weird: 30 sec delay during early boot David Balazic
2004-07-05 11:25 ` Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2004-07-30 12:52 David Balazic
2004-07-29 13:05 David Balazic
2004-07-29 16:02 ` Matt Domsch
2004-07-28 12:16 David Balazic
2004-07-28 12:40 ` Matt Domsch
2004-07-05 11:30 David Balazic
2004-07-13 22:16 ` Matt Domsch
2004-07-13 22:35   ` Jeff Garzik
2004-07-14  2:32     ` Matt Domsch
2004-07-14  3:03       ` Matt Domsch
2004-07-14  3:18         ` Jeff Garzik
     [not found] <2e55c-392-7@gated-at.bofh.it>
2004-07-04  2:47 ` Andi Kleen
2004-07-04  2:52   ` Jeff Garzik
2004-07-04  3:23     ` Andi Kleen
2004-07-04  2:34 Jeff Garzik
2004-07-04  6:33 ` Pavel Machek
2004-07-04 17:33   ` Jeff Garzik
2004-07-04 20:52     ` Matt Domsch
2004-07-04 23:27       ` Andries Brouwer
2004-07-05 13:31         ` Matt Domsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox