# cannot turn on dma (hd)

## t0bi

hi

i cannot turn on the dma for my hd,

if i try

```
hdparm -d 1 /dev/hda
```

it says

```

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Opertion not permitted

 using_dma = 0 (off)

```

even though dma is supported by the hd, the kernel supports it:

```
 cat /usr/src/linux/.config | grep DMA

CONFIG_ZONE_DMA32=y

CONFIG_GENERIC_ISA_DMA=y

CONFIG_ISA_DMA_API=y

CONFIG_BLK_DEV_IDEDMA_PCI=y

# CONFIG_BLK_DEV_IDEDMA_FORCED is not set

CONFIG_IDEDMA_PCI_AUTO=y

# CONFIG_IDEDMA_ONLYDISK is not set

CONFIG_BLK_DEV_IDEDMA=y

# CONFIG_IDEDMA_IVB is not set

CONFIG_IDEDMA_AUTO=y

# CONFIG_PDC_ADMA is not set

# CONFIG_PATA_OPTIDMA is not set

# CONFIG_CARDMAN_4000 is not set

# CONFIG_CARDMAN_4040 is not set

# DMA Engine support

CONFIG_DMA_ENGINE=y

# DMA Clients

CONFIG_NET_DMA=y

# DMA Devices

CONFIG_INTEL_IOATDMA=m

```

i can turn on dma using the gentoo live-cd, but when i

reboot,  dma is set off again!

thanks,

toby

----------

## djay

 *t0bi wrote:*   

> hi
> 
> i cannot turn on the dma for my hd,
> 
> if i try
> ...

 

Hi toby

To enable DMA you have to include your motherboard chipset support into kernel. If you can't find what it is, post the output of 

```
lspci
```

 and we'll help you find out.

Hope it helps.

----------

## erik258

hi, i have this same problem on an old laptop of mine; problem is, doesn't look like it has pci ide controller. ..

 *Quote:*   

> 0000:00:00.0 Host bridge: Toshiba America Info Systems 601 (rev 26)
> 
> 0000:00:02.0 CardBus bridge: Toshiba America Info Systems ToPIC95 (rev 07)
> 
> 0000:00:02.1 CardBus bridge: Toshiba America Info Systems ToPIC95 (rev 07)
> ...

 

I think my problem may not be correct kernel drivers (like toby!) but I don't know where to see what ISA (?) devices i have...

----------

## djay

 *erik258 wrote:*   

> hi, i have this same problem on an old laptop of mine; problem is, doesn't look like it has pci ide controller. ..
> 
>  *Quote:*   0000:00:00.0 Host bridge: Toshiba America Info Systems 601 (rev 26)
> 
> 0000:00:02.0 CardBus bridge: Toshiba America Info Systems ToPIC95 (rev 07)
> ...

 

OK, is that all your 'lspci' ? interesting

I'd say that one of the first 3 devices (I bet its 0000:00:00.0 Host bridge: Toshiba America Info Systems 601 ) is holding all whats needed to IDE operation.

Which laptop is it? You could probably find the model online and this way find the chipset.

----------

## erik258

unfortunately my ancient Toshiba Tecra 520CDT is not exactly a common laptop ; ( especially not anymore, as it's a Pentium-MMX 166.  

Too bad, Toshiba's webpage usually offers grand support but it looks like even they dont' know what's inside as far as ide ; )

It also looks like it's using Uniform IDE driver .. that's almost certainly the source of the lack of DMA support ... as soon as this 2-hour emerge sync gets done i'm gonna investigate the kernel configuration.

----------

## t0bi

thanks,

the output of lspci is

```
00:00.0 Host bridge: Silicon Integrated Systems [SiS] 760/M760 Host (rev 03)

00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SG86C202

00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS963 [MuTIOL Media IO] (rev 25)

00:02.1 SMBus: Silicon Integrated Systems [SiS] SiS961/2 SMBus Controller

00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE]

00:02.6 Modem: Silicon Integrated Systems [SiS] AC'97 Modem Controller (rev a0)

00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] AC'97 Sound Controller (rev a0)

00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)

00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f)

00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller

00:04.0 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)

00:06.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)

00:09.0 CardBus bridge: O2 Micro, Inc. OZ711M1/MC1 4-in-1 MemoryCardBus Controller (rev 20)

00:09.1 CardBus bridge: O2 Micro, Inc. OZ711M1/MC1 4-in-1 MemoryCardBus Controller (rev 20)

00:09.2 System peripheral: O2 Micro, Inc. OZ711Mx 4-in-1 MemoryCardBus Accelerator

00:0b.0 Network controller: RaLink RT2500 802.11g Cardbus/mini-PCI (rev 01)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:00.0 VGA compatible controller: Silicon Integrated Systems [SiS] 661/741/760/761 PCI/AGP VGA Display Adapter

```

i think the 

00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SG86C202

is my chipset, but i cannot find it in the kernel-config tool..?

thanks

----------

## erik258

 *Toby wrote:*   

> 
> 
> i think the
> 
> 00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SG86C202
> ...

 

Nope.  That one's your PCI bridge

This one is the ide controller:

 *lspci wrote:*   

> 00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] 

 

kernel config-tool? are you using genkernel ?

this is what i would do, i am not using genkernel and configure my kernel with menuconfig:

```
cd /usr/src/linux

make menuconfig
```

Device Drivers --->ATA/ATAPI/MFM/RLL support  --->SiS5513 chipset support

you'll also need  Generic PCI bus-master DMA support, in the same section and if not enabled at the very bottom.

----------

## djay

 *erik258 wrote:*   

> 
> 
> Nope.  That one's your PCI bridge
> 
> This one is the ide controller:
> ...

 

I couldn't say better myself, thanks erik.

----------

## djay

 *erik258 wrote:*   

> unfortunately my ancient Toshiba Tecra 520CDT is not exactly a common laptop ; ( especially not anymore, as it's a Pentium-MMX 166.  
> 
> Too bad, Toshiba's webpage usually offers grand support but it looks like even they dont' know what's inside as far as ide ; )
> 
> It also looks like it's using Uniform IDE driver .. that's almost certainly the source of the lack of DMA support ... as soon as this 2-hour emerge sync gets done i'm gonna investigate the kernel configuration.

 

Hi erik, one more thing. After checking the laptop components, I am totally not sure that HD supports DMA mode. I'd bet it supports PIO (which is older technology, used before DMA).

I also don't think that on a such small drives it will do any difference at all.

Just MHO.

----------

## t0bi

thanks!! it worked!!

----------

## erik258

it took soooo long to compile that kernel.  pretty much all day.

Well, it doesn't really seem any faster, and i also broke X/fbdev support which now locks up the pc ; (

As soon as I get X working, i can really say for sure what a difference it made, since command line stuff isn't terribly taxing on the system.  But it's kind of a back burner issue.

----------

## djay

 *erik258 wrote:*   

> it took soooo long to compile that kernel.  pretty much all day.
> 
> Well, it doesn't really seem any faster, and i also broke X/fbdev support which now locks up the pc ; (
> 
> As soon as I get X working, i can really say for sure what a difference it made, since command line stuff isn't terribly taxing on the system.  But it's kind of a back burner issue.

 

To tell you the truth - I wouldn't even bother.

Such a laptop doesn't even have what it takes to run X. So, running CLI only, you'd be fine even without DMA, because even if it can be turned on, your other components are too slow to see the difference.

I'd probably use such a laptop for text only  :Smile:  but that just me.

Have fun.

----------

## bollucks

Yes but there is no _disadvantage_ to running with DMA since it reduces dramatically the cpu used to do any file transfers.

----------

## djay

 *bollucks wrote:*   

> Yes but there is no _disadvantage_ to running with DMA since it reduces dramatically the cpu used to do any file transfers.

 

Really? I'd like to know what kind of load can  dramatically  be reduced on Pentium 166 machine and on which file transfers with 2G hard drive  :Smile: 

Come on, don't throw buzzwords around just for the kicks of it. It does no good.

If you do think it will give a gain, show how.

In any case, Gentoo is fun even on older machines.

----------

## erik258

X actually runs OK on this machine.  It ran really well with the Chips hardware accellerated X, but I never got it to go more than 640x480.  I eventually got it at 600x800 and recently 32 bpp, but framebuffer is a lot slower.  Of course, i wasn't foolish enough to try gnome or kde - they'd flop for sure.  It only has 96 megs of ram.  But as I am sure many of you noticed yourselves, gentoo with a minimal X environment and no uncecessary services will run with only 30-70 megs of ram used, or less.  Linux caches memory agressively but can stretch it a long way when it comes down to it.  

It also runs xterm and all the 'old' x programs just fine.  It doesn't do so well with firefox.  It definitely runs faster on G wifi with X forwarding firefox than it does running its own firefox.

for what it's worth, i do think DMA would substantially increase the percieved performance, especially when starting programs and running firefox (which pushes this little system over the top and forces some memory to be swapped out).

However, I have my doubts as to whether it's supported.  I don't think it is, actually; i haven't yet been able to enable it.  

What it's really bad at (compiling and emerge, especially syncs) unfortunately has little to do with DMA.  Surely, i have gotten more from this hardware than I ever thought possible.   I want to speak for the ability of old computers to run X (not kde/gnome or friends, but xwm or pwm do fine).

----------

## bollucks

 *djay wrote:*   

>  *bollucks wrote:*   Yes but there is no _disadvantage_ to running with DMA since it reduces dramatically the cpu used to do any file transfers. 
> 
> Really? I'd like to know what kind of load can  dramatically  be reduced on Pentium 166 machine and on which file transfers with 2G hard drive 
> 
> Come on, don't throw buzzwords around just for the kicks of it. It does no good.
> ...

 

What an interesting comment... You obviously know everything so I'm going to run away scared.

----------

## erik258

don't run away, i know nothing.  but...

 *Quote:*   

> Yes but there is no _disadvantage_ to running with DMA since it reduces dramatically the cpu used to do any file transfers.

 

not if you can't run with it it doesn't ; )  btw, where's the catch phrase there?  the  it reduces dramatically the cpu used to do any file transfers: no, that isn't very buzzwordy.   there is no _disadvantage_ to running with DMA: again, i'm not seeing a buzz word.  I guess you could count DMA or cpu ... 

for what it's worth:

pio does indeed work.  at least, in write-only mode.

```
lappy pnp # cat /proc/ide/hda/settings | grep pio

pio_mode                write-only      0               255             w
```

dma is disabled but /proc/ide/hda/settings thinks it's possible...

```
lappy dan # cat /proc/ide/hda/settings | grep dma

using_dma               0               0               1               rw
```

..but 

```
lappy dan # hdparm -d1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

And if you didn't notice 

lappy pnp # lspci

```
0000:00:00.0 Host bridge: Toshiba America Info Systems 601 (rev 26)

0000:00:02.0 CardBus bridge: Toshiba America Info Systems ToPIC95 (rev 07)

0000:00:02.1 CardBus bridge: Toshiba America Info Systems ToPIC95 (rev 07)

0000:00:04.0 VGA compatible controller: Chips and Technologies F65555 HiQVPro (rev c3)

0000:00:0b.0 USB Controller: NEC Corporation USB (rev 01)

0000:01:00.0 Ethernet controller: Unknown device 168c:0013 (rev 01)
```

there isn't a pci ide device there.  must be isa... too bad i have no idea how to set up isa ; (.  In my experience, either it works or it doesn't.  However, you'll notice no modem there (works fine, surprisingly; may be a hardware modem) so I know there's some stuff there that isn't showing.  Also ...

```

pascal dan # lspci | grep ISA; uname -a

00:01.0 ISA bridge: nVidia Corporation CK804 ISA Bridge (rev a3)

Linux pascal 2.6.18-gentoo-r3 #1 PREEMPT Mon Dec 4 10:50:57 CST 2006 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux
```

...shown here is the ISA bridge that is still around, even in this, an amd64 box that's way beyond legacy hardware and doesn't even have isa slots.  

so i don't really know where to start looking, let alone how.  

in conclusion i agree with bollucks, kind of, but djay also,  on the point that a pentium-mmx 166 is [/i]never [i] going to be dramatically fast, even compared to itself ; )

I don't really have any expectations that I can get this working; mostly, i am just curious as to WTF is up with this neat old computer ; )  BTW, i have some emotional attachment too, since it was my first hand-configured no help from anyone gentoo box.  Oh yeah, and no one gives me (too many) dirty looks when I walk into an internet cafe, unlike what would happen if i trudged in with a PC and monitor, went back outside, and then returned with handfuls of cables...

----------

## djay

 *bollucks wrote:*   

>  What an interesting comment... You obviously know everything so I'm going to run away scared. 

 

I hardly know everything, just some. But if you want to run away just because someone said something (even if you think its wrong), I won't stop you. If you'd like to stay - please, but don't be sarcastic just because you think you're very smart and never mistaken and other people are all stupid.

We don't need battles in Gentoo, we try to help each other, remember?

 *erik258 wrote:*   

> don't run away, i know nothing.  but...
> 
> in conclusion i agree with bollucks, kind of, but djay also,  on the point that a pentium-mmx 166 is never  going to be dramatically fast, even compared to itself ; ) 

 

Thanks eric, that's exactly what I meant.

----------

## erik258

well, i finally got this old workhorse back up and running with X @ 32-bit color (I am very pleased by this) and 800x600, which takes up the (gasp) whole screen.  yay!

this thing's slow as hell.  ; ) i forgot how slow it is, using my amd64s, pentium 3/4s, and even 2s back home with good distributed compiling.  

i am going to try out some speed enhancements now.  fyi, if anybody's got DMA ideas, i do really think that would improve things, but i don't really know where to start...

----------

## djay

 *erik258 wrote:*   

> well, i finally got this old workhorse back up and running with X @ 32-bit color (I am very pleased by this) and 800x600, which takes up the (gasp) whole screen.  yay!
> 
> this thing's slow as hell.  ; ) i forgot how slow it is, using my amd64s, pentium 3/4s, and even 2s back home with good distributed compiling.  
> 
> i am going to try out some speed enhancements now.  fyi, if anybody's got DMA ideas, i do really think that would improve things, but i don't really know where to start...

 

Hi erik

Considering the hardware, I really doubt you have DMA at all. But I bet you have PIO.

IIRC, hdparm -I <your hd>, I think you will the all the modes hardware supports (or at least as driver and HD report it).

----------

## djay

 *erik258 wrote:*   

> well, i finally got this old workhorse back up and running with X @ 32-bit color (I am very pleased by this) and 800x600, which takes up the (gasp) whole screen.  yay!
> 
> 

 

BTW, which wm you have installed?

----------

## erik258

I run pwm on all my boxes.  it's really old and supposedly out of date, but works fine for me.  

i had to hack the source for amd64 to get it to compile, but it seems to be running ok even there for the most part.  

 screenshot on a nice box, w/ fractal in backround  the screen, looks nice i think.  right now it's taking up about 13 k of memory on my desktop.  it's the smallest acceptable wm i could find ... that's 5k less than twm ; )

----------

## djay

 *erik258 wrote:*   

> I run pwm on all my boxes.  it's really old and supposedly out of date, but works fine for me.  
> 
> i had to hack the source for amd64 to get it to compile, but it seems to be running ok even there for the most part.  
> 
>  screenshot on a nice box, w/ fractal in backround  the screen, looks nice i think.  right now it's taking up about 13 k of memory on my desktop.  it's the smallest acceptable wm i could find ... that's 5k less than twm ; )

 

Hey, thats amazing what limited hardware requires you to do in order to speed up things, right? brings me back to a happy hackish DOS days with 286 and 1MB memory  :Smile: 

Happy nostalgic memories...   :Wink: 

----------

## erik258

i wasn't old enough ( / rich enough?) to partake in any 16 bit computing when it was the standard ; (

but I have never seen anyone with a laptop as old as mine at an internet cafe, let alone using wifi ; )  i don't think it's possible under windows ; it ran 98 ok when it was given to me but I doubt my atheros wireless would have worked.  

that's why gentoo rocks.  it is i think the only distro that would ever enable me to do this.

----------

## djay

 *erik258 wrote:*   

> i wasn't old enough ( / rich enough?) to partake in any 16 bit computing when it was the standard ; (
> 
> but I have never seen anyone with a laptop as old as mine at an internet cafe, let alone using wifi ; )  i don't think it's possible under windows ; it ran 98 ok when it was given to me but I doubt my atheros wireless would have worked.  
> 
> that's why gentoo rocks.  it is i think the only distro that would ever enable me to do this.

 

First, I'm not that old, just started early (my dad brought a "computer" with 16k memory which connected to TV and magnetic tape) at age of 9, so I can say I hacked some of this stuff when I was young.

Regarding wireless - I have a much better laptop but wireless eats its juices in 40 minutes, and sorta negating the point of wireless in the first place. I guess not developed tech from few years ago  :Smile: 

And lastly, regarding Gentoo - yea, I've seen what linux in general can do with an old hardware, and Gentoo is just the most convenient for configuring stuff.

I want to see someone remove junk from, say, Fedora  :Smile:  in Gentoo you just don't install it in the first place.

----------

## erik258

i wish very much that my laptop had a still working battery.  

unfortunately it doesn't, but at least i don't drain it in a couple minutes using wifi.  it is kind of a funny thing - you don't need a cord to the network, but you do need one to the power, even though that we made 'wireless' so long ago...

----------

## erik258

huzzah!  I got the Chips and Technologies graphics driver for X working!!!  This increases my graphics performance many times over.  

I am trying to brute-force my way through kernel config for hard drive.

----------

## djay

 *erik258 wrote:*   

> huzzah!  I got the Chips and Technologies graphics driver for X working!!!  This increases my graphics performance many times over.  
> 
> I am trying to brute-force my way through kernel config for hard drive.

 

Hi erik,

You'll show all this to toshiba people, and will be like "ha? it was not intended to be used like that, man."  :Smile: 

----------

