2003-08-31 16:16:38

by Petr Baudis

[permalink] [raw]
Subject: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

Hello,

when upgrading from 2.4.20 to 2.4.22, I hit a strange problem - the machine
mysteriously freezed (totally, interrupts blocked) in few seconds when I tried
to do anything with the soundcard. It turned out to be a DMA conflict between
soundcard and disk, since it disappears when I disable the (now defaultly on)
DMA-by-default IDE option.

The IDE driver smells the hardware as:

Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686a (rev 1b) IDE UDMA66 controller on pci00:07.1
ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:pio, hdd:DMA
hda: C/H/S=1024/16/255 from BIOS ignored
hda: IC35L040AVER07-0, ATA DISK drive
hdd: SAMSUNG CD-R/RW DRIVE SW-224B, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: attached ide-disk driver.
hda: host protected area => 1
hda: 80418240 sectors (41174 MB) w/1916KiB Cache, CHS=79780/16/63
Partition check:
/dev/ide/host0/bus0/target0/lun0: p1 p2 p3 < p5 p6 p7 p8 p9 p10 p11 >

The option help mentions that this is gonna happen if I have VIA VP2 chipset,
however I think I have VP3 :

Host bridge: VIA Technologies, Inc. VT82C597 [Apollo VP3] (rev 4).
Master Capable. Latency=16.
Prefetchable 32 bit memory at 0xd8000000 [0xdfffffff].
Bus 0, device 1, function 0:
PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] (rev 0).
Master Capable. No bursts. Min Gnt=12.
Bus 0, device 7, function 0:
ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 27).
Bus 0, device 7, function 1:
IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 6).
Master Capable. Latency=32.
I/O at 0xd000 [0xd00f].

So apparently this is still not fixed in VP3, I think it should be mentioned
in the option help (together with reflecting that this is on by default now),
especially as VP3 IMHO isn't that uncommon. If you don't want to bother with
doing this, I can make the patch. Just FYI.

Kind regards,

--

Petr "Pasky" Baudis
.
Perfection is reached, not when there is no longer anything to add, but when
there is no longer anything to take away.
-- Antoine de Saint-Exupery
.
Stuff: http://pasky.ji.cz/


2003-08-31 17:58:20

by Alan

[permalink] [raw]
Subject: Re: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

On Sul, 2003-08-31 at 17:16, Petr Baudis wrote:
> Hello,
>
> when upgrading from 2.4.20 to 2.4.22, I hit a strange problem - the machine
> mysteriously freezed (totally, interrupts blocked) in few seconds when I tried
> to do anything with the soundcard. It turned out to be a DMA conflict between
> soundcard and disk, since it disappears when I disable the (now defaultly on)
> DMA-by-default IDE option.

Sound and IDE work together on my MVP3 board. Maybe your hardware is
just broken.

Subject: Re: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

On Sunday 31 of August 2003 19:57, Alan Cox wrote:
> On Sul, 2003-08-31 at 17:16, Petr Baudis wrote:
> > Hello,
> >
> > when upgrading from 2.4.20 to 2.4.22, I hit a strange problem - the
> > machine mysteriously freezed (totally, interrupts blocked) in few seconds
> > when I tried to do anything with the soundcard. It turned out to be a DMA
> > conflict between soundcard and disk, since it disappears when I disable
> > the (now defaultly on) DMA-by-default IDE option.
>
> Sound and IDE work together on my MVP3 board. Maybe your hardware is
> just broken.

Or maybe sound driver is doing some funny things (?).

--bartlomiej

2003-08-31 18:57:11

by Petr Baudis

[permalink] [raw]
Subject: Re: Re: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

Dear diary, on Sun, Aug 31, 2003 at 08:32:47PM CEST, I got a letter,
where Bartlomiej Zolnierkiewicz <[email protected]> told me, that...
> On Sunday 31 of August 2003 19:57, Alan Cox wrote:
> > On Sul, 2003-08-31 at 17:16, Petr Baudis wrote:
> > > Hello,
> > >
> > > when upgrading from 2.4.20 to 2.4.22, I hit a strange problem - the
> > > machine mysteriously freezed (totally, interrupts blocked) in few seconds
> > > when I tried to do anything with the soundcard. It turned out to be a DMA
> > > conflict between soundcard and disk, since it disappears when I disable
> > > the (now defaultly on) DMA-by-default IDE option.
> >
> > Sound and IDE work together on my MVP3 board. Maybe your hardware is
> > just broken.
>
> Or maybe sound driver is doing some funny things (?).

sb: ESS ES1869 Plug and Play AudioDrive detected
sb: ISAPnP reports 'ESS ES1869 Plug and Play AudioDrive' at i/o 0x220, irq 10, dma 1, 3
SB 3.01 detected OK (220)
ESS chip ES1869 detected
<ESS ES1869 AudioDrive (rev 11) (3.01)> at 0x220 irq 10 dma 1,3
sb: 1 Soundblaster PnP card(s) found.

...worked just fine in the past. Oh and under 2.6.0-test I was using ALSA.

Kind regards,

--

Petr "Pasky" Baudis
.
Perfection is reached, not when there is no longer anything to add, but when
there is no longer anything to take away.
-- Antoine de Saint-Exupery
.
Stuff: http://pasky.ji.cz/

2003-08-31 20:06:45

by Petr Baudis

[permalink] [raw]
Subject: Re: Re: Re: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

Dear diary, on Sun, Aug 31, 2003 at 08:57:06PM CEST, I got a letter,
where Petr Baudis <[email protected]> told me, that...
> Dear diary, on Sun, Aug 31, 2003 at 08:32:47PM CEST, I got a letter,
> where Bartlomiej Zolnierkiewicz <[email protected]> told me, that...
> > On Sunday 31 of August 2003 19:57, Alan Cox wrote:
> > > On Sul, 2003-08-31 at 17:16, Petr Baudis wrote:
> > > > Hello,
> > > >
> > > > when upgrading from 2.4.20 to 2.4.22, I hit a strange problem - the
> > > > machine mysteriously freezed (totally, interrupts blocked) in few seconds
> > > > when I tried to do anything with the soundcard. It turned out to be a DMA
> > > > conflict between soundcard and disk, since it disappears when I disable
> > > > the (now defaultly on) DMA-by-default IDE option.
> > >
> > > Sound and IDE work together on my MVP3 board. Maybe your hardware is
> > > just broken.
> >
> > Or maybe sound driver is doing some funny things (?).
>
> sb: ESS ES1869 Plug and Play AudioDrive detected
> sb: ISAPnP reports 'ESS ES1869 Plug and Play AudioDrive' at i/o 0x220, irq 10, dma 1, 3
> SB 3.01 detected OK (220)
> ESS chip ES1869 detected
> <ESS ES1869 AudioDrive (rev 11) (3.01)> at 0x220 irq 10 dma 1,3
> sb: 1 Soundblaster PnP card(s) found.
>
> ...worked just fine in the past. Oh and under 2.6.0-test I was using ALSA.

I did few more experiments, and one strange thing is that /proc/dma does not
change when turning using_dma on thru hdparm:

1: SoundBlaster8
4: cascade

I'd expect some entry for ide to appear or so. Or is this normal?

When I'm playing something thru the soundcard and turn using_dma in the middle
of the playback, it freezes the first time it tries to do any disk i/o, it
seems.

In case it matters, here is /proc/ide/via :

----------VIA BusMastering IDE Configuration----------------
Driver Version: 3.37
South Bridge: VIA vt82c686a
Revision: ISA 0x1b IDE 0x6
Highest DMA rate: UDMA66
BM-DMA base: 0xd000
PCI clock: 33.3MHz
Master Read Cycle IRDY: 1ws
Master Write Cycle IRDY: 1ws
BM IDE Status Register Read Retry: yes
Max DRDY Pulse Width: No limit
-----------------------Primary IDE-------Secondary IDE------
Read DMA FIFO flush: yes yes
End Sector FIFO flush: no no
Prefetch Buffer: no no
Post Write Buffer: no no
Enabled: yes yes
Simplex only: no no
Cable Type: 40w 40w
-------------------drive0----drive1----drive2----drive3-----
Transfer Mode: PIO PIO PIO PIO
Address Setup: 30ns 120ns 120ns 30ns
Cmd Active: 90ns 90ns 90ns 90ns
Cmd Recovery: 30ns 30ns 30ns 30ns
Data Active: 90ns 330ns 330ns 90ns
Data Recovery: 30ns 270ns 270ns 30ns
Cycle Time: 120ns 600ns 600ns 120ns
Transfer Rate: 16.6MB/s 3.3MB/s 3.3MB/s 16.6MB/s

Settings are:

root@machine:~# cat /proc/ide/ide0/hda/settings
name value min max mode
---- ----- --- --- ----
acoustic 0 0 254 rw
address 0 0 2 rw
bios_cyl 79780 0 65535 rw
bios_head 16 0 255 rw
bios_sect 63 0 63 rw
breada_readahead 8 0 255 rw
bswap 0 0 1 r
current_speed 66 0 70 rw
failures 0 0 65535 rw
file_readahead 124 0 16384 rw
init_speed 12 0 70 rw
io_32bit 1 0 3 rw
keepsettings 0 0 1 rw
lun 0 0 7 rw
max_failures 1 0 65535 rw
max_kb_per_request 128 1 255 rw
multcount 16 0 16 rw
nice1 1 0 1 rw
nowerr 0 0 1 rw
number 0 0 3 rw
pio_mode write-only 0 255 w
slow 0 0 1 rw
unmaskirq 1 0 1 rw
using_dma 0 0 1 rw
wcache 0 0 1 rw

(before doing hdparm -d 1 /dev/hda)

(By the way, there are two 'capacity' entries in /proc/ide/ide*/hd*/.)

I tried to somehow disable the DMA usage in the sound driver or at least
convince it to use dma 3, but I didn't succeed - if I don't let isapnp do the
job, sb fails to reset dsp even if i manually insert the identical stuff that
isapnp autodetected :/ :

root@machine:~# insmod sb
Using /lib/modules/2.4.22/kernel/drivers/sound/sb.o
Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996
sb: ESS ES1869 Plug and Play AudioDrive detected
sb: ISAPnP reports 'ESS ES1869 Plug and Play AudioDrive' at i/o 0x220, irq 10, dma 1, 3
SB 3.01 detected OK (220)
ESS chip ES1869 detected
<ESS ES1869 AudioDrive (rev 11) (3.01)> at 0x220 irq 10 dma 1,3
sb: 1 Soundblaster PnP card(s) found.

root@machine:~# rmmod sb
root@machine:~# insmod sb isapnp=0 io=0x220 irq=10 dma=1
Using /lib/modules/2.4.22/kernel/drivers/sound/sb.o
Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996
sb: dsp reset failed.
/lib/modules/2.4.22/kernel/drivers/sound/sb.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters

root@machine:~# insmod sb isapnp=0 io=0x220 irq=10 dma=1,3
Using /lib/modules/2.4.22/kernel/drivers/sound/sb.o
/lib/modules/2.4.22/kernel/drivers/sound/sb.o: too many values for dma (max 1)

Regards,

--

Petr "Pasky" Baudis
.
Perfection is reached, not when there is no longer anything to add, but when
there is no longer anything to take away.
-- Antoine de Saint-Exupery
.
Stuff: http://pasky.ji.cz/

2003-08-31 21:22:14

by Alan

[permalink] [raw]
Subject: Re: Re: Re: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

On Sul, 2003-08-31 at 21:06, Petr Baudis wrote:
> I did few more experiments, and one strange thing is that /proc/dma does not
> change when turning using_dma on thru hdparm:

IDE DMA is PCI not ISA. It appears your mainboard is dying when both ISA
and PCI DMA occur together. If so you'd want to drop the ESS audiodrive
into PIO mode assuming ALSA supports it (OSS doesnt although I've got
the docs if you care that much).

Can you do another test here - write to a floppy disk while doing IDE
DMA and see if it also hangs.

> (By the way, there are two 'capacity' entries in /proc/ide/ide*/hd*/.)

Curious 8)


2003-08-31 21:51:15

by Petr Baudis

[permalink] [raw]
Subject: Re: Re: Re: Re: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

Dear diary, on Sun, Aug 31, 2003 at 11:21:13PM CEST, I got a letter,
where Alan Cox <[email protected]> told me, that...
> On Sul, 2003-08-31 at 21:06, Petr Baudis wrote:
> > I did few more experiments, and one strange thing is that /proc/dma does not
> > change when turning using_dma on thru hdparm:
>
> IDE DMA is PCI not ISA. It appears your mainboard is dying when both ISA
> and PCI DMA occur together. If so you'd want to drop the ESS audiodrive
> into PIO mode assuming ALSA supports it (OSS doesnt although I've got
> the docs if you care that much).

I don't ;-) - I lived w/o IDE DMA until now so I guess I'll survive for another
while. Thanks for the help, though. I will try again with ALSA+PIO later in the
2.6.0-test stage, when the other aspects (fb and usb) will more-or-less be
usable for me for daily use.

> Can you do another test here - write to a floppy disk while doing IDE
> DMA and see if it also hangs.

It works fine (aside of the ancient floppy disk grifting terribly).

--

Petr "Pasky" Baudis
.
Perfection is reached, not when there is no longer anything to add, but when
there is no longer anything to take away.
-- Antoine de Saint-Exupery
.
Stuff: http://pasky.ji.cz/

2003-08-31 23:39:59

by Mikulas Patocka

[permalink] [raw]
Subject: Re: Re: Re: IDE DMA breakage w/ 2.4.21+ and 2.6.0-test4(-mm4)

> I did few more experiments, and one strange thing is that /proc/dma does not
> change when turning using_dma on thru hdparm:
>
> 1: SoundBlaster8
> 4: cascade
>
> I'd expect some entry for ide to appear or so. Or is this normal?

/proc/dma lists isa dma devices.
pci busmaster dma that is used by ide controllers has nothing to do with
it. It's totally different technology and it's reported in /proc/pci (look
for "Master Capable").

Mikulas