Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 855d854a authored by James Bottomley's avatar James Bottomley Committed by Linus Torvalds
Browse files

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: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e675349e
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2394,6 +2394,7 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
	memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
	memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);


#ifdef CONFIG_ATA_SFF
#ifdef CONFIG_ATA_SFF
	if (ap->ops->sff_tf_read)
		ap->ops->sff_tf_read(ap, &qc->tf);
		ap->ops->sff_tf_read(ap, &qc->tf);
#endif
#endif