From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kishon Vijay Abraham I Subject: Re: [PATCH] PCI: designware: Add irq_create_mapping() Date: Wed, 9 Oct 2013 15:57:16 +0530 Message-ID: <52552F84.2020901@ti.com> References: <000401cec4c6$dc415180$94c3f480$%han@samsung.com> <52551C6E.1040404@ti.com> <003901cec4d0$5d83e650$188bb2f0$%han@samsung.com> <5255266B.6040809@ti.com> <000501cec4d7$1233a3f0$369aebd0$%han@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <000501cec4d7$1233a3f0$369aebd0$%han@samsung.com> Sender: linux-pci-owner@vger.kernel.org To: Jingoo Han 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 List-Id: devicetree@vger.kernel.org On Wednesday 09 October 2013 03:35 PM, Jingoo Han wrote: > 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 meant something like this, for (i = 0; i < MAX_MSI_IRQS; i++) irq_create_mapping(pp->irq_domain, i); That didn't give me any issues though. Thanks Kishon