All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Doug Maxey <dwm@austin.ibm.com>
Cc: Linux IDE Mailing List <linux-ide@vger.kernel.org>, dwm@maxeymade.com
Subject: Re: [PATCH] honor IDE drive write cache settings
Date: Tue, 19 Oct 2004 19:15:27 +0200	[thread overview]
Message-ID: <58cb370e04101910153f179edc@mail.gmail.com> (raw)
In-Reply-To: <200410191615.i9JGFEXI010445@falcon10.austin.ibm.com>

Hi Doug,

On Tue, 19 Oct 2004 11:15:14 -0500, Doug Maxey <dwm@austin.ibm.com> wrote:
> 
> Bart,
> 
> here is a patch that handles drives that come with write cache disabled,
> both as modular and builtin drivers.

This patch seems to be trying to do too much in one go and we've learned
(by experience :) that write cache related changes should be done in small
steps.  Please split your patch to:

* HDIO_DRIVE_CMD fix
* honor disk write cache fix
* "barrier" fix (this one needs some more thinking)

Do you care to also make "disable write cache by default" patch?

+static inline sector_t idedisk_capacity (ide_drive_t *drive) {
+	return drive->capacity64 - drive->sect0;
+}
+
+static inline int ide_drive_has_flush_cache (ide_drive_t *drive) {
+	return ((drive->addressing && (idedisk_capacity (drive) > (1ULL << 28)) &&
+		    (ide_id_has_flush_cache_ext(drive->id))) ||
+		(ide_id_has_flush_cache(drive->id)));
+}

please fix it to be more readable
(see Documentation/CodingStyle)

foo()
{
}

+	 * If we have a drive that does not support write cache, do not
+	 * attempt to change the write cache setting.
+	 */
+
+	if (!(drive->id->command_set_1 & (1 << 5)))
+		return -EIO;	/* Would prefer ENXIO for command not supported... */

Is this enough?  IMO it is the best to leave it alone for now...

+	if ((args[2] == SETFEATURES_EN_WCACHE) ||
+	    (args[2] == SETFEATURES_DIS_WCACHE)) {
+		/*
+		 * Call the handler to support settings in the block layer.
+		 */
+		err = ide_write_cache (drive, (args[2] == SETFEATURES_EN_WCACHE));
+		return err;
+	}

This check is only valid for XFER_SETFEATURES command...

The rest of the patch looks OK.

Oh, and please inline patches instead of attaching them.

Thanks,
Bartlomiej

  reply	other threads:[~2004-10-19 17:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19 16:15 [PATCH] honor IDE drive write cache settings Doug Maxey
2004-10-19 17:15 ` Bartlomiej Zolnierkiewicz [this message]
2004-10-19 18:21   ` [PATCH] honor IDE drive write cache settings (respin#1) Doug Maxey
2004-10-19 19:13     ` 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=58cb370e04101910153f179edc@mail.gmail.com \
    --to=bzolnier@gmail.com \
    --cc=dwm@austin.ibm.com \
    --cc=dwm@maxeymade.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.