linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Martynov <andrei.martynov@web.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-ide@vger.kernel.org
Subject: Re[2]: porting IDE patches to PATA driver
Date: Fri, 26 Jun 2009 16:40:52 +0200	[thread overview]
Message-ID: <792909512.20090626164052@web.de> (raw)
In-Reply-To: <20090626144639.4bc822b8@lxorguk.ukuu.org.uk>

Hello Alan,

Friday, June 26, 2009, 3:46:39 PM, you wrote:

> The bmdma_start shouldn't be needed. Libata knows about using the cache
> coherency dma interfaces and uses them.

Correct, libata does call corresponding interface and the functions
are defined for the cpu. But this architecture is buggy. It is
necessary to clean (write back) complete cache before DMA write
operation even if the corresponding range is already cleaned,
otherwise few bytes in the written block are corrupted at random
offset. I've spent many days playing with dma interface and even
calculating md5sum of every written block before I had to accept this
fact.

> The bmdma end is no standard and polls the status up to 100 times until
> it gives a sensible looking answer. That may be needed but its hard to
> guess from just horrible code if that was someone's random debug hacks or
> a real chip erratum.

Chip is really weird. A group of enthusiasts implemented slave device
support for it. As I could understand from their explanation the
controller switches to a specific DVD-LOADER mode as soon as kernel
sends any command to the slave device, so they had to patch sources
and add a strange looking command

OUT_BYTE((head|drive->select.all) & ~(1<<4), IDE_SELECT_REG);

everywhere the slave device is accessed to cheat the controller and
let it believe it talks to the master. Slave device remains active
because it was already selected but the controller assumes we are
talking to the master and does not switch to DVD-LOADER mode.

> I notice the 2.4.17 patches you are referencing don't enable MWDMA either
> (#undef EBABLE_BMDMA) so does MWDMA actually work on the hardware ?

Here is a part of the boot log with 2.4.17 kernel. Speed is set to
0x22 (XFER_MW_DMA_2), that's why I assume it should work. I can limit
allowed modes to PIO-only in 2.6 kernel, the driver is working but it
is too slow.

Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
JASPER ide controller activated
ide0: BM-DMA at 0x500e00-0x500e0f, BIOS settings: hda:pio, hdb:pio
hda: IDE_SELECT Reg = 000000a0
hda: IDE_SIDETIM Reg = 00000000
hda: IDE_SELECT Reg = 000000a0
hda: IDE_SIDETIM Reg = 00000000
hda: 9929D05E59V1.500P3311077, ATAPI CD/DVD-ROM drive
IDE: waiting for drives to settle...
hdb: IDE_SELECT Reg = 000000b0
hdb: IDE_SIDETIM Reg = 00000000
hdb: SAMSUNG HD300LD, ATA DISK drive
ide0 at 0x500bf0-0x500bf7,0x500be6 on irq 11
hdb: ignore DMA off message.
model = SAMSUNG HD300LD
firmware version = WK100-12
jasper_config_drive_for_dma:
capability = 0x002f
field_valid = 0x0007
dma_ultra = 0x003f
dma_1word (s) = 0x0000
dma_mword (m) = 0x0407
autodma = 0x0001
jasper_tune_chipset: speed = 22
***** init_idedisk_capacity: set_max_ext=15647024, capacity_2=586070255
hdb: 586070255 sectors (300068 MB) w/8192KiB Cache, CHS=36481/255/63, (U)DMA
hda: ignore DMA off message.
model = 9929D05E59V1.500P3311077
firmware version =
jasper_config_drive_for_dma:
capability = 0x000b
field_valid = 0x0002
dma_ultra = 0x0000
dma_1word (s) = 0x0000
dma_mword (m) = 0x0407
autodma = 0x0001
jasper_tune_chipset: speed = 22
hda: ATAPI 32X DVD-ROM drive, 256kB Cache, DMA
Uniform CD-ROM driver Revision: 3.12
Partition check:
/dev/ide/host0/bus0/target1/lun0: p1 < p5 p6 >

-- 
Best regards,
 Andrei                            mailto:andrei.martynov@web.de


  reply	other threads:[~2009-06-26 14:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25  8:09 porting IDE patches to PATA driver Andrei Martynov
2009-06-25  8:23 ` Alan Cox
2009-06-25  8:38   ` Re[2]: " Andrei Martynov
2009-06-25  9:05     ` Alan Cox
2009-06-25 10:30       ` Re[2]: " Andrei Martynov
2009-06-25 11:29         ` Alan Cox
2009-06-26 13:24           ` Re[2]: " Andrei Martynov
2009-06-26 13:46             ` Alan Cox
2009-06-26 14:40               ` Andrei Martynov [this message]
2009-06-26 16:21                 ` Alan Cox
2009-06-28 20:33                   ` Sergei Shtylyov
2009-06-29 12:31                     ` Alan Cox
2009-06-29 12:01                   ` Re[2]: " Andrei Martynov
2009-06-29 14:53                     ` Alan Cox
2009-07-03  9:50                       ` Re[2]: " Andrei Martynov
2009-07-04  1:17                         ` Robert Hancock

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=792909512.20090626164052@web.de \
    --to=andrei.martynov@web.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-ide@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).