All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH #upstream] libata: make EH fail gracefully if no reset method is available
Date: Wed, 30 Jan 2008 18:18:26 +0900	[thread overview]
Message-ID: <47A040E2.1050801@gmail.com> (raw)

When no reset method is available, libata currently oopses.  Although
the condition can't happen unless there's a bug in a low level driver,
oopsing isn't the best way to report the error condition.  Complain,
dump stack and fail reset instead.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
This patch is on top of

upstream (a984f58dd97f22f5113700322fed311a0ee29947)
+ prefer-hardreset patchset
  http://thread.gmane.org/gmane.linux.ide/27447

 drivers/ata/libata-eh.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 64418f1..8d82b06 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2135,9 +2135,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
 	if (hardreset) {
 		reset = hardreset;
 		ehc->i.action = ATA_EH_HARDRESET;
-	} else {
+	} else if (softreset) {
 		reset = softreset;
 		ehc->i.action = ATA_EH_SOFTRESET;
+	} else {
+		ata_link_printk(link, KERN_ERR, "BUG: no reset method, "
+				"please report to linux-ide@vger.kernel.org\n");
+		dump_stack();
+		return -EINVAL;
 	}
 
 	if (prereset) {
-- 
1.5.2.4


             reply	other threads:[~2008-01-30  9:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30  9:18 Tejun Heo [this message]
2008-02-01 20:35 ` [PATCH #upstream] libata: make EH fail gracefully if no reset method is available Jeff Garzik
2008-02-11 19:25 ` Jeff Garzik
2008-03-11  3:45   ` Tejun Heo
2008-04-12  5:18 ` 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=47A040E2.1050801@gmail.com \
    --to=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --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.