All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gunter Grau <gunter.grau@philips.com>, xenomai@xenomai.org
Cc: Gunter Grau <guntgrau@bbl.ma.philips.com>
Subject: Re: [PATCH] cobalt: ipipe: intr: Fix return value check of ipipe_set_irq_affinity
Date: Tue, 24 May 2022 09:24:30 +0200	[thread overview]
Message-ID: <dd14086f-41b8-d66a-07a2-804ffd3bf831@siemens.com> (raw)
In-Reply-To: <20220520142913.2081560-2-guntgrau@bbl.ma.philips.com>

On 20.05.22 16:29, Gunter Grau via Xenomai wrote:
> From: Julian Haller <julian.haller@philips.com>
> 
> ipipe_set_irq_affinity directly returns the value of the regular
> irq_set_affinity method. As described in irq.h in the linux kernel,
> the following return values indicate a success:
> 
> /*
>  * Return value for chip->irq_set_affinity()
>  *
>  * IRQ_SET_MASK_OK      - OK, core updates irq_common_data.affinity
>  * IRQ_SET_MASK_NOCPY   - OK, chip did update irq_common_data.affinity
>  * IRQ_SET_MASK_OK_DONE - Same as IRQ_SET_MASK_OK for core. Special code to
>  *                        support stacked irqchips, which indicates skipping
>  *                        all descendent irqchips.
>  */
> enum {
>         IRQ_SET_MASK_OK = 0,
>         IRQ_SET_MASK_OK_NOCOPY,
>         IRQ_SET_MASK_OK_DONE,
> };
> 
> As one example, the GIC in i.MX6 devices returns IRQ_SET_MASK_OK_DONE
> on success. Fix the xintr_attach function by treating all positive
> return values as success.
> 
> Signed-off-by: Gunter Grau <gunter.grau@philips.com>
> ---
>  kernel/cobalt/ipipe/intr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/cobalt/ipipe/intr.c b/kernel/cobalt/ipipe/intr.c
> index 378c7f07d..cb15597f7 100644
> --- a/kernel/cobalt/ipipe/intr.c
> +++ b/kernel/cobalt/ipipe/intr.c
> @@ -869,7 +869,7 @@ int xnintr_attach(struct xnintr *intr, void *cookie, const cpumask_t *cpumask)
>  			return -EINVAL;
>  	}
>  	ret = ipipe_set_irq_affinity(intr->irq, *effective_mask);
> -	if (ret)
> +	if (ret < 0)
>  		return ret;
>  #endif /* CONFIG_SMP */
>  

Thanks, applied to the 3.2 stable tree. Other versions are not affected.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


      parent reply	other threads:[~2022-05-24  7:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 16:48 Bug in xenomai 3.2.x on ARM François Legal
2022-03-22 17:31 ` Greg Gallagher
2022-03-22 18:57   ` Jan Kiszka
2022-03-22 22:19     ` François Legal
2022-04-14 16:37     ` François Legal
2022-05-20 14:29       ` Gunter Grau
2022-05-20 14:29         ` [PATCH] cobalt: ipipe: intr: Fix return value check of ipipe_set_irq_affinity Gunter Grau
2022-05-20 14:32           ` Grau, Gunter
2022-05-24  7:24           ` Jan Kiszka [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=dd14086f-41b8-d66a-07a2-804ffd3bf831@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gunter.grau@philips.com \
    --cc=guntgrau@bbl.ma.philips.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.