All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhen Lei <thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	iommu
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Cc: Xinwei Hu <huxinwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	Zhen Lei
	<thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	Zefan Li <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	Tianhong Ding
	<dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 8/8] iommu/arm-smmu: suppress fault information about CMD_PREFETCH_CONFIG execution
Date: Fri, 26 Jun 2015 16:33:04 +0800	[thread overview]
Message-ID: <1435307584-9812-9-git-send-email-thunder.leizhen@huawei.com> (raw)
In-Reply-To: <1435307584-9812-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

Some broken SMMUv3 devices treat CMD_PREFETCH_CONFIG as illegal command,
it's ugly to print error information. CMD_PREFETCH_CONFIG is just used to
prefetch the configuration for a specified StreamID, without this command
will not impact SMMUv3 function.

Signed-off-by: Zhen Lei <thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/iommu/arm-smmu-v3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index d799feb..3971aef 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -813,6 +813,7 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
 	};

 	int i;
+	u32 opcode;
 	u64 cmd[CMDQ_ENT_DWORDS];
 	struct arm_smmu_queue *q = &smmu->cmdq.q;
 	u32 cons = readl_relaxed(q->cons_reg);
@@ -821,15 +822,14 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
 		.opcode = CMDQ_OP_CMD_SYNC,
 	};

-	dev_err(smmu->dev, "CMDQ error (cons 0x%08x): %s\n", cons,
-		cerror_str[idx]);
-
 	switch (idx) {
 	case CMDQ_ERR_CERROR_ILL_IDX:
 		break;
 	case CMDQ_ERR_CERROR_ABT_IDX:
-		dev_err(smmu->dev, "retrying command fetch\n");
 	case CMDQ_ERR_CERROR_NONE_IDX:
+		dev_err(smmu->dev, "CMDQ error (cons 0x%08x): %s\n", cons,
+			cerror_str[idx]);
+		dev_err(smmu->dev, "retrying command execution\n");
 		return;
 	}

@@ -838,10 +838,20 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
 	 * not to touch any of the shadow cmdq state.
 	 */
 	queue_read(cmd, Q_ENT(q, idx), q->ent_dwords);
+
+	/*
+	 * Some broken SMMUv3 devices treat CMD_PREFETCH_CONFIG as illegal
+	 * command, it's ugly to print error information.
+	 */
+	opcode = (cmd[0] >> CMDQ_0_OP_SHIFT) & CMDQ_0_OP_MASK;
+	if (opcode == CMDQ_OP_PREFETCH_CFG)
+		goto skip_error_command;
+
 	dev_err(smmu->dev, "skipping command in error state:\n");
 	for (i = 0; i < ARRAY_SIZE(cmd); ++i)
 		dev_err(smmu->dev, "\t0x%016llx\n", (unsigned long long)cmd[i]);

+skip_error_command:
 	/* Convert the erroneous command into a CMD_SYNC */
 	if (arm_smmu_cmdq_build_cmd(cmd, &cmd_sync)) {
 		dev_err(smmu->dev, "failed to convert to CMD_SYNC\n");
--
1.8.0

WARNING: multiple messages have this Message-ID (diff)
From: thunder.leizhen@huawei.com (Zhen Lei)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/8] iommu/arm-smmu: suppress fault information about CMD_PREFETCH_CONFIG execution
Date: Fri, 26 Jun 2015 16:33:04 +0800	[thread overview]
Message-ID: <1435307584-9812-9-git-send-email-thunder.leizhen@huawei.com> (raw)
In-Reply-To: <1435307584-9812-1-git-send-email-thunder.leizhen@huawei.com>

Some broken SMMUv3 devices treat CMD_PREFETCH_CONFIG as illegal command,
it's ugly to print error information. CMD_PREFETCH_CONFIG is just used to
prefetch the configuration for a specified StreamID, without this command
will not impact SMMUv3 function.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/iommu/arm-smmu-v3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index d799feb..3971aef 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -813,6 +813,7 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
 	};

 	int i;
+	u32 opcode;
 	u64 cmd[CMDQ_ENT_DWORDS];
 	struct arm_smmu_queue *q = &smmu->cmdq.q;
 	u32 cons = readl_relaxed(q->cons_reg);
@@ -821,15 +822,14 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
 		.opcode = CMDQ_OP_CMD_SYNC,
 	};

-	dev_err(smmu->dev, "CMDQ error (cons 0x%08x): %s\n", cons,
-		cerror_str[idx]);
-
 	switch (idx) {
 	case CMDQ_ERR_CERROR_ILL_IDX:
 		break;
 	case CMDQ_ERR_CERROR_ABT_IDX:
-		dev_err(smmu->dev, "retrying command fetch\n");
 	case CMDQ_ERR_CERROR_NONE_IDX:
+		dev_err(smmu->dev, "CMDQ error (cons 0x%08x): %s\n", cons,
+			cerror_str[idx]);
+		dev_err(smmu->dev, "retrying command execution\n");
 		return;
 	}

@@ -838,10 +838,20 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
 	 * not to touch any of the shadow cmdq state.
 	 */
 	queue_read(cmd, Q_ENT(q, idx), q->ent_dwords);
+
+	/*
+	 * Some broken SMMUv3 devices treat CMD_PREFETCH_CONFIG as illegal
+	 * command, it's ugly to print error information.
+	 */
+	opcode = (cmd[0] >> CMDQ_0_OP_SHIFT) & CMDQ_0_OP_MASK;
+	if (opcode == CMDQ_OP_PREFETCH_CFG)
+		goto skip_error_command;
+
 	dev_err(smmu->dev, "skipping command in error state:\n");
 	for (i = 0; i < ARRAY_SIZE(cmd); ++i)
 		dev_err(smmu->dev, "\t0x%016llx\n", (unsigned long long)cmd[i]);

+skip_error_command:
 	/* Convert the erroneous command into a CMD_SYNC */
 	if (arm_smmu_cmdq_build_cmd(cmd, &cmd_sync)) {
 		dev_err(smmu->dev, "failed to convert to CMD_SYNC\n");
--
1.8.0

  parent reply	other threads:[~2015-06-26  8:33 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26  8:32 [PATCH 0/8] iommu/arm-smmu: bugfixs and add support for non-pci devices Zhen Lei
2015-06-26  8:32 ` Zhen Lei
     [not found] ` <1435307584-9812-1-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-26  8:32   ` [PATCH 1/8] iommu/arm-smmu: fix the assignment of log2size field Zhen Lei
2015-06-26  8:32     ` Zhen Lei
     [not found]     ` <1435307584-9812-2-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-29 17:05       ` Will Deacon
2015-06-29 17:05         ` Will Deacon
     [not found]         ` <20150629170517.GH17474-5wv7dgnIgG8@public.gmane.org>
2015-06-30  3:47           ` leizhen
2015-06-30  3:47             ` leizhen
2015-06-26  8:32   ` [PATCH 2/8] iommu/arm-smmu: fix the index calculation of strtab Zhen Lei
2015-06-26  8:32     ` Zhen Lei
     [not found]     ` <1435307584-9812-3-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-29 17:17       ` Will Deacon
2015-06-29 17:17         ` Will Deacon
2015-06-26  8:32   ` [PATCH 3/8] iommu/arm-smmu: fix the values of ARM64_TCR_IRGN0_SHIFT and ARM64_TCR_ORGN0_SHIFT Zhen Lei
2015-06-26  8:32     ` Zhen Lei
     [not found]     ` <1435307584-9812-4-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-29 17:25       ` Will Deacon
2015-06-29 17:25         ` Will Deacon
     [not found]         ` <20150629172531.GJ17474-5wv7dgnIgG8@public.gmane.org>
2015-06-30  3:57           ` leizhen
2015-06-30  3:57             ` leizhen
     [not found]             ` <559213AE.6060206-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-30 14:11               ` Will Deacon
2015-06-30 14:11                 ` Will Deacon
2015-06-26  8:33   ` [PATCH 4/8] iommu/arm-smmu: set EPD1 to disable TT1 translation table walk Zhen Lei
2015-06-26  8:33     ` Zhen Lei
     [not found]     ` <1435307584-9812-5-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-29 17:26       ` Will Deacon
2015-06-29 17:26         ` Will Deacon
     [not found]         ` <20150629172622.GK17474-5wv7dgnIgG8@public.gmane.org>
2015-06-30  4:40           ` leizhen
2015-06-30  4:40             ` leizhen
2015-06-26  8:33   ` [PATCH 5/8] iommu/arm-smmu: rename __arm_smmu_get_pci_sid Zhen Lei
2015-06-26  8:33     ` Zhen Lei
2015-06-26  8:33   ` [PATCH 6/8] iommu/arm-smmu: add support for non-pci devices Zhen Lei
2015-06-26  8:33     ` Zhen Lei
     [not found]     ` <1435307584-9812-7-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-29 17:28       ` Will Deacon
2015-06-29 17:28         ` Will Deacon
     [not found]         ` <20150629172831.GL17474-5wv7dgnIgG8@public.gmane.org>
2015-06-30  8:51           ` leizhen
2015-06-30  8:51             ` leizhen
2015-06-30 11:26       ` Robin Murphy
2015-06-30 11:26         ` Robin Murphy
     [not found]         ` <55927CEC.4090900-5wv7dgnIgG8@public.gmane.org>
2015-07-01  2:16           ` leizhen
2015-07-01  2:16             ` leizhen
2015-06-26  8:33   ` [PATCH 7/8] iommu/arm-smmu: enlarge STRTAB_L1_SZ_SHIFT to support larger sidsize Zhen Lei
2015-06-26  8:33     ` Zhen Lei
     [not found]     ` <1435307584-9812-8-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-29 17:35       ` Will Deacon
2015-06-29 17:35         ` Will Deacon
     [not found]         ` <20150629173539.GM17474-5wv7dgnIgG8@public.gmane.org>
2015-06-30  8:57           ` leizhen
2015-06-30  8:57             ` leizhen
2015-06-26  8:33   ` Zhen Lei [this message]
2015-06-26  8:33     ` [PATCH 8/8] iommu/arm-smmu: suppress fault information about CMD_PREFETCH_CONFIG execution Zhen Lei
     [not found]     ` <1435307584-9812-9-git-send-email-thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-06-29 17:49       ` Will Deacon
2015-06-29 17:49         ` Will Deacon
     [not found]         ` <20150629174909.GN17474-5wv7dgnIgG8@public.gmane.org>
2015-06-30  9:18           ` leizhen
2015-06-30  9:18             ` leizhen

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=1435307584-9812-9-git-send-email-thunder.leizhen@huawei.com \
    --to=thunder.leizhen-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=dingtianhong-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=huxinwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.