2006-01-18 00:31:35

by Christer Bäckström

[permalink] [raw]
Subject: Re: amd64 cdrom access locks system

> Aric Cyr <Aric.Cyr () gmail ! com> writes:
> > Bartlomiej Zolnierkiewicz <bzolnier <at> gmail.com> writes:
>
>>
>> On 6/14/05, Jeff Wiegley <jeffw <at> cyte.com> wrote:
>> > using "dev=/dev/hda" yeilds the exact same behavior...
>> >
>> > Jun 14 03:21:50 localhost kernel: ide-cd: cmd 0x3 timed out
>> > Jun 14 03:21:50 localhost kernel: hda: lost interrupt
>> > Jun 14 03:22:50 localhost kernel: ide-cd: cmd 0x3 timed out
>> > Jun 14 03:22:50 localhost kernel: hda: lost interrupt
>> > Jun 14 03:23:30 localhost kernel: hda: lost interrupt
>>
>> Jens, any idea?
>>
>> > And I'm a little confused by Robert's suggestion... Should it
>> > ever be possible for a user-space application to cause lost
>> > interrupts and other kernel state problems regardless of what
>> > "interface" is used?? Sure, if the application uses the wrong
>> > interface it should get spanked somehow but should it be able to
>> > mess up the kernel for other applications as well? (Like now
>> > I can't read or eject.)
>>
>> It shouldn't be possible unless it is "raw" interface
>> (requires CAP_SYS_RAWIO) w/o checking all possible
>> parameters (it is not always possible) or device is buggy.
>>
>> Also it is quite unlikely that somebody will fix obsolete
>> interface (hey, it got obsoleted for some reason .
>>
>> Bartlomiej
>>
>
> Has this problem been fixed at all or any workarounds known? I am having the
> exact same issue with similar hardware and the alim15x3 driver. In my case it
> does not matter which method I use for cdrecord (ATA:, ATAPI: or dev=/dev/hda),
> I will always get the lost interrupts from the command "cdrecord -atip". I have
> tried other drives without success so I don't believe that is the problem.
> Interestingly cdrdao does not have any problems at all and burns perfectly, so I
> suspect that cdrecord might be throwing some command that ide-cd or the IDE
> drive doesn't like and fails to recover from. However, disabling DMA on the
> drive via hdparm makes cdrecord work perfectly, so I suspect the alim15x3 driver
> more than anything else. I can play DVDs for hours with DMA enabled just fine
> though... go figure. My current kernel is 2.6.14-gentoo-r6, but I have had this
> problem since I first had got the system (around 2.6.12).

Exactly the same problems here, on a laptop (Amd64, Mandriva 2006,
linux-2.6.15) with an:

ALi Corporation M5229 IDE (rev c7)

The cd-writer locks up if the DMA is enabled, as above. But the drive is
usable if it is disabled.

The only other potential problem I've found is that the UDMA timings for
the /dev/hda is "???" (see below).

----------------------------------------------
#> cat /proc/ide/ali

Ali M15x3 Chipset.
------------------
PCI Clock: 0.
CD_ROM FIFO:No , CD_ROM DMA:Yes
FIFO Status: contains 1 Words, runs.

----------------primary channel---------secondary channel---------

channel status: Off Off
both channels togth: Yes Yes
Channel state: busy OK
Add. Setup Timing: 1T 1T
Command Act. Count: 3T 3T
Command Rec. Count: 1T 1T

----------------drive0----------drive1----------drive0----------drive1------

DMA enabled: Yes No Yes No
FIFO threshold: 4 Words 4 Words 4 Words 4 Words
FIFO mode: FIFO Off FIFO Off FIFO Off FIFO Off
Dt RW act. Cnt 3T 8T 3T 8T
Dt RW rec. Cnt 1T 16T 1T 16T

-----------------------------------UDMATimings--------------------------------

UDMA: OK No OK No
UDMA timings: ??? 1.5T 2.5T 1.5T

--------------------------------------

>
> I'm really anxious to track this down so if anyone has any information, or need
> something from me (logs or debugging) please don't hesitate to ask.
>

The same situation here. I've seen a few reports about this behaviour
with the alim15x3 driver before, so I just wanted to report my problems
too. If someone has any idea what's happening I'd be glad to try out any
patches. Please CC me, as I am not subscribed to the list.

/Chris
> Regards,
> Aric
>


2006-01-18 09:18:29

by Alan

[permalink] [raw]
Subject: Re: amd64 cdrom access locks system

On Mer, 2006-01-18 at 01:31 +0100, Christer Bäckström wrote:
> ALi Corporation M5229 IDE (rev c7)
>
> The cd-writer locks up if the DMA is enabled, as above. But the drive is
> usable if it is disabled.

Under what circumstances does the writer lock - when writing or in
general ?


Subject: Re: amd64 cdrom access locks system

On 1/18/06, Christer B?ckstr?m <[email protected]> wrote:
> > Aric Cyr <Aric.Cyr () gmail ! com> writes:
> > > Bartlomiej Zolnierkiewicz <bzolnier <at> gmail.com> writes:
> >
> >>
> >> On 6/14/05, Jeff Wiegley <jeffw <at> cyte.com> wrote:
> >> > using "dev=/dev/hda" yeilds the exact same behavior...
> >> >
> >> > Jun 14 03:21:50 localhost kernel: ide-cd: cmd 0x3 timed out
> >> > Jun 14 03:21:50 localhost kernel: hda: lost interrupt
> >> > Jun 14 03:22:50 localhost kernel: ide-cd: cmd 0x3 timed out
> >> > Jun 14 03:22:50 localhost kernel: hda: lost interrupt
> >> > Jun 14 03:23:30 localhost kernel: hda: lost interrupt
> >>
> >> Jens, any idea?
> >>
> >> > And I'm a little confused by Robert's suggestion... Should it
> >> > ever be possible for a user-space application to cause lost
> >> > interrupts and other kernel state problems regardless of what
> >> > "interface" is used?? Sure, if the application uses the wrong
> >> > interface it should get spanked somehow but should it be able to
> >> > mess up the kernel for other applications as well? (Like now
> >> > I can't read or eject.)
> >>
> >> It shouldn't be possible unless it is "raw" interface
> >> (requires CAP_SYS_RAWIO) w/o checking all possible
> >> parameters (it is not always possible) or device is buggy.
> >>
> >> Also it is quite unlikely that somebody will fix obsolete
> >> interface (hey, it got obsoleted for some reason .
> >>
> >> Bartlomiej
> >>
> >
> > Has this problem been fixed at all or any workarounds known? I am having the
> > exact same issue with similar hardware and the alim15x3 driver. In my case it
> > does not matter which method I use for cdrecord (ATA:, ATAPI: or dev=/dev/hda),
> > I will always get the lost interrupts from the command "cdrecord -atip". I have
> > tried other drives without success so I don't believe that is the problem.
> > Interestingly cdrdao does not have any problems at all and burns perfectly, so I
> > suspect that cdrecord might be throwing some command that ide-cd or the IDE
> > drive doesn't like and fails to recover from. However, disabling DMA on the
> > drive via hdparm makes cdrecord work perfectly, so I suspect the alim15x3 driver
> > more than anything else. I can play DVDs for hours with DMA enabled just fine
> > though... go figure. My current kernel is 2.6.14-gentoo-r6, but I have had this
> > problem since I first had got the system (around 2.6.12).
>
> Exactly the same problems here, on a laptop (Amd64, Mandriva 2006,
> linux-2.6.15) with an:
>
> ALi Corporation M5229 IDE (rev c7)
>
> The cd-writer locks up if the DMA is enabled, as above. But the drive is
> usable if it is disabled.
>
> The only other potential problem I've found is that the UDMA timings for
> the /dev/hda is "???" (see below).
>
> ----------------------------------------------
> #> cat /proc/ide/ali
>
> Ali M15x3 Chipset.
> ------------------
> PCI Clock: 0.
> CD_ROM FIFO:No , CD_ROM DMA:Yes
> FIFO Status: contains 1 Words, runs.
>
> ----------------primary channel---------secondary channel---------
>
> channel status: Off Off
> both channels togth: Yes Yes
> Channel state: busy OK
> Add. Setup Timing: 1T 1T
> Command Act. Count: 3T 3T
> Command Rec. Count: 1T 1T
>
> ----------------drive0----------drive1----------drive0----------drive1------
>
> DMA enabled: Yes No Yes No
> FIFO threshold: 4 Words 4 Words 4 Words 4 Words
> FIFO mode: FIFO Off FIFO Off FIFO Off FIFO Off
> Dt RW act. Cnt 3T 8T 3T 8T
> Dt RW rec. Cnt 1T 16T 1T 16T
>
> -----------------------------------UDMATimings--------------------------------
>
> UDMA: OK No OK No
> UDMA timings: ??? 1.5T 2.5T 1.5T
>
> --------------------------------------
>
> >
> > I'm really anxious to track this down so if anyone has any information, or need
> > something from me (logs or debugging) please don't hesitate to ask.
> >
>
> The same situation here. I've seen a few reports about this behaviour
> with the alim15x3 driver before, so I just wanted to report my problems
> too. If someone has any idea what's happening I'd be glad to try out any
> patches. Please CC me, as I am not subscribed to the list.

This issue is being tracked in the kernel bugzilla:
http://bugzilla.kernel.org/show_bug.cgi?id=5786

Please add yourself to cc:.

Bartlomiej

2006-01-18 12:15:38

by Christer Bäckström

[permalink] [raw]
Subject: Re: amd64 cdrom access locks system

Alan Cox skrev:
> On Mer, 2006-01-18 at 01:31 +0100, Christer Bäckström wrote:
>
>>ALi Corporation M5229 IDE (rev c7)
>>
>>The cd-writer locks up if the DMA is enabled, as above. But the drive is
>>usable if it is disabled.
>
>
> Under what circumstances does the writer lock - when writing or in
> general ?
>
>

It locks while writing and using DMA. I get the errors:

ide-cd: cmd 0x3 timed out
hdc: lost interrupt

And the cd-writer hangs. Disabling DMA makes it possible to write
(slowly, and only after rebooting). Reading always works. Other
functions also works while using DMA, like "cdrecord -checkdrive" or
"cdrecord -scanbus". However not things like "cdrecord -dummy".

A few snippets:
-------
lspci -v:
-------
00:1f.0 IDE interface: ALi Corporation M5229 IDE (rev c7) (prog-if 8a
[Master SecP PriP])
Subsystem: Unknown device 1631:c00e
Flags: bus master, 66Mhz, medium devsel, latency 32, IRQ 255
I/O ports at 1100 [size=16]
Capabilities: [60] Power Management version 2
-------

dmesg:
-------
Bootdata ok (command line is BOOT_IMAGE=2615 root=306 noinitrd
hdc=ide-cdrom resume=/dev/hda5 resume2=/dev/hda5 splash=silent 3)
Linux version 2.6.15 (root@localhost) (gcc version 4.0.1 (4.0.1-5mdk for
Mandriva Linux release 2006.0)) #7 PREEMPT Sun Jan 8 18:23:09 CET 2006
...
CPU: AMD Turion(tm) 64 Mobile Technology ML-30 stepping 02
...
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ALI15X3: IDE controller at PCI slot 0000:00:1f.0
ACPI: PCI Interrupt 0000:00:1f.0[A]: no GSI
ALI15X3: chipset revision 199
ALI15X3: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0x1100-0x1107, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0x1108-0x110f, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide0...
hda: WDC WD800UE-00HCT0, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: _NEC DVD+/-RW ND-6650A, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
hda: max request size: 128KiB
hda: 156301488 sectors (80026 MB) w/2048KiB Cache, CHS=65535/16/63,
UDMA(100)
hda: cache flushes supported
hda: hda1 hda2 hda3 < hda5 hda6 >
hdc: ATAPI 24X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
-------

The irq and ioports in the dmesg are the same as presented in windows,
if that helps in any way. Bartlomiej Zolnierkiewicz pointed out there
are a bugzilla entry for this:

http://bugzilla.kernel.org/show_bug.cgi?id=5786

I'm going to look into the posts 'til tomorrow, and continue with this
problem over there.

Cheers,

/Chris

--
Dr. Chris Backstrom, BSc, PhD.

2006-02-05 12:14:19

by Erwin Rol

[permalink] [raw]
Subject: Re: amd64 cdrom access locks system

On Wed, 2006-01-18 at 01:31 +0100, Christer Bäckström wrote:
> > Aric Cyr <Aric.Cyr () gmail ! com> writes:
> >> >
> >> > Jun 14 03:21:50 localhost kernel: ide-cd: cmd 0x3 timed out
> >> > Jun 14 03:21:50 localhost kernel: hda: lost interrupt
> >> > Jun 14 03:22:50 localhost kernel: ide-cd: cmd 0x3 timed out
> >> > Jun 14 03:22:50 localhost kernel: hda: lost interrupt
> >> > Jun 14 03:23:30 localhost kernel: hda: lost interrupt
> >>
> >>
> Exactly the same problems here, on a laptop (Amd64, Mandriva 2006,
> linux-2.6.15) with an:
>
> ALi Corporation M5229 IDE (rev c7)
>
> The cd-writer locks up if the DMA is enabled, as above. But the drive is
> usable if it is disabled.
>

I just wanted to add a "me too". I have a Shuttle ST20G5 with a M5229
rev c7:

00:1f.0 IDE interface: ALi Corporation M5229 IDE (rev c7) (prog-if fa)
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer Unknown device f391
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 185
I/O ports at 8880 [size=16]

Reading CD's and DVD's always works, but writing or blanking hangs the
drive, with the following entries in the log files;

ide-cd: cmd 0x3 timed out
hda: lost interrupt
hda: request sense failure: status=0x51 { DriveReady SeekComplete Error }
hda: request sense failure: error=0x40 { LastFailedSense=0x04 }
hda: lost interrupt
hda: lost interrupt

The "lost interrupt" message is than repeated endlessly until i reboot,
and every program that tries to access the drive (including reading)
will hang for example:

31527 pts/0 D+ 0:00 cat /proc/ide/hda/capacity

This is also on a AMD64, so i don't know maybe it is a AMD64 problem
only.

- Erwin