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 08/10] megaraid_sas: fix megasas_fire_cmd_fusion calling convention
Date: Wed, 14 Jan 2015 16:35:35 +0530 [thread overview]
Message-ID: <c31ba7b7fe0e44f06e76a4cd9923a6f5@mail.gmail.com> (raw)
In-Reply-To: <1420909883-19479-9-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 08/10] megaraid_sas: fix megasas_fire_cmd_fusion calling
>convention
>
>The fusion HBAs don't really use the instance template like the other
variants,
>as it branches off at a much higher level. So instead of trying to
squeeze
>megasas_fire_cmd_fusion into the wrong calling convention call it locally
with
>argument data types that match what is passed.
>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>---
> drivers/scsi/megaraid/megaraid_sas_fusion.c | 73
++++++++++++-------------
>----
> 1 file changed, 29 insertions(+), 44 deletions(-)
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c
>b/drivers/scsi/megaraid/megaraid_sas_fusion.c
>index b1e053b..5a45764 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
>@@ -230,6 +230,31 @@ inline void megasas_return_mfi_mpt_pthr(struct
>megasas_instance *instance, }
>
> /**
>+ * megasas_fire_cmd_fusion - Sends command to the FW
>+ */
>+static void
>+megasas_fire_cmd_fusion(struct megasas_instance *instance,
>+ union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc)
>{ #if
>+defined(writeq) && defined(CONFIG_64BIT)
>+ u64 req_data = (((u64)le32_to_cpu(req_desc->u.low) << 32) |
>+ le32_to_cpu(req_desc->u.high));
In req_data building, positions of "req_desc->u.low" and
"req_desc->u.high" are swapped.
req_data should be like below:
u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
le32_to_cpu(req_desc->u.low));
I will post new patch with this change.
Thanks,
Sumit
>+
>+ writeq(req_data, &instance->reg_set->inbound_low_queue_port);
>+#else
>+ unsigned long flags;
>+
>+ spin_lock_irqsave(&instance->hba_lock, flags);
>+ writel(le32_to_cpu(req_desc->u.low),
>+ &instance->reg_set->inbound_low_queue_port);
>+ writel(le32_to_cpu(req_desc.u.high),
>+ &instance->reg_set->inbound_high_queue_port);
>+ spin_unlock_irqrestore(&instance->hba_lock, flags); #endif }
>+
>+
>+/**
> * megasas_teardown_frame_pool_fusion - Destroy the cmd frame DMA
>pool
> * @instance: Adapter soft state
> */
>@@ -721,8 +746,7 @@ megasas_ioc_init_fusion(struct megasas_instance
>*instance)
> break;
> }
>
>- instance->instancet->fire_cmd(instance, req_desc.u.low,
>- req_desc.u.high, instance->reg_set);
>+ megasas_fire_cmd_fusion(instance, &req_desc);
>
> wait_and_poll(instance, cmd, MFI_POLL_TIMEOUT_SECS);
>
>@@ -1133,34 +1157,6 @@ fail_alloc_mfi_cmds:
> }
>
> /**
>- * megasas_fire_cmd_fusion - Sends command to the FW
>- * @frame_phys_addr : Physical address of cmd
>- * @frame_count : Number of frames for the command
>- * @regs : MFI register set
>- */
>-void
>-megasas_fire_cmd_fusion(struct megasas_instance *instance,
>- dma_addr_t req_desc_lo,
>- u32 req_desc_hi,
>- struct megasas_register_set __iomem *regs)
>-{
>-#if defined(writeq) && defined(CONFIG_64BIT)
>- u64 req_data = (((u64)le32_to_cpu(req_desc_hi) << 32) |
>- le32_to_cpu(req_desc_lo));
>-
>- writeq(req_data, &(regs)->inbound_low_queue_port);
>-#else
>- unsigned long flags;
>-
>- spin_lock_irqsave(&instance->hba_lock, flags);
>-
>- writel(le32_to_cpu(req_desc_lo), &(regs)-
>>inbound_low_queue_port);
>- writel(le32_to_cpu(req_desc_hi), &(regs)-
>>inbound_high_queue_port);
>- spin_unlock_irqrestore(&instance->hba_lock, flags);
>-#endif
>-}
>-
>-/**
> * map_cmd_status - Maps FW cmd status to OS cmd status
> * @cmd : Pointer to cmd
> * @status : status of cmd returned by FW
>@@ -1947,9 +1943,7 @@ megasas_build_and_issue_cmd_fusion(struct
>megasas_instance *instance,
> */
> atomic_inc(&instance->fw_outstanding);
>
>- instance->instancet->fire_cmd(instance,
>- req_desc->u.low, req_desc->u.high,
>- instance->reg_set);
>+ megasas_fire_cmd_fusion(instance, req_desc);
>
> return 0;
> }
>@@ -2328,8 +2322,7 @@ megasas_issue_dcmd_fusion(struct
>megasas_instance *instance,
> return;
> }
> atomic_set(&cmd->mfi_mpt_pthr, MFI_MPT_ATTACHED);
>- instance->instancet->fire_cmd(instance, req_desc->u.low,
>- req_desc->u.high,
instance->reg_set);
>+ megasas_fire_cmd_fusion(instance, req_desc);
> }
>
> /**
>@@ -2816,14 +2809,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost,
>int iotimeout)
> frame */
>
> megasas_return_cmd_fusion(instance, cmd_fusion);
> } else {
>-
instance->instancet->
>- fire_cmd(instance,
>-
req_desc->
>- u.low,
>-
req_desc->
>- u.high,
>-
instance->
>- reg_set);
>+
> megasas_fire_cmd_fusion(instance, req_desc);
> }
> }
> }
>@@ -2978,7 +2964,6 @@ void megasas_fusion_ocr_wq(struct work_struct
>*work)
> }
>
> struct megasas_instance_template megasas_instance_template_fusion = {
>- .fire_cmd = megasas_fire_cmd_fusion,
> .enable_intr = megasas_enable_intr_fusion,
> .disable_intr = megasas_disable_intr_fusion,
> .clear_intr = megasas_clear_intr_fusion,
>--
>1.9.1
next prev parent reply other threads:[~2015-01-14 11:05 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
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 [this message]
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=c31ba7b7fe0e44f06e76a4cd9923a6f5@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.