mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: <jejb@linux.vnet.ibm.com>, <martin.petersen@oracle.com>
Cc: <linuxarm@huawei.com>, <linux-kernel@vger.kernel.org>,
	<linux-scsi@vger.kernel.org>,
	Xiang Chen <chenxiang66@hisilicon.com>,
	"John Garry" <john.garry@huawei.com>
Subject: [PATCH 2/9] scsi: hisi_sas: Remedy inconsistent PHY down state in software
Date: Thu, 11 Apr 2019 20:46:37 +0800	[thread overview]
Message-ID: <1554986804-233706-3-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com>

From: Xiang Chen <chenxiang66@hisilicon.com>

Currently there are two scenarioes which may cause PHY state of hardware
(which is 0) is inconsistent with the state held in software:
- Unplug SAS wire before get_phys_state when SAS controller reset, then the interrupts
of phy down are ignored, phy state is 0 before reset, and it also gets 0 after
reset, so phy down doesn't occur even if unpluged SAS wire;
- For v3 hw later version, it will close bus when 2 bit ECC error occur.
So if unplug SAS wire at that time, interrupts of phy down also not occur.
So at last it will cause host reset. It also get phy state 0 before and
after reset, the same issue occurs.

To solve it, use hisi_sas_phy_down() directly in rescan topology function.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index a1eaddcf740d..e7401e2bea27 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1427,9 +1427,9 @@ static void hisi_sas_rescan_topology(struct hisi_hba *hisi_hba, u32 old_state,
 					sas_ha->notify_port_event(sas_phy,
 							PORTE_BROADCAST_RCVD);
 			}
-		} else if (old_state & (1 << phy_no))
-			/* PHY down but was up before */
+		} else {
 			hisi_sas_phy_down(hisi_hba, phy_no, 0);
+		}
 
 	}
 }
-- 
2.17.1


  parent reply	other threads:[~2019-04-11 12:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 12:46 [PATCH 0/9] hisi_sas: Some misc patches John Garry
2019-04-11 12:46 ` [PATCH 1/9] scsi: hisi_sas: add host reset interface for test John Garry
2019-04-11 12:46 ` John Garry [this message]
2019-04-11 12:46 ` [PATCH 3/9] scsi: hisi_sas: Fix for setting the PHY linkrate when disconnected John Garry
2019-04-11 12:46 ` [PATCH 4/9] scsi: hisi_sas: Adjust the printk format of functions hisi_sas_init_device() John Garry
2019-04-11 12:46 ` [PATCH 5/9] scsi: hisi_sas: allocate different SAS address for directly attached situation John Garry
2019-04-11 12:46 ` [PATCH 6/9] scsi: hisi_sas: Support all RAS events with MSI interrupts John Garry
2019-04-11 12:46 ` [PATCH 7/9] scsi: hisi_sas: Don't hard reset disk during controller reset John Garry
2019-04-11 12:46 ` [PATCH 8/9] scsi: hisi_sas: Don't fail IT nexus reset for Open Reject timeout John Garry
2019-04-11 12:46 ` [PATCH 9/9] scsi: hisi_sas: Some misc tidy-up John Garry
2019-04-15 23:08 ` [PATCH 0/9] hisi_sas: Some misc patches Martin K. Petersen

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=1554986804-233706-3-git-send-email-john.garry@huawei.com \
    --to=john.garry@huawei.com \
    --cc=chenxiang66@hisilicon.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=martin.petersen@oracle.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

all inboxes | Powered by JetHome®