Commit 5dd8b3e7 authored by Ching Huang's avatar Ching Huang Committed by Martin K. Petersen

scsi: arcmsr: Add ACB_F_MSG_GET_CONFIG to acb->acb_flags

Add ACB_F_MSG_GET_CONFIG to acb->acb_flags for for message interrupt
checking before schedule work for get device map.
Signed-off-by: default avatarChing Huang <ching2048@areca.com.tw>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent abf33d83
......@@ -782,6 +782,7 @@ struct AdapterControlBlock
/* iop init */
#define ACB_F_ABORT 0x0200
#define ACB_F_FIRMWARE_TRAP 0x0400
#define ACB_F_MSG_GET_CONFIG 0x1000
struct CommandControlBlock * pccb_pool[ARCMSR_MAX_FREECCB_NUM];
/* used for memory free */
struct list_head ccb_free_list;
......
......@@ -743,6 +743,7 @@ static void arcmsr_message_isr_bh_fn(struct work_struct *work)
struct scsi_device *psdev;
char diff, temp;
acb->acb_flags &= ~ACB_F_MSG_GET_CONFIG;
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
struct MessageUnit_A __iomem *reg = acb->pmuA;
......@@ -2328,6 +2329,7 @@ static void arcmsr_hbaA_message_isr(struct AdapterControlBlock *acb)
struct MessageUnit_A __iomem *reg = acb->pmuA;
/*clear interrupt and message state*/
writel(ARCMSR_MU_OUTBOUND_MESSAGE0_INT, &reg->outbound_intstatus);
if (acb->acb_flags & ACB_F_MSG_GET_CONFIG)
schedule_work(&acb->arcmsr_do_message_isr_bh);
}
static void arcmsr_hbaB_message_isr(struct AdapterControlBlock *acb)
......@@ -2336,6 +2338,7 @@ static void arcmsr_hbaB_message_isr(struct AdapterControlBlock *acb)
/*clear interrupt and message state*/
writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN, reg->iop2drv_doorbell);
if (acb->acb_flags & ACB_F_MSG_GET_CONFIG)
schedule_work(&acb->arcmsr_do_message_isr_bh);
}
/*
......@@ -2352,6 +2355,7 @@ static void arcmsr_hbaC_message_isr(struct AdapterControlBlock *acb)
struct MessageUnit_C __iomem *reg = acb->pmuC;
/*clear interrupt and message state*/
writel(ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR, &reg->outbound_doorbell_clear);
if (acb->acb_flags & ACB_F_MSG_GET_CONFIG)
schedule_work(&acb->arcmsr_do_message_isr_bh);
}
......@@ -2361,6 +2365,7 @@ static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb)
writel(ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE, reg->outbound_doorbell);
readl(reg->outbound_doorbell);
if (acb->acb_flags & ACB_F_MSG_GET_CONFIG)
schedule_work(&acb->arcmsr_do_message_isr_bh);
}
......@@ -2369,6 +2374,7 @@ static void arcmsr_hbaE_message_isr(struct AdapterControlBlock *acb)
struct MessageUnit_E __iomem *reg = acb->pmuE;
writel(0, &reg->host_int_status);
if (acb->acb_flags & ACB_F_MSG_GET_CONFIG)
schedule_work(&acb->arcmsr_do_message_isr_bh);
}
......@@ -3826,6 +3832,7 @@ static void arcmsr_hbaA_request_device_map(struct AdapterControlBlock *acb)
return;
}
writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, &reg->inbound_msgaddr0);
acb->acb_flags |= ACB_F_MSG_GET_CONFIG;
mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ));
}
return;
......@@ -3848,6 +3855,7 @@ static void arcmsr_hbaB_request_device_map(struct AdapterControlBlock *acb)
return;
}
writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell);
acb->acb_flags |= ACB_F_MSG_GET_CONFIG;
mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ));
}
return;
......@@ -3871,6 +3879,7 @@ static void arcmsr_hbaC_request_device_map(struct AdapterControlBlock *acb)
}
writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, &reg->inbound_msgaddr0);
writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, &reg->inbound_doorbell);
acb->acb_flags |= ACB_F_MSG_GET_CONFIG;
mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ));
}
return;
......@@ -3900,6 +3909,7 @@ static void arcmsr_hbaD_request_device_map(struct AdapterControlBlock *acb)
}
writel(ARCMSR_INBOUND_MESG0_GET_CONFIG,
reg->inbound_msgaddr0);
acb->acb_flags |= ACB_F_MSG_GET_CONFIG;
mod_timer(&acb->eternal_timer, jiffies +
msecs_to_jiffies(6 * HZ));
}
......@@ -3930,6 +3940,7 @@ static void arcmsr_hbaE_request_device_map(struct AdapterControlBlock *acb)
writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, &reg->inbound_msgaddr0);
acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE;
writel(acb->out_doorbell, &reg->iobound_doorbell);
acb->acb_flags |= ACB_F_MSG_GET_CONFIG;
mod_timer(&acb->eternal_timer, jiffies +
msecs_to_jiffies(6 * HZ));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment