linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>,
	linux-scsi@vger.kernel.org
Cc: xjtuwjp@gmail.com, JBottomley@parallels.com, Viswas.G@pmcs.com,
	pmchba@pmcs.com
Subject: Re: [PATCH] pm8001: Update nvmd response data to request buffer
Date: Mon, 11 Aug 2014 12:59:39 +0200	[thread overview]
Message-ID: <53E8A21B.8030906@redhat.com> (raw)
In-Reply-To: <1407738035-3327-1-git-send-email-Suresh.Thiagarajan@pmcs.com>

On 08/11/2014 08:20 AM, Suresh Thiagarajan wrote:
> Instead of using the virt_ptr use request buffer for copying
> back the nvmd response data and use the same in request function also

Patch looks good to me

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

> Signed-off-by: Suresh Thiagarajan <suresh.thiagarajan@pmcs.com>
> Reviewed-by: Tomas Henzl <thenzl@redhat.com>
> ---
>  drivers/scsi/pm8001/pm8001_ctl.c |    4 +---
>  drivers/scsi/pm8001/pm8001_hwi.c |    8 ++++++++
>  2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
> index d3a08ae..e871a14 100644
> --- a/drivers/scsi/pm8001/pm8001_ctl.c
> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> @@ -385,7 +385,6 @@ static ssize_t pm8001_ctl_bios_version_show(struct device *cdev,
>  	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
>  	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
>  	char *str = buf;
> -	void *virt_addr;
>  	int bios_index;
>  	DECLARE_COMPLETION_ONSTACK(completion);
>  	struct pm8001_ioctl_payload payload;
> @@ -402,11 +401,10 @@ static ssize_t pm8001_ctl_bios_version_show(struct device *cdev,
>  		return -ENOMEM;
>  	}
>  	wait_for_completion(&completion);
> -	virt_addr = pm8001_ha->memoryMap.region[NVMD].virt_ptr;
>  	for (bios_index = BIOSOFFSET; bios_index < BIOS_OFFSET_LIMIT;
>  		bios_index++)
>  		str += sprintf(str, "%c",
> -			*((u8 *)((u8 *)virt_addr+bios_index)));
> +			*(payload.func_specific+bios_index));
>  	kfree(payload.func_specific);
>  	return str - buf;
>  }
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index 1738310..fd4f507 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -3132,6 +3132,7 @@ void pm8001_mpi_set_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  void
>  pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  {
> +	struct fw_control_ex    *fw_control_context;
>  	struct get_nvm_data_resp *pPayload =
>  		(struct get_nvm_data_resp *)(piomb + 4);
>  	u32 tag = le32_to_cpu(pPayload->tag);
> @@ -3140,6 +3141,7 @@ pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  	u32 ir_tds_bn_dps_das_nvm =
>  		le32_to_cpu(pPayload->ir_tda_bn_dps_das_nvm);
>  	void *virt_addr = pm8001_ha->memoryMap.region[NVMD].virt_ptr;
> +	fw_control_context = ccb->fw_control_context;
>  
>  	PM8001_MSG_DBG(pm8001_ha, pm8001_printk("Get nvm data complete!\n"));
>  	if ((dlen_status & NVMD_STAT) != 0) {
> @@ -3180,6 +3182,12 @@ pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  			pm8001_printk("Get NVMD success, IR=0, dataLen=%d\n",
>  			(dlen_status & NVMD_LEN) >> 24));
>  	}
> +	/* Though fw_control_context is freed below, usrAddr still needs
> +	 * to be updated as this holds the response to the request function
> +	 */
> +	memcpy(fw_control_context->usrAddr,
> +		pm8001_ha->memoryMap.region[NVMD].virt_ptr,
> +		fw_control_context->len);
>  	kfree(ccb->fw_control_context);
>  	ccb->task = NULL;
>  	ccb->ccb_tag = 0xFFFFFFFF;


  reply	other threads:[~2014-08-11 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11  6:20 [PATCH] pm8001: Update nvmd response data to request buffer Suresh Thiagarajan
2014-08-11 10:59 ` Tomas Henzl [this message]
2014-08-19 17:27 ` Christoph Hellwig

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=53E8A21B.8030906@redhat.com \
    --to=thenzl@redhat.com \
    --cc=JBottomley@parallels.com \
    --cc=Suresh.Thiagarajan@pmcs.com \
    --cc=Viswas.G@pmcs.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=pmchba@pmcs.com \
    --cc=xjtuwjp@gmail.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).