linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] scsi: arcmsr: fixed the wrong cdb payload report to IOP
@ 2021-04-16  3:44 ching Huang
  2021-05-11  3:25 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: ching Huang @ 2021-04-16  3:44 UTC (permalink / raw)
  To: martin.petersen, James.Bottomley, linux-scsi, Linux Kernel Mailing List

From: ching Huang <ching2048@areca.com.tw>

This patch fixed the wrong cdb payload report to IOP.

Signed-off-by: ching Huang <ching2048@areca.com.tw>
---

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 4b79661..930972c 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -1923,8 +1923,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);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] scsi: arcmsr: fixed the wrong cdb payload report to IOP
  2021-04-16  3:44 [PATCH 1/2] scsi: arcmsr: fixed the wrong cdb payload report to IOP ching Huang
@ 2021-05-11  3:25 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-05-11  3:25 UTC (permalink / raw)
  To: linux-scsi, James.Bottomley, Linux Kernel Mailing List, ching Huang
  Cc: Martin K . Petersen

On Fri, 16 Apr 2021 11:44:57 +0800, ching Huang wrote:

> This patch fixed the wrong cdb payload report to IOP.

Applied to 5.14/scsi-queue, thanks!

[1/2] scsi: arcmsr: fixed the wrong cdb payload report to IOP
      https://git.kernel.org/mkp/scsi/c/5b8644968d2c

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-11  3:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16  3:44 [PATCH 1/2] scsi: arcmsr: fixed the wrong cdb payload report to IOP ching Huang
2021-05-11  3:25 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).