From: Ryder Lee <ryder.lee-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Cc: bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
hongkun.cao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
youlin.pei-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
xinping.qian-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH] PCI: mediatek: add msi support for mt2712 and mt7622
Date: Sat, 12 Aug 2017 08:57:21 +0800 [thread overview]
Message-ID: <1502499441.31707.6.camel@mtkswgap22> (raw)
In-Reply-To: <1502454469-29230-1-git-send-email-honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Hi Honghui,
On Fri, 2017-08-11 at 20:27 +0800, honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org wrote:
...
> +static void mtk_pcie_enable_msi(struct mtk_pcie_port *port)
> +{
> + u32 val;
> +
> + val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> + writel(val, port->base + PCIE_IMSI_ADDR);
> +
> + val = readl(port->base + PCIE_INT_MASK);
> + val &= ~MSI_MASK;
> + writel(val, port->base + PCIE_INT_MASK);
> +}
> +
> static int mtk_pcie_intx_map(struct irq_domain *domain, unsigned int irq,
> irq_hw_number_t hwirq)
> {
> @@ -460,6 +574,18 @@ static int mtk_pcie_init_irq_domain(struct mtk_pcie_port *port,
> return PTR_ERR(port->irq_domain);
> }
>
> + /* Setup MSI */
> + if (IS_ENABLED(CONFIG_PCI_MSI)) {
> + port->msi_domain = irq_domain_add_linear(node, MTK_MSI_IRQS_NUM,
> + &msi_domain_ops,
> + &mtk_pcie_msi_chip);
> + if (!port->msi_domain) {
> + dev_err(dev, "Failed to get a MSI IRQ domain\n");
> + return PTR_ERR(port->msi_domain);
Just return -ENOMEM. PTR_ERR(NULL) will cause a static checker warning.
> + }
> + mtk_pcie_enable_msi(port);
> + }
> +
> return 0;
> }
Ryder
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-08-12 0:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 12:27 [PATCH] PCI: mediatek: add msi support for mt2712 and mt7622 honghui.zhang
[not found] ` <1502454469-29230-1-git-send-email-honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-08-12 0:57 ` Ryder Lee [this message]
2017-08-14 1:12 ` honghui.zhang
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=1502499441.31707.6.camel@mtkswgap22 \
--to=ryder.lee-nus5lvnupcjwk0htik3j/w@public.gmane.org \
--cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=honghui.zhang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=hongkun.cao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=xinping.qian-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=youlin.pei-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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).