From patchwork Fri Jun 26 08:33:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 6678851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA4C3C05AC for ; Fri, 26 Jun 2015 08:40:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA919206E8 for ; Fri, 26 Jun 2015 08:40:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15A5620640 for ; Fri, 26 Jun 2015 08:40:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8P96-0005Vm-8R; Fri, 26 Jun 2015 08:38:00 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8P8d-0004y9-Os for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2015 08:37:32 +0000 Received: from 172.24.2.119 (EHLO szxeml432-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CNR45836; Fri, 26 Jun 2015 16:35:49 +0800 (CST) Received: from localhost (10.177.27.142) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.158.1; Fri, 26 Jun 2015 16:35:31 +0800 From: Zhen Lei To: Will Deacon , Joerg Roedel , linux-arm-kernel , iommu Subject: [PATCH 8/8] iommu/arm-smmu: suppress fault information about CMD_PREFETCH_CONFIG execution Date: Fri, 26 Jun 2015 16:33:04 +0800 Message-ID: <1435307584-9812-9-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.8.4.msysgit.0 In-Reply-To: <1435307584-9812-1-git-send-email-thunder.leizhen@huawei.com> References: <1435307584-9812-1-git-send-email-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.27.142] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150626_013732_154571_332FE646 X-CRM114-Status: GOOD ( 14.65 ) X-Spam-Score: -5.7 (-----) Cc: Xinwei Hu , Zhen Lei , Zefan Li , Tianhong Ding X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/iommu/arm-smmu-v3.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -- 1.8.0 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");