All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Fabio Comolli <fabio.comolli@gmail.com>,
	Jeff Garzik <jeff@garzik.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-ide@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>
Subject: [PATCH] libata: don't whine if ->prereset() returns -ENOENT
Date: Mon, 12 Mar 2007 17:24:08 +0900	[thread overview]
Message-ID: <45F50E28.7010509@gmail.com> (raw)
In-Reply-To: <20070309234839.2070a265@lxorguk.ukuu.org.uk>

->prereset() returns -ENOENT to tell libata that the port is empty and
reset sequencing should be stopped.  This is not an error condition.
Update ata_eh_reset() such that it sets device classes to ATA_DEV_NONE
and return success in on -ENOENT.  This makes spurious error message
go away.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---

This should do it and better fits the intention of the return value.
Two things to note.

1. I think these ports should be made dummy instead of returning
-ENOENT on prereset().  -ENOENT from prereset() was a hack to keep
ata_piix's behavior unchanged while converting it to new EH.  If no
one objcts, I'll convert similar usages to use dummy ports after new
init model and drop -ENOENT hack in #upstream.

2. -ENODEV sounds more appropriate.  Why have I used -ENOENT.  :-)

Thanks.

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7349c3d..361953a 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1625,8 +1625,14 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
 		rc = prereset(ap);
 		if (rc) {
 			if (rc == -ENOENT) {
-				ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n");
+				ata_port_printk(ap, KERN_DEBUG,
+						"port disabled. ignoring.\n");
 				ap->eh_context.i.action &= ~ATA_EH_RESET_MASK;
+
+				for (i = 0; i < ATA_MAX_DEVICES; i++)
+					classes[i] = ATA_DEV_NONE;
+
+				rc = 0;
 			} else
 				ata_port_printk(ap, KERN_ERR,
 					"prereset failed (errno=%d)\n", rc);

  parent reply	other threads:[~2007-03-12  8:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09 16:31 [git patches] libata (and devres) fixes Jeff Garzik
2007-03-09 21:24 ` Fabio Comolli
2007-03-09 21:43   ` Jeff Garzik
2007-03-09 23:48   ` Alan Cox
2007-03-10 15:28     ` Fabio Comolli
2007-03-12  8:24     ` Tejun Heo [this message]
2007-03-12 12:10       ` [PATCH] libata: don't whine if ->prereset() returns -ENOENT Alan Cox
2007-03-12 20:14       ` Fabio Comolli
2007-03-19 16:03       ` Jeff Garzik

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=45F50E28.7010509@gmail.com \
    --to=htejun@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=fabio.comolli@gmail.com \
    --cc=greg@kroah.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.