aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-18 13:18:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 11:20:42 -0700
commit855d854a33fca71cf68bad258bd5e66e5b265d10 (patch)
treefcb5cac022d38af474c5243182a3c6f91de0b2ec
parente675349e2bdbfb661fa0d8ff2441b4cf48fb7e48 (diff)
libata: fix boot panic with SATAPI devices on non-SFF HBAs
The kernel now panics reliably on boot if you have a SATAPI device connected. The problem was introduced by the libata merge trying to pull out all the SFF code into a separate module. Unfortunately, if you're a satapi device you usually need to call atapi_request_sense, which has a bare invocation of a SFF callback which is NULL on non-SFF HBAs. Fix this by making the call conditional. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/ata/libata-scsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index fedf62de946..c16e3cea1d2 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2394,7 +2394,8 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
#ifdef CONFIG_ATA_SFF
- ap->ops->sff_tf_read(ap, &qc->tf);
+ if (ap->ops->sff_tf_read)
+ ap->ops->sff_tf_read(ap, &qc->tf);
#endif
/* fill these in, for the case where they are -not- overwritten */