[PATCH] libata: move cdb_len for host to device
cdb_len is per-device property. Sharing cdb_len on ap results in inaccurate configuration on revalidation and hotplugging. This patch makes cdb_len per-device. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
@@ -371,7 +371,7 @@ static void sil24_dev_config(struct ata_port *ap, struct ata_device *dev)
|
||||
{
|
||||
void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
|
||||
|
||||
if (ap->cdb_len == 16)
|
||||
if (dev->cdb_len == 16)
|
||||
writel(PORT_CS_CDB16, port + PORT_CTRL_STAT);
|
||||
else
|
||||
writel(PORT_CS_CDB16, port + PORT_CTRL_CLR);
|
||||
@@ -543,7 +543,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
|
||||
prb = &cb->atapi.prb;
|
||||
sge = cb->atapi.sge;
|
||||
memset(cb->atapi.cdb, 0, 32);
|
||||
memcpy(cb->atapi.cdb, qc->cdb, ap->cdb_len);
|
||||
memcpy(cb->atapi.cdb, qc->cdb, qc->dev->cdb_len);
|
||||
|
||||
if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) {
|
||||
if (qc->tf.flags & ATA_TFLAG_WRITE)
|
||||
|
||||
Reference in New Issue
Block a user