mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-05 18:59:58 +00:00
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>
This commit is contained in:
parent
b93fda1235
commit
4f7faa3f2b
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue