Bug 173435 - Atapi cdrom boot delay
Summary: Atapi cdrom boot delay
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Warner Losh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-07 01:10 UTC by taner76
Modified: 2021-10-07 22:08 UTC (History)
4 users (show)

See Also:


Attachments
file.txt (10.65 KB, text/plain)
2012-11-07 01:10 UTC, taner76
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description taner76 2012-11-07 01:10:00 UTC
Hi, I recently booted via 9.1-RC3 cdrom and I have caused a approximately 1 minute boot delay problem during atapi cdrom/device detect.

I got these kernel messages during delay:

(aprobe0:ata0:0:1:0): ATAPI_IDENTIFY. ACB: a1 00 00 00 00 40 00 00 00 00 00 00
(aprobe0:ata0:0:1:0): CAM status: Command timeout
(aprobe0:ata0:0:1:0): Error 5, Retry was blocked
run_interrupt_driven_hooks: still waiting after 60 seconds for xpt_config
(aprobe0:ata0:0:1:0): ATAPI_IDENTIFY. ACB: a1 00 00 00 00 40 00 00 00 00 00 00
(aprobe0:ata0:0:1:0): CAM status: Command timeout
(aprobe0:ata0:0:1:0): Error 5, Retry was blocked

Same problem exists in current 10.HEAD

Fix: Patch attached with submission follows:
How-To-Repeat: Booting via 9.1-RC3 GENERIC kernel using NVIDIA nForce 720D/GeForce 8200 Chipset mainboard with ATAPI/IDE device connected.
Comment 1 taner76 2013-01-02 02:32:27 UTC
I have recently tested 9.1-RELEASE kernel and problem still exists. It
doesn't matter booting from cdrom or disk, there is a problem during
probing ATAPI cd/dvd drivers as I described in #173435.
Comment 2 George 2015-07-08 15:11:09 UTC
Friends, is there any solutions for that bug?
On my old laptop Sony Vaio PCG-6C2L I have infinite repeated errors when booting from 10.1-i386 and 11-Current-i386 setup disk:
(aprobe0:ata0:0:1:0): ATAPI_IDENTIFY. ACB: a1 00 00 00 00 40 00 00 00 00 00 00
(aprobe0:ata0:0:1:0): CAM status: Command timeout
(aprobe0:ata0:0:1:0): Error 5, Retry was blocked
run_interrupt_driven_hooks: still waiting after 60 seconds for xpt_config
...........
...........

I'm trying insert disk into DVD-ROM drive, that not helps. I can't install FreeBSD on laptop because of that bug.
Comment 3 mq 2017-11-28 14:14:25 UTC
Any solution on this problem?

I experience the same issue on IBM ThinkPad R40 with FreeBSD 11.1.
After removing my DVD drive,  the installation succeeded.
But now after re-inserting the DVD driver,  the kernel is
caught again in this end-less loop with the  "CAM status:  Command timeout".

I am about to install FreeBSD 7.0 on my notebook.
Comment 4 mq 2017-11-28 14:46:46 UTC
After setting hint.ata.1.disbled="1" in /boot/device/hints,  FreeBSD 11.1
boots on my notebook.  Now,  the DVD drive is disabled.  Fortunately,  there is only little need for a DVD drive today.  

Anyway,  I would be great,  if this problem can be solved without disabling the DVD drive.
Comment 5 Arto Pekkanen 2017-11-28 18:47:02 UTC
(In reply to mq from comment #4)

A suggestion: implement a boot configuration option to only initialize the root device during boot, while other devices would be left to initialize in the background. Later if a an operation is attempted on a device (such as mount), if the device has not yet initialized, the operation would block until the device is ready. This would considerably decrease boot times on all computers which have optical drives that force read the media at initialization, or hard disks (not hosting root, data storage) with slow spin-up.
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:52:51 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"
Comment 7 Warner Losh freebsd_committer freebsd_triage 2021-10-07 17:52:24 UTC
The common thread appears to be CDROM devices on ata (eg parallel attached) HBAs. This doesn't happen with SATA CDROM drives attached via AHCI devices.
Comment 8 Warner Losh freebsd_committer freebsd_triage 2021-10-07 22:08:52 UTC
So, we think there's a 'target 1' and are sending it a INQUIRE PACKET command.
But there is no such target, so it tries twice to send the command with a 30
second timeout, leading to the 1 minute delay.

I kinda think this is a bug in the SIM detecting the phantom device that's not there. But old-school Parallel ATA is black magic to me, and there's a plethora of devices that behave badly so I don't know if this is a bug in ata-lowlevel.c:ata_generic_reset or if these are just badly behaving DVD drives.

If someone has this issue still, please add a boot verbose update.

Also, the original text says something about attaching a patch to fix this, but I see no such patches.

My guess is we should bump down the timeout to 3s since the 30s timeout comes generally from spinning drives that need to spin up and packet devices (cd and dvd drives) don't need that long. That would at least reduce the problem to 6s on boot rather than 60s.