linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream] libata: make EH fail gracefully if no reset method is available
@ 2008-01-30  9:18 Tejun Heo
  2008-02-01 20:35 ` Jeff Garzik
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tejun Heo @ 2008-01-30  9:18 UTC (permalink / raw)
  To: Jeff Garzik, IDE/ATA development list

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-12  5:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-30  9:18 [PATCH #upstream] libata: make EH fail gracefully if no reset method is available Tejun Heo
2008-02-01 20:35 ` Jeff Garzik
2008-02-11 19:25 ` Jeff Garzik
2008-03-11  3:45   ` Tejun Heo
2008-04-12  5:18 ` Jeff Garzik

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).