Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29234
b: refs/heads/master
c: 74e6c8c
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 2, 2006
1 parent 0640558 commit df2e6c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 058e55e120ca59d37392f9aa753da2d9ead24505
refs/heads/master: 74e6c8c394ca2126a60e97bc1142ec2d91761e9a
27 changes: 9 additions & 18 deletions trunk/drivers/scsi/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,6 @@ void ata_gen_ata_desc_sense(struct ata_queued_cmd *qc)

cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;

/*
* Read the controller registers.
*/
WARN_ON(qc->ap->ops->tf_read == NULL);
qc->ap->ops->tf_read(qc->ap, tf);

/*
* Use ata_to_sense_error() to map status register bits
* onto sense key, asc & ascq.
Expand Down Expand Up @@ -621,12 +615,6 @@ void ata_gen_fixed_sense(struct ata_queued_cmd *qc)

cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;

/*
* Read the controller registers.
*/
WARN_ON(qc->ap->ops->tf_read == NULL);
qc->ap->ops->tf_read(qc->ap, tf);

/*
* Use ata_to_sense_error() to map status register bits
* onto sense key, asc & ascq.
Expand Down Expand Up @@ -1337,11 +1325,14 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
*/
if (((cdb[0] == ATA_16) || (cdb[0] == ATA_12)) &&
((cdb[2] & 0x20) || need_sense)) {
qc->ap->ops->tf_read(qc->ap, &qc->tf);
ata_gen_ata_desc_sense(qc);
} else {
if (!need_sense) {
cmd->result = SAM_STAT_GOOD;
} else {
qc->ap->ops->tf_read(qc->ap, &qc->tf);

/* TODO: decide which descriptor format to use
* for 48b LBA devices and call that here
* instead of the fixed desc, which is only
Expand Down Expand Up @@ -2133,13 +2124,15 @@ void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8

static void atapi_sense_complete(struct ata_queued_cmd *qc)
{
if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0))
if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0)) {
/* FIXME: not quite right; we don't want the
* translation of taskfile registers into
* a sense descriptors, since that's only
* correct for ATA, not ATAPI
*/
qc->ap->ops->tf_read(qc->ap, &qc->tf);
ata_gen_ata_desc_sense(qc);
}

qc->scsidone(qc->scsicmd);
ata_qc_free(qc);
Expand Down Expand Up @@ -2207,17 +2200,15 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
cmd->result = SAM_STAT_CHECK_CONDITION;
atapi_request_sense(qc);
return;
}

else if (unlikely(err_mask))
} else if (unlikely(err_mask)) {
/* FIXME: not quite right; we don't want the
* translation of taskfile registers into
* a sense descriptors, since that's only
* correct for ATA, not ATAPI
*/
qc->ap->ops->tf_read(qc->ap, &qc->tf);
ata_gen_ata_desc_sense(qc);

else {
} else {
u8 *scsicmd = cmd->cmnd;

if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) {
Expand Down

0 comments on commit df2e6c0

Please sign in to comment.