From patchwork Tue Apr 6 11:48:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 415889 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4490479jai; Tue, 6 Apr 2021 04:52:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxskHkNO2DvKYWEfKE226BYb5zE4H0bzHahrUAPF6VFFrdS6K9RLA2SMzpEHINMGJV9cFUA X-Received: by 2002:a17:906:71d3:: with SMTP id i19mr34152227ejk.347.1617709967356; Tue, 06 Apr 2021 04:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617709967; cv=none; d=google.com; s=arc-20160816; b=GE72IMK4EKiVOVjuhdACzUB1D4dAimmgDo+3NWohypvmw1v7fiOJ1KEV6x0F50ZuO1 5KAp3MvDPYweQ/dFzrP+Bl1pDIGzR9DmClRL5vw2nD5wv565RtYB47Lf1OJAAJYqGYjv c4jcs88PSeWHkG+aS+16r6Wt2p8u+cHLP34OwH0b7FEdWD+g3bnEjJB9bxCOVzhj5Ld0 uyn9BtahV7qeGtkxlJiYzAeBxL84jICbFDIDulGleEPkjaIWHsPvrfQG3xzHTSTKemPx zOF6/8wbmo+K92XTZEIcc/evqtDJrpcQ6nM342L8g/HSyoH66qAOWSGikgYCE61SfYiI 3RYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=2qdqdfClLaV0jOzcVAC7PqFKhcgMK/UTtmSS6ChigSY=; b=qweF5A9GdxyWsq4LjS5JitXbY/uPMFsU8Mvq+mN2IZpwB/MOaZNPrkZ5iJ2QOqcBQE mIIdeZ9hsufjPROe3g9YzCTWL+3/UUiMqvhFNlKWCe8QX0/66XHJPwlS0WmsOR8uaTJ9 D3rJZmmr6mwwRdx/d2xgyNigSPj+Qf6F6XXJeIHDgrQFMNee8ViGOqyA0ioBk5EWCp3p 7jUYOA6++36wKHTcYXEO+g6xN0VJAwqq7bIb+NBGctcMHOkkxoPpFrpS1csC09svRk5C IwZUMNtz/JBFQnCJ+8vZQQbbVqL7fSeNK3T8ajtqCRfneN0G15TWn6k+0QtraS7yadZa 1ZCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si17443705edw.487.2021.04.06.04.52.47 for ; Tue, 06 Apr 2021 04:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343501AbhDFLwx (ORCPT ); Tue, 6 Apr 2021 07:52:53 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15136 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbhDFLww (ORCPT ); Tue, 6 Apr 2021 07:52:52 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FF5Rp26tmzpVLQ; Tue, 6 Apr 2021 19:49:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 19:52:37 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 1/6] scsi: hisi_sas: Delete some unused callbacks Date: Tue, 6 Apr 2021 19:48:26 +0800 Message-ID: <1617709711-195853-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1617709711-195853-1-git-send-email-john.garry@huawei.com> References: <1617709711-195853-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing The debugfs code has been relocated to v3 hw driver, so delete unused struct hisi_sas_hw function pointers snapshot_{prepare, restore}. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 2 -- 1 file changed, 2 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 2401a9575215..4dd53bc2d946 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -346,8 +346,6 @@ struct hisi_sas_hw { u8 reg_index, u8 reg_count, u8 *write_data); void (*wait_cmds_complete_timeout)(struct hisi_hba *hisi_hba, int delay_ms, int timeout_ms); - void (*snapshot_prepare)(struct hisi_hba *hisi_hba); - void (*snapshot_restore)(struct hisi_hba *hisi_hba); int complete_hdr_size; struct scsi_host_template *sht; }; From patchwork Tue Apr 6 11:48:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 415893 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4490529jai; Tue, 6 Apr 2021 04:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHUsRongIDQf3JyFrsvXnBzSmRYAYNVcl1ldbsZUB0Xg2QshyPbatX8gHY9Uu206O6CPpS X-Received: by 2002:a05:6402:270c:: with SMTP id y12mr37432051edd.284.1617709973172; Tue, 06 Apr 2021 04:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617709973; cv=none; d=google.com; s=arc-20160816; b=o+hV+0eYrar9s0qobFH3C7kmhpAmw1kR381e/ejUtv0S7SOzhcZnHFJ11/JVI2HKwj ThRGG3+YeXGJGB0oSGEjGIlo3ZSEe+MQ0+sKm/fyTTA1P+hKEAaxzasMA3zl2jLKROti 0OmBziKys4UUK7JWqJaNi8Fr4MXwT+kj96cmoiM6smhwoZ5Lf0iJf28W9CRa4m6slKBd AL1rUmBxChs5uUmPbryC3YEbmeXu8srmzQlHJBbq4sS5Ju+uu1DPZLaC5jmOmMdJyKCN A3mGvuXONcFzZw3s/2C54pRt4cAKHvwm4tL2LL3F43wEA9czGa1GqGJS5xoxg/Q1/quG A3qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=CD3SJU7o7UvjWjPEvkiqGPFB0D5juY/HPR07+/nKuYw=; b=rjn8HyEZGMhrlH1MpfNy4BsIcXWpNf0q6ep/LyfCVfFxHx7GbyVdoBk5dqVRk9CkJ6 LNE4sNPoOsbQzJ2zZQunToMw/KgBRv8mVij5DOSgZk3y6KnmEG0hBmVP8MNQbjJawkcZ r8ypCuo5mrhRYbGnrM+P0iTBCT4LvVEDDoXVb1F27X3nwhGjizhCqxcZn6aCIX196adX HSTr81Emsnrq47F8SxI7MqDK7iVSsWBtGP3kwEaAsgnCN7Q6MXXmh3oGzqqf5FrZLm7H XhAugsS2yk4KbQ2mQ7I4KIH69rTImBAfitRhM8Zi/GmH21GF5eEKyTly1LpV6oxnjdVy kyGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si17443705edw.487.2021.04.06.04.52.53 for ; Tue, 06 Apr 2021 04:52:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343539AbhDFLw7 (ORCPT ); Tue, 6 Apr 2021 07:52:59 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16360 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343534AbhDFLw5 (ORCPT ); Tue, 6 Apr 2021 07:52:57 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FF5SY3ffBz9405; Tue, 6 Apr 2021 19:50:37 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 19:52:37 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 2/6] scsi: hisi_sas: Print SAS address for v3 hw erroneous completion print Date: Tue, 6 Apr 2021 19:48:27 +0800 Message-ID: <1617709711-195853-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1617709711-195853-1-git-send-email-john.garry@huawei.com> References: <1617709711-195853-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing To help debugging efforts, print the device SAS address for v3 hw erroneous completion log. Here is an example print: hisi_sas_v3_hw 0000:b4:02.0: erroneous completion iptt=2193 task=000000002b0c13f8 dev id=17 addr=570fd45f9d17b001 Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 4580e081e489..51187dd53c86 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2252,8 +2252,9 @@ static void slot_complete_v3_hw(struct hisi_hba *hisi_hba, slot_err_v3_hw(hisi_hba, task, slot); if (ts->stat != SAS_DATA_UNDERRUN) - dev_info(dev, "erroneous completion iptt=%d task=%pK dev id=%d CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n", + dev_info(dev, "erroneous completion iptt=%d task=%pK dev id=%d addr=%016llx CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n", slot->idx, task, sas_dev->device_id, + SAS_ADDR(device->sas_addr), dw0, dw1, complete_hdr->act, dw3, error_info[0], error_info[1], error_info[2], error_info[3]); From patchwork Tue Apr 6 11:48:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 415892 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4490518jai; Tue, 6 Apr 2021 04:52:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2d+CElb5r7y/yp1iJNAzLODNcaMXzwkSePEbFvVLYWbNpFxxFlHvC69TcOILyeE9ARe9B X-Received: by 2002:a17:907:2062:: with SMTP id qp2mr33471657ejb.397.1617709972035; Tue, 06 Apr 2021 04:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617709972; cv=none; d=google.com; s=arc-20160816; b=bsQzzMLYeY0LTWuvmh1OgIIfILpuy3IxXkshNz/9jj+imdIC298uuRygJgz09aKYxj 4aJMoyKycvoJC6yL1a2RrkhaR89xRafWgEeJZCioJMuHdM1OgiVMIuQZ8ldMZsMtarHm dG6cAB9OYMV53o0+VUTbMwrREMzog8gwqgk+J9IX2/QDn+2V53IvZ645zQaAokg+JhLu vC/yhVyCMCxPR550xTXtsB33aqPcFEb1QkkWifdxOzUf/EORdAceN7kyN8CrUSfuGjTV Rp65gnyR5yDXr9csGQn0i3MPkmAol+mtrTbSFdMVWx0tjX2Qa7wNDAvh2BBh558YfUCj dAVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Ec0c3KoNmfoe8nAXGCdNMjbvQ4QP+laIdqa6hMuFBnU=; b=uO/LffZVPIKck2dtP/s3tV723l7ZMMHv1pdQJwGJ16zy8cWhMkTCJQU71mKHX3Jg1c ZiVfI/zV3a7SkRagCjyJTfCdLXbeKuy/mTxtIfY+B5Zym0QGUyhPGSH0pu1kZQ3GHZED riZDuZCuG1Ey3aIkr6n4k3LNw5pdoZuuX4ztgyzjpntEyNFH7yYur11h5Hqss4rL9Rt6 YSRakvtTX4EKkntwkOWc8U6HRcpgkR6ICPiNOERsrDjU9+KU2vqPS6KWTyhp4Z1/AOkf hdgtsUE3j1WopMmdmkaXjjIcWcQgbO7lvEMPkTWlPDoiJxYSY2lHSBpE40DLK8sWy1cV Z+vQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si17443705edw.487.2021.04.06.04.52.51 for ; Tue, 06 Apr 2021 04:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343538AbhDFLw6 (ORCPT ); Tue, 6 Apr 2021 07:52:58 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16362 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243272AbhDFLw5 (ORCPT ); Tue, 6 Apr 2021 07:52:57 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FF5SY3Qpzz93l6; Tue, 6 Apr 2021 19:50:37 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 19:52:37 +0800 From: John Garry To: , CC: , , , Xiang Chen , John Garry Subject: [PATCH 3/6] scsi: hisi_sas: Call sas_unregister_ha() to roll back if .hw_init() fails Date: Tue, 6 Apr 2021 19:48:28 +0800 Message-ID: <1617709711-195853-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1617709711-195853-1-git-send-email-john.garry@huawei.com> References: <1617709711-195853-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen Function sas_unregister_ha() needs to be called to roll back if hisi_hba->hw->hw_init() fails in function hisi_sas_probe() or hisi_sas_v3_probe(), so make that change. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 +++- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index a979edfd9a78..971c45a1401c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2689,12 +2689,14 @@ int hisi_sas_probe(struct platform_device *pdev, rc = hisi_hba->hw->hw_init(hisi_hba); if (rc) - goto err_out_register_ha; + goto err_out_hw_init; scsi_scan_host(shost); return 0; +err_out_hw_init: + sas_unregister_ha(sha); err_out_register_ha: scsi_remove_host(shost); err_out_ha: diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 51187dd53c86..d7f8ba0c1680 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -4761,7 +4761,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) rc = hisi_sas_v3_init(hisi_hba); if (rc) - goto err_out_register_ha; + goto err_out_hw_init; scsi_scan_host(shost); @@ -4778,6 +4778,8 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) return 0; +err_out_hw_init: + sas_unregister_ha(sha); err_out_register_ha: scsi_remove_host(shost); err_out_free_irq_vectors: From patchwork Tue Apr 6 11:48:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 415895 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4490558jai; Tue, 6 Apr 2021 04:52:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2/jgpPwZkXxB3mC6Myj4wSvgvrZzTEJP7EeFovxtTG+PVjoYBXLu7qu7vDzrteq9LwX0T X-Received: by 2002:a05:6402:4388:: with SMTP id o8mr23982592edc.262.1617709976716; Tue, 06 Apr 2021 04:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617709976; cv=none; d=google.com; s=arc-20160816; b=twaPiO20ntwsngwbrn+lvXkyCbuC1C1YvRV0vPfbxEy+NIbtZlT7BN7sbjAY2zYpkZ 3T7ljuSC+qccGIAe3W+e3St21FJ3w6vJwhpcLd+xwCKUJaSoqSBuOXDQTKOQMnhVvYwP 8TvzatyGOE+wZ1+SX90tV81TtRdgiwQcyh+0ZY0Fu6VNm7o+ILvoPMcn9W+zoVdCTsXK HFJTXePs6d3s1XZ6bYXQeOkfegNiAB5AHvcaB7JjUfkuoG+ts3iKjy55TjtJyrAwMHtz E4b1L3Htq6RpRBe88PHRbvKxVyNnLJh6sb0Bg3Q3/X7/SK76t0zti640vnZv6AUJVnV7 42Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zKe7KGZNqOnNS2X3cI3P5D6/SjW3xn0IpFxqef9nkzQ=; b=iY+NGuexyIMx36gPpGEXb3BaDBrist/c7/N9pkWNIDKuiYPa9ki1KK6qpOpoV2uSgc xVhVVH960ucr+7wtWECe7PXSpdL+bTSuqJHypN9UDirjL8L8aAeyolcL2upMa0F33wrW MR48QDjNB55CmVrnr9zP8CFSLTiSl/OlXcypPBJeFO+CWXAfb0Dk8ZwGMbJk5o7wcs2D EFCkC51VJ16z6z/qrj/sCq7Jmm7lNPJ9qcc+uKQxyEiIRaHAUKMAHNvqe/Glri5r4P71 UNDSDE7msa2jpkO3Dd6j1fbGDhvsKqfaGvOLUjC2QtwGotC38qLZHzQj6O2aB38G50ad 06TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si17443705edw.487.2021.04.06.04.52.56 for ; Tue, 06 Apr 2021 04:52:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343540AbhDFLxB (ORCPT ); Tue, 6 Apr 2021 07:53:01 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16364 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343536AbhDFLw6 (ORCPT ); Tue, 6 Apr 2021 07:52:58 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FF5SY45BLz94Cq; Tue, 6 Apr 2021 19:50:37 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 19:52:38 +0800 From: John Garry To: , CC: , , , Jianqin Xie , Luo Jiaxing , John Garry Subject: [PATCH 4/6] scsi: hisi_sas: Directly snapshot registers when executing a reset Date: Tue, 6 Apr 2021 19:48:29 +0800 Message-ID: <1617709711-195853-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1617709711-195853-1-git-send-email-john.garry@huawei.com> References: <1617709711-195853-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Jianqin Xie The debugfs snapshot should be executed before the reset occurs to ensure that the register contents are saved properly. As such, it is incorrect to queue the debugfs dump when running a reset as the reset will occur prior to the snapshot work item is handler. Therefore, directly snapshot registers in the reset work handler. Signed-off-by: Jianqin Xie Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 28 ++++++++++++++++++-------- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 27 ++++++++++++++----------- 3 files changed, 36 insertions(+), 20 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 4dd53bc2d946..cf879cc59e4c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -346,6 +346,7 @@ struct hisi_sas_hw { u8 reg_index, u8 reg_count, u8 *write_data); void (*wait_cmds_complete_timeout)(struct hisi_hba *hisi_hba, int delay_ms, int timeout_ms); + void (*debugfs_snapshot_regs)(struct hisi_hba *hisi_hba); int complete_hdr_size; struct scsi_host_template *sht; }; diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 971c45a1401c..4c90d91d47f4 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1568,21 +1568,26 @@ void hisi_sas_controller_reset_done(struct hisi_hba *hisi_hba) } EXPORT_SYMBOL_GPL(hisi_sas_controller_reset_done); -static int hisi_sas_controller_reset(struct hisi_hba *hisi_hba) +static int hisi_sas_controller_prereset(struct hisi_hba *hisi_hba) { - struct device *dev = hisi_hba->dev; - struct Scsi_Host *shost = hisi_hba->shost; - int rc; - - if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) - queue_work(hisi_hba->wq, &hisi_hba->debugfs_work); - if (!hisi_hba->hw->soft_reset) return -1; if (test_and_set_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) return -1; + if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) + hisi_hba->hw->debugfs_snapshot_regs(hisi_hba); + + return 0; +} + +static int hisi_sas_controller_reset(struct hisi_hba *hisi_hba) +{ + struct device *dev = hisi_hba->dev; + struct Scsi_Host *shost = hisi_hba->shost; + int rc; + dev_info(dev, "controller resetting...\n"); hisi_sas_controller_reset_prepare(hisi_hba); @@ -2471,6 +2476,9 @@ void hisi_sas_rst_work_handler(struct work_struct *work) struct hisi_hba *hisi_hba = container_of(work, struct hisi_hba, rst_work); + if (hisi_sas_controller_prereset(hisi_hba)) + return; + hisi_sas_controller_reset(hisi_hba); } EXPORT_SYMBOL_GPL(hisi_sas_rst_work_handler); @@ -2480,8 +2488,12 @@ void hisi_sas_sync_rst_work_handler(struct work_struct *work) struct hisi_sas_rst *rst = container_of(work, struct hisi_sas_rst, work); + if (hisi_sas_controller_prereset(rst->hisi_hba)) + goto rst_complete; + if (!hisi_sas_controller_reset(rst->hisi_hba)) rst->done = true; +rst_complete: complete(rst->completion); } EXPORT_SYMBOL_GPL(hisi_sas_sync_rst_work_handler); diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index d7f8ba0c1680..0927b0b30b29 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -531,6 +531,7 @@ module_param(prot_mask, int, 0); MODULE_PARM_DESC(prot_mask, " host protection capabilities mask, def=0x0 "); static void debugfs_work_handler_v3_hw(struct work_struct *work); +static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba); static u32 hisi_sas_read32(struct hisi_hba *hisi_hba, u32 off) { @@ -3182,6 +3183,7 @@ static const struct hisi_sas_hw hisi_sas_v3_hw = { .get_events = phy_get_events_v3_hw, .write_gpio = write_gpio_v3_hw, .wait_cmds_complete_timeout = wait_cmds_complete_timeout_v3_hw, + .debugfs_snapshot_regs = debugfs_snapshot_regs_v3_hw, }; static struct Scsi_Host * @@ -3666,6 +3668,19 @@ static void debugfs_create_files_v3_hw(struct hisi_hba *hisi_hba) static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba) { + int debugfs_dump_index = hisi_hba->debugfs_dump_index; + struct device *dev = hisi_hba->dev; + u64 timestamp = local_clock(); + + if (debugfs_dump_index >= hisi_sas_debugfs_dump_count) { + dev_warn(dev, "dump count exceeded!\n"); + return; + } + + do_div(timestamp, NSEC_PER_MSEC); + hisi_hba->debugfs_timestamp[debugfs_dump_index] = timestamp; + hisi_hba->debugfs_dump_index++; + debugfs_snapshot_prepare_v3_hw(hisi_hba); debugfs_snapshot_global_reg_v3_hw(hisi_hba); @@ -4408,20 +4423,8 @@ static void debugfs_work_handler_v3_hw(struct work_struct *work) { struct hisi_hba *hisi_hba = container_of(work, struct hisi_hba, debugfs_work); - int debugfs_dump_index = hisi_hba->debugfs_dump_index; - struct device *dev = hisi_hba->dev; - u64 timestamp = local_clock(); - - if (debugfs_dump_index >= hisi_sas_debugfs_dump_count) { - dev_warn(dev, "dump count exceeded!\n"); - return; - } - - do_div(timestamp, NSEC_PER_MSEC); - hisi_hba->debugfs_timestamp[debugfs_dump_index] = timestamp; debugfs_snapshot_regs_v3_hw(hisi_hba); - hisi_hba->debugfs_dump_index++; } static void debugfs_release_v3_hw(struct hisi_hba *hisi_hba, int dump_index) From patchwork Tue Apr 6 11:48:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 415894 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4490539jai; Tue, 6 Apr 2021 04:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEjBZTIzIWsT6LJI2TFRC+GpSJuTF4ac20Y/sJbAWSgM/mV9SkfgK85wxAx89sJyfHHjHU X-Received: by 2002:a17:906:7f8c:: with SMTP id f12mr4427460ejr.550.1617709974717; Tue, 06 Apr 2021 04:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617709974; cv=none; d=google.com; s=arc-20160816; b=bRXSbvxxmj/S+X+DMR1jyJhD9zZA1i2jev134QnMEmIHbEnWY4MYChWyjbrFYtJohg 7AbUbIRmLoYmycmu/Vun3PyPSW5Jm5wQoSUXZvtxSkS3+ufvynsT1GUt2oHv4v1qC9F4 T14x1m8Mp8z5gVDbbigVOwm2zwkkZuVFl0DiIHTsVUT183+k5J6TEYuMFtfi/3CgFF/U SeIVIiBXDeHPFU2cp1KprnlZqAa66eHaMSfIdoGLbxm7ymMm5kTeCBZQg4SqrDiS+nTB h6N4nZkDBYstsZfeFxf2K/E+9nqrn6Asrf8qcHZBun++jJJlHLktH/y8Qzb7R7WAD2mB Yfow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=kkRLeAl278WU4HbiWYUB7MyYJC/Nwo0faNY481e3bKo=; b=UFcJKbWY0SYTOwifGL7CtvmhTIV+2mCzLugoxAlRKxZadSEKeylMpjO/QqGuUGHh1J bQO3wpnAyn3p5FQpOctKgdoQt7nVIfZPuE7YeePA7VxtVjllisf6fkwbqFMvbcZnDOAd iuXllN10DNOXqanhXLTWTMVJSztfmshVUE7SbWVSBFDlJpDAYxbEzBaKm5HNomH14Srm sqx8icyXW0hboftIA7y292C002L5ExpN7H6JJ9zVtvmuVZfFMxpmL7RevYA+S1/QzdiA /w8GB4MoIreCM/vC1PtzTurARK9YsDBfu3ArV1SO1whdyZ6iZ/nTXj3N09jmlgCo/axd CrRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si17443705edw.487.2021.04.06.04.52.54 for ; Tue, 06 Apr 2021 04:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343543AbhDFLxA (ORCPT ); Tue, 6 Apr 2021 07:53:00 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16363 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343530AbhDFLw5 (ORCPT ); Tue, 6 Apr 2021 07:52:57 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FF5SY3sbYz94Cp; Tue, 6 Apr 2021 19:50:37 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 19:52:38 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , Yihang Li , John Garry Subject: [PATCH 5/6] scsi: hisi_sas: Warn in v3 hw channel interrupt handler when status reg cleared Date: Tue, 6 Apr 2021 19:48:30 +0800 Message-ID: <1617709711-195853-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1617709711-195853-1-git-send-email-john.garry@huawei.com> References: <1617709711-195853-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing If a channel interrupt occurs without any status bit set, the handler will return directly. However, if such redundant interrupts are received, it's better to check what happen, so add logs for this. Signed-off-by: Yihang Li Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 0927b0b30b29..499c770d405c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1718,8 +1718,11 @@ static void handle_chl_int1_v3_hw(struct hisi_hba *hisi_hba, int phy_no) int i; irq_value &= ~irq_msk; - if (!irq_value) + if (!irq_value) { + dev_warn(dev, "phy%d channel int 1 received with status bits cleared\n", + phy_no); return; + } for (i = 0; i < ARRAY_SIZE(port_axi_error); i++) { const struct hisi_sas_hw_error *error = &port_axi_error[i]; @@ -1780,8 +1783,11 @@ static void handle_chl_int2_v3_hw(struct hisi_hba *hisi_hba, int phy_no) BIT(CHL_INT2_RX_INVLD_DW_OFF); irq_value &= ~irq_msk; - if (!irq_value) + if (!irq_value) { + dev_warn(dev, "phy%d channel int 2 received with status bits cleared\n", + phy_no); return; + } if (irq_value & BIT(CHL_INT2_SL_IDAF_TOUT_CONF_OFF)) { dev_warn(dev, "phy%d identify timeout\n", phy_no); From patchwork Tue Apr 6 11:48:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 415891 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4490513jai; Tue, 6 Apr 2021 04:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdYvPJY3x3Hc3EenQoWAP0RfUNryRJNeciWydim3SwclZiOOKV0mJi5xTZOGtIjUdOUi8i X-Received: by 2002:aa7:d886:: with SMTP id u6mr9151813edq.346.1617709971291; Tue, 06 Apr 2021 04:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617709971; cv=none; d=google.com; s=arc-20160816; b=bUZXTMMWS+jRhsE+seTjL/Q5Q1h42l7zoK8OnPXsalIuPo6Obpr9opNEmErRXVyQsf jMgrWt6D5MyBxYHZCakvqGzglZD9ggZRxPAv6pVk9AWBn2ZSAViZeLWctLjte86aWV+O 3dvGa+Nhyuc1Cq5M6MljX2SAG9kmLgIdr4IuitVrUufVXqFGBDookozi8jX7CIIqn4fu M4UjWZnlVClxknf4Czj8OchFGUhrWq546f69YwJpILwnoUHfjyWcWVKXqjNkVGl143SD LaY8I4nMYvcb7r1vBLU1ly7m+OaG+gc+TfcFqNRDX+5pId0wCg7tdmHY9F5iVbia3lg6 xHGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=7WEdxYKmfqiJKVbzwNvNchpy9Nn42eTZY31k3FFlwig=; b=I0vS8g5T/Iqe1YRNAlyA0z4/dske6k+Rpf51PLQNVH6Gcc4p9fnZ6LS1rC9AgdR43e 9tDGIR7ehFBdp2bElwfz4Bd8fa3Lo/ftxOtCw7Jpzv9d1InOhbMQ8tLYKQxE8AqZ528t iJXV174cwPf9ZRGUNSAYhEyE3nYnAwEeqV4xFL5FlHFlygvrBPkR/LRL2LaRWw6Nc5FO 2sjj/MYsbgTtNUvof2ZtBVnI2PCUj+Lr+VTK2AZZIFDrVfhgWoamGLt5HmQL6YZhcUhS oSlMrKNZ8FnPE0sqttB93QvAieuNv7B38BE8xS0aC+2KZrO3SDcP2ftPujaW1JuucEb+ 5Kkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si17443705edw.487.2021.04.06.04.52.51 for ; Tue, 06 Apr 2021 04:52:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343537AbhDFLw5 (ORCPT ); Tue, 6 Apr 2021 07:52:57 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16361 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233425AbhDFLw4 (ORCPT ); Tue, 6 Apr 2021 07:52:56 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FF5SY3BDjz93fR; Tue, 6 Apr 2021 19:50:37 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 19:52:38 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 6/6] scsi: hisi_sas: Print SATA device SAS address for soft reset failure Date: Tue, 6 Apr 2021 19:48:31 +0800 Message-ID: <1617709711-195853-7-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1617709711-195853-1-git-send-email-john.garry@huawei.com> References: <1617709711-195853-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing Add (pseudo) SAS address for ATA software reset failure log to assist debugging. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 4c90d91d47f4..5a204074099c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1341,10 +1341,12 @@ static int hisi_sas_softreset_ata_disk(struct domain_device *device) rc = hisi_sas_exec_internal_tmf_task(device, fis, s, NULL); if (rc != TMF_RESP_FUNC_COMPLETE) - dev_err(dev, "ata disk de-reset failed\n"); + dev_err(dev, "ata disk %016llx de-reset failed\n", + SAS_ADDR(device->sas_addr)); } } else { - dev_err(dev, "ata disk reset failed\n"); + dev_err(dev, "ata disk %016llx reset failed\n", + SAS_ADDR(device->sas_addr)); } if (rc == TMF_RESP_FUNC_COMPLETE)