From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH 2/11] it8213/piix/slc90e66: remove {it8213,piix,slc90e66}_dma_2_pio()
Date: Sun, 05 Aug 2007 19:55:49 +0400 [thread overview]
Message-ID: <46B5F305.5040206@ru.mvista.com> (raw)
In-Reply-To: <200708042206.22546.bzolnier@gmail.com>
Hello.
Bartlomiej Zolnierkiewicz wrote:
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sigh... when I was talking about getting rid of that function, I meant
that we need to also decouple UltraDMA from PIO -- which is what this patch
misses...
Actually, I intended to decouple DMA form PIO in this drivers completely
but that would be a next step...
> Index: b/drivers/ide/pci/it8213.c
> ===================================================================
> --- a/drivers/ide/pci/it8213.c
> +++ b/drivers/ide/pci/it8213.c
> @@ -124,7 +93,7 @@ static void it8213_set_dma_mode(ide_driv
> int w_flag = 0x10 << drive->dn;
> int u_speed = 0;
> u16 reg4042, reg4a;
> - u8 reg48, reg54, reg55;
> + u8 reg48, reg54, reg55, pio;
>
> pci_read_config_word(dev, maslave, ®4042);
> pci_read_config_byte(dev, 0x48, ®48);
> @@ -165,7 +134,11 @@ static void it8213_set_dma_mode(ide_driv
> pci_write_config_byte(dev, 0x54, reg54 | v_flag);
> } else
> pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
> +
> + pio = 4;
Why let this stupidity live?
> } else {
> + const u8 mwdma_to_pio[] = { 0, 3, 4 };
> +
> if (reg48 & u_flag)
> pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
> if (reg4a & a_speed)
> @@ -174,9 +147,14 @@ static void it8213_set_dma_mode(ide_driv
> pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
> if (reg55 & w_flag)
> pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
> +
> + if (speed >= XFER_MW_DMA_0)
> + pio = mwdma_to_pio[speed - XFER_MW_DMA_0];
> + else
> + pio = 2; /* only SWDMA2 is allowed */
Well, MWDMA0 is also not allowed, so you could have cut on mwdma_to_pio
array size.
MBR, Sergei
next prev parent reply other threads:[~2007-08-05 15:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-04 20:06 [PATCH 2/11] it8213/piix/slc90e66: remove {it8213,piix,slc90e66}_dma_2_pio() Bartlomiej Zolnierkiewicz
2007-08-05 15:55 ` Sergei Shtylyov [this message]
2007-08-09 19:40 ` Bartlomiej Zolnierkiewicz
2007-08-10 16:44 ` Sergei Shtylyov
2007-08-10 18:54 ` Sergei Shtylyov
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=46B5F305.5040206@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 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).