All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, Magnus Damm <damm@opensource.se>,
	Ian Molton <ian.molton@codethink.co.uk>,
	Alexandre Courbot <acourbot@nvidia.com>
Subject: Re: [PATCH] gpio: em: lock IRQs when starting them
Date: Thu, 21 Nov 2013 13:50:06 +0900	[thread overview]
Message-ID: <20131121045006.GS31130@verge.net.au> (raw)
In-Reply-To: <1384940344-19708-1-git-send-email-linus.walleij@linaro.org>

On Wed, Nov 20, 2013 at 10:39:04AM +0100, Linus Walleij wrote:
> This uses the new API for tagging GPIO lines as in use by
> IRQs. This enforces a few semantic checks on how the underlying
> GPIO line is used.
> 
> Also assign the gpio_chip.dev pointer to be used for error
> messages.

Hi,

I have tested this patch on top of next-20131121 using
the emev2 based kzm9d board using its defconfig.
Unfortunately it seems to cause the following problem:

smsc911x smsc911x eth0: ISR failed signaling test (IRQ 201)

This seems to render the NIC unusable.

> Cc: Magnus Damm <damm@opensource.se>
> Cc: Ian Molton <ian.molton@codethink.co.uk>
> Cc: Simon Horman <horms+renesas@verge.net.au>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpio-em.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
> index ec190361bf2e..bbf242312bda 100644
> --- a/drivers/gpio/gpio-em.c
> +++ b/drivers/gpio/gpio-em.c
> @@ -99,6 +99,25 @@ static void em_gio_irq_enable(struct irq_data *d)
>  	em_gio_write(p, GIO_IEN, BIT(irqd_to_hwirq(d)));
>  }
>  
> +static unsigned int em_gio_irq_startup(struct irq_data *d)
> +{
> +	struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
> +
> +	if (gpio_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d)))
> +		dev_err(p->gpio_chip.dev,
> +			"unable to lock HW IRQ %lu for IRQ\n",
> +			irqd_to_hwirq(d));
> +	return 0;
> +}
> +
> +static void em_gio_irq_shutdown(struct irq_data *d)
> +{
> +	struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
> +
> +	gpio_unlock_as_irq(&p->gpio_chip, irqd_to_hwirq(d));
> +}
> +
> +
>  #define GIO_ASYNC(x) (x + 8)
>  
>  static unsigned char em_gio_sense_table[IRQ_TYPE_SENSE_MASK + 1] = {
> @@ -328,6 +347,7 @@ static int em_gio_probe(struct platform_device *pdev)
>  	gpio_chip->request = em_gio_request;
>  	gpio_chip->free = em_gio_free;
>  	gpio_chip->label = name;
> +	gpio_chip->dev = &pdev->dev;
>  	gpio_chip->owner = THIS_MODULE;
>  	gpio_chip->base = pdata->gpio_base;
>  	gpio_chip->ngpio = pdata->number_of_pins;
> @@ -339,6 +359,8 @@ static int em_gio_probe(struct platform_device *pdev)
>  	irq_chip->irq_enable = em_gio_irq_enable;
>  	irq_chip->irq_disable = em_gio_irq_disable;
>  	irq_chip->irq_set_type = em_gio_irq_set_type;
> +	irq_chip->irq_startup = em_gio_irq_startup;
> +	irq_chip->irq_shutdown = em_gio_irq_shutdown;
>  	irq_chip->flags	= IRQCHIP_SKIP_SET_WAKE;
>  
>  	p->irq_domain = irq_domain_add_simple(pdev->dev.of_node,
> -- 
> 1.8.3.1
> 

      reply	other threads:[~2013-11-21  4:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  9:39 [PATCH] gpio: em: lock IRQs when starting them Linus Walleij
2013-11-21  4:50 ` Simon Horman [this message]

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=20131121045006.GS31130@verge.net.au \
    --to=horms@verge.net.au \
    --cc=acourbot@nvidia.com \
    --cc=damm@opensource.se \
    --cc=ian.molton@codethink.co.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.