aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/arcmsr
diff options
context:
space:
mode:
authorChing Huang <ching2048@areca.com.tw>2014-08-19 02:47:16 -0400
committerChristoph Hellwig <hch@lst.de>2014-09-16 12:39:37 -0400
commitcab5aecee60a7930ca208ee723c18be7b400cfaf (patch)
treed8eaee46850c79f88c90fae130b9d3a2bafde40b /drivers/scsi/arcmsr
parent3df824aff935444601101cc329ebe3f52e126a4e (diff)
arcmsr: return status of abort command
This patch fixes the wrong return status of abort command. Signed-off-by: Ching Huang <ching2048@areca.com.tw> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/arcmsr')
-rw-r--r--drivers/scsi/arcmsr/arcmsr_hba.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index ed61ee283a61..87f388226e83 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -2477,7 +2477,7 @@ static int arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb,
2477 } 2477 }
2478 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5)); 2478 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));
2479 ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); 2479 ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb);
2480 poll_ccb_done = (ccb == poll_ccb) ? 1:0; 2480 poll_ccb_done |= (ccb == poll_ccb) ? 1 : 0;
2481 if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) { 2481 if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) {
2482 if ((ccb->startdone == ARCMSR_CCB_ABORTED) || (ccb == poll_ccb)) { 2482 if ((ccb->startdone == ARCMSR_CCB_ABORTED) || (ccb == poll_ccb)) {
2483 printk(KERN_NOTICE "arcmsr%d: scsi id = %d lun = %d ccb = '0x%p'" 2483 printk(KERN_NOTICE "arcmsr%d: scsi id = %d lun = %d ccb = '0x%p'"
@@ -2541,7 +2541,7 @@ static int arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb,
2541 /* check if command done with no error*/ 2541 /* check if command done with no error*/
2542 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5)); 2542 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));
2543 ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); 2543 ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb);
2544 poll_ccb_done = (ccb == poll_ccb) ? 1:0; 2544 poll_ccb_done |= (ccb == poll_ccb) ? 1 : 0;
2545 if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) { 2545 if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) {
2546 if ((ccb->startdone == ARCMSR_CCB_ABORTED) || (ccb == poll_ccb)) { 2546 if ((ccb->startdone == ARCMSR_CCB_ABORTED) || (ccb == poll_ccb)) {
2547 printk(KERN_NOTICE "arcmsr%d: scsi id = %d lun = %d ccb = '0x%p'" 2547 printk(KERN_NOTICE "arcmsr%d: scsi id = %d lun = %d ccb = '0x%p'"
@@ -2597,7 +2597,7 @@ polling_hbc_ccb_retry:
2597 ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); 2597 ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0);
2598 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy);/*frame must be 32 bytes aligned*/ 2598 arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy);/*frame must be 32 bytes aligned*/
2599 pCCB = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); 2599 pCCB = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb);
2600 poll_ccb_done = (pCCB == poll_ccb) ? 1 : 0; 2600 poll_ccb_done |= (pCCB == poll_ccb) ? 1 : 0;
2601 /* check ifcommand done with no error*/ 2601 /* check ifcommand done with no error*/
2602 if ((pCCB->acb != acb) || (pCCB->startdone != ARCMSR_CCB_START)) { 2602 if ((pCCB->acb != acb) || (pCCB->startdone != ARCMSR_CCB_START)) {
2603 if (pCCB->startdone == ARCMSR_CCB_ABORTED) { 2603 if (pCCB->startdone == ARCMSR_CCB_ABORTED) {
@@ -3199,8 +3199,10 @@ static int arcmsr_abort(struct scsi_cmnd *cmd)
3199 (struct AdapterControlBlock *)cmd->device->host->hostdata; 3199 (struct AdapterControlBlock *)cmd->device->host->hostdata;
3200 int i = 0; 3200 int i = 0;
3201 int rtn = FAILED; 3201 int rtn = FAILED;
3202 uint32_t intmask_org;
3203
3202 printk(KERN_NOTICE 3204 printk(KERN_NOTICE
3203 "arcmsr%d: abort device command of scsi id = %d lun = %d \n", 3205 "arcmsr%d: abort device command of scsi id = %d lun = %d\n",
3204 acb->host->host_no, cmd->device->id, (u32)cmd->device->lun); 3206 acb->host->host_no, cmd->device->id, (u32)cmd->device->lun);
3205 acb->acb_flags |= ACB_F_ABORT; 3207 acb->acb_flags |= ACB_F_ABORT;
3206 acb->num_aborts++; 3208 acb->num_aborts++;
@@ -3210,9 +3212,12 @@ static int arcmsr_abort(struct scsi_cmnd *cmd)
3210 ** we need to handle it as soon as possible and exit 3212 ** we need to handle it as soon as possible and exit
3211 ************************************************ 3213 ************************************************
3212 */ 3214 */
3213 if (!atomic_read(&acb->ccboutstandingcount)) 3215 if (!atomic_read(&acb->ccboutstandingcount)) {
3216 acb->acb_flags &= ~ACB_F_ABORT;
3214 return rtn; 3217 return rtn;
3218 }
3215 3219
3220 intmask_org = arcmsr_disable_outbound_ints(acb);
3216 for (i = 0; i < ARCMSR_MAX_FREECCB_NUM; i++) { 3221 for (i = 0; i < ARCMSR_MAX_FREECCB_NUM; i++) {
3217 struct CommandControlBlock *ccb = acb->pccb_pool[i]; 3222 struct CommandControlBlock *ccb = acb->pccb_pool[i];
3218 if (ccb->startdone == ARCMSR_CCB_START && ccb->pcmd == cmd) { 3223 if (ccb->startdone == ARCMSR_CCB_START && ccb->pcmd == cmd) {
@@ -3222,6 +3227,7 @@ static int arcmsr_abort(struct scsi_cmnd *cmd)
3222 } 3227 }
3223 } 3228 }
3224 acb->acb_flags &= ~ACB_F_ABORT; 3229 acb->acb_flags &= ~ACB_F_ABORT;
3230 arcmsr_enable_outbound_ints(acb, intmask_org);
3225 return rtn; 3231 return rtn;
3226} 3232}
3227 3233