Skip to contentSkip to conversation

libata: fix boot panic with SATAPI devices on non-SFF HBAs

PATCH In review James Bottomley 2 participants 3 messages Apr 18, 2008 – Apr 19, 2008

Subsystems (2)
lore
Share & tools
lore

James Bottomley

author maintainer
#0 lore raw

PATCH 1/1 libata: fix boot panic with SATAPI devices on non-SFF HBAs

Current 2.6.25 git head 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.

---

drivers/ata/libata-scsi.c +2 -1
index 784ac41..f3c69a8 100644
@@ -2390,7 +2390,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 */
#1 lore raw
Quoted 5 lines · James Bottomley

Current 2.6.25 git head 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...

Hi James,

When I saw your commit I thought it would fix the panic introduced by Tejun's commit <305d2a1a>, but no luck.

I have a pata drive connected to a sata controller using a plugin adapter. After Tejun's commit the kernel panics with unknown-block (8,9) instead of mounting /dev/sda9. Is this the scenario your patch is intended to fix?

author maintainer
#2 lore raw
Quoted 7 lines · walt
Quoted 5 lines · James Bottomley

Current 2.6.25 git head 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...

Quoted 8 lines

Hi James,

When I saw your commit I thought it would fix the panic introduced by Tejun's commit <305d2a1a>, but no luck.

I have a pata drive connected to a sata controller using a plugin adapter. After Tejun's commit the kernel panics with unknown-block (8,9) instead of mounting /dev/sda9. Is this the scenario your patch is intended to fix?

If it's a panic with a SATA drive, then no it wouldn't ... the problem I fixed was in SATAPI only (That's CD/DVD/Tape devices). If you actually post the boot log and panic, linux-ide and Tejun might be able to help. Your brief snippet indicates the controller isn't finding sda, I think.

James