2003-09-14 15:14:40

by Mario 'BitKoenig' Holbe

[permalink] [raw]
Subject: 2.4.22: ide-scsi interfers with APM

Hello,

while installing 2.4.22 kernel, I found, my CD-Writer wasnt
detected anymore by ide-scsi.
Using the default debian kernel configuration (I use
the debian kernel-source-2.4.22 package, but this does
also happen with plain 2.4.22 sources - I tried it), it seemed
working fine.

After tracing this back (don't ask how long it took... :)), I
found the following surprising coherence:

ide-scsi works fine, if CONFIG_APM=m is defined:

VP_IDE: IDE controller at PCI slot 00:04.1
ide-cd: passing drive hdd to ide-scsi emulation.
hdd: attached ide-scsi driver.
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: TOSHIBA Model: DVD-ROM SD-R1002 Rev: X840
Type: CD-ROM ANSI SCSI revision: 02
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
sr0: scsi3-mmc drive: 24x/24x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12

it does not, if CONFIG_APM is undefined:

VP_IDE: IDE controller at PCI slot 00:04.1
ide-cd: passing drive hdd to ide-scsi emulation.
hdd: attached ide-scsi driver.
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: Model: Rev:
Type: Direct-Access ANSI SCSI revision: 03

Just to clarify this:
1. my IDE and SCSI drivers are compiled into the kernel.
2. compiling APM as a module is enough.
3. the module is *not* loaded at all, I'm using ACPI.
4. the only thing i've finally changed is CONFIG_APM=m.

I have no explanation for this and no idea how to debug it
down. Hopefully someone else is able to explain it to me.
Do I have to expect any other interferences like this?

I attached /proc/scsi/scsi for faulty and working case,
the kernel .config for faulty case and diff to working
version.

The behaviour is reproducible for me, I hope, it's too for
somebody else.


PS: Please CC: me in replies, Mail-Followup-To: should be
set appropriate.


Thanks,
Mario
--
I heard, if you play a NT-CD backwards, you get satanic messages...
That's nothing, if you play it forwards, it installs NT.


Attachments:
(No filename) (2.07 kB)
ide-scsi.faulty.proc.scsi.scsi (177.00 B)
ide-scsi.working.proc.scsi.scsi (177.00 B)
ide-scsi.faulty.config (25.75 kB)
ide-scsi.config.diff (532.00 B)
Download all attachments

2003-09-15 23:30:18

by Mario 'BitKoenig' Holbe

[permalink] [raw]
Subject: Re: 2.4.22: ide-scsi interfers with APM

On Sun, Sep 14, 2003 at 05:13:52PM +0200, Mario 'BitKoenig' Holbe wrote:
> ide-scsi works fine, if CONFIG_APM=m is defined:
> it does not, if CONFIG_APM is undefined:
>
> I have no explanation for this and no idea how to debug it
> down. Hopefully someone else is able to explain it to me.

Okay, now I'm able to explain it myself.
It's a timing issue.

After this it works well even with CONFIG_APM is undefined:

--- kernel-source-2.4.22.old/include/linux/ide.h 2003-09-15 09:49:34.000000000 +0200
+++ kernel-source-2.4.22/include/linux/ide.h 2003-09-15 21:22:57.000000000 +0200
@@ -271,7 +271,7 @@
#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
#define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */
#else
-#define WAIT_READY (3*HZ/100) /* 30msec - should be instantaneous */
+#define WAIT_READY (4*HZ/100) /* 40msec - should be instantaneous */
#endif /* CONFIG_APM || CONFIG_APM_MODULE */
#define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */
#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */

There were no changes from 2.4.20 to 2.4.22 (with 2.4.20
everything worked fine), so I guess, other timings changed.
I *guess* the 30msecs was a bit strong for cd-drives in
2.4.20 too (btw. it doesnt matter, if I compile ide-scsi
as module and insmod/rmmod it a few times) but worked.
Somewhere in 2.4.21 things were changed somehow that
modified the timing hardly enough to cross the border.

> Do I have to expect any other interferences like this?

IMHO some ide-proof should have a look at it to answer
this.


regards,
Mario
--
Ho ho ho! I am Santa Claus of Borg. Nice assimilation all together!