From patchwork Wed Nov 9 14:05:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 692783 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tDSdx1TP1z9vDn for ; Thu, 10 Nov 2016 01:06:29 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tDSdw5fykzDvgf for ; Thu, 10 Nov 2016 01:06:28 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tDScl27xrzDvRc for ; Thu, 10 Nov 2016 01:05:26 +1100 (AEDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA9E4baS041403 for ; Wed, 9 Nov 2016 09:05:24 -0500 Received: from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86]) by mx0a-001b2d01.pphosted.com with ESMTP id 26m39w1m8d-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 09 Nov 2016 09:05:24 -0500 Received: from localhost by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 Nov 2016 12:05:21 -0200 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 9 Nov 2016 12:05:19 -0200 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.18.232.225]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 56C793520074 for ; Wed, 9 Nov 2016 09:04:50 -0500 (EST) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA9E5Ikl35520724 for ; Wed, 9 Nov 2016 12:05:18 -0200 Received: from d24av03.br.ibm.com (localhost [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA9E5HvC010758 for ; Wed, 9 Nov 2016 12:05:18 -0200 Received: from localhost ([9.85.139.228]) by d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uA9E5GNF010719; Wed, 9 Nov 2016 12:05:17 -0200 From: "Guilherme G. Piccoli" To: devicetree@vger.kernel.org Subject: [PATCH] of/irq: improve error message on irq discovery process failure Date: Wed, 9 Nov 2016 12:05:08 -0200 X-Mailer: git-send-email 2.1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110914-0020-0000-0000-0000026240B7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110914-0021-0000-0000-00003075018F Message-Id: <1478700308-25481-1-git-send-email-gpiccoli@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-09_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611090264 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, robh+dt@kernel.org, linuxppc-dev@lists.ozlabs.org, frowand.list@gmail.com, gpiccoli@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On PowerPC machines some PCI slots might not have Level-triggered interrupts capability (also know as Level Signaled Interrupts - LSI), leading of_irq_parse_pci() to complain by presenting error messages on the kernel log - in this case, the properties "interrupt-map" and "interrupt-map-mask" are not present on the device's node on device tree. This patch introduces a different message for this specific case, and it also reduces the level of the message from error to warning. Before this patch, when an adapter was plugged in a slot without Level interrupts capabilities, we saw generic error messages like this: [54.239] pci 002d:70:00.0: of_irq_parse_pci() failed with rc=-22 Now, with this applied, we see the following specific message: [19.947] pci 0014:60:00.0: of_irq_parse_pci() gave up. The slot of this device has no Level-triggered Interrupts capability. No functional changes were introduced. Signed-off-by: Guilherme G. Piccoli --- drivers/of/irq.c | 5 ++++- drivers/of/of_pci_irq.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 393fea8..1ad6882 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -275,7 +275,10 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq) of_node_put(ipar); of_node_put(newpar); - return -EINVAL; + /* Positive non-zero return means no Level-triggered Interrupts + * capability was found. + */ + return ENOENT; } EXPORT_SYMBOL_GPL(of_irq_parse_raw); diff --git a/drivers/of/of_pci_irq.c b/drivers/of/of_pci_irq.c index 2306313..9b6f387 100644 --- a/drivers/of/of_pci_irq.c +++ b/drivers/of/of_pci_irq.c @@ -89,8 +89,14 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8)); laddr[1] = laddr[2] = cpu_to_be32(0); rc = of_irq_parse_raw(laddr, out_irq); - if (rc) + + if (rc < 0) { goto err; + } else if (rc > 0) { + dev_warn(&pdev->dev, + "of_irq_parse_pci() gave up. The slot of this device has no Level-triggered Interrupts capability.\n"); + return -rc; + } return 0; err: dev_err(&pdev->dev, "of_irq_parse_pci() failed with rc=%d\n", rc);