All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	David Miller <davem@davemloft.net>,
	linux-ide@vger.kernel.org, elendil@planet.nl
Subject: Re: [PATCH] Serialize CMD643 and CMD646 to fix a hardware bug with SSD
Date: Fri, 23 Oct 2009 21:27:38 +0400	[thread overview]
Message-ID: <4AE1E78A.2090801@ru.mvista.com> (raw)
In-Reply-To: <20091023175157.3a898525@lxorguk.ukuu.org.uk>

Hello.

Alan Cox wrote:

>>So, why was it serialized before? I assume that either someone noticed the 
>>corruption or someone read some datasheet noting the corruption or someone 
>>reverse engineered some other driver and saw the serialization.

> The data sheet has some things to say for the 643 abd 646

> In PIO mode it says you must check

> CFR bit 2   (indicates primary interrupt)
> ARTIM23 bit 4  (secondary interrupt)

> Both bits can be written 1 to clear the interrupt.

    Not in the original PCI0646 datasheet -- it says that reading the 
register clears the interrupt bit. PCI0646U datashett however started 
talking about writing one to clear the bit.

> The doc doesn't say
> anything about not touching status but it also uses the word "must" about
> the other bits so make what you will of it.

    I think they use must in the sense that if the driver *really* needs to 
know from which channel the interrupt has come. Since most of the chip don't 
provide that capability, the real world Linux drivers, both old and new, had 
to get along without such knowledge. The IDE driver does read and clear the 
interrupt bits now though, in both PIO abnd DMA modes.

> In DMA mode I would read the BMDMA status in preference to status but the
> doc doesn't specifically say to do so and simply say it works to the
> spec. it isn't clear if ARTIM23 and CFR work for reporting/clearing a DMA
> interrupt. You'd have to try it.

    Earlier the IDE driver did chec CFR/ARTTIM23 bits before the BMIDE 
status interrupt bit in dma_test_irq() method and that used to work.  Now it 
also does so, via the new test_irq() method.

> ARTIM23 may well need some locking care

    Locking WRT what? It's not shared between channels...

> The 646U2 adds the MRDMODE register so you can check the bits more sanely

    Yeah. The libata driver however doesn't make use of that register, 
unlike  cmd64x. It doesn't even touch the interrupt bits on PCI0646, only 
manipulation the "old" bits on PCI-64[89].
    It seems that I need to sync up these two, pata_cmd64x.c seems to be 
lagging behind the changes in cmd64x.c. Well, not only this one, at least 
pata_hpt* drivers are lagging behind too...

WBR, Sergei

  reply	other threads:[~2009-10-23 17:53 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21 18:55 [PATCH] Serialize CMD643 and CMD646 to fix a hardware bug with SSD Mikulas Patocka
2009-10-21 19:34 ` Mikael Pettersson
2009-10-21 23:01   ` Mikulas Patocka
2009-10-27 11:34     ` Alan Cox
2009-10-28  1:10       ` Mikulas Patocka
2009-10-21 19:39 ` Bartlomiej Zolnierkiewicz
2009-10-22  0:41   ` David Miller
2009-10-22  9:44     ` Bartlomiej Zolnierkiewicz
2009-10-22 11:00       ` David Miller
2009-10-22 11:15         ` Bartlomiej Zolnierkiewicz
2009-10-22 11:20           ` David Miller
2009-10-23 14:29       ` Mikulas Patocka
2009-10-23 14:31         ` David Miller
2009-10-23 14:44         ` Bartlomiej Zolnierkiewicz
2009-10-23 14:55           ` Mikulas Patocka
2009-10-23 15:03             ` Bartlomiej Zolnierkiewicz
2009-10-23 15:18               ` Daniela Engert
2009-10-23 16:51             ` Alan Cox
2009-10-23 17:27               ` Sergei Shtylyov [this message]
2009-10-23 18:22                 ` Alan Cox
2009-10-23 18:52                   ` Bartlomiej Zolnierkiewicz
2009-10-24  3:24                     ` David Miller
2009-10-24 12:38                       ` Bartlomiej Zolnierkiewicz
2009-10-24 12:58                         ` David Miller
2009-10-24 13:13                           ` Bartlomiej Zolnierkiewicz
2009-10-24 13:20                             ` David Miller
2009-10-26 11:36                   ` Mikulas Patocka
2009-10-26 12:18                     ` Alan Cox
2009-11-05  1:25                       ` [PATCH] Don't use UDMA on VIA UDMA33 controller with Transcend SSD Mikulas Patocka
2009-11-05 10:40                         ` Alan Cox
2009-11-05 22:18                           ` Mikulas Patocka
2009-11-05 22:46                             ` Alan Cox
2009-11-05 23:19                               ` Mikulas Patocka
2009-11-17 12:30                         ` David Miller
2009-11-18 17:09                           ` Mikulas Patocka
2009-11-18 17:22                             ` Alan Cox
2009-11-18 17:32                               ` David Miller
2009-11-18 17:46                                 ` Mikulas Patocka
2009-11-18 17:53                                   ` David Miller
2009-11-18 18:04                                     ` Mikulas Patocka
2009-11-18 17:37                               ` Mikulas Patocka
2009-11-18 17:50                                 ` Alan Cox
2009-11-18 18:02                                   ` Mikulas Patocka
2011-10-11 17:12                             ` Bartlomiej Zolnierkiewicz
2011-10-11 19:05                               ` David Miller
2011-10-11 19:39                                 ` Alan Cox
2011-10-12 14:38                                   ` Bartlomiej Zolnierkiewicz
2011-10-12 17:59                                     ` Alan Cox
2011-10-13 10:35                                       ` Bartlomiej Zolnierkiewicz
2010-01-14 15:49                         ` Bartlomiej Zolnierkiewicz
2010-01-14 19:24                           ` Alan Cox
2010-01-14 20:17                             ` Bartlomiej Zolnierkiewicz
2009-10-23 17:15         ` [PATCH] Serialize CMD643 and CMD646 to fix a hardware bug with SSD Alan Cox
2009-10-22 13:56     ` Alan Cox
2009-10-23  1:30       ` David Miller
2009-10-23 14:50     ` Mikulas Patocka
2009-10-23 20:50       ` Sergei Shtylyov
2009-10-26 11:30         ` Mikulas Patocka
2009-10-26 18:20           ` Sergei Shtylyov
2009-10-24 11:28     ` Frans Pop
2009-10-24 11:31       ` David Miller
2009-10-25  2:48         ` Frans Pop
2009-10-29 10:02           ` David Miller

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=4AE1E78A.2090801@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bzolnier@gmail.com \
    --cc=davem@davemloft.net \
    --cc=elendil@planet.nl \
    --cc=linux-ide@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    /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.