linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sumit Saxena <sumit.saxena@avagotech.com>
To: Christoph Hellwig <hch@lst.de>,
	Kashyap Desai <kashyap.desai@avagotech.com>
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Subject: RE: [PATCH 07/10] megaraid_sas: add missing byte swaps to the sriov code
Date: Wed, 14 Jan 2015 16:32:01 +0530	[thread overview]
Message-ID: <2255d5d70cf7858afeb4fec547f2dba6@mail.gmail.com> (raw)
In-Reply-To: <1420909883-19479-8-git-send-email-hch@lst.de>

>-----Original Message-----
>From: Christoph Hellwig [mailto:hch@lst.de]
>Sent: Saturday, January 10, 2015 10:41 PM
>To: Sumit.Saxena@avagotech.com; kashyap.desai@avagotech.com
>Cc: martin.petersen@oracle.com; linux-scsi@vger.kernel.org
>Subject: [PATCH 07/10] megaraid_sas: add missing byte swaps to the sriov
>code
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
> drivers/scsi/megaraid/megaraid_sas_base.c | 46 +++++++++++++++++-------
>-------
> 1 file changed, 25 insertions(+), 21 deletions(-)
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>b/drivers/scsi/megaraid/megaraid_sas_base.c
>index 548d033..5350e18 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_base.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>@@ -1924,20 +1924,22 @@ static int
>megasas_get_ld_vf_affiliation_111(struct megasas_instance *instance,
> 	dcmd->cmd = MFI_CMD_DCMD;
> 	dcmd->cmd_status = 0xFF;
> 	dcmd->sge_count = 1;
>-	dcmd->flags = MFI_FRAME_DIR_BOTH;
>+	dcmd->flags = cpu_to_le16(MFI_FRAME_DIR_BOTH);
> 	dcmd->timeout = 0;
> 	dcmd->pad_0 = 0;
>-	dcmd->data_xfer_len = sizeof(struct MR_LD_VF_AFFILIATION_111);
>-	dcmd->opcode = MR_DCMD_LD_VF_MAP_GET_ALL_LDS_111;
>+	dcmd->data_xfer_len =
>+		cpu_to_le32(sizeof(struct MR_LD_VF_AFFILIATION_111));
>+	dcmd->opcode =
>cpu_to_le32(MR_DCMD_LD_VF_MAP_GET_ALL_LDS_111);
>
> 	if (initial)
> 		dcmd->sgl.sge32[0].phys_addr =
>-			instance->vf_affiliation_111_h;
>+			cpu_to_le32(instance->vf_affiliation_111_h);
> 	else
>-		dcmd->sgl.sge32[0].phys_addr = new_affiliation_111_h;
>+		dcmd->sgl.sge32[0].phys_addr =
>+			cpu_to_le32(new_affiliation_111_h);
>
>-	dcmd->sgl.sge32[0].length =
>-		sizeof(struct MR_LD_VF_AFFILIATION_111);
>+	dcmd->sgl.sge32[0].length = cpu_to_le32(
>+		sizeof(struct MR_LD_VF_AFFILIATION_111));
>
> 	printk(KERN_WARNING "megasas: SR-IOV: Getting LD/VF affiliation
>for "
> 	       "scsi%d\n", instance->host->host_no); @@ -2039,20 +2041,22
@@
>static int megasas_get_ld_vf_affiliation_12(struct megasas_instance
>*instance,
> 	dcmd->cmd = MFI_CMD_DCMD;
> 	dcmd->cmd_status = 0xFF;
> 	dcmd->sge_count = 1;
>-	dcmd->flags = MFI_FRAME_DIR_BOTH;
>+	dcmd->flags = cpu_to_le16(MFI_FRAME_DIR_BOTH);
> 	dcmd->timeout = 0;
> 	dcmd->pad_0 = 0;
>-	dcmd->data_xfer_len = (MAX_LOGICAL_DRIVES + 1) *
>-		sizeof(struct MR_LD_VF_AFFILIATION);
>-	dcmd->opcode = MR_DCMD_LD_VF_MAP_GET_ALL_LDS;
>+	dcmd->data_xfer_len = cpu_to_le32((MAX_LOGICAL_DRIVES + 1) *
>+		sizeof(struct MR_LD_VF_AFFILIATION));
>+	dcmd->opcode =
>cpu_to_le32(MR_DCMD_LD_VF_MAP_GET_ALL_LDS);
>
> 	if (initial)
>-		dcmd->sgl.sge32[0].phys_addr = instance->vf_affiliation_h;
>+		dcmd->sgl.sge32[0].phys_addr =
>+			cpu_to_le32(instance->vf_affiliation_h);
> 	else
>-		dcmd->sgl.sge32[0].phys_addr = new_affiliation_h;
>+		dcmd->sgl.sge32[0].phys_addr =
>+			cpu_to_le32(new_affiliation_h);;
>
>-	dcmd->sgl.sge32[0].length = (MAX_LOGICAL_DRIVES + 1) *
>-		sizeof(struct MR_LD_VF_AFFILIATION);
>+	dcmd->sgl.sge32[0].length = cpu_to_le32((MAX_LOGICAL_DRIVES +
>1) *
>+		sizeof(struct MR_LD_VF_AFFILIATION));
>
> 	printk(KERN_WARNING "megasas: SR-IOV: Getting LD/VF affiliation
>for "
> 	       "scsi%d\n", instance->host->host_no); @@ -2204,17 +2208,17
@@
>int megasas_sriov_start_heartbeat(struct megasas_instance *instance,
>
> 	memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE);
>
>-	dcmd->mbox.s[0] = sizeof(struct MR_CTRL_HB_HOST_MEM);
>+	dcmd->mbox.s[0] = cpu_to_le16(sizeof(struct
>MR_CTRL_HB_HOST_MEM));
> 	dcmd->cmd = MFI_CMD_DCMD;
> 	dcmd->cmd_status = 0xFF;
> 	dcmd->sge_count = 1;
>-	dcmd->flags = MFI_FRAME_DIR_BOTH;
>+	dcmd->flags = cpu_to_le16(MFI_FRAME_DIR_BOTH);
> 	dcmd->timeout = 0;
> 	dcmd->pad_0 = 0;
>-	dcmd->data_xfer_len = sizeof(struct MR_CTRL_HB_HOST_MEM);
>-	dcmd->opcode = MR_DCMD_CTRL_SHARED_HOST_MEM_ALLOC;
>-	dcmd->sgl.sge32[0].phys_addr = instance->hb_host_mem_h;
>-	dcmd->sgl.sge32[0].length = sizeof(struct
>MR_CTRL_HB_HOST_MEM);
>+	dcmd->data_xfer_len = cpu_to_le32(sizeof(struct
>MR_CTRL_HB_HOST_MEM));
>+	dcmd->opcode =
>cpu_to_le32(MR_DCMD_CTRL_SHARED_HOST_MEM_ALLOC);
>+	dcmd->sgl.sge32[0].phys_addr = cpu_to_le32(instance-
>>hb_host_mem_h);
>+	dcmd->sgl.sge32[0].length = cpu_to_le32(sizeof(struct
>+MR_CTRL_HB_HOST_MEM));
>
> 	printk(KERN_WARNING "megasas: SR-IOV: Starting heartbeat for
>scsi%d\n",
> 	       instance->host->host_no);
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>

>--
>1.9.1

  reply	other threads:[~2015-01-14 11:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-10 17:11 megaraid_sas: sparse annotations and endianess fixes Christoph Hellwig
2015-01-10 17:11 ` [PATCH 01/10] megaraid_sas: megasas_complete_outstanding_ioctls() can be static Christoph Hellwig
2015-01-13  5:38   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 02/10] megaraid_sas: add missing __iomem annotations Christoph Hellwig
2015-01-13  7:05   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 03/10] megaraid_sas: add endianess annotations Christoph Hellwig
2015-01-13  7:17   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 04/10] megaraid_sas: add endianess conversions for all ones Christoph Hellwig
2015-01-13  7:21   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 05/10] megaraid_sas: move endianess conversion into caller of megasas_get_seq_num Christoph Hellwig
2015-01-13  7:23   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 06/10] megaraid_sas: bytewise or should be done on native endian variables Christoph Hellwig
2015-01-14 11:01   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 07/10] megaraid_sas: add missing byte swaps to the sriov code Christoph Hellwig
2015-01-14 11:02   ` Sumit Saxena [this message]
2015-01-10 17:11 ` [PATCH 08/10] megaraid_sas: fix megasas_fire_cmd_fusion calling convention Christoph Hellwig
2015-01-14 11:05   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 09/10] megaraid_sas: swap whole register in megasas_register_aen Christoph Hellwig
2015-01-14 11:07   ` Sumit Saxena
2015-01-10 17:11 ` [PATCH 10/10] megaraid_sas: fix endianess for the crash dump state support Christoph Hellwig
2015-01-14 12:01   ` Sumit Saxena

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2255d5d70cf7858afeb4fec547f2dba6@mail.gmail.com \
    --to=sumit.saxena@avagotech.com \
    --cc=hch@lst.de \
    --cc=kashyap.desai@avagotech.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).