Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1561919 > unrolled thread

[PATCH 0/7] hisi_sas: SATA IO workaround and other misc patches

Started byJohn Garry <john.garry@huawei.com>
First post2017-01-18 17:10 +0100
Last post2017-01-19 10:00 +0100
Articles 11 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/7] hisi_sas: SATA IO workaround and other misc patches John Garry <john.garry@huawei.com> - 2017-01-18 17:10 +0100
    [PATCH 3/7] scsi: hisi_sas: downgrade refclk message John Garry <john.garry@huawei.com> - 2017-01-18 17:10 +0100
      Re: [PATCH 3/7] scsi: hisi_sas: downgrade refclk message Johannes Thumshirn <jthumshirn@suse.de> - 2017-01-19 09:50 +0100
    [PATCH 4/7] scsi: hisi_sas: modify hard reset for directed-attached disk John Garry <john.garry@huawei.com> - 2017-01-18 17:10 +0100
      Re: [PATCH 4/7] scsi: hisi_sas: modify hard reset for  directed-attached disk Johannes Thumshirn <jthumshirn@suse.de> - 2017-01-19 10:10 +0100
    [PATCH 5/7] scsi: hisi_sas: downgrade internal abort exit print John Garry <john.garry@huawei.com> - 2017-01-18 17:10 +0100
      Re: [PATCH 5/7] scsi: hisi_sas: downgrade internal abort exit print Johannes Thumshirn <jthumshirn@suse.de> - 2017-01-19 10:10 +0100
    [PATCH 6/7] scsi: hisi_sas: fix probe ordering problem John Garry <john.garry@huawei.com> - 2017-01-18 17:10 +0100
      Re: [PATCH 6/7] scsi: hisi_sas: fix probe ordering problem Johannes Thumshirn <jthumshirn@suse.de> - 2017-01-19 10:00 +0100
    [PATCH 7/7] scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free() John Garry <john.garry@huawei.com> - 2017-01-18 17:10 +0100
      Re: [PATCH 7/7] scsi: hisi_sas: decrease running_req in  hisi_sas_slot_task_free() Johannes Thumshirn <jthumshirn@suse.de> - 2017-01-19 10:00 +0100

#1561919 — [PATCH 0/7] hisi_sas: SATA IO workaround and other misc patches

FromJohn Garry <john.garry@huawei.com>
Date2017-01-18 17:10 +0100
Subject[PATCH 0/7] hisi_sas: SATA IO workaround and other misc patches
Message-ID<t10Ya-6eP-7@gated-at.bofh.it>
This patchset introduces some misc fixes and improvements.

Most signifigantly this patchset includes a workaround
for a SATA IO issue on v2 hw (hip06/7).

John Garry (2):
  scsi: hisi_sas: downgrade refclk message
  scsi: hisi_sas: downgrade internal abort exit print

Xiang Chen (5):
  scsi: hisi_sas: workaround v2 hw SATA IO timeout issue
  scsi: hisi_sas: modify some values of ITCT table
  scsi: hisi_sas: modify hard reset for directed-attached disk
  scsi: hisi_sas: fix probe ordering problem
  scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free()

 drivers/scsi/hisi_sas/hisi_sas_main.c  |  20 +++----
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 106 +++++++++++++++++++++++++++++----
 2 files changed, 103 insertions(+), 23 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1561920 — [PATCH 3/7] scsi: hisi_sas: downgrade refclk message

FromJohn Garry <john.garry@huawei.com>
Date2017-01-18 17:10 +0100
Subject[PATCH 3/7] scsi: hisi_sas: downgrade refclk message
Message-ID<t10Ya-6eP-23@gated-at.bofh.it>
In reply to#1561919
The message to inform that the controller has no refclk
is currently at warning level, which is unnecessary, so
downgrade to debug.

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

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 22dba01..eee7ae2 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1453,7 +1453,7 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
 
 	refclk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(refclk))
-		dev_info(dev, "no ref clk property\n");
+		dev_dbg(dev, "no ref clk property\n");
 	else
 		hisi_hba->refclk_frequency_mhz = clk_get_rate(refclk) / 1000000;
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1562476 — Re: [PATCH 3/7] scsi: hisi_sas: downgrade refclk message

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-01-19 09:50 +0100
SubjectRe: [PATCH 3/7] scsi: hisi_sas: downgrade refclk message
Message-ID<t1gzT-7DU-11@gated-at.bofh.it>
In reply to#1561920
On Thu, Jan 19, 2017 at 12:32:49AM +0800, John Garry wrote:
> The message to inform that the controller has no refclk
> is currently at warning level, which is unnecessary, so
> downgrade to debug.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> Reviewed-by: Xiang Chen <chenxiang66@hisilicon.com>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@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

[toc] | [prev] | [next] | [standalone]


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

FromJohn Garry <john.garry@huawei.com>
Date2017-01-18 17:10 +0100
Subject[PATCH 4/7] scsi: hisi_sas: modify hard reset for directed-attached disk
Message-ID<t10Yb-6eP-45@gated-at.bofh.it>
In reply to#1561919
From: Xiang Chen <chenxiang66@hisilicon.com>

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

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
 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

[toc] | [prev] | [next] | [standalone]


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

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-01-19 10:10 +0100
SubjectRe: [PATCH 4/7] scsi: hisi_sas: modify hard reset for directed-attached disk
Message-ID<t1gTf-805-15@gated-at.bofh.it>
In reply to#1561924
On Thu, Jan 19, 2017 at 12:32:50AM +0800, John Garry wrote:
> From: Xiang Chen <chenxiang66@hisilicon.com>
> 
> Correctly set registers in v2 for root PHY hardreset for directly
> attached disk.
> 
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@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

[toc] | [prev] | [next] | [standalone]


#1561925 — [PATCH 5/7] scsi: hisi_sas: downgrade internal abort exit print

FromJohn Garry <john.garry@huawei.com>
Date2017-01-18 17:10 +0100
Subject[PATCH 5/7] scsi: hisi_sas: downgrade internal abort exit print
Message-ID<t10Yb-6eP-47@gated-at.bofh.it>
In reply to#1561919
Downgrade the exit print in hisi_sas_internal_task_abort()
to dbg level, as info is not required.

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

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index eee7ae2..b2782ce 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1121,7 +1121,7 @@ static int hisi_sas_query_task(struct sas_task *task)
 	}
 
 exit:
-	dev_info(dev, "internal task abort: task to dev %016llx task=%p "
+	dev_dbg(dev, "internal task abort: task to dev %016llx task=%p "
 		"resp: 0x%x sts 0x%x\n",
 		SAS_ADDR(device->sas_addr),
 		task,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1562486 — Re: [PATCH 5/7] scsi: hisi_sas: downgrade internal abort exit print

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-01-19 10:10 +0100
SubjectRe: [PATCH 5/7] scsi: hisi_sas: downgrade internal abort exit print
Message-ID<t1gTf-805-11@gated-at.bofh.it>
In reply to#1561925
On Thu, Jan 19, 2017 at 12:32:51AM +0800, John Garry wrote:
> Downgrade the exit print in hisi_sas_internal_task_abort()
> to dbg level, as info is not required.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> Reviewed-by: Xiang Chen <chenxiang66@hisilicon.com>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@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

[toc] | [prev] | [next] | [standalone]


#1561926 — [PATCH 6/7] scsi: hisi_sas: fix probe ordering problem

FromJohn Garry <john.garry@huawei.com>
Date2017-01-18 17:10 +0100
Subject[PATCH 6/7] scsi: hisi_sas: fix probe ordering problem
Message-ID<t10Yb-6eP-49@gated-at.bofh.it>
In reply to#1561919
From: Xiang Chen <chenxiang66@hisilicon.com>

There is a potential probe issue in how we trigger the hw initialisation.
Although we use 1s timer to delay hw initialisation, there is still a
potential that sas_register_ha() is not be finished before we start
the PHY init from hw->hw_init().
To avoid this issue, initialise the hw after sas_register_ha() in the
same probe context.
Note: it is not necessary to use 1s timer now (modified v2 hw only).

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  | 8 ++++----
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 ++------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index b2782ce..8601cec 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1552,10 +1552,6 @@ int hisi_sas_probe(struct platform_device *pdev,
 
 	hisi_sas_init_add(hisi_hba);
 
-	rc = hisi_hba->hw->hw_init(hisi_hba);
-	if (rc)
-		goto err_out_ha;
-
 	rc = scsi_add_host(shost, &pdev->dev);
 	if (rc)
 		goto err_out_ha;
@@ -1564,6 +1560,10 @@ int hisi_sas_probe(struct platform_device *pdev,
 	if (rc)
 		goto err_out_register_ha;
 
+	rc = hisi_hba->hw->hw_init(hisi_hba);
+	if (rc)
+		goto err_out_register_ha;
+
 	scsi_scan_host(shost);
 
 	return 0;
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 7519772..62655c7 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -1090,9 +1090,8 @@ static void phy_hard_reset_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
 	start_phy_v2_hw(hisi_hba, phy_no);
 }
 
-static void start_phys_v2_hw(unsigned long data)
+static void start_phys_v2_hw(struct hisi_hba *hisi_hba)
 {
-	struct hisi_hba *hisi_hba = (struct hisi_hba *)data;
 	int i;
 
 	for (i = 0; i < hisi_hba->n_phy; i++)
@@ -1101,10 +1100,7 @@ static void start_phys_v2_hw(unsigned long data)
 
 static void phys_init_v2_hw(struct hisi_hba *hisi_hba)
 {
-	struct timer_list *timer = &hisi_hba->timer;
-
-	setup_timer(timer, start_phys_v2_hw, (unsigned long)hisi_hba);
-	mod_timer(timer, jiffies + HZ);
+	start_phys_v2_hw(hisi_hba);
 }
 
 static void sl_notify_v2_hw(struct hisi_hba *hisi_hba, int phy_no)
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1562479 — Re: [PATCH 6/7] scsi: hisi_sas: fix probe ordering problem

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-01-19 10:00 +0100
SubjectRe: [PATCH 6/7] scsi: hisi_sas: fix probe ordering problem
Message-ID<t1gJA-7Hu-5@gated-at.bofh.it>
In reply to#1561926
On Thu, Jan 19, 2017 at 12:32:52AM +0800, John Garry wrote:
> From: Xiang Chen <chenxiang66@hisilicon.com>
> 
> There is a potential probe issue in how we trigger the hw initialisation.
> Although we use 1s timer to delay hw initialisation, there is still a
> potential that sas_register_ha() is not be finished before we start
> the PHY init from hw->hw_init().
> To avoid this issue, initialise the hw after sas_register_ha() in the
> same probe context.
> Note: it is not necessary to use 1s timer now (modified v2 hw only).
> 
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---

Looks OK,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@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

[toc] | [prev] | [next] | [standalone]


#1561929 — [PATCH 7/7] scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free()

FromJohn Garry <john.garry@huawei.com>
Date2017-01-18 17:10 +0100
Subject[PATCH 7/7] scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free()
Message-ID<t10Yb-6eP-43@gated-at.bofh.it>
In reply to#1561919
From: Xiang Chen <chenxiang66@hisilicon.com>

There is an issue that hisi_sas_dev.running_req is not
decremented properly for internal abort and TMF.

To resolve, only decrease running_req in hisi_sas_slot_task_free()

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  | 8 ++++----
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 2 --
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 8601cec..53637a9 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -71,6 +71,8 @@ void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task,
 			     struct hisi_sas_slot *slot)
 {
 	struct device *dev = &hisi_hba->pdev->dev;
+	struct domain_device *device = task->dev;
+	struct hisi_sas_device *sas_dev = device->lldd_dev;
 
 	if (!slot->task)
 		return;
@@ -97,6 +99,8 @@ void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task,
 	slot->task = NULL;
 	slot->port = NULL;
 	hisi_sas_slot_index_free(hisi_hba, slot->idx);
+	if (sas_dev)
+		atomic64_dec(&sas_dev->running_req);
 	/* slot memory is fully zeroed when it is reused */
 }
 EXPORT_SYMBOL_GPL(hisi_sas_slot_task_free);
@@ -141,8 +145,6 @@ static void hisi_sas_slot_abort(struct work_struct *work)
 	struct hisi_hba *hisi_hba = dev_to_hisi_hba(task->dev);
 	struct scsi_cmnd *cmnd = task->uldd_task;
 	struct hisi_sas_tmf_task tmf_task;
-	struct domain_device *device = task->dev;
-	struct hisi_sas_device *sas_dev = device->lldd_dev;
 	struct scsi_lun lun;
 	struct device *dev = &hisi_hba->pdev->dev;
 	int tag = abort_slot->idx;
@@ -165,8 +167,6 @@ static void hisi_sas_slot_abort(struct work_struct *work)
 	spin_unlock_irqrestore(&hisi_hba->lock, flags);
 	if (task->task_done)
 		task->task_done(task);
-	if (sas_dev)
-		atomic64_dec(&sas_dev->running_req);
 }
 
 static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 62655c7..de240d2 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -1827,8 +1827,6 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba,
 	}
 
 out:
-	if (sas_dev)
-		atomic64_dec(&sas_dev->running_req);
 
 	hisi_sas_slot_task_free(hisi_hba, task, slot);
 	sts = ts->stat;
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1562478 — Re: [PATCH 7/7] scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free()

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-01-19 10:00 +0100
SubjectRe: [PATCH 7/7] scsi: hisi_sas: decrease running_req in hisi_sas_slot_task_free()
Message-ID<t1gJz-7Hu-1@gated-at.bofh.it>
In reply to#1561929
On Thu, Jan 19, 2017 at 12:32:53AM +0800, John Garry wrote:
> From: Xiang Chen <chenxiang66@hisilicon.com>
> 
> There is an issue that hisi_sas_dev.running_req is not
> decremented properly for internal abort and TMF.
> 
> To resolve, only decrease running_req in hisi_sas_slot_task_free()
> 
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web