Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1098524ybe; Fri, 13 Sep 2019 11:00:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFLvqDrV5giF2sXWiE6uvq7SMjLJUCPkRkv8q4vX/3s/THp0r36YQEbWf5WMrRxahauqKt X-Received: by 2002:a17:906:139b:: with SMTP id f27mr41047443ejc.273.1568397639725; Fri, 13 Sep 2019 11:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568397639; cv=none; d=google.com; s=arc-20160816; b=UEZ9WEZTCTu/i6ilTPKl3BsscOdqm2FwPJ77CssEkGy4auEs74Tbqd7uUJErjUkdLZ r/yZ1L4Jo2H+UT8yVULXojuNfl/HGEdwYjZXoTVLNf7SFnRCg2bEJ3PAwf7JysuUatRp co8G2Um9Okxcq94JIEdUimulsKknvB+qNitzPvXQUdrWbxa9a0j3Pv/XXCjeUf/Ok893 bomU478YnfrzujuB+CtqfFyHvNV4iXnawHlZI0HA6azXrd5CUyQQELTEjkPQnwcTIAIm wy5+NAV3rW5afpsogiRTsj0CqmLKA8D9KaqmGoWoGezsQL+MDvESRLmo7nx7pwdYOtGN EsiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6wlzScHPwXP62L0zFPRz8slA79y3pF8ypF0w0b9hNHc=; b=PV42Qp/lsgHql0VbBgHOvL9iqxq9OOxhQ0NwQWD+t9BroSVi0UM7Gpx/MqkD7SYh6I TLx/PA39lSrwcF35yvF7oaohe9gXk3P91aAgYW6pzURUMSft1bOxvyaLgIKIsNlknvzE JiAYFTmQN6mr7sNWPTBXPu2hqrUPF2DXwd6t0V8GdUAvOc0amocBuS1XFebi2jeo2KST 4d7swkaIAc0wTUmILMdHCveKLxgo8rG6F/MwsAfkpaxmg/SWRsg9GvjU0LW4q5oXcDQf EcxVzqHKsaMAVReo1JsILQ7CPNtCpUoGLneBnh/66Ql9C97oc4S6ld8U4zw7j4TXzK2L 36Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hk4AT1hv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si15305548edr.36.2019.09.13.11.00.16; Fri, 13 Sep 2019 11:00:39 -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=@kernel.org header.s=default header.b=hk4AT1hv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388632AbfIMNJ6 (ORCPT + 99 others); Fri, 13 Sep 2019 09:09:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:34678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388579AbfIMNJ5 (ORCPT ); Fri, 13 Sep 2019 09:09:57 -0400 Received: from localhost (unknown [104.132.45.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 07C5D2089F; Fri, 13 Sep 2019 13:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380196; bh=/UeehScbMu3t7XqRJk6imFK9H3ouhpY1b8trKpClpXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hk4AT1hvXlP86nKsIbACGGBWItO8kWRk/WO5UeyDjbUvyJlDsZ8eYPlvHbTEEI8QC QpS6vDdniQPrzdreQHxxYgTICCOgXCTw9Xnh1brFG3kwuR3kd5tYDB9ac+KBUpnwZ0 ZNfev+lqaRfM3RrymOMU2k1JSR3ZNznnoumfc94U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Helgaas , Chris Welch , Vignesh R , Lorenzo Pieralisi , Kishon Vijay Abraham I , Mathieu Poirier Subject: [PATCH 4.14 10/21] PCI: dra7xx: Fix legacy INTD IRQ handling Date: Fri, 13 Sep 2019 14:07:03 +0100 Message-Id: <20190913130505.079444042@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913130501.285837292@linuxfoundation.org> References: <20190913130501.285837292@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vignesh R commit 524d59f6e30aab5b618da55e604c802ccd83e708 upstream. Legacy INTD IRQ handling is broken on dra7xx due to fact that driver uses hwirq in range of 1-4 for INTA, INTD whereas IRQ domain is of size 4 which is numbered 0-3. Therefore when INTD IRQ line is used with pci-dra7xx driver following warning is seen: WARNING: CPU: 0 PID: 1 at kernel/irq/irqdomain.c:342 irq_domain_associate+0x12c/0x1c4 error: hwirq 0x4 is too large for dummy Fix this by using pci_irqd_intx_xlate() helper to translate the INTx 1-4 range into the 0-3 as done in other PCIe drivers. Suggested-by: Bjorn Helgaas Reported-by: Chris Welch Signed-off-by: Vignesh R Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman --- drivers/pci/dwc/pci-dra7xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/pci/dwc/pci-dra7xx.c +++ b/drivers/pci/dwc/pci-dra7xx.c @@ -227,6 +227,7 @@ static int dra7xx_pcie_intx_map(struct i static const struct irq_domain_ops intx_domain_ops = { .map = dra7xx_pcie_intx_map, + .xlate = pci_irqd_intx_xlate, }; static int dra7xx_pcie_init_irq_domain(struct pcie_port *pp) @@ -270,7 +271,7 @@ static irqreturn_t dra7xx_pcie_msi_irq_h case INTC: case INTD: generic_handle_irq(irq_find_mapping(dra7xx->irq_domain, - ffs(reg))); + ffs(reg) - 1)); break; }