From: Tomas Henzl <thenzl@redhat.com>
To: Viswas.G@pmcs.com, linux-scsi@vger.kernel.org
Cc: Jack Wang <jinpu.wang@profitbricks.com>,
JBottomley@parallels.com, Suresh.Thiagarajan@pmcs.com,
Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH V2 2/8] pm80xx: Corrected device state changes in I_T_Nexus_Reset.
Date: Thu, 20 Aug 2015 16:51:53 +0200 [thread overview]
Message-ID: <55D5E989.9090401@redhat.com> (raw)
In-Reply-To: <1439285792-12030-3-git-send-email-Viswas.G@pmcs.com>
On 11.8.2015 11:36, Viswas.G@pmcs.com wrote:
> From: Viswas G <Viswas.G@pmcs.com>
>
> In Nexus reset the device state request are not needed.
>
> Changes from V1:
> Device state change request has been removed as the firmware
> will handle it during internal cleanup. Also updated the
> proper return value in case of failures.
>
> Signed-off-by: Viswas G <Viswas.G@pmcs.com>
>
> Reviewed-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Tomas
> ---
> drivers/scsi/pm8001/pm8001_sas.c | 18 +++++++++++++-----
> drivers/scsi/pm8001/pm8001_sas.h | 8 ++++++++
> 2 files changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index b93f289..48f4627 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -975,19 +975,27 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
> phy = sas_get_local_phy(dev);
>
> if (dev_is_sata(dev)) {
> - DECLARE_COMPLETION_ONSTACK(completion_setstate);
> if (scsi_is_sas_phy_local(phy)) {
> rc = 0;
> goto out;
> }
> rc = sas_phy_reset(phy, 1);
> + if (rc) {
> + PM8001_EH_DBG(pm8001_ha,
> + pm8001_printk("phy reset failed for device %x\n"
> + "with rc %d\n", pm8001_dev->device_id, rc));
> + rc = TMF_RESP_FUNC_FAILED;
> + goto out;
> + }
> msleep(2000);
> rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev ,
> dev, 1, 0);
> - pm8001_dev->setds_completion = &completion_setstate;
> - rc = PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha,
> - pm8001_dev, 0x01);
> - wait_for_completion(&completion_setstate);
> + if (rc) {
> + PM8001_EH_DBG(pm8001_ha,
> + pm8001_printk("task abort failed %x\n"
> + "with rc %d\n", pm8001_dev->device_id, rc));
> + rc = TMF_RESP_FUNC_FAILED;
> + }
> } else {
> rc = sas_phy_reset(phy, 1);
> msleep(2000);
> diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
> index 8dd8b78..c9736cc 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.h
> +++ b/drivers/scsi/pm8001/pm8001_sas.h
> @@ -569,6 +569,14 @@ struct pm8001_fw_image_header {
> #define NCQ_READ_LOG_FLAG 0x80000000
> #define NCQ_ABORT_ALL_FLAG 0x40000000
> #define NCQ_2ND_RLE_FLAG 0x20000000
> +
> +/* Device states */
> +#define DS_OPERATIONAL 0x01
> +#define DS_PORT_IN_RESET 0x02
> +#define DS_IN_RECOVERY 0x03
> +#define DS_IN_ERROR 0x04
> +#define DS_NON_OPERATIONAL 0x07
> +
> /**
> * brief param structure for firmware flash update.
> */
>
next prev parent reply other threads:[~2015-08-20 14:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 9:36 [PATCH V2 0/8] pm80xx: Driver updates Viswas.G
2015-08-11 9:36 ` [PATCH V2 1/8] pm80xx: Updated link rate Viswas.G
2015-08-11 9:36 ` [PATCH V2 2/8] pm80xx: Corrected device state changes in I_T_Nexus_Reset Viswas.G
2015-08-13 12:43 ` Jinpu Wang
2015-08-14 7:15 ` Viswas G
2015-08-17 7:52 ` Jinpu Wang
2015-08-20 14:51 ` Tomas Henzl [this message]
2015-08-11 9:36 ` [PATCH V2 3/8] pm80xx: Update For Thermal Page Code Viswas.G
2015-08-11 9:36 ` [PATCH V2 4/8] pm80xx: Fix for Incorrect DMA Unmapping of SG List Viswas.G
2015-08-11 9:36 ` [PATCH V2 5/8] pm80xx: Remove unnecessary phy disconnect while link error Viswas.G
2015-08-11 9:36 ` [PATCH V2 6/8] pm80xx: Add PORT RECOVERY TIMEOUT support Viswas.G
2015-08-11 9:36 ` [PATCH V2 7/8] pm80xx: Handling Invalid SSP Response frame Viswas.G
2015-08-11 9:36 ` [PATCH V2 8/8] pm80xx: Bump pm80xx driver version to 0.1.38 Viswas.G
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=55D5E989.9090401@redhat.com \
--to=thenzl@redhat.com \
--cc=JBottomley@parallels.com \
--cc=Suresh.Thiagarajan@pmcs.com \
--cc=Viswas.G@pmcs.com \
--cc=hare@suse.com \
--cc=jinpu.wang@profitbricks.com \
--cc=linux-scsi@vger.kernel.org \
/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).