Skip to content

Commit

Permalink
libata: fix boot panic with SATAPI devices on non-SFF HBAs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Bottomley authored and Linus Torvalds committed Apr 18, 2008
1 parent e675349 commit 855d854
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 855d854

Please sign in to comment.