From: John Garry <john.garry@huawei.com>
To: <jejb@linux.vnet.ibm.com>, <martin.petersen@oracle.com>
Cc: <linuxarm@huawei.com>, <linux-scsi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <zhangfei.gao@linaro.org>,
Shiju Jose <shiju.jose@huawei.com>,
John Garry <john.garry@huawei.com>
Subject: [PATCH 11/19] scsi: hisi_sas: report v2 hw AXI errors to userspace
Date: Tue, 24 Oct 2017 23:51:41 +0800 [thread overview]
Message-ID: <1508860309-212397-12-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1508860309-212397-1-git-send-email-john.garry@huawei.com>
From: Shiju Jose <shiju.jose@huawei.com>
This patch adds reporting of AXI errors in the SAS v2 hw
driver to userspace as non-standard trace events.
rasdaemon can be used to read and log these AXI errors
in userspace.
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 54 +++++++++++++++++++++++++++++++---
1 file changed, 50 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 0cf8244..8626d9f 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -389,6 +389,13 @@
#define HISI_SAS_ECC_ERR_HGC_RXM_MEM1 BIT(7)
#define HISI_SAS_ECC_ERR_HGC_RXM_MEM2 BIT(8)
#define HISI_SAS_ECC_ERR_HGC_RXM_MEM3 BIT(9)
+#define HISI_SAS_ERR_WP_DEPTH BIT(10)
+#define HISI_SAS_ERR_IPTT_SLOT_NOMATCH BIT(11)
+#define HISI_SAS_ERR_RP_DEPTH BIT(12)
+#define HISI_SAS_ERR_AXI BIT(13)
+#define HISI_SAS_ERR_FIFO BIT(14)
+#define HISI_SAS_ERR_LM_ADD_FETCH_LIST BIT(15)
+#define HISI_SAS_ERR_HGC_ABT_FETCH_LM BIT(16)
struct hisi_sas_complete_v2_hdr {
__le32 dw0;
@@ -417,6 +424,7 @@ struct hisi_sas_hw_err_info {
u64 physical_addr;
u32 mb_err;
u32 type;
+ u32 axi_err_info;
};
static const struct hisi_sas_hw_error one_bit_ecc_errors[] = {
@@ -748,6 +756,7 @@ enum {
#define HISI_SAS_VALID_PA BIT(0)
#define HISI_SAS_VALID_MB_ERR BIT(1)
#define HISI_SAS_VALID_ERR_TYPE BIT(2)
+#define HISI_SAS_VALID_AXI_ERR_INFO BIT(3)
#define ERR_ON_TX_PHASE(err_phase) (err_phase == 0x2 || \
err_phase == 0x4 || err_phase == 0x8 ||\
@@ -3052,32 +3061,39 @@ static irqreturn_t fatal_ecc_int_v2_hw(int irq_no, void *p)
{
.irq_msk = BIT(ENT_INT_SRC3_WP_DEPTH_OFF),
.msg = "write pointer and depth",
+ .type = HISI_SAS_ERR_WP_DEPTH,
},
{
.irq_msk = BIT(ENT_INT_SRC3_IPTT_SLOT_NOMATCH_OFF),
.msg = "iptt no match slot",
+ .type = HISI_SAS_ERR_IPTT_SLOT_NOMATCH,
},
{
.irq_msk = BIT(ENT_INT_SRC3_RP_DEPTH_OFF),
.msg = "read pointer and depth",
+ .type = HISI_SAS_ERR_RP_DEPTH,
},
{
.irq_msk = BIT(ENT_INT_SRC3_AXI_OFF),
.reg = HGC_AXI_FIFO_ERR_INFO,
+ .type = HISI_SAS_ERR_AXI,
.sub = axi_error,
},
{
.irq_msk = BIT(ENT_INT_SRC3_FIFO_OFF),
.reg = HGC_AXI_FIFO_ERR_INFO,
+ .type = HISI_SAS_ERR_FIFO,
.sub = fifo_error,
},
{
.irq_msk = BIT(ENT_INT_SRC3_LM_OFF),
.msg = "LM add/fetch list",
+ .type = HISI_SAS_ERR_LM_ADD_FETCH_LIST,
},
{
.irq_msk = BIT(ENT_INT_SRC3_ABT_OFF),
.msg = "SAS_HGC_ABT fetch LM list",
+ .type = HISI_SAS_ERR_HGC_ABT_FETCH_LM,
},
};
@@ -3088,12 +3104,17 @@ static irqreturn_t fatal_axi_int_v2_hw(int irq_no, void *p)
struct device *dev = hisi_hba->dev;
const struct hisi_sas_hw_error *axi_error;
int i;
+ struct hisi_sas_hw_err_info err_data;
+ bool trace_ns_event_enabled = trace_non_standard_event_enabled();
irq_msk = hisi_sas_read32(hisi_hba, ENT_INT_SRC_MSK3);
hisi_sas_write32(hisi_hba, ENT_INT_SRC_MSK3, irq_msk | 0xfffffffe);
irq_value = hisi_sas_read32(hisi_hba, ENT_INT_SRC3);
+ if (trace_ns_event_enabled)
+ memset(&err_data, 0, sizeof(err_data));
+
for (i = 0; i < ARRAY_SIZE(fatal_axi_errors); i++) {
axi_error = &fatal_axi_errors[i];
if (!(irq_value & axi_error->irq_msk))
@@ -3108,13 +3129,38 @@ static irqreturn_t fatal_axi_int_v2_hw(int irq_no, void *p)
for (; sub->msk || sub->msg; sub++) {
if (!(err_value & sub->msk))
continue;
- dev_warn(dev, "%s (0x%x) found!\n",
- sub->msg, irq_value);
+ if (trace_ns_event_enabled) {
+ err_data.validation_bits =
+ HISI_SAS_VALID_ERR_TYPE |
+ HISI_SAS_VALID_AXI_ERR_INFO;
+ err_data.type = axi_error->type;
+ err_data.axi_err_info = sub->msk;
+ log_non_standard_event(
+ &CPER_SEC_TYPE_HISI_SAS,
+ &NULL_UUID_LE,
+ dev_name(dev),
+ GHES_SEV_PANIC,
+ (const u8 *)&err_data,
+ sizeof(err_data));
+ } else
+ dev_warn(dev, "%s (0x%x) found!\n",
+ sub->msg, irq_value);
queue_work(hisi_hba->wq, &hisi_hba->rst_work);
}
} else {
- dev_warn(dev, "%s (0x%x) found!\n",
- axi_error->msg, irq_value);
+ if (trace_ns_event_enabled) {
+ err_data.validation_bits =
+ HISI_SAS_VALID_ERR_TYPE;
+ err_data.type = axi_error->type;
+ log_non_standard_event(&CPER_SEC_TYPE_HISI_SAS,
+ &NULL_UUID_LE,
+ dev_name(dev),
+ GHES_SEV_PANIC,
+ (const u8 *)&err_data,
+ sizeof(err_data));
+ } else
+ dev_warn(dev, "%s (0x%x) found!\n",
+ axi_error->msg, irq_value);
queue_work(hisi_hba->wq, &hisi_hba->rst_work);
}
}
--
1.9.1
next prev parent reply other threads:[~2017-10-24 15:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 15:51 [PATCH 00/19] hisi_sas: misc fixes, improvements, and new features John Garry
2017-10-24 15:51 ` [PATCH 01/19] scsi: hisi_sas: delete get_ncq_tag_v3_hw() John Garry
2017-10-24 15:51 ` [PATCH 02/19] scsi: hisi_sas: fix internal abort slot timeout bug John Garry
2017-10-24 15:51 ` [PATCH 03/19] scsi: hisi_sas: use spin_lock_irqsave() for hisi_hba.lock John Garry
2017-10-24 15:51 ` [PATCH 04/19] scsi: hisi_sas: grab hisi_hba.lock when processing slots John Garry
2017-10-24 15:51 ` [PATCH 05/19] scsi: hisi_sas: fix SATA breakpoint memory size John Garry
2017-10-24 15:51 ` [PATCH 06/19] scsi: hisi_sas: us start_phy in PHY_FUNC_LINK_RESET John Garry
2017-10-24 15:51 ` [PATCH 07/19] scsi: hisi_sas: fix NULL check in SMP abort task path John Garry
2017-10-24 15:51 ` [PATCH 08/19] scsi: hisi_sas: fix the risk of freeing slot twice John Garry
2017-10-24 15:51 ` [PATCH 09/19] scsi: hisi_sas: use array for v2 hw AXI errors John Garry
2017-10-24 15:51 ` [PATCH 10/19] scsi: hisi_sas: report ECC errors in v2 hw to userspace John Garry
2017-10-24 15:51 ` John Garry [this message]
2017-10-24 15:51 ` [PATCH 12/19] scsi: hisi_sas: check PHY state in get_wideport_bitmap_v3_hw() John Garry
2017-10-24 15:51 ` [PATCH 13/19] scsi: hisi_sas: init connect cfg register for v3 hw John Garry
2017-10-24 15:51 ` [PATCH 14/19] scsi: hisi_sas: add v3 hw DFX feature John Garry
2017-10-24 15:51 ` [PATCH 15/19] scsi: hisi_sas: add hisi_hba.rst_work init for v3 hw John Garry
2017-10-24 15:51 ` [PATCH 16/19] scsi: hisi_sas: fix a bug when free device " John Garry
2017-10-24 15:51 ` [PATCH 17/19] scsi: hisi_sas: complete all tasklets prior to host reset John Garry
2017-10-24 15:51 ` [PATCH 18/19] scsi: hisi_sas: add v3 hw support for AXI fatal error John Garry
2017-10-24 15:51 ` [PATCH 19/19] scsi: hisi_sas: add v3 hw port AXI error handling John Garry
2017-10-25 12:29 ` [PATCH 00/19] hisi_sas: misc fixes, improvements, and new features 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=1508860309-212397-12-git-send-email-john.garry@huawei.com \
--to=john.garry@huawei.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 \
--cc=shiju.jose@huawei.com \
--cc=zhangfei.gao@linaro.org \
/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®