Re: [PATCH 4/7] scsi: hisi_sas: modify hard reset for directed-attached disk

2017-01-19 Thread Johannes Thumshirn
On Thu, Jan 19, 2017 at 12:32:50AM +0800, John Garry wrote:
> From: Xiang Chen 
> 
> Correctly set registers in v2 for root PHY hardreset for directly
> attached disk.
> 
> Signed-off-by: Xiang Chen 
> Signed-off-by: John Garry 
> ---

Looks good,
Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] scsi: hisi_sas: modify hard reset for directed-attached disk

2017-01-18 Thread John Garry
From: Xiang Chen 

Correctly set registers in v2 for root PHY hardreset for directly
attached disk.

Signed-off-by: Xiang Chen 
Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c 
b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 452e329..7519772 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -207,6 +207,8 @@
 #define TXID_AUTO  (PORT_BASE + 0xb8)
 #define TXID_AUTO_CT3_OFF  1
 #define TXID_AUTO_CT3_MSK  (0x1 << TXID_AUTO_CT3_OFF)
+#define TX_HARDRST_OFF  2
+#define TX_HARDRST_MSK  (0x1 << TX_HARDRST_OFF)
 #define RX_IDAF_DWORD0 (PORT_BASE + 0xc4)
 #define RX_IDAF_DWORD1 (PORT_BASE + 0xc8)
 #define RX_IDAF_DWORD2 (PORT_BASE + 0xcc)
@@ -1075,7 +1077,15 @@ static void stop_phy_v2_hw(struct hisi_hba *hisi_hba, 
int phy_no)
 
 static void phy_hard_reset_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
 {
+   struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
+   u32 txid_auto;
+
stop_phy_v2_hw(hisi_hba, phy_no);
+   if (phy->identify.device_type == SAS_END_DEVICE) {
+   txid_auto = hisi_sas_phy_read32(hisi_hba, phy_no, TXID_AUTO);
+   hisi_sas_phy_write32(hisi_hba, phy_no, TXID_AUTO,
+   txid_auto | TX_HARDRST_MSK);
+   }
msleep(100);
start_phy_v2_hw(hisi_hba, phy_no);
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html