From patchwork Mon Oct 15 13:07:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 148841 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3778606lji; Mon, 15 Oct 2018 06:10:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV62COZbNpo/xnYhhfLMQkMGFeVgOEN2BzSMJYH/LfBsFNLihKMsJDrfnemFfhwNEn0tHqXNs X-Received: by 2002:a62:ea03:: with SMTP id t3-v6mr18186091pfh.228.1539609045865; Mon, 15 Oct 2018 06:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539609045; cv=none; d=google.com; s=arc-20160816; b=GPavsFlEI9kSzC6W+GeSBGKZCT94Kaek8/x39gBYB+NpVkNbkCF7vWpGdlYwf5isi8 ZeiKkrqfdmVdfqe/txSwDzosZ0WvqaZ6KigaK17oj3HMbn2s7rOvaL1UPHPPhZiLgi69 doqSXTTSL80dY9n1j8WoFKf8AuABbw0LWx4xhlfsgY4SsDZazQ7k9k9CW1vGgEd0KR1c TPumxe0247kDK+W5vhs0B9Y/zYte7NHSDQo1FravuuZXQlKdQzMUqKOZ6NqsvX3dHUn4 8Rw6xVNwltNqnl+VqTFh+/nXru07NgFoiluurFpPA9FoitqxOziP0XB+IHrcGboF0caU G1xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=G9hq3x68WrRMbLheOnFYUO0lO7CLcco2NS7pcpSXcFw=; b=GW7U1CyilIQDxXPTV3fbJHuI8nNEloSKALq8SWjTfdQctN3avYCFTMBEbE+8WvhMTl 9i3ZJebz/hakHkiFAxqmIuvASbKv2KkOILXjb4Qh7CXImgBUsr3zHCUfvCliXIdfir6e hN/GWpLiU5p7a0ZFAUU8faAgW8mZ0RZqK/G2MAPorHVRoITw8l2nE2p0TsUbvASmOGgK QV3BL5ZXwSp23PnKJElfGn4CUFy3k3sYuqmqV9ztxa5iqQqdTkxrjlqnEAzq+PAqIdFF fRY9HX4H8Ny1aFvudUfPJelkJZg8HD/bOuXQdsadYb84MRLiXOr8Xs6NMdKg6hwSTGOl GYgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=OpvkAwm3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si8169164plb.197.2018.10.15.06.10.45; Mon, 15 Oct 2018 06:10:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=OpvkAwm3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727005AbeJOUym (ORCPT + 32 others); Mon, 15 Oct 2018 16:54:42 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:48014 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbeJOUyl (ORCPT ); Mon, 15 Oct 2018 16:54:41 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9FD8wki124006; Mon, 15 Oct 2018 08:08:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539608938; bh=G9hq3x68WrRMbLheOnFYUO0lO7CLcco2NS7pcpSXcFw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OpvkAwm3jCXF79l5fgSW6AmJRc2T0KUV8LvUT1Xy1S6FKzI2UCjDQ7JXKYIuqT8kk ISIYGC2+nzlPZSW3UH34hoQSlbOUfIYmwGv6CGnxdfzbxo+EhGPySqA38h70FnrcyN /9JSj1pw44jgmoaYHC8O0VL/zElrdOJbppQ7BxGc= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9FD8w2w012053; Mon, 15 Oct 2018 08:08:58 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 15 Oct 2018 08:08:58 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 15 Oct 2018 08:08:58 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9FD7tLK009433; Mon, 15 Oct 2018 08:08:55 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Lorenzo Pieralisi , Murali Karicheri , Jingoo Han , Gustavo Pimentel CC: Rob Herring , , , , , Kishon Vijay Abraham I Subject: [PATCH 17/19] PCI: keystone: Add debug error message for all errors Date: Mon, 15 Oct 2018 18:37:19 +0530 Message-ID: <20181015130721.5535-18-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181015130721.5535-1-kishon@ti.com> References: <20181015130721.5535-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 025dd3daeda77f61a280da87ae701 ("PCI: keystone: Add error IRQ handler") added dev_err() message only for ERR_AXI and ERR_FATAL. Add debug error message for ERR_SYS, ERR_NONFATAL, ERR_CORR and ERR_AER here. While at that avoid using ERR_IRQ_STATUS_RAW and use ERR_IRQ_STATUS instead. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pci-keystone.c | 33 +++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index 67646a64c895..35ad3686d4a1 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -78,8 +78,6 @@ #define ERR_SYS BIT(0) /* System (fatal, non-fatal, or correctable) */ #define ERR_IRQ_ALL (ERR_AER | ERR_AXI | ERR_CORR | \ ERR_NONFATAL | ERR_FATAL | ERR_SYS) -#define ERR_FATAL_IRQ (ERR_FATAL | ERR_AXI) -#define ERR_IRQ_STATUS_RAW 0x1c0 #define ERR_IRQ_STATUS 0x1c4 #define ERR_IRQ_ENABLE_SET 0x1c8 #define ERR_IRQ_ENABLE_CLR 0x1cc @@ -251,18 +249,31 @@ static void ks_pcie_enable_error_irq(struct keystone_pcie *ks_pcie) static irqreturn_t ks_pcie_handle_error_irq(struct keystone_pcie *ks_pcie) { - u32 status; + u32 reg; + struct device *dev = ks_pcie->pci->dev; + + reg = ks_pcie_app_readl(ks_pcie, ERR_IRQ_STATUS); + + if (reg & ERR_SYS) + dev_err(dev, "System Error\n"); + + if (reg & ERR_FATAL) + dev_err(dev, "Fatal Error\n"); + + if (reg & ERR_NONFATAL) + dev_dbg(dev, "Non Fatal Error\n"); + + if (reg & ERR_CORR) + dev_dbg(dev, "Correctable Error\n"); + + if (reg & ERR_AXI) + dev_err(dev, "AXI tag lookup fatal Error\n"); - status = ks_pcie_app_readl(ks_pcie, ERR_IRQ_STATUS_RAW) & ERR_IRQ_ALL; - if (!status) - return IRQ_NONE; + if (reg & ERR_AER) + dev_err(dev, "ECRC Error\n"); - if (status & ERR_FATAL_IRQ) - dev_err(ks_pcie->pci->dev, "fatal error (status %#010x)\n", - status); + ks_pcie_app_writel(ks_pcie, ERR_IRQ_STATUS, reg); - /* Ack the IRQ; status bits are RW1C */ - ks_pcie_app_writel(ks_pcie, ERR_IRQ_STATUS, status); return IRQ_HANDLED; }