From: Richard Zidlicky <rz@linux-m68k.org>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
linux-ide@vger.kernel.org,
Linux Kernel Development <linux-kernel@vger.kernel.org>,
Linux/m68k <linux-m68k@vger.kernel.org>,
Michael Schmitz <schmitz@debian.org>
Subject: Re: [PATCH 5/5] falconide/q40ide: add ->atapi_*put_bytes and ->ata_*put_data methods
Date: Tue, 8 Apr 2008 11:40:29 +0200 [thread overview]
Message-ID: <20080408094029.GA1005@linux-m68k.org> (raw)
In-Reply-To: <200804072113.42441.bzolnier@gmail.com>
On Mon, Apr 07, 2008 at 09:13:42PM +0200, Bartlomiej Zolnierkiewicz wrote:
>
> v2:
> * Add 'struct request *rq' argument to ->ata_{in,out}put_data methods
> and don't byte-swap disk fs requests (we shouldn't un-swap fs requests
> because fs itself is stored byte-swapped on the disk) - this is how
> things were done before the patch (ideally device mapper should be
> used instead but it would break existing setups and would have some
> performance impact).
I like the part about checking 'struct request *rq', will make a clean
distinction between ide command data and ide disk/medium data which is badly
needed.
However, not only FS data is byteswapped, complete disk including partition
table and everything else is. Will "rq->cmd_type == REQ_TYPE_FS" also catch
all these cases?
> Index: b/drivers/ide/legacy/falconide.c
> ===================================================================
> --- a/drivers/ide/legacy/falconide.c
> +++ b/drivers/ide/legacy/falconide.c
> @@ -44,6 +44,36 @@
> int falconide_intr_lock;
> EXPORT_SYMBOL(falconide_intr_lock);
>
> +static void falconide_atapi_input_bytes(ide_drive_t *drive, void *buf,
> + unsigned int len)
> +{
> + insw_swapw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2);
> +}
> +
> +static void falconide_atapi_output_bytes(ide_drive_t *drive, void *buf,
> + unsigned int len)
> +{
> + outsw_swapw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2);
> +}
> +
> +static void falconide_ata_input_data(ide_drive_t *drive, struct request *rq,
> + void *buf, unsigned int wcount)
> +{
> + if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS)
> + return insw(drive->hwif->io_ports.data_addr, buf, wcount * 2);
> +
> + falconide_atapi_input_bytes(drive, buf, wcount * 4);
> +}
this will still do double swapping for disk access, although this is very
easier to fix once the distinction between ide and disk data works fine.
So IMHO despite the little concerns this is the way to go.
Richard
next prev parent reply other threads:[~2008-04-08 9:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-30 15:14 [PATCH 5/5] falconide/q40ide: add ->atapi_*put_bytes and ->ata_*put_data methods Bartlomiej Zolnierkiewicz
2008-03-30 18:18 ` Geert Uytterhoeven
2008-03-30 19:34 ` Bartlomiej Zolnierkiewicz
2008-03-31 5:53 ` Geert Uytterhoeven
2008-03-31 6:04 ` Geert Uytterhoeven
2008-03-31 9:37 ` Alan Cox
2008-04-07 19:13 ` Bartlomiej Zolnierkiewicz
2008-04-08 9:40 ` Richard Zidlicky [this message]
2008-04-09 1:40 ` Michael Schmitz
2008-04-09 18:13 ` Richard Zidlicky
2008-04-09 18:49 ` Bartlomiej Zolnierkiewicz
-- strict thread matches above, loose matches on Subject: below --
2008-03-31 21:41 Roman Zippel
2008-03-31 21:43 ` Alan Cox
2008-03-31 22:02 ` Roman Zippel
2008-04-01 3:20 ` Michael Schmitz
2008-04-01 8:12 ` Alan Cox
2008-04-01 8:32 ` Mikael Pettersson
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=20080408094029.GA1005@linux-m68k.org \
--to=rz@linux-m68k.org \
--cc=bzolnier@gmail.com \
--cc=geert@linux-m68k.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=schmitz@debian.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).