summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-01-30 10:18:26 +0100
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 21:44:26 +0200
commit4f7faa3f2b99f8fb246c8cdeef971e55ceda4e52 (patch)
tree54602fe9e13d6ee571efe41174dd6ba1c63aec4c /drivers/ata/libata-eh.c
parentlibata: Be a bit more slack about early devices (diff)
downloadlinux-4f7faa3f2b99f8fb246c8cdeef971e55ceda4e52.tar.xz
linux-4f7faa3f2b99f8fb246c8cdeef971e55ceda4e52.zip
libata: make EH fail gracefully if no reset method is available
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> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index ecbb8e90cb8d..d94359a24d41 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2137,9 +2137,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) {