From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3F7DC4CEC5 for ; Fri, 13 Sep 2019 13:09:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD9F42089F for ; Fri, 13 Sep 2019 13:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380199; bh=/UeehScbMu3t7XqRJk6imFK9H3ouhpY1b8trKpClpXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=m3eKzg0u9yBP1wEKWZIc07enDa/goQWjko+KUebhe/lkJUiEUfrtLGred/5iqWciT kFQ8cpzhiI6NWl9SMZTF6Ei6K4GxZj0Vc6UgdFsdX+a8DmDDcyTXaZ+YO0qTpnYJMC 7qEiRkQlc+g6PFH7TiuRjj6cyl9PwcenaDWtFepI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388636AbfIMNJ6 (ORCPT ); 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; }