* RE: [PATCH Resend] [scsi] pm8001 : fix panic when cat /sys/class/sas_phy/phy-8:0/running_disparity_error_count
[not found] ` <003901cecae6$1ee5f980$5cb1ec80$@com>
@ 2013-10-17 3:37 ` lindar_liu
0 siblings, 0 replies; only message in thread
From: lindar_liu @ 2013-10-17 3:37 UTC (permalink / raw)
To: 'zxh3737', linux-scsi; +Cc: asanthan, Sangeetha.Gnanasekaran
>
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-10-17 3:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <33d91895.262d9.141c17a5a04.Coremail.zxh3737@163.com>
[not found] ` <003901cecae6$1ee5f980$5cb1ec80$@com>
2013-10-17 3:37 ` [PATCH Resend] [scsi] pm8001 : fix panic when cat /sys/class/sas_phy/phy-8:0/running_disparity_error_count lindar_liu
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).