From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2 v3] irqchip/Layerscape: Add SCFG MSI controller support
Date: Mon, 29 Feb 2016 10:14:28 +0000 [thread overview]
Message-ID: <56D41A04.8030302@arm.com> (raw)
In-Reply-To: <VI1PR04MB1615735FD9B40547228B7B51E8A60@VI1PR04MB1615.eurprd04.prod.outlook.com>
On 25/02/16 03:21, Minghuan Lian wrote:
> Hi Marc,
>
> I am sorry for the delayed response due to the Chinese Spring Festival holiday.
> Thank you very much for the review.
> Please see my comments inline.
>
> Thanks,
> Minghuan
>
[...]
>>> +static int ls_scfg_msi_probe(struct platform_device *pdev) {
>>> + struct ls_scfg_msi *msi_data;
>>> + struct resource *res;
>>> + int ret;
>>> +
>>> + msi_data = devm_kzalloc(&pdev->dev, sizeof(*msi_data), GFP_KERNEL);
>>> + if (!msi_data)
>>> + return -ENOMEM;
>>> +
>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> + msi_data->regs = devm_ioremap_resource(&pdev->dev, res);
>>> + if (IS_ERR(msi_data->regs)) {
>>> + dev_err(&pdev->dev, "failed to initialize 'regs'\n");
>>> + return PTR_ERR(msi_data->regs);
>>> + }
>>> + msi_data->msiir_addr = res->start;
>>> +
>>> + msi_data->irq = platform_get_irq(pdev, 0);
>>> + if (msi_data->irq <= 0) {
>>> + dev_err(&pdev->dev, "failed to get MSI irq\n");
>>> + return -ENODEV;
>>> + }
>>> +
>>> + msi_data->pdev = pdev;
>>> + msi_data->nr_irqs = MSI_MAX_IRQS;
>>
>> So this is hardcoded, always. Why do you need a nr_irqs variable at all?
> [Lian Minghuan-B31939] Currently, nr_irqs is always 32, but in the
> future, the MSI controller may be extended to support more IRQs. And,
> we may set nr_irqs the value of less than 32 to reserve some IRQs for
> special usage. So nr_irqs can bring flexibility
You have to choose: either this is configurable and you describe it in
DT, or this is not and you drop this field from the structure.
As for the "reserved interrupts", that would need to be described too.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2016-02-29 10:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 9:00 [PATCH 1/2 v3] dt/bindings: Add bindings for Layerscape SCFG MSI Minghuan Lian
2016-02-02 9:00 ` [PATCH 2/2 v3] irqchip/Layerscape: Add SCFG MSI controller support Minghuan Lian
2016-02-17 17:29 ` Marc Zyngier
2016-02-25 3:21 ` Minghuan Lian
2016-02-29 10:14 ` Marc Zyngier [this message]
2016-03-01 11:03 ` Minghuan Lian
2016-02-17 17:33 ` [PATCH 1/2 v3] dt/bindings: Add bindings for Layerscape SCFG MSI Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56D41A04.8030302@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).