From: Rene Herman <rene.herman@keyaccess.nl>
To: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
Alan Cox <alan@redhat.com>, Andrew Morton <akpm@osdl.org>,
"Eric D. Mudama" <edmudama@mail.bounceswoosh.org>,
Jens Axboe <axboe@suse.de>
Subject: Re: [RFT][PATCH] ide-disk.c: more write cache fixes
Date: Fri, 14 May 2004 01:28:37 +0200 [thread overview]
Message-ID: <40A404A5.8070500@keyaccess.nl> (raw)
In-Reply-To: <200405132116.44201.bzolnier@elka.pw.edu.pl>
Bartlomiej Zolnierkiewicz wrote:
> Comments, suggestions, complains?
Yes, this works to stop it from complaining (on 6Y120P0). It comes up
with write cache enabled, and hdparm -W0/-W1 work to disable/enable
write cache as evidenced by the tiobench results. Not as evidenced by
/proc/ide/hda/settings (drive->wcache) which is always 1 and which will
probably confuse more users than just me -- I believe I saw hdparm just
pushes a drive command through an ioctl?
Question though:
> @@ -1678,8 +1683,12 @@ static void idedisk_setup (ide_drive_t *
> #endif /* CONFIG_IDEDISK_MULTI_MODE */
> }
> drive->no_io_32bit = id->dword_io ? 1 : 0;
> - if (drive->id->cfs_enable_2 & 0x3000)
> - write_cache(drive, (id->cfs_enable_2 & 0x3000));
> +
> + /* write cache enabled? */
> + if ((id->csfo & 1) || (id->cfs_enable_1 & (1 << 5)))
> + drive->wcache = 1;
> +
> + write_cache(drive, 1);
write_cache() also sets drive->wcache (to the argument, 1 in this case)
and you call that unconditionally, so the "if (foo) drive->wcache = 1"
seems superfluous. If the idea indeed is to unconditionally enable write
cache, it seems just
write_cache(drive, 1);
would be equivalent. Or if that wasn't the intention, maybe:
if (foo)
write_cache(drive, 1);
or if it should in fact be disabled if (!foo):
write_cache(drive, (id->csfo & 1) || (id->cfs_enable_1 & (1 << 5)));
or ...
Ignore me if I completely missed the point, just looks odd.
Rene.
next prev parent reply other threads:[~2004-05-13 23:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-13 19:16 [RFT][PATCH] ide-disk.c: more write cache fixes Bartlomiej Zolnierkiewicz
2004-05-13 23:28 ` Rene Herman [this message]
2004-05-14 0:14 ` Bartlomiej Zolnierkiewicz
2004-05-14 11:58 ` Rene Herman
2004-05-16 19:58 ` Alan Cox
2004-05-16 20:20 ` Bartlomiej Zolnierkiewicz
2004-05-16 21:15 ` Rene Herman
2004-05-16 21:30 ` Bartlomiej Zolnierkiewicz
2004-05-16 22:13 ` Rene Herman
2004-05-17 16:52 ` Alan Cox
2004-05-17 16:49 ` Alan Cox
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=40A404A5.8070500@keyaccess.nl \
--to=rene.herman@keyaccess.nl \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=akpm@osdl.org \
--cc=alan@redhat.com \
--cc=axboe@suse.de \
--cc=edmudama@mail.bounceswoosh.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@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).