Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci <linux-pci@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Graeme Gregory <graeme.gregory@linaro.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jingoo Han <jingoohan1@gmail.com>,
	Joao Pinto <Joao.Pinto@synopsys.com>,
	Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: [PATCH 2/3] pci: designware: add separate driver for the MSI part of the RC
Date: Thu, 24 Aug 2017 17:43:08 +0100
Message-ID: <CAKv+Gu-K7wqROca9wOPGppEJyrsWCZFzJisqKwObZtFSGkC6vQ@mail.gmail.com> (raw)
In-Reply-To: <20170824164211.GH31858@bhelgaas-glaptop.roam.corp.google.com>

On 24 August 2017 at 17:42, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Mon, Aug 21, 2017 at 08:29:06PM +0100, Ard Biesheuvel wrote:
>> Most drivers that currently exist for the Synopsys Designware PCIe
>> controller in RC mode hardcode the relation with the embedded MSI
>> controller. This makes it more difficult than necessary to use a
>> generic driver to drive the RC, which is especially unfortunate
>> in cases where the firmware already configures the RC to the extent
>> that it can be driven by the generic ECAM driver. It also makes it
>> impossible to use an existing driver but use another IP block for
>> MSI support, i.e., a GICv2m or GICv3-ITS.
>>
>> So add a separate driver for the MSI part, which can be referenced
>> from the DT node describing the RC via its msi-parent property.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
>> +static int dw_pcie_msi_probe(struct platform_device *pdev)
>> +{
>> +     struct fwnode_handle *fwnode = of_node_to_fwnode(pdev->dev.of_node);
>> +     struct device *dev = &pdev->dev;
>> +     struct dw_pcie_msi *dw_msi;
>> +     struct resource *res;
>> +
>> +     dw_msi = devm_kzalloc(dev, sizeof(*dw_msi), GFP_KERNEL);
>> +     if (!dw_msi)
>> +             return -ENOMEM;
>> +
>> +     /* get the control register and map it */
>> +     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +     dw_msi->regbase = devm_ioremap_resource(dev, res);
>> +     if (IS_ERR(dw_msi->regbase))
>> +             return PTR_ERR(dw_msi->regbase);
>> +
>> +     /* get the wired interrupt that gets raised when we receive an MSI */
>> +     dw_msi->irq = platform_get_irq(pdev, 0);
>> +     if (dw_msi->irq <= 0) {
>> +             pr_err("Failed to map IRQ\n");
>
> dev_err()
>
> I'm not sure "failed to *map* IRQ" is the most informative text.
> Other callers often use some variant of "failed to get IRQ" or "no IRQ
> resource found".
>

Good point. I will fix that.

  reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 19:29 [PATCH 0/3] pci: add support for firmware initialized designware RCs Ard Biesheuvel
2017-08-21 19:29 ` [PATCH 2/3] pci: designware: add separate driver for the MSI part of the RC Ard Biesheuvel
2017-08-24 16:42   ` Bjorn Helgaas
2017-08-24 16:43     ` Ard Biesheuvel [this message]
2017-08-24 16:48   ` Robin Murphy
2017-08-24 16:50     ` Ard Biesheuvel
2020-02-15  0:54   ` Alan Mikhak
2020-02-15  9:35     ` Ard Biesheuvel
2020-02-15 10:36       ` Marc Zyngier
2020-02-18 19:09         ` Alan Mikhak
2020-02-19  8:11           ` Marc Zyngier
2020-02-19  8:17             ` Ard Biesheuvel
2020-02-19 20:24               ` Alan Mikhak
2020-02-19 21:06                 ` Ard Biesheuvel
2020-02-19 21:35                   ` Alan Mikhak
2017-08-21 19:29 ` [PATCH 3/3] dt-bindings: designware: add binding for Designware PCIe in ECAM mode Ard Biesheuvel
2017-08-24 16:46 ` [PATCH 0/3] pci: add support for firmware initialized designware RCs Bjorn Helgaas
2017-08-31 19:21   ` Ard Biesheuvel
2017-08-21 19:29 [PATCH 1/3] pci: designware: add driver for DWC controller in ECAM shift mode Ard Biesheuvel
2017-08-24 16:24 ` kbuild test robot
2017-08-24 16:25 ` kbuild test robot

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=CAKv+Gu-K7wqROca9wOPGppEJyrsWCZFzJisqKwObZtFSGkC6vQ@mail.gmail.com \
    --to=ard.biesheuvel@linaro.org \
    --cc=Joao.Pinto@synopsys.com \
    --cc=bhelgaas@google.com \
    --cc=graeme.gregory@linaro.org \
    --cc=helgaas@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=leif.lindholm@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    /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

Linux-PCI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pci/0 linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ https://lore.kernel.org/linux-pci \
		linux-pci@vger.kernel.org
	public-inbox-index linux-pci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git