All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Fajun Chen <fajunchen@gmail.com>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: Re: Question about PATA Sil680 Bus Reset Code
Date: Mon, 09 Jul 2007 22:37:05 +0400	[thread overview]
Message-ID: <46928051.5080907@ru.mvista.com> (raw)
In-Reply-To: <8202f4270707090946q6ae5347ascd93a2bff6c2f281@mail.gmail.com>

Hello.

Fajun Chen wrote:

> Could someone help me interpret the code snippet below:
> static int sil680_bus_reset(struct ata_port *ap,unsigned int *classes)
> {
>        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
>        unsigned long addr = sil680_selreg(ap, 0);
>        u8 reset;
> 
>        pci_read_config_byte(pdev, addr, &reset);
>        pci_write_config_byte(pdev, addr, reset | 0x03);   // ?

>        udelay(25);
>        pci_write_config_byte(pdev, addr, reset);
>        return ata_std_softreset(ap, classes);
> }
> 
> Based on Sil680 data sheet, channel reset bit is bit 2,  why the reset
> code above is not "pci_write_config_byte(pdev, addr, reset | 0x04);"?

    I guess it's been blindly copied over form drivers/ide/pci/siimage.c...
The code indeed does seem meaningless. For the libata it could make sense to 
set bit 2 for the hardreset -- but then sil680_error_handler() needs to be 
turn into ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, 
sil680_bus_reset, ata_std_postreset)...
    For the legacy driver, this function needs to be converted to something 
sane too...

> Thanks in advance!

MBR, Sergei

  parent reply	other threads:[~2007-07-09 18:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09 16:46 Question about PATA Sil680 Bus Reset Code Fajun Chen
2007-07-09 16:58 ` Jeff Garzik
2007-07-09 18:37 ` Sergei Shtylyov [this message]
2007-07-09 18:46   ` Jeff Garzik
2007-07-09 18:51     ` Sergei Shtylyov
2007-07-09 22:09   ` Alan Cox
2007-07-10 12:58     ` Sergei Shtylyov
2007-07-10 22:00       ` Bartlomiej Zolnierkiewicz

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=46928051.5080907@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bzolnier@gmail.com \
    --cc=fajunchen@gmail.com \
    --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 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.