All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1 2/3] pm80xx: Resetting the phy state.
@ 2013-11-11 16:24 Anand
  2013-11-13  9:35 ` Jack Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Anand @ 2013-11-11 16:24 UTC (permalink / raw)
  To: linux-scsi
  Cc: xjtuwjp, Sangeetha.Gnanasekaran, Viswas.G, Nikith.Ganigarakoppal

>From 800d934dd22f3ef5d7f52d900295d371d17004bd Mon Sep 17 00:00:00 2001
From: Nikith Ganigarakoppal <Nikith.Ganigarakoppal@pmcs.com>
Date: Wed, 30 Oct 2013 16:23:47 +0530
Subject: [PATCH V1 2/3] pm80xx: Resetting the phy state.

Setting the phy state for hard reset response.
After sending hard reset for a device ,phy down event sets
the phy state to zero but for phy up event it will not set
the phy state again.This will cause problem to successive
hard resets.


Signed-off-by: Anandkumar.Santhanam@pmcs.com
Signed-off-by: Nikith.Ganigarakoppal@pmcs.com
---
 drivers/scsi/pm8001/pm8001_hwi.c |    2 ++
 drivers/scsi/pm8001/pm8001_hwi.h |    4 ++++
 drivers/scsi/pm8001/pm80xx_hwi.c |    2 ++
 drivers/scsi/pm8001/pm80xx_hwi.h |    2 ++
 4 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 9961616..b23f49d 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -3403,6 +3403,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
 	unsigned long flags;
 	u8 deviceType = pPayload->sas_identify.dev_type;
 	port->port_state =  portstate;
+	phy->phy_state = PHY_STATE_LINK_UP_SPC;
 	PM8001_MSG_DBG(pm8001_ha,
 		pm8001_printk("HW_EVENT_SAS_PHY_UP port id = %d, phy id = %d\n",
 		port_id, phy_id));
@@ -3483,6 +3484,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
 		pm8001_printk("HW_EVENT_SATA_PHY_UP port id = %d,"
 		" phy id = %d\n", port_id, phy_id));
 	port->port_state =  portstate;
+	phy->phy_state = PHY_STATE_LINK_UP_SPC;
 	port->port_attached = 1;
 	pm8001_get_lrate_mode(phy, link_rate);
 	phy->phy_type |= PORT_TYPE_SATA;
diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
index 6d91e24..e4867e6 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.h
+++ b/drivers/scsi/pm8001/pm8001_hwi.h
@@ -131,6 +131,10 @@
 #define LINKRATE_30			(0x02 << 8)
 #define LINKRATE_60			(0x04 << 8)
 
+/* for phy state */
+
+#define PHY_STATE_LINK_UP_SPC		0x1
+
 /* for new SPC controllers MEMBASE III is shared between BIOS and DATA */
 #define GSM_SM_BASE			0x4F0000
 struct mpi_msg_hdr{
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 4ebc79b..41bee62 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -2894,6 +2894,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
 	unsigned long flags;
 	u8 deviceType = pPayload->sas_identify.dev_type;
 	port->port_state = portstate;
+	phy->phy_state = PHY_STATE_LINK_UP_SPCV;
 	PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
 		"portid:%d; phyid:%d; linkrate:%d; "
 		"portstate:%x; devicetype:%x\n",
@@ -2978,6 +2979,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
 				port_id, phy_id, link_rate, portstate));
 
 	port->port_state = portstate;
+	phy->phy_state = PHY_STATE_LINK_UP_SPCV;
 	port->port_attached = 1;
 	pm8001_get_lrate_mode(phy, link_rate);
 	phy->phy_type |= PORT_TYPE_SATA;
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
index c86816b..9970a38 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.h
+++ b/drivers/scsi/pm8001/pm80xx_hwi.h
@@ -215,6 +215,8 @@
 #define SAS_DOPNRJT_RTRY_TMO            128
 #define SAS_COPNRJT_RTRY_TMO            128
 
+/* for phy state */
+#define PHY_STATE_LINK_UP_SPCV		0x2
 /*
   Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second.
   Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V1 2/3] pm80xx: Resetting the phy state.
  2013-11-11 16:24 [PATCH V1 2/3] pm80xx: Resetting the phy state Anand
@ 2013-11-13  9:35 ` Jack Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jack Wang @ 2013-11-13  9:35 UTC (permalink / raw)
  To: Anand; +Cc: linux-scsi, Sangeetha.Gnanasekaran, Viswas.G, Nikith.Ganigarakoppal

On 11/11/2013 05:24 PM, Anand wrote:
> From 800d934dd22f3ef5d7f52d900295d371d17004bd Mon Sep 17 00:00:00 2001
> From: Nikith Ganigarakoppal <Nikith.Ganigarakoppal@pmcs.com>
> Date: Wed, 30 Oct 2013 16:23:47 +0530
> Subject: [PATCH V1 2/3] pm80xx: Resetting the phy state.
> 
> Setting the phy state for hard reset response.
> After sending hard reset for a device ,phy down event sets
> the phy state to zero but for phy up event it will not set
> the phy state again.This will cause problem to successive
> hard resets.
> 
> 
> Signed-off-by: Anandkumar.Santhanam@pmcs.com
> Signed-off-by: Nikith.Ganigarakoppal@pmcs.com
Nice catch, Thanks

Reviewed-by: Jack Wang <jinpu.wang@profitbricks.com>

PS: same about the signed-off chain.
> ---
>  drivers/scsi/pm8001/pm8001_hwi.c |    2 ++
>  drivers/scsi/pm8001/pm8001_hwi.h |    4 ++++
>  drivers/scsi/pm8001/pm80xx_hwi.c |    2 ++
>  drivers/scsi/pm8001/pm80xx_hwi.h |    2 ++
>  4 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
> index 9961616..b23f49d 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.c
> +++ b/drivers/scsi/pm8001/pm8001_hwi.c
> @@ -3403,6 +3403,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  	unsigned long flags;
>  	u8 deviceType = pPayload->sas_identify.dev_type;
>  	port->port_state =  portstate;
> +	phy->phy_state = PHY_STATE_LINK_UP_SPC;
>  	PM8001_MSG_DBG(pm8001_ha,
>  		pm8001_printk("HW_EVENT_SAS_PHY_UP port id = %d, phy id = %d\n",
>  		port_id, phy_id));
> @@ -3483,6 +3484,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  		pm8001_printk("HW_EVENT_SATA_PHY_UP port id = %d,"
>  		" phy id = %d\n", port_id, phy_id));
>  	port->port_state =  portstate;
> +	phy->phy_state = PHY_STATE_LINK_UP_SPC;
>  	port->port_attached = 1;
>  	pm8001_get_lrate_mode(phy, link_rate);
>  	phy->phy_type |= PORT_TYPE_SATA;
> diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
> index 6d91e24..e4867e6 100644
> --- a/drivers/scsi/pm8001/pm8001_hwi.h
> +++ b/drivers/scsi/pm8001/pm8001_hwi.h
> @@ -131,6 +131,10 @@
>  #define LINKRATE_30			(0x02 << 8)
>  #define LINKRATE_60			(0x04 << 8)
>  
> +/* for phy state */
> +
> +#define PHY_STATE_LINK_UP_SPC		0x1
> +
>  /* for new SPC controllers MEMBASE III is shared between BIOS and DATA */
>  #define GSM_SM_BASE			0x4F0000
>  struct mpi_msg_hdr{
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 4ebc79b..41bee62 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -2894,6 +2894,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  	unsigned long flags;
>  	u8 deviceType = pPayload->sas_identify.dev_type;
>  	port->port_state = portstate;
> +	phy->phy_state = PHY_STATE_LINK_UP_SPCV;
>  	PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
>  		"portid:%d; phyid:%d; linkrate:%d; "
>  		"portstate:%x; devicetype:%x\n",
> @@ -2978,6 +2979,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  				port_id, phy_id, link_rate, portstate));
>  
>  	port->port_state = portstate;
> +	phy->phy_state = PHY_STATE_LINK_UP_SPCV;
>  	port->port_attached = 1;
>  	pm8001_get_lrate_mode(phy, link_rate);
>  	phy->phy_type |= PORT_TYPE_SATA;
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
> index c86816b..9970a38 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.h
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.h
> @@ -215,6 +215,8 @@
>  #define SAS_DOPNRJT_RTRY_TMO            128
>  #define SAS_COPNRJT_RTRY_TMO            128
>  
> +/* for phy state */
> +#define PHY_STATE_LINK_UP_SPCV		0x2
>  /*
>    Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second.
>    Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-13  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-11 16:24 [PATCH V1 2/3] pm80xx: Resetting the phy state Anand
2013-11-13  9:35 ` Jack Wang

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.