Skip to content

Commit

Permalink
scsi: arcmsr: Fix doorbell status being updated late on ARC-1886
Browse files Browse the repository at this point in the history
[ Upstream commit d9a2312 ]

It is possible for the IOP to be delayed in updating the doorbell
status. The doorbell status should not be 0 so loop until the value
changes.

Link: https://lore.kernel.org/r/afdfdf7eabecf14632492c4987a6b9ac6312a7ad.camel@areca.com.tw
Signed-off-by: ching Huang <ching2048@areca.com.tw>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ching Huang authored and gregkh committed Jul 20, 2021
1 parent 20c62ca commit 0245504
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/scsi/arcmsr/arcmsr_hba.c
Expand Up @@ -2424,10 +2424,17 @@ static void arcmsr_hbaD_doorbell_isr(struct AdapterControlBlock *pACB)

static void arcmsr_hbaE_doorbell_isr(struct AdapterControlBlock *pACB)
{
uint32_t outbound_doorbell, in_doorbell, tmp;
uint32_t outbound_doorbell, in_doorbell, tmp, i;
struct MessageUnit_E __iomem *reg = pACB->pmuE;

in_doorbell = readl(&reg->iobound_doorbell);
if (pACB->adapter_type == ACB_ADAPTER_TYPE_F) {
for (i = 0; i < 5; i++) {
in_doorbell = readl(&reg->iobound_doorbell);
if (in_doorbell != 0)
break;
}
} else
in_doorbell = readl(&reg->iobound_doorbell);
outbound_doorbell = in_doorbell ^ pACB->in_doorbell;
do {
writel(0, &reg->host_int_status); /* clear interrupt */
Expand Down

0 comments on commit 0245504

Please sign in to comment.