linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "lindar_liu" <lindar_liu@usish.com>
To: 'zxh3737' <zxh3737@163.com>, linux-scsi@vger.kernel.org
Cc: asanthan@gmail.com, Sangeetha.Gnanasekaran@pmcs.com
Subject: RE: [PATCH Resend] [scsi] pm8001 : fix panic when cat /sys/class/sas_phy/phy-8:0/running_disparity_error_count
Date: Thu, 17 Oct 2013 11:37:36 +0800	[thread overview]
Message-ID: <003a01cecaea$3c98fbe0$b5caf3a0$@com> (raw)
In-Reply-To: <003901cecae6$1ee5f980$5cb1ec80$@com>

>
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_h
> wi.c index 9f91030..c0ea473 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
>
@@ -3076,8 +3076,43 @@ static int mpi_get_controller_config_resp(struct pm80
> 01_hba_info *pm8001_ha,
>  static int mpi_get_phy_profile_resp(struct pm8001_hba_info *pm8001_ha,
>   void *piomb)
>  {
> - PM8001_MSG_DBG(pm8001_ha,
> - pm8001_printk(" pm80xx_addition_functionality\n"));
> + u8 page_code;
> + struct get_phy_profile_resp *pPayload = (struct get_phy_profile_resp
> + *)(piomb + 4);
> + u32 ppc_phyid = le32_to_cpu(pPayload->ppc_phyid);
> + u32 status = le32_to_cpu(pPayload->status);
> + u8 phy_id = (u8)(ppc_phyid & 0x00FF);
> + page_code = (u8)((ppc_phyid & 0xFF00) >> 8); struct asd_sas_phy
> + *sas_phy = &(pm8001_ha->phy[phy_id].sas_phy);
> + struct sas_phy *phy = sas_phy->phy;
> +
> + if (status) {
> + /* status is FAILED */
> + PM8001_FAIL_DBG(pm8001_ha,
> + pm8001_printk("PhyProfile command failed  with status "
> + "0x%08X \n", status));
> + return -1;
> + } else {
> + switch (page_code) {
> + case SAS_PHY_ERROR_PAGE:
> + phy->invalid_dword_count =
> + le32_to_cpu(pPayload->ppc_specific_rsp[0]);
> + phy->running_disparity_error_count =
> + le32_to_cpu(pPayload->ppc_specific_rsp[1]);
> + phy->loss_of_dword_sync_count =
> + le32_to_cpu(pPayload->ppc_specific_rsp[3]);
> + phy->phy_reset_problem_count =
> + le32_to_cpu(pPayload->ppc_specific_rsp[4]);
> + complete(pm8001_ha->phy[phy_id].enable_completion);
> + break;
> + default:
> + PM8001_MSG_DBG(pm8001_ha,
> + pm8001_printk("other page code 0x%X\n", page_code)); break; } }
> 
>   return 0;
>  }

Any failure response also need to call complete() function. 
You can put the "complete()" at end before return.

Thanks.
Lindar

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

           reply	other threads:[~2013-10-17  3:47 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <003901cecae6$1ee5f980$5cb1ec80$@com>]

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='003a01cecaea$3c98fbe0$b5caf3a0$@com' \
    --to=lindar_liu@usish.com \
    --cc=Sangeetha.Gnanasekaran@pmcs.com \
    --cc=asanthan@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=zxh3737@163.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).