All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: Re: [PATCH, review] IDE driver for MIPS Toshiba RBTX4939
Date: Wed, 31 May 2006 22:23:29 +0400	[thread overview]
Message-ID: <447DDF21.4060509@ru.mvista.com> (raw)
In-Reply-To: <447DD363.1070206@ru.mvista.com>

Hello, I wrote:

>>> Hello.  I'm submitting, mainly for review (questions, comments, etc) the
>>> IDE driver for the MIPS-based Toshiba RBTX4939.  In some private emails
>>> with Bartlomiej about the ide-dma changes, I understand there's at least
>>> one problem with the driver (happy to fix with a pointer to a good
>>> example).  And I see real quickly there's a few style things a
>>> Lindent'ing would fix.  Thanks.

>>> Signed-off-by: Hiroshi DOYU <hdoyu@mvista.com>
>>> Signed-off-by: Tom Rini <trini@kernel.crashing.org>

>>> Index: linux-2.6.10/drivers/ide/ide-cd.c
>>> ===================================================================
>>> --- linux-2.6.10.orig/drivers/ide/ide-cd.c
>>> +++ linux-2.6.10/drivers/ide/ide-cd.c
>>> @@ -678,6 +678,13 @@ static int cdrom_decode_status(ide_drive
>>>        err = HWIF(drive)->INB(IDE_ERROR_REG);
>>>        sense_key = err >> 4;
>>>
>>> +#if defined(CONFIG_BLK_DEV_IDE_TX4939)
>>> +        if (IS_IDE_TX4939) {
>>> +               extern void tx4939_ide_softreset(ide_drive_t*);
>>> +               tx4939_ide_softreset(drive);
>>> +        }
>>> +#endif
>>> +

>> Why is this needed?

    The datasheet says only about the DMA transfer being stopped by a bus 
error case. So, who knows? I'm afraid, even Toshiba engineers don't... :-)

>>> Index: linux-2.6.10/drivers/ide/mips/ide-tx4939.c
>>> ===================================================================
>>> --- /dev/null
>>> +++ linux-2.6.10/drivers/ide/mips/ide-tx4939.c

>>> +       sc_port = (!is_slave) ?
>>> +               data_port + TX4939_ATA_SYSTEM_CONTROL1_OFFSET :
>>> +               data_port + TX4939_ATA_SYSTEM_CONTROL2_OFFSET;
>>> +
>>> +       if (!hwif->channel) {   /* primary */

>> Why only primary channel is tuned?

>    You won't believe: it's single channel, and that's how Toshiba deals 
> with this. :-)

    Worse, it's dual channel. Then I have no idea other than that this was 
copied from another driver for the single-channel chip (I've seen such code 
already). Oh, horror... :-/

>    Worse still: this controller has only _one_ timing register for both 
> master and slave, and doesn't define selectproc!

    BTW, the datasheet is contradictory here. The register map has 2 system 
control regs per channel, while ATAP setcion says about the single one, and 
warns that it must be changed with every change of DEV bit...

> Though wait, they 
> prefer to handle this in tx4939_ide_outb(). The driver seems even more 
> broken-minded than I initially thought... And that tuneproc() stupidity 
> where they're clearing the  DMA mode...

    Well, this is not as stupid, DMA mode should be off anyway...

MBR, Sergei

      reply	other threads:[~2006-05-31 18:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-29 16:22 [PATCH, review] IDE driver for MIPS Toshiba RBTX4939 Tom Rini
2005-10-03 16:17 ` Bartlomiej Zolnierkiewicz
2005-10-03 18:43   ` Tom Rini
2006-05-31 17:33   ` Sergei Shtylyov
2006-05-31 18:23     ` Sergei Shtylyov [this message]

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=447DDF21.4060509@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=bzolnier@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.