* reply: [PATCH v3 1/2] PCI: kirin: Add MSI support
@ 2018-05-14 1:11 songxiaowei
2018-05-14 7:16 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: songxiaowei @ 2018-05-14 1:11 UTC (permalink / raw)
To: Andy Shevchenko, chenyao (F)
Cc: Wangbinghui, Lorenzo Pieralisi, Bjorn Helgaas, xuwei (O),
Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
linux-pci, Linux Kernel Mailing List, linux-arm Mailing List,
devicetree, dimitrysh, guodong.xu, Suzhuangluan, Kongfei
Hi, Andy Shevchenko
Yao is on maternity leave, and I'll take over the job after discussing with her.
> -----邮件原件-----
> 发件人: Andy Shevchenko [mailto:andy.shevchenko@gmail.com]
> 发送时间: 2018年5月14日 7:16
> 收件人: chenyao (F) <chenyao11@huawei.com>
> 抄送: songxiaowei <songxiaowei@hisilicon.com>; Wangbinghui
> <wangbinghui@hisilicon.com>; Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>;
> Bjorn Helgaas <bhelgaas@google.com>; xuwei (O) <xuwei5@huawei.com>;
> Rob Herring <robh+dt@kernel.org>; Mark Rutland <mark.rutland@arm.com>;
> Catalin Marinas <catalin.marinas@arm.com>; Will Deacon
> <will.deacon@arm.com>; linux-pci@vger.kernel.org; Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>; linux-arm Mailing List
> <linux-arm-kernel@lists.infradead.org>; devicetree
> <devicetree@vger.kernel.org>; dimitrysh@google.com;
> guodong.xu@linaro.org; Suzhuangluan <suzhuangluan@hisilicon.com>; Kongfei
> <kongfei@hisilicon.com>
> 主题: Re: [PATCH v3 1/2] PCI: kirin: Add MSI support
>
> On Fri, May 11, 2018 at 12:15 PM, Yao Chen <chenyao11@huawei.com> wrote:
> > Add support for MSI.
>
>
> > + int ret;
> > +
> > + if (IS_ENABLED(CONFIG_PCI_MSI)) {
>
> > + pci->pp.msi_irq = platform_get_irq(pdev, 0);
> > + if (pci->pp.msi_irq < 0) {
> > + dev_err(&pdev->dev, "failed to get MSI IRQ
> (%d)\n",
> > + pci->pp.msi_irq);
>
> > + return -ENODEV;
>
> Why shadowing actual error code?
[songxiaowei] Sorry, I can't get your point about this, would you explain it for me.
>
> > + }
> > + ret = devm_request_irq(&pdev->dev, pci->pp.msi_irq,
> > + kirin_pcie_msi_irq_handler,
> > + IRQF_SHARED |
> IRQF_NO_THREAD,
> > + "kirin_pcie_msi", &pci->pp);
> > + if (ret) {
> > + dev_err(&pdev->dev, "failed to request MSI
> IRQ %d\n",
> > + pci->pp.msi_irq);
> > + return ret;
> > + }
>
> It would be easy to read and maintain if this would be a separate function.
[songxiaowei] Yes, a separate function will be better, and I'll fix it.
>
> > + }
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
Thanks a lot,
Best Regards,
Xiaowei Song
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: reply: [PATCH v3 1/2] PCI: kirin: Add MSI support
2018-05-14 1:11 reply: [PATCH v3 1/2] PCI: kirin: Add MSI support songxiaowei
@ 2018-05-14 7:16 ` Andy Shevchenko
2018-05-14 7:40 ` 答复: " songxiaowei
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2018-05-14 7:16 UTC (permalink / raw)
To: songxiaowei
Cc: chenyao (F),
Wangbinghui, Lorenzo Pieralisi, Bjorn Helgaas, xuwei (O),
Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
linux-pci, Linux Kernel Mailing List, linux-arm Mailing List,
devicetree, dimitrysh, guodong.xu, Suzhuangluan, Kongfei
On Mon, May 14, 2018 at 4:11 AM, songxiaowei <songxiaowei@hisilicon.com> wrote:
>> > + int ret;
>> > +
>> > + if (IS_ENABLED(CONFIG_PCI_MSI)) {
>>
>> > + pci->pp.msi_irq = platform_get_irq(pdev, 0);
>> > + if (pci->pp.msi_irq < 0) {
>> > + dev_err(&pdev->dev, "failed to get MSI IRQ
>> (%d)\n",
>> > + pci->pp.msi_irq);
>>
>> > + return -ENODEV;
>>
>> Why shadowing actual error code?
> [songxiaowei] Sorry, I can't get your point about this, would you explain it for me.
platform_get_irq() returns either correct IRQ number or negative error code.
In the code above you shadow the actual error (as returned by that
call) by -ENODEV. Any reason why?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* 答复: reply: [PATCH v3 1/2] PCI: kirin: Add MSI support
2018-05-14 7:16 ` Andy Shevchenko
@ 2018-05-14 7:40 ` songxiaowei
0 siblings, 0 replies; 3+ messages in thread
From: songxiaowei @ 2018-05-14 7:40 UTC (permalink / raw)
To: Andy Shevchenko
Cc: chenyao (F),
Wangbinghui, Lorenzo Pieralisi, Bjorn Helgaas, xuwei (O),
Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
linux-pci, Linux Kernel Mailing List, linux-arm Mailing List,
devicetree, dimitrysh, guodong.xu, Suzhuangluan, Kongfei
Hi Andy Shevchenko
> -----邮件原件-----
> 发件人: Andy Shevchenko [mailto:andy.shevchenko@gmail.com]
> 发送时间: 2018年5月14日 15:17
> 收件人: songxiaowei <songxiaowei@hisilicon.com>
> 抄送: chenyao (F) <chenyao11@huawei.com>; Wangbinghui
> <wangbinghui@hisilicon.com>; Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>;
> Bjorn Helgaas <bhelgaas@google.com>; xuwei (O) <xuwei5@huawei.com>;
> Rob Herring <robh+dt@kernel.org>; Mark Rutland <mark.rutland@arm.com>;
> Catalin Marinas <catalin.marinas@arm.com>; Will Deacon
> <will.deacon@arm.com>; linux-pci@vger.kernel.org; Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>; linux-arm Mailing List
> <linux-arm-kernel@lists.infradead.org>; devicetree
> <devicetree@vger.kernel.org>; dimitrysh@google.com;
> guodong.xu@linaro.org; Suzhuangluan <suzhuangluan@hisilicon.com>; Kongfei
> <kongfei@hisilicon.com>
> 主题: Re: reply: [PATCH v3 1/2] PCI: kirin: Add MSI support
>
> On Mon, May 14, 2018 at 4:11 AM, songxiaowei <songxiaowei@hisilicon.com>
> wrote:
>
> >> > + int ret;
> >> > +
> >> > + if (IS_ENABLED(CONFIG_PCI_MSI)) {
> >>
> >> > + pci->pp.msi_irq = platform_get_irq(pdev, 0);
> >> > + if (pci->pp.msi_irq < 0) {
> >> > + dev_err(&pdev->dev, "failed to get MSI IRQ
> >> (%d)\n",
> >> > + pci->pp.msi_irq);
> >>
> >> > + return -ENODEV;
> >>
> >> Why shadowing actual error code?
> > [songxiaowei] Sorry, I can't get your point about this, would you explain it
> for me.
>
> platform_get_irq() returns either correct IRQ number or negative error code.
> In the code above you shadow the actual error (as returned by that
> call) by -ENODEV. Any reason why?
>
[songxiaowei] I guess the reason is that she wanted to keep the same with other hosts,
So, you'd like to use "return pci->pp.msi_irq " instead of " return -ENODEV ".
> --
> With Best Regards,
> Andy Shevchenko
Thanks a lot,
Xiaowei.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-14 7:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 1:11 reply: [PATCH v3 1/2] PCI: kirin: Add MSI support songxiaowei
2018-05-14 7:16 ` Andy Shevchenko
2018-05-14 7:40 ` 答复: " songxiaowei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).