diff mbox

[5/8] pm80xx: Remove unnecessary phy disconnect while link error

Message ID 1438151240-4097-6-git-send-email-Viswas.G@pmcs.com (mailing list archive)
State New, archived
Headers show

Commit Message

Viswas.G@pmcs.com July 29, 2015, 6:27 a.m. UTC
From: Viswas G <Viswas.G@pmcs.com>

If the link error happens, we don't need to disconnect the phy,
which will remove the drive. Instead acknowledging the controller
and logging the error will be enough.

Signed-off-by: Viswas G <Viswas.G@pmcs.com>
Signed-off-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com> 
---
 drivers/scsi/pm8001/pm80xx_hwi.c |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

Comments

Hannes Reinecke July 29, 2015, 8:56 a.m. UTC | #1
On 07/29/2015 08:27 AM, Viswas.G@pmcs.com wrote:
> From: Viswas G <Viswas.G@pmcs.com>
> 
> If the link error happens, we don't need to disconnect the phy,
> which will remove the drive. Instead acknowledging the controller
> and logging the error will be enough.
> 
> Signed-off-by: Viswas G <Viswas.G@pmcs.com>
> Signed-off-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com> 
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c |   12 ------------
>  1 files changed, 0 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index dced9f7..3d8b4ae 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -3176,9 +3176,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  			pm8001_printk("HW_EVENT_LINK_ERR_INVALID_DWORD\n"));
>  		pm80xx_hw_event_ack_req(pm8001_ha, 0,
>  			HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0);
> -		sas_phy_disconnected(sas_phy);
> -		phy->phy_attached = 0;
> -		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>  		break;
>  	case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
>  		PM8001_MSG_DBG(pm8001_ha,
> @@ -3186,9 +3183,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  		pm80xx_hw_event_ack_req(pm8001_ha, 0,
>  			HW_EVENT_LINK_ERR_DISPARITY_ERROR,
>  			port_id, phy_id, 0, 0);
> -		sas_phy_disconnected(sas_phy);
> -		phy->phy_attached = 0;
> -		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>  		break;
>  	case HW_EVENT_LINK_ERR_CODE_VIOLATION:
>  		PM8001_MSG_DBG(pm8001_ha,
> @@ -3196,9 +3190,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  		pm80xx_hw_event_ack_req(pm8001_ha, 0,
>  			HW_EVENT_LINK_ERR_CODE_VIOLATION,
>  			port_id, phy_id, 0, 0);
> -		sas_phy_disconnected(sas_phy);
> -		phy->phy_attached = 0;
> -		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>  		break;
>  	case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
>  		PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
> @@ -3206,9 +3197,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>  		pm80xx_hw_event_ack_req(pm8001_ha, 0,
>  			HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
>  			port_id, phy_id, 0, 0);
> -		sas_phy_disconnected(sas_phy);
> -		phy->phy_attached = 0;
> -		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>  		break;
>  	case HW_EVENT_MALFUNCTION:
>  		PM8001_MSG_DBG(pm8001_ha,
> 
So what happens with the port, then?
Will you be getting another event when the port finally disconnects?
If not, how to you remove the port after a link failure?

Cheers,

Hannes
Viswas.G@pmcs.com July 29, 2015, 9:20 a.m. UTC | #2
On Wed, Jul 29, 2015 at 2:26 PM, Hannes Reinecke <hare@suse.de> wrote:
> On 07/29/2015 08:27 AM, Viswas.G@pmcs.com wrote:
>> From: Viswas G <Viswas.G@pmcs.com>
>>
>> If the link error happens, we don't need to disconnect the phy,
>> which will remove the drive. Instead acknowledging the controller
>> and logging the error will be enough.
>>
>> Signed-off-by: Viswas G <Viswas.G@pmcs.com>
>> Signed-off-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>
>> ---
>>  drivers/scsi/pm8001/pm80xx_hwi.c |   12 ------------
>>  1 files changed, 0 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
>> index dced9f7..3d8b4ae 100644
>> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
>> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
>> @@ -3176,9 +3176,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>                       pm8001_printk("HW_EVENT_LINK_ERR_INVALID_DWORD\n"));
>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>                       HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0);
>> -             sas_phy_disconnected(sas_phy);
>> -             phy->phy_attached = 0;
>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>               break;
>>       case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
>>               PM8001_MSG_DBG(pm8001_ha,
>> @@ -3186,9 +3183,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>                       HW_EVENT_LINK_ERR_DISPARITY_ERROR,
>>                       port_id, phy_id, 0, 0);
>> -             sas_phy_disconnected(sas_phy);
>> -             phy->phy_attached = 0;
>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>               break;
>>       case HW_EVENT_LINK_ERR_CODE_VIOLATION:
>>               PM8001_MSG_DBG(pm8001_ha,
>> @@ -3196,9 +3190,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>                       HW_EVENT_LINK_ERR_CODE_VIOLATION,
>>                       port_id, phy_id, 0, 0);
>> -             sas_phy_disconnected(sas_phy);
>> -             phy->phy_attached = 0;
>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>               break;
>>       case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
>>               PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
>> @@ -3206,9 +3197,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>                       HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
>>                       port_id, phy_id, 0, 0);
>> -             sas_phy_disconnected(sas_phy);
>> -             phy->phy_attached = 0;
>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>               break;
>>       case HW_EVENT_MALFUNCTION:
>>               PM8001_MSG_DBG(pm8001_ha,
>>
> So what happens with the port, then?
> Will you be getting another event when the port finally disconnects?
> If not, how to you remove the port after a link failure?
>

When the Phy disconnects, we will be getting the PHY DOWN events for 
the phys in that port and we will remove that port. 

> Cheers,
>
> Hannes
> --
> Dr. Hannes Reinecke                            zSeries & Storage
> hare@suse.de                                   +49 911 74053 688
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
> HRB 21284 (AG Nürnberg)
> --
> 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
--
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
Hannes Reinecke July 29, 2015, 9:21 a.m. UTC | #3
On 07/29/2015 11:20 AM, Viswas G wrote:
> 
> On Wed, Jul 29, 2015 at 2:26 PM, Hannes Reinecke <hare@suse.de> wrote:
>> On 07/29/2015 08:27 AM, Viswas.G@pmcs.com wrote:
>>> From: Viswas G <Viswas.G@pmcs.com>
>>>
>>> If the link error happens, we don't need to disconnect the phy,
>>> which will remove the drive. Instead acknowledging the controller
>>> and logging the error will be enough.
>>>
>>> Signed-off-by: Viswas G <Viswas.G@pmcs.com>
>>> Signed-off-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>
>>> ---
>>>  drivers/scsi/pm8001/pm80xx_hwi.c |   12 ------------
>>>  1 files changed, 0 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
>>> index dced9f7..3d8b4ae 100644
>>> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
>>> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
>>> @@ -3176,9 +3176,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>>                       pm8001_printk("HW_EVENT_LINK_ERR_INVALID_DWORD\n"));
>>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>>                       HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0);
>>> -             sas_phy_disconnected(sas_phy);
>>> -             phy->phy_attached = 0;
>>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>>               break;
>>>       case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
>>>               PM8001_MSG_DBG(pm8001_ha,
>>> @@ -3186,9 +3183,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>>                       HW_EVENT_LINK_ERR_DISPARITY_ERROR,
>>>                       port_id, phy_id, 0, 0);
>>> -             sas_phy_disconnected(sas_phy);
>>> -             phy->phy_attached = 0;
>>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>>               break;
>>>       case HW_EVENT_LINK_ERR_CODE_VIOLATION:
>>>               PM8001_MSG_DBG(pm8001_ha,
>>> @@ -3196,9 +3190,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>>                       HW_EVENT_LINK_ERR_CODE_VIOLATION,
>>>                       port_id, phy_id, 0, 0);
>>> -             sas_phy_disconnected(sas_phy);
>>> -             phy->phy_attached = 0;
>>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>>               break;
>>>       case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
>>>               PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
>>> @@ -3206,9 +3197,6 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
>>>               pm80xx_hw_event_ack_req(pm8001_ha, 0,
>>>                       HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
>>>                       port_id, phy_id, 0, 0);
>>> -             sas_phy_disconnected(sas_phy);
>>> -             phy->phy_attached = 0;
>>> -             sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
>>>               break;
>>>       case HW_EVENT_MALFUNCTION:
>>>               PM8001_MSG_DBG(pm8001_ha,
>>>
>> So what happens with the port, then?
>> Will you be getting another event when the port finally disconnects?
>> If not, how to you remove the port after a link failure?
>>
> 
> When the Phy disconnects, we will be getting the PHY DOWN events for 
> the phys in that port and we will remove that port. 
> 
Okay, thanks.

Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Tomas Henzl July 30, 2015, 10:08 a.m. UTC | #4
On 29.7.2015 08:27, Viswas.G@pmcs.com wrote:
> From: Viswas G <Viswas.G@pmcs.com>
> 
> If the link error happens, we don't need to disconnect the phy,
> which will remove the drive. Instead acknowledging the controller
> and logging the error will be enough.
> 
> Signed-off-by: Viswas G <Viswas.G@pmcs.com>
> Signed-off-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com> 
Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas


--
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
diff mbox

Patch

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index dced9f7..3d8b4ae 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -3176,9 +3176,6 @@  static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
 			pm8001_printk("HW_EVENT_LINK_ERR_INVALID_DWORD\n"));
 		pm80xx_hw_event_ack_req(pm8001_ha, 0,
 			HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0);
-		sas_phy_disconnected(sas_phy);
-		phy->phy_attached = 0;
-		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
 		break;
 	case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
 		PM8001_MSG_DBG(pm8001_ha,
@@ -3186,9 +3183,6 @@  static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
 		pm80xx_hw_event_ack_req(pm8001_ha, 0,
 			HW_EVENT_LINK_ERR_DISPARITY_ERROR,
 			port_id, phy_id, 0, 0);
-		sas_phy_disconnected(sas_phy);
-		phy->phy_attached = 0;
-		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
 		break;
 	case HW_EVENT_LINK_ERR_CODE_VIOLATION:
 		PM8001_MSG_DBG(pm8001_ha,
@@ -3196,9 +3190,6 @@  static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
 		pm80xx_hw_event_ack_req(pm8001_ha, 0,
 			HW_EVENT_LINK_ERR_CODE_VIOLATION,
 			port_id, phy_id, 0, 0);
-		sas_phy_disconnected(sas_phy);
-		phy->phy_attached = 0;
-		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
 		break;
 	case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
 		PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
@@ -3206,9 +3197,6 @@  static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb)
 		pm80xx_hw_event_ack_req(pm8001_ha, 0,
 			HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
 			port_id, phy_id, 0, 0);
-		sas_phy_disconnected(sas_phy);
-		phy->phy_attached = 0;
-		sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
 		break;
 	case HW_EVENT_MALFUNCTION:
 		PM8001_MSG_DBG(pm8001_ha,