# PCMCIA IDE - Dog Slow

## regomodo

I'm accessing my CF card through the aforementioned interface. However, despite having a very high-speed sandisk, it only transfers at ~1.5MB and whilst doing so grinds the whole system to a halt. 

This occurs on every kernel version i've ever used up to 2.6.28.4. What could be wrong?

----------

## pappy_mcfae

If you have windoze installed, how fast is the throughput with it? Faster? If so, then it's most likely a kernel misconfiguration. If not, then it's a limitation with the device.

Blessed be!

Pappy

----------

## regomodo

I don't have windows installed but I think I may have not explained the issue quite correct. When transferring to/from the CF card, the system becomes very laggy. CPU usage isn't maxed out but all responses to user inputs are very bad.

A kernel misconfiguration? I've had the same issue in Ubuntu 8.10 a month ago on the same device (I wiped it after a week of frustrating use).

----------

## pappy_mcfae

Yes, kernel misconfiguration. While I'm sure Ubuntu turns on everything but the kitchen sink when it comes to kernel settings, it is possible your device isn't tweaked properly. 

If you'd like to see if it is a kernel misconfiguration, post your kernel .config, the results of lspci -n and cat /proc/cpuinfo as well as your /etc/fstab file, and I'll take a look. Make sure you do the lspci -n with the device in question installed and as close to running as you can get it.

If tweaking the kernel doesn't do the trick, you might want to see how said device runs on a friend's windoze machine.

Blessed be!

Pappy

----------

## eccerr0r

I've noticed some of the IDE-CF adaptors do not implement DMA and the CF disks end up using PIO which is very slow.  See if DMA is enabled or not?

Then again, if you're using it through 16-bit PCMCIA, ISA-DMA is nothing to write home about, and might well be as slow as PIO...

----------

## regomodo

.config file --> http://pastebin.com/f49cc0124

/proc/cpuinfo --> http://pastebin.com/f1071a602

lspci -n --> http://pastebin.com/f6ada676c

fstab --> http://pastebin.com/f7d8b1231

I'll have to check up on DMA with this interface.

----------

## regomodo

```
genpad ~ # hdparm -Q /dev/sda1

/dev/sda1:

/sys/block/sda/sda1/device/queue_depth: No such file or directory
```

----------

## pappy_mcfae

regomodo,

I begin by saying this is my first CF configuration attempt. If my assumptions about your setup are correct, the CF should run faster. If it doesn't work at all, then it is a 16 bit device, and you really shouldn't expect much more out of it than you're presently getting. If it is a 32 bit device, then it should run in 32 bit mode, which would be faster. If it's a 16 bit device, I don't think it will run at all with this .config. It's troubleshooting the not-so-easy way.

That said, I would expect you'll notice that the .config I set up for you will run your system a little faster than the old one. I started with a kernel seed, so you may have to do a little tweaking. We can cross that bridge when we get there.

Click here for your new .config. Compile as is.

For the best results, please do the following:

1) Move your .config file out of your kernel source directory (/usr/src/linux-  ).

2) Issue the command make mrproper. This is a destructive step. It returns the source to pristine condition. Unmoved .config files will be deleted!

3) Copy my .config into your source directory.

4) Issue the command make && make modules_install.

5) Install the kernel as you normally would, and reboot.

6) Once it boots, please post /var/log/dmesg so I can see how things loaded.

Blessed be!

Pappy

----------

## eccerr0r

I don't think any CF cards today support NCQ/TCQ yet, so queue depth will always be 0.  "hdparm -iv" the disk and see if DMA is enabled.

So this is in a true PCMCIA slot, with a CF-PCMCIA adapter?  Or is it an IDE port with an IDE-CF/PCMCIA adaptor?  Both methods tend to use "IDE" protocols but the latter can be booted but does not support hotplug.

----------

## regomodo

Hi guys. Cheers for the input. I'll have to give the .config file later and get back to you. Can't atm.

Just so you know what i'm playing with link

----------

## pappy_mcfae

It's up for a month. If your run out of time, I still have the original. I keep a copy of every kernel I've worked on.

Blessed be!

Pappy

----------

## regomodo

Thanks again for the input. Unfortunately, things are worse now. There is no cf-pcmcia adapter present, no relevant module in lsmod and no pcmcia module present in modprobe -l | grep pcmcia. Additionally there is no userspace cpu-scaling module so my cpu is maxed to 1.6Ghz and unnecessarily warm. 

There's a few things i'm not too certain I need (kernel-automounter support) so i'm going to diff the old and new .configs and have a ponder. Cheers all the same.

DMESG

lsmod

```

Module                  Size  Used by

snd_pcm_oss            36768  0 

snd_mixer_oss          14016  1 snd_pcm_oss

snd_seq_oss            28800  0 

snd_seq_midi_event      6208  1 snd_seq_oss

snd_seq                46096  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          6220  2 snd_seq_oss,snd_seq

snd_intel8x0           28508  1 

snd_intel8x0m          13516  0 

snd_ac97_codec         94688  2 snd_intel8x0,snd_intel8x0m

ac97_bus                1472  1 snd_ac97_codec

snd_pcm                67592  4 snd_pcm_oss,snd_intel8x0,snd_intel8x0m,snd_ac97_codec

ipw2100                66480  0 

snd_timer              19588  2 snd_seq,snd_pcm

snd_page_alloc          7176  3 snd_intel8x0,snd_intel8x0m,snd_pcm

e1000                 117952  0 

ieee80211              27272  1 ipw2100

ieee80211_crypt         4608  1 ieee80211
```

----------

## pappy_mcfae

Good. then we know that the device in question is a sixteen bit device, and it won't work with the 32 bit yenta driver. Also, I built the devices into the kernel. There is no need to modprobe.

So, more or less, barring anyone who knows better, I'm pretty sure the speed you're getting is the speed you're going to get. Turn the 16 bit PCMCIA driver back on, and you should come back to functionality.

Blessed be!

Pappy

----------

## regomodo

Yeah. When I went back through menuconfig I noticed 16-bit wasn't enabled. Built it back in and the card reappears. Damn.

Cheers for the help. At least now I know.

----------

## pappy_mcfae

Yeah. Sorry I don't have better news.

Blessed be!

Pappy

----------

## eccerr0r

I kind of figure DMA should still be enabled, is DMA enabled on the flash drive?  Again, if the cf-pcmcia adaptor doesn't wire all the pins, DMA may be impossible.

Also some CF cards do not support DMA, but I figure most "fast" card should.

Pretty much all PIO over PCMCIA (16-bit) really bog down even the fastest computers.  I have a Interrupt-PIO PCMCIA adaptor that does exactly the same thing, not much can be done.

I've not tested all my PCMCIA/CF disks and cf-cards to see if any support DMA or not, I thought they should be able to do some sort of io optimization over pcmcia so they'd work a bit faster without bogging the machine as with PIO would do.  I wonder if unmasking interrupts would work...

If you need speed, perhaps getting a USB-CF reader would be good.  I find those to be fairly quick and does not bog down the machine.

----------

