Bug 24272

Summary: ATAPI CD "open" causes "ticks" as ATA drive is pinged
Product: Base System Reporter: jan grant <jan.grant>
Component: i386Assignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   

Description jan grant 2001-01-12 11:30:00 UTC
(I'm a KDE-1 user) kscd was running (no CD in the tray). The system produced an
insistent "ticking" sound once per second. This appeared to be caused by the
IDE drive on the primary master springing into life (the drive-in-use light
flashes once per second or so).

Looking at recent logs (prior to this the last CVSUP was about 10 days ago)
this may have been introduced at about the same time the "close tray on open"
changes were made (you need nimble fingers to get a CD into the drive with
kscd trying to open it! :-) - this may be a problem with kscd repeatedly
trying to open the CD but I'd imagine most desktop CD players operate after
a similar fashion)

I don't really care about the CD tray behaviour; but the system seems to
be pinging the ATA drive on the main controller for every attempted CD open.
This is the problem!

Fix: 

Haven't located the exact problem in source.
How-To-Repeat: 
CVSUP to stable as of 11 jan 2001 and run kscd on a machine with an ATA drive on
IDE primary master, ATAPI CD on primary slave.
Comment 1 sos 2001-01-12 11:55:58 UTC
It seems jan.grant@bristol.ac.uk wrote:
> 
> >Number:         24272
> >Category:       i386
> >Synopsis:       ATAPI CD "open" causes "ticks" as ATA drive is pinged
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       medium
> >Responsible:    freebsd-bugs
> >State:          open
> >Quarter:        
> >Keywords:       
> >Date-Required:
> >Class:          sw-bug
> >Submitter-Id:   current-users
> >Arrival-Date:   Fri Jan 12 03:30:00 PST 2001
> >Closed-Date:
> >Last-Modified:
> >Originator:     jan grant
> >Release:        FreeBSD 4.2-STABLE i386
> >Organization:
> ILRT, University of Bristol
> >Environment:
> 4-stable cvsupped yesterday
> 
> FreeBSD tribble.ilrt.bris.ac.uk 4.2-STABLE FreeBSD 4.2-STABLE #0: Thu Jan 11 21:14:50 GMT 2001     cmjg@tribble.ilrt.bris.ac.uk:/external/usr.obj/usr/src/sys/JAN  i386
> 
> Relevant lines from dmesg:
> atapci0: <Intel PIIX4 ATA33 controller> port 0x14a0-0x14af at device 7.1 on pci0
> ata0: at 0x1f0 irq 14 on atapci0
> ata1: at 0x170 irq 15 on atapci0
> ad0: 8063MB <WDC AC38400L> [16383/16/63] at ata0-master UDMA33
> acd0: CDROM <SAMSUNG CD-ROM SCR-3231> at ata1-master using PIO4
> 
> A GENERIC kernel with the following additions:
> 
> #Sound...
> device		pcm
> 
> >Description:
> 
> (I'm a KDE-1 user) kscd was running (no CD in the tray). The system produced an
> insistent "ticking" sound once per second. This appeared to be caused by the
> IDE drive on the primary master springing into life (the drive-in-use light
> flashes once per second or so).
> 
> Looking at recent logs (prior to this the last CVSUP was about 10 days ago)
> this may have been introduced at about the same time the "close tray on open"
> changes were made (you need nimble fingers to get a CD into the drive with
> kscd trying to open it! :-) - this may be a problem with kscd repeatedly
> trying to open the CD but I'd imagine most desktop CD players operate after
> a similar fashion)
> 
> I don't really care about the CD tray behaviour; but the system seems to
> be pinging the ATA drive on the main controller for every attempted CD open.
> This is the problem!
> 
> >How-To-Repeat:
> 
> CVSUP to stable as of 11 jan 2001 and run kscd on a machine with an ATA drive on
> IDE primary master, ATAPI CD on primary slave.

Hmm, if kscd is polling the drive once a second, and you have both
disk and CDROM on the primary, I'd bet those blinking lights are
from accesses to the CDROM and not the disk...

However in you probemessages above disk and CDROM are located on
seperate controllers, so now what gives ?

-Søren
Comment 2 jan grant 2001-01-12 12:10:42 UTC
On Fri, 12 Jan 2001, Soren Schmidt wrote:

> Hmm, if kscd is polling the drive once a second, and you have both
> disk and CDROM on the primary, I'd bet those blinking lights are
> from accesses to the CDROM and not the disk...
> 
> However in you probemessages above disk and CDROM are located on
> seperate controllers, so now what gives ?

As I said, it really does sound like the hard drive head is "ticking";
there is a separate CD-rom activity light and both lights generally
only come on during activity of the appropriate device.

Yes, the two devices _are_ on separate controllers. It may be that the
hardware causes both devices/controllers to jump on a tray-close; I'm
not a hardware expert.

In either case, it is definitely being caused by the tray-close-on-open
CD behaviour (which I'd contend is pretty broken; if such behaviour is
required by a user program, it can close the tray itself).

In other words, I think the recent change in behaviour is broken; it
just so happens that it's come to light due to kscd.

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287163 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
Whenever I see a dog salivate I get an insatiable urge to ring a bell.
Comment 3 Søren Schmidt freebsd_committer freebsd_triage 2001-05-29 14:25:14 UTC
State Changed
From-To: open->closed

The close tray behavior is no longer there.