Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757093Ab3JIKFi (ORCPT ); Wed, 9 Oct 2013 06:05:38 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:62369 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079Ab3JIKFe (ORCPT ); Wed, 9 Oct 2013 06:05:34 -0400 X-AuditID: cbfee68e-b7f756d000004512-a9-52552a6487b5 From: Jingoo Han To: "'Kishon Vijay Abraham I'" Cc: "'Bjorn Helgaas'" , linux-pci@vger.kernel.org, linux-samsung-soc@vger.kernel.org, "'Kukjin Kim'" , "'Pratyush Anand'" , "'Mohit KUMAR'" , "'Siva Reddy Kallam'" , "'SRIKANTH TUMKUR SHIVANAND'" , "'Arnd Bergmann'" , "'Sean Cross'" , "'Thierry Reding'" , "'Thomas Petazzoni'" , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, "'Jingoo Han'" References: <000401cec4c6$dc415180$94c3f480$%han@samsung.com> <52551C6E.1040404@ti.com> <003901cec4d0$5d83e650$188bb2f0$%han@samsung.com> <5255266B.6040809@ti.com> In-reply-to: <5255266B.6040809@ti.com> Subject: Re: [PATCH] PCI: designware: Add irq_create_mapping() Date: Wed, 09 Oct 2013 19:05:24 +0900 Message-id: <000501cec4d7$1233a3f0$369aebd0$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac7E1L1l3uG9QP0WQlCEdfLt9V9DOQAAkNqg Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCKsWRmVeSWpSXmKPExsVy+t8zA90UrdAgg4Wf1S3+TjrGbrGkKcPi 5SFNi/lHzrFaXF54idWid8FVNosLT3vYLC7vmsNmcXbecTaLGef3MVlsnPqL0aL9krLFiqat jBY/d81jsXj6oInJovHoA1aL1icPGB0EPX7/msTo8WTTRUaPnbPusnss2F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lAKFAhKLi5X07TBNCA1x07WAaYzQ9Q0JgusxMkADCesY M7r3vWIveCtY0dM2j6WBcSVfFyMnh4SAicSJM3MZIWwxiQv31rN1MXJxCAksYpTYeuowE4Tz i1Fi88p57CBVbAJqEl++HAazRQR0JBaeXs8MYjML3GSRuPVSFaJhOaPEhWcLwIo4gRq23VgH tkJYwE6iaeMXNhCbRUBVYuqjySwgNq+ArcSPo+egbEGJH5PvsUAM1ZLYvK2JFcKWl9i85i3Q Mg6gU9UlHv3VhbjBSOL8xQ9MECUiEvtevGOcwCg0C8mkWUgmzUIyaRaSlgWMLKsYRVMLkguK k9JzjfSKE3OLS/PS9ZLzczcxglPUM+kdjKsaLA4xCnAwKvHwPuAPCRJiTSwrrsw9xCjBwawk wrteKjRIiDclsbIqtSg/vqg0J7X4EGMy0KMTmaVEk/OB6TOvJN7Q2MTMyNLIzMLIxNycNGEl cd6DrdaBQgLpiSWp2ampBalFMFuYODilGhgFt6y5L3WjKpBR0WtLyBrn3QEsyz4l1NhPk1oc +5Jz842LinWTVh3fefcvc00vv9yWQPOXM7coBGz4KSAuXsSRsb1GNexF96fDAjVKPK9q59hO MI98nftGwCnGcYOo8KnCsKeJHT8YtnPvOsqwlF1BfEkx47ueOs8fMl1hwfZTWp2fv1554osS S3FGoqEWc1FxIgCV/DYblQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2470 Lines: 65 On Wednesday, October 09, 2013 6:48 PM, Kishon Vijay Abraham I wrote: > On Wednesday 09 October 2013 02:47 PM, Jingoo Han wrote: > > On Wednesday, October 09, 2013 6:06 PM, Kishon Vijay Abraham I wrote: > >> On Wednesday 09 October 2013 01:39 PM, Jingoo Han wrote: > >>> Without irq_create_mapping(), the correct irq number cannot be > >>> provided. In this case, it makes problem such as NULL deference. > >>> Thus, irq_create_mapping() should be added for MSI. > >>> > >>> Signed-off-by: Jingoo Han > >>> Cc: Kishon Vijay Abraham I > >>> --- > >>> Tested on Exynos5440. > >>> > >>> drivers/pci/host/pcie-designware.c | 10 ++++------ > >>> drivers/pci/host/pcie-designware.h | 1 + > >>> 2 files changed, 5 insertions(+), 6 deletions(-) > >>> > >>> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c > >>> index 8963017..e536bb6 100644 > >>> --- a/drivers/pci/host/pcie-designware.c > >>> +++ b/drivers/pci/host/pcie-designware.c > >>> @@ -237,6 +237,8 @@ static int assign_irq(int no_irqs, struct msi_desc *desc, int *pos) > >>> } > >>> } > >>> > >>> + pp->msi_irq_start = irq_create_mapping(pp->irq_domain, 0); > >>> + > >> > >> I think irq_create_mapping should be done for all the MSI irq lines instead of > >> only the first line. So you might have to do for MAX_MSI_IRQS lines. > > Maybe it should be only till MAX_MSI_IRQS-1? I am not sure; however, it doesn't look correct. irq_create_mapping() is defined as below. According to the comment, irq_create_mapping() maps 'a' hardware interrupt, not max value of MSI IRQ lines. ./kernel/irq/irqdomain.c /** * irq_create_mapping() - Map a hardware interrupt into linux irq space * @domain: domain owning this hardware interrupt or NULL for default domain * @hwirq: hardware irq number in that domain space [.....] unsigned int irq_create_mapping(struct irq_domain *domain, irq_hw_number_t hwirq) Also, another value of 'irq' can be selected, because 'pos0' is added. pp->msi_irq_start = irq_create_mapping(pp->irq_domain, 0); irq = (pp->msi_irq_start + pos0); Pratyush Anand, If I am wrong, please let me know. :-) Best regards, Jingoo Han -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/