linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Jamie Lentin <jm@lentin.co.uk>,
	Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Imre Kaloz <kaloz@openwrt.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v0 06/10] arm: orion5x: Add DT-based support for Netgear WNR854T
Date: Sat, 16 Jul 2016 21:10:38 +0200	[thread overview]
Message-ID: <4290281.AD5Bhg23o6@wuerfel> (raw)
In-Reply-To: <1468679348-10522-7-git-send-email-jm@lentin.co.uk>

On Saturday, July 16, 2016 3:29:04 PM CEST Jamie Lentin wrote:
> +
> +#define WNR854T_PCI_SLOT0_OFFS	7
> +#define WNR854T_PCI_SLOT0_IRQ_PIN	4
> +
> +static void __init wnr854t_pci_preinit(void)
> +{
> +	int pin;
> +
> +	/*
> +	 * Configure PCI GPIO IRQ pins
> +	 */
> +	pin = WNR854T_PCI_SLOT0_IRQ_PIN;
> +	if (gpio_request(pin, "PCI Int") == 0) {
> +		if (gpio_direction_input(pin) == 0) {
> +			irq_set_irq_type(gpio_to_irq(pin), IRQ_TYPE_LEVEL_LOW);
> +		} else {
> +			pr_err("wnr854t_pci_preinit failed to set_irq_type pin %d\n",
> +				pin);
> +			gpio_free(pin);
> +		}
> +	} else {
> +		pr_err("wnr854t_pci_preinit failed to request gpio %d\n", pin);
> +	}
> +}
> +
> +static int __init wnr854t_pci_map_irq(const struct pci_dev *dev, u8 slot,
> +	u8 pin)
> +{
> +	int irq;
> +
> +	/*
> +	 * Check for devices with hard-wired IRQs.
> +	 */
> +	irq = orion5x_pci_map_irq(dev, slot, pin);
> +	if (irq != -1)
> +		return irq;
> +
> +	/*
> +	 * PCI IRQs are connected via GPIOs
> +	 */
> +	switch (slot - WNR854T_PCI_SLOT0_OFFS) {
> +	case 0:
> +		return gpio_to_irq(WNR854T_PCI_SLOT0_IRQ_PIN);
> +	default:
> +		return -1;
> +	}
> +}

The other patches all appear good to me, but I find this one suspicious.

Why are you not using the device tree for probing PCI? Is there anything
missing in drivers/pci/host/pci-mvebu.c, or do you just need help
describing it in DT?

	Arnd

  parent reply	other threads:[~2016-07-16 19:11 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-16 14:28 [PATCH v0 00/10] Convert Netgear WNR854T to devicetree Jamie Lentin
2016-07-16 14:28 ` [PATCH v0 01/10] arm: orion5x: Add required properties for orion-wdt to DT node Jamie Lentin
2016-07-16 16:03   ` Andrew Lunn
2016-07-16 14:29 ` [PATCH v0 02/10] arm: orion5x: Add documentation for SoC and board bindings Jamie Lentin
2016-07-16 16:05   ` Andrew Lunn
2016-07-17 20:35   ` Rob Herring
2016-07-16 14:29 ` [PATCH v0 03/10] arm: orion5x: Add clk support for mv88f5181 Jamie Lentin
2016-07-16 16:10   ` Andrew Lunn
2016-07-16 17:34   ` Sergei Shtylyov
2016-07-17 20:36   ` Rob Herring
2016-07-16 14:29 ` [PATCH v0 04/10] arm: orion5x: Generalise mv88f5181l pinctrl support for 88f5181 Jamie Lentin
2016-07-16 16:15   ` Andrew Lunn
2016-07-17 20:40   ` Rob Herring
2016-07-16 14:29 ` [PATCH v0 05/10] arm: orion5x: Add DT include for mv88f5181 Jamie Lentin
2016-07-16 16:17   ` Andrew Lunn
2016-07-17 20:41   ` Rob Herring
2016-07-16 14:29 ` [PATCH v0 06/10] arm: orion5x: Add DT-based support for Netgear WNR854T Jamie Lentin
2016-07-16 16:34   ` Andrew Lunn
2016-07-16 16:39   ` Andrew Lunn
2016-07-16 19:10   ` Arnd Bergmann [this message]
2016-07-17  9:39     ` Jamie Lentin
2016-07-17 20:41       ` Arnd Bergmann
2016-07-18  9:44         ` Thomas Petazzoni
2016-07-18 10:06           ` Arnd Bergmann
2016-07-19  9:40             ` Jamie Lentin
2016-07-19  9:46               ` Arnd Bergmann
2016-07-17 20:51   ` Rob Herring
2016-07-19  9:46     ` Jamie Lentin
2016-07-16 14:29 ` [PATCH v0 07/10] arm: orion5x: Remove old non-DT-based WNR854T support Jamie Lentin
2016-07-16 16:36   ` Andrew Lunn
2016-07-16 14:29 ` [PATCH v0 08/10] net: phy: Try looking for a phy-handle property to find the OF node Jamie Lentin
2016-07-16 16:44   ` Andrew Lunn
2016-07-16 14:29 ` [PATCH v0 09/10] net: phy: Re-attempt custom DT configuration after configuration Jamie Lentin
2016-07-16 16:44   ` Andrew Lunn
2016-07-16 14:29 ` [PATCH v0 10/10] arm: orion5x: Configure Netgear WNR854T network port LEDs Jamie Lentin

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=4290281.AD5Bhg23o6@wuerfel \
    --to=arnd@arndb.de \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=jm@lentin.co.uk \
    --cc=kaloz@openwrt.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sebastian.hesselbarth@gmail.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
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).