Skip to content

Commit

Permalink
scsi: arcmsr: Fix the wrong CDB payload report to IOP
Browse files Browse the repository at this point in the history
[ Upstream commit 5b86449 ]

This patch fixes the wrong CDB payload report to IOP.

Link: https://lore.kernel.org/r/d2c97df3c817595c6faf582839316209022f70da.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 22d22fe commit 4d39514
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/scsi/arcmsr/arcmsr_hba.c
Expand Up @@ -1928,8 +1928,12 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr

if (ccb->arc_cdb_size <= 0x300)
arc_cdb_size = (ccb->arc_cdb_size - 1) >> 6 | 1;
else
arc_cdb_size = (((ccb->arc_cdb_size + 0xff) >> 8) + 2) << 1 | 1;
else {
arc_cdb_size = ((ccb->arc_cdb_size + 0xff) >> 8) + 2;
if (arc_cdb_size > 0xF)
arc_cdb_size = 0xF;
arc_cdb_size = (arc_cdb_size << 1) | 1;
}
ccb_post_stamp = (ccb->smid | arc_cdb_size);
writel(0, &pmu->inbound_queueport_high);
writel(ccb_post_stamp, &pmu->inbound_queueport_low);
Expand Down

0 comments on commit 4d39514

Please sign in to comment.