All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: How to disable DMA for compact-flash disk?
Date: Fri, 14 Aug 2009 13:49:19 -0700	[thread overview]
Message-ID: <4A85CDCF.3060802@candelatech.com> (raw)
In-Reply-To: <20090811201206.14556624@lxorguk.ukuu.org.uk>

On 08/11/2009 12:12 PM, Alan Cox wrote:
> On Tue, 11 Aug 2009 11:51:18 -0700
> Ben Greear<greearb@candelatech.com>  wrote:
>
>> I'm trying to use Fedora 11 with default kernel on an old via system
>> that boots from compact flash.  DMA is not supported on the CF for
>> whatever reason, and in previous kernels, I've always disabled
>> DMA, first with ide=nodma, and then later with
>> ide_core.nodma=0.0 ide_core.nodma=0.1 ...
>
> Fedora switched to libata some releases ago so
>
> libata.dma=n
>
> 0 - off
> 1 - disk only
>
> + 2 disk/CD
> + 4 disk/CD/CFA
>
> (so you can turn DMA off just for CFA devices providing they admit they
> are CFA)


This worked fine, but now I'm having some more issues.  Using libata is 1/2
as fast as using IDE mode.  I *think* the problem might be that libsata
may not be using 32-bit PIO mode, but I'm not certain of that.  It seems
that ide mode uses PIO2 v/s PIO4 for libsata too.

I'm going to try configuring a .31 kernel with ide instead of libsata.
In case it helps anyone, here are more more details:


On Fedora 8, using a 2.6.29-6 kernel compiled for ide instead of libata,
I get about 6MB/s read (according to hdparm -t).

[root@lanforge-D0-20 lanforge]# hdparm -tT /dev/hdb1

/dev/hdb1:
  Timing cached reads:   460 MB in  2.00 seconds = 230.00 MB/sec
  Timing buffered disk reads:   18 MB in  3.24 seconds =   5.56 MB/sec
[root@lanforge-D0-20 lanforge]# hdparm -tT /dev/hdb1

/dev/hdb1:
  Timing cached reads:   460 MB in  2.00 seconds = 229.78 MB/sec
  Timing buffered disk reads:   18 MB in  3.23 seconds =   5.57 MB/sec

dmesg output:
Uniform Multi-Platform E-IDE driver
via82cxxx 0000:00:0f.1: VIA vt8237 (rev 00) IDE UDMA133
via82cxxx 0000:00:0f.1: IDE controller (0x1106:0x0571 rev 0x06)
via82cxxx 0000:00:0f.1: not 100% native mode: will probe irqs later
ide: disallowing DMA for hda
ide: disallowing DMA for hdb
     ide0: BM-DMA at 0xe900-0xe907
     ide1: BM-DMA at 0xe908-0xe90f
Probing IDE interface ide0...
hdb: Ridata CF, CFA DISK drive
hdb: host max PIO5 wanted PIO255(auto-tune) selected PIO2
hdb: host max PIO5 wanted PIO255(auto-tune) selected PIO2
Probing IDE interface ide1...
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
ide-gd driver 1.18
hdb: max request size: 128KiB
hdb: 15662304 sectors (8019 MB) w/1KiB Cache, CHS=15538/16/63
  hdb: hdb1


[root@lanforge-D0-20 lanforge]# hdparm /dev/hdb1

/dev/hdb1:
  multcount     =  0 (off)
  IO_support    =  1 (32-bit)
  unmaskirq     =  1 (on)
  using_dma     =  0 (off)
  keepsettings  =  0 (off)
  readonly      =  0 (off)
  readahead     = 256 (on)
  geometry      = 15538/16/63, sectors = 3887667, start = 63



On F11, using a kernel compiled for libata, I'm getting about 1/2 that
speed.  I get similar results for a 2.6.31-rc5 kernel and the official
F11 2.6.29-6-ish kernel.  I also get similar results on FC8 with the
default FC8 2.6.26 kernel (using libsata).


Gscsi0 : pata_via
scsi1 : pata_via
ata1: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0xe900 irq 14
ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xe908 irq 15
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2
ata1.01: CFA: Ridata CF, 20080820, max UDMA/133
ata1.01: 15662304 sectors, multi 0: LBA
ata1.01: limited to UDMA/33 due to 40-wire cable
ata1.01: configured for PIO4
scsi 0:0:1:0: Direct-Access     ATA      Ridata CF        2008 PQ: 0 ANSI: 5
sd 0:0:1:0: [sda] 15662304 512-byte hardware sectors: (8.01 GB/7.46 GiB)
sd 0:0:1:0: [sda] Write Protect is off
sd 0:0:1:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:1:0: [sda] 15662304 512-byte hardware sectors: (8.01 GB/7.46 GiB)
sd 0:0:1:0: [sda] Write Protect is off
sd 0:0:1:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
  sda: sda1
sd 0:0:1:0: [sda] Attached SCSI disk
sd 0:0:1:0: Attached scsi generic sg0 type 0


[root@lanforge-D0-20 ~]# hdparm /dev/sda1

/dev/sda1:
  IO_support    =  0 (default)
  readonly      =  0 (off)
  readahead     = 256 (on)
  geometry      = 974/255/63, sectors = 14336000, start = 63


[root@lanforge-D0-20 ~]# hdparm -Tt /dev/sda1

/dev/sda1:
  Timing cached reads:   280 MB in  2.00 seconds = 139.98 MB/sec
  Timing buffered disk reads:   10 MB in  3.69 seconds =   2.71 MB/sec


Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2009-08-14 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 18:51 How to disable DMA for compact-flash disk? Ben Greear
2009-08-11 19:12 ` Alan Cox
2009-08-14 20:49   ` Ben Greear [this message]
2009-08-14 21:10     ` Alan Cox
2009-08-14 21:18       ` Ben Greear
2009-08-14 21:32         ` Alan Cox
2009-08-14 21:37           ` Ben Greear
2009-08-14 21:51           ` Ben Greear
2009-08-11 20:24 ` Krzysztof Halasa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A85CDCF.3060802@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.