libata: fix boot panic with SATAPI devices on non-SFF HBAs
James Bottomley
maintainerPATCH 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
@@ -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 */
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?
James Bottomley
maintainerQuoted 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