All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Thomas Petazzoni <thomas@free-electrons.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Boris Brezillon <boris@free-electrons.com>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	xenomai@xenomai.org
Subject: Re: [Xenomai] [PATCH] AT91: SAMA5D3: Adapt Ipipe for AIC5
Date: Tue, 01 Jul 2014 12:59:51 +0200	[thread overview]
Message-ID: <53B294A7.5010803@xenomai.org> (raw)
In-Reply-To: <1404210421-17081-1-git-send-email-maxime.ripard@free-electrons.com>

On 07/01/2014 12:27 PM, Maxime Ripard wrote:
> -
> -	at91_pic_muter_register();
>  }

Obviously, some if (soc_is_foo()) missing here.

> +static void __maybe_unused at91_aic5_eoi(struct irq_data *d)
> +{
> +	at91_aic_write(AT91_AIC5_EOICR, 0);
> +}

You want to make that inline, so that the hold callback ends-up doing
just two register writes without any function calls, improving interrupt
latency.

> +
>  #ifdef CONFIG_IPIPE
>  static void at91_aic_hold_irq(struct irq_data *d)
>  {
> @@ -258,13 +283,20 @@ static void at91_aic_release_irq(struct irq_data *d)
>  {
>  	at91_aic_hard_unmask_irq(d);
>  }
> -#endif /* CONFIG_IPIPE */
>  
> -static void __maybe_unused at91_aic5_eoi(struct irq_data *d)
> +static void at91_aic5_hold_irq(struct irq_data *d)
>  {
> -	at91_aic_write(AT91_AIC5_EOICR, 0);
> +	at91_aic5_hard_mask_irq(d);
> +	at91_aic5_eoi(d);
>  }
>  
> +static void at91_aic5_release_irq(struct irq_data *d)
> +{
> +	at91_aic5_hard_unmask_irq(d);
> +}

The ->release callback is called with irqs on, so you may want to call
hard_local_irq_save / hard_local_irq_restore to make it atomic (note
that the old at91s are also broken by the addition of the call to
set_backup). Alternatively, you may move the clear_backup/set_bakcup
calls to the linux mask/unmask routines, so that the register writes
remain atomic, and you can avoid the save/restore and function calls and
improve the interrupt latency.


-- 
                                                                Gilles.


  reply	other threads:[~2014-07-01 10:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01 10:27 [Xenomai] [PATCH] AT91: SAMA5D3: Adapt Ipipe for AIC5 Maxime Ripard
2014-07-01 10:59 ` Gilles Chanteperdrix [this message]
2014-07-01 14:15   ` Maxime Ripard
2014-07-01 19:35     ` Gilles Chanteperdrix
2014-07-04  9:27       ` Maxime Ripard
2014-07-05  8:13         ` Gilles Chanteperdrix
2014-07-07 16:02           ` Maxime Ripard
2014-07-07 16:07             ` Gilles Chanteperdrix
2014-07-08 12:55               ` Maxime Ripard
2014-07-08 14:04                 ` Maxime Ripard
2014-07-08 17:30                 ` Gilles Chanteperdrix
2014-07-10 15:05                   ` Maxime Ripard
2014-07-10 17:04                     ` Gilles Chanteperdrix
2014-07-16 16:18                       ` Maxime Ripard
2014-07-16 19:47                         ` Gilles Chanteperdrix
2014-07-17 10:18                           ` Maxime Ripard
2014-07-17 10:54                             ` Gilles Chanteperdrix
2014-07-17 11:59                               ` Maxime Ripard
2014-07-17 22:21                                 ` Gilles Chanteperdrix
2014-07-10 18:27                     ` Gilles Chanteperdrix
     [not found]                     ` <20140710172702.5ba6511c@free-electrons.com>
2014-07-10 18:30                       ` Gilles Chanteperdrix

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=53B294A7.5010803@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=boris@free-electrons.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=thomas@free-electrons.com \
    --cc=xenomai@xenomai.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.