All of lore.kernel.org
 help / color / mirror / Atom feed
From: b.brezillon.dev@gmail.com (Boris BREZILLON)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 3/9] at91: pinctrl: don't request GPIOs used for interrupts but lock them as IRQ
Date: Wed, 12 Mar 2014 13:59:50 +0100	[thread overview]
Message-ID: <53205A46.6000304@gmail.com> (raw)
In-Reply-To: <1393841162-25339-4-git-send-email-jjhiblot@traphandler.com>

Hi JJ,

IIRC this patch was necessary for the DM9000 device, which is not defined
in this series anymore.
And, correct me if I'm wrong, but there's still a discussion about how
this should be fixed properly (https://lkml.org/lkml/2014/2/25/388).

As a result, shouldn't we remove this patch from this series ?

Best Regards,

Boris

Le 03/03/2014 11:05, Jean-Jacques Hiblot a ?crit :
> During the xlate stage of the DT interrupt parsing, the at91 pinctrl driver
> requests the GPIOs that are described as interrupt sources. This prevents a
> driver to request the gpio later to get its electrical value.
> This patch replaces the gpio_request with a gpio_lock_as_irq to prevent the
> gpio to be set as an ouput while allowing a subsequent gpio_request to succeed
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> ---
>   drivers/pinctrl/pinctrl-at91.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index d990e33..db55b96 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1478,18 +1478,17 @@ static int at91_gpio_irq_domain_xlate(struct irq_domain *d,
>   {
>   	struct at91_gpio_chip *at91_gpio = d->host_data;
>   	int ret;
> -	int pin = at91_gpio->chip.base + intspec[0];
>   
>   	if (WARN_ON(intsize < 2))
>   		return -EINVAL;
>   	*out_hwirq = intspec[0];
>   	*out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;
>   
> -	ret = gpio_request(pin, ctrlr->full_name);
> +	ret = gpio_lock_as_irq(&at91_gpio->chip, intspec[0]);
>   	if (ret)
>   		return ret;
>   
> -	ret = gpio_direction_input(pin);
> +	ret = at91_gpio_direction_input(&at91_gpio->chip, intspec[0]);
>   	if (ret)
>   		return ret;
>   

WARNING: multiple messages have this Message-ID (diff)
From: Boris BREZILLON <b.brezillon.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jean-Jacques Hiblot
	<jjhiblot-dLKeG7h1OhBDOHtkgc7UlQ@public.gmane.org>,
	nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org
Cc: plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org
Subject: Re: [PATCH v5 3/9] at91: pinctrl: don't request GPIOs used for interrupts but lock them as IRQ
Date: Wed, 12 Mar 2014 13:59:50 +0100	[thread overview]
Message-ID: <53205A46.6000304@gmail.com> (raw)
In-Reply-To: <1393841162-25339-4-git-send-email-jjhiblot-dLKeG7h1OhBDOHtkgc7UlQ@public.gmane.org>

Hi JJ,

IIRC this patch was necessary for the DM9000 device, which is not defined
in this series anymore.
And, correct me if I'm wrong, but there's still a discussion about how
this should be fixed properly (https://lkml.org/lkml/2014/2/25/388).

As a result, shouldn't we remove this patch from this series ?

Best Regards,

Boris

Le 03/03/2014 11:05, Jean-Jacques Hiblot a écrit :
> During the xlate stage of the DT interrupt parsing, the at91 pinctrl driver
> requests the GPIOs that are described as interrupt sources. This prevents a
> driver to request the gpio later to get its electrical value.
> This patch replaces the gpio_request with a gpio_lock_as_irq to prevent the
> gpio to be set as an ouput while allowing a subsequent gpio_request to succeed
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot-dLKeG7h1OhBDOHtkgc7UlQ@public.gmane.org>
> ---
>   drivers/pinctrl/pinctrl-at91.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index d990e33..db55b96 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1478,18 +1478,17 @@ static int at91_gpio_irq_domain_xlate(struct irq_domain *d,
>   {
>   	struct at91_gpio_chip *at91_gpio = d->host_data;
>   	int ret;
> -	int pin = at91_gpio->chip.base + intspec[0];
>   
>   	if (WARN_ON(intsize < 2))
>   		return -EINVAL;
>   	*out_hwirq = intspec[0];
>   	*out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;
>   
> -	ret = gpio_request(pin, ctrlr->full_name);
> +	ret = gpio_lock_as_irq(&at91_gpio->chip, intspec[0]);
>   	if (ret)
>   		return ret;
>   
> -	ret = gpio_direction_input(pin);
> +	ret = at91_gpio_direction_input(&at91_gpio->chip, intspec[0]);
>   	if (ret)
>   		return ret;
>   

--
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

WARNING: multiple messages have this Message-ID (diff)
From: Boris BREZILLON <b.brezillon.dev@gmail.com>
To: Jean-Jacques Hiblot <jjhiblot@traphandler.com>, nicolas.ferre@atmel.com
Cc: plagnioj@jcrosoft.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	gregory.clement@free-electrons.com, devicetree@vger.kernel.org,
	thomas.petazzoni@free-electrons.com,
	alexandre.belloni@free-electrons.com
Subject: Re: [PATCH v5 3/9] at91: pinctrl: don't request GPIOs used for interrupts but lock them as IRQ
Date: Wed, 12 Mar 2014 13:59:50 +0100	[thread overview]
Message-ID: <53205A46.6000304@gmail.com> (raw)
In-Reply-To: <1393841162-25339-4-git-send-email-jjhiblot@traphandler.com>

Hi JJ,

IIRC this patch was necessary for the DM9000 device, which is not defined
in this series anymore.
And, correct me if I'm wrong, but there's still a discussion about how
this should be fixed properly (https://lkml.org/lkml/2014/2/25/388).

As a result, shouldn't we remove this patch from this series ?

Best Regards,

Boris

Le 03/03/2014 11:05, Jean-Jacques Hiblot a écrit :
> During the xlate stage of the DT interrupt parsing, the at91 pinctrl driver
> requests the GPIOs that are described as interrupt sources. This prevents a
> driver to request the gpio later to get its electrical value.
> This patch replaces the gpio_request with a gpio_lock_as_irq to prevent the
> gpio to be set as an ouput while allowing a subsequent gpio_request to succeed
>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> ---
>   drivers/pinctrl/pinctrl-at91.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index d990e33..db55b96 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1478,18 +1478,17 @@ static int at91_gpio_irq_domain_xlate(struct irq_domain *d,
>   {
>   	struct at91_gpio_chip *at91_gpio = d->host_data;
>   	int ret;
> -	int pin = at91_gpio->chip.base + intspec[0];
>   
>   	if (WARN_ON(intsize < 2))
>   		return -EINVAL;
>   	*out_hwirq = intspec[0];
>   	*out_type = intspec[1] & IRQ_TYPE_SENSE_MASK;
>   
> -	ret = gpio_request(pin, ctrlr->full_name);
> +	ret = gpio_lock_as_irq(&at91_gpio->chip, intspec[0]);
>   	if (ret)
>   		return ret;
>   
> -	ret = gpio_direction_input(pin);
> +	ret = at91_gpio_direction_input(&at91_gpio->chip, intspec[0]);
>   	if (ret)
>   		return ret;
>   


  reply	other threads:[~2014-03-12 12:59 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 10:05 [PATCH v5 0/9] Device Tree support for the at91sam9261ek Jean-Jacques Hiblot
2014-03-03 10:05 ` Jean-Jacques Hiblot
2014-03-03 10:05 ` Jean-Jacques Hiblot
2014-03-03 10:05 ` [PATCH v5 1/9] at91: dt: Adds support for the bus matrix declaration in the DT Jean-Jacques Hiblot
2014-03-03 10:05   ` Jean-Jacques Hiblot
2014-03-03 10:05   ` Jean-Jacques Hiblot
2014-03-03 10:05 ` [PATCH v5 2/9] dt: bindings: at91: Add a new binding for the bus matrix Jean-Jacques Hiblot
2014-03-03 10:05   ` Jean-Jacques Hiblot
2014-03-03 10:05 ` [PATCH v5 3/9] at91: pinctrl: don't request GPIOs used for interrupts but lock them as IRQ Jean-Jacques Hiblot
2014-03-03 10:05   ` Jean-Jacques Hiblot
2014-03-12 12:59   ` Boris BREZILLON [this message]
2014-03-12 12:59     ` Boris BREZILLON
2014-03-12 12:59     ` Boris BREZILLON
2014-03-17 11:14     ` Jean-Jacques Hiblot
2014-03-17 11:14       ` Jean-Jacques Hiblot
2014-03-17 11:14       ` Jean-Jacques Hiblot
2014-03-17 11:33       ` Boris BREZILLON
2014-03-17 11:33         ` Boris BREZILLON
2014-03-03 10:05 ` [PATCH v5 4/9] at91: dt: Add at91sam9261 dt SoC support Jean-Jacques Hiblot
2014-03-03 10:05   ` Jean-Jacques Hiblot
2014-03-03 18:40   ` Alexandre Belloni
2014-03-03 18:40     ` Alexandre Belloni
2014-03-03 18:40     ` Alexandre Belloni
2014-03-12 13:29     ` Nicolas Ferre
2014-03-12 13:29       ` Nicolas Ferre
2014-03-12 13:29       ` Nicolas Ferre
2014-03-17 11:40   ` Jean-Christophe PLAGNIOL-VILLARD
2014-03-17 11:40     ` Jean-Christophe PLAGNIOL-VILLARD
2014-03-17 11:40     ` Jean-Christophe PLAGNIOL-VILLARD
2014-03-17 11:48     ` Alexandre Belloni
2014-03-17 11:48       ` Alexandre Belloni
2014-03-17 11:48       ` Alexandre Belloni
2014-03-03 10:05 ` [PATCH v5 5/9] at91: dt: defconfig: Added the sam9261 to the list of DT-enabled SOCs Jean-Jacques Hiblot
2014-03-03 10:05   ` Jean-Jacques Hiblot
2014-03-03 10:05 ` [PATCH v5 6/9] at91: dt: sam9261: Device Tree support for the at91sam9261ek Jean-Jacques Hiblot
2014-03-03 10:05   ` Jean-Jacques Hiblot
2014-03-03 18:38   ` Alexandre Belloni
2014-03-03 18:38     ` Alexandre Belloni
2014-03-03 18:38     ` Alexandre Belloni
2014-03-12 13:35     ` Nicolas Ferre
2014-03-12 13:35       ` Nicolas Ferre
2014-03-12 13:35       ` Nicolas Ferre
2014-03-17 11:38   ` Jean-Christophe PLAGNIOL-VILLARD
2014-03-17 11:38     ` Jean-Christophe PLAGNIOL-VILLARD
2014-03-03 10:06 ` [PATCH v5 7/9] at91: updated the at91_dt_defconfig with support for the ADS7846 Jean-Jacques Hiblot
2014-03-03 10:06   ` Jean-Jacques Hiblot
2014-03-03 10:06 ` [PATCH v5 8/9] ARM: at91: prepare common clk transition for sam9261 SoC Jean-Jacques Hiblot
2014-03-03 10:06   ` Jean-Jacques Hiblot
2014-03-03 10:06 ` [PATCH v5 9/9] ARM: at91: move sam9261 SoC to common clk Jean-Jacques Hiblot
2014-03-03 10:06   ` Jean-Jacques Hiblot
2014-03-03 18:41 ` [PATCH v5 0/9] Device Tree support for the at91sam9261ek Alexandre Belloni
2014-03-03 18:41   ` Alexandre Belloni
2014-03-03 18:41   ` Alexandre Belloni
2014-03-12 13:05 ` Nicolas Ferre
2014-03-12 13:05   ` Nicolas Ferre
2014-03-12 13:05   ` Nicolas Ferre

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=53205A46.6000304@gmail.com \
    --to=b.brezillon.dev@gmail.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 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.