[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151218110253.GC29219@leverpostej>
Date: Fri, 18 Dec 2015 11:02:54 +0000
From: Mark Rutland <mark.rutland@....com>
To: MaJun <majun258@...wei.com>
Cc: Catalin.Marinas@....com, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, Will.Deacon@....com,
marc.zyngier@....com, jason@...edaemon.net, tglx@...utronix.de,
lizefan@...wei.com, huxinwei@...wei.com, dingtianhong@...wei.com,
zhaojunhua@...ilicon.com, liguozhu@...ilicon.com,
xuwei5@...ilicon.com, wei.chenwei@...ilicon.com,
guohanjun@...wei.com, wuyun.wu@...wei.com, guodong.xu@...aro.org,
haojian.zhuang@...aro.org, zhangfei.gao@...aro.org,
usman.ahmad@...aro.org, klimov.linux@...il.com,
gabriele.paoloni@...wei.com
Subject: Re: [PATCH v10 3/4] irqchip:create irq domain for each mbigen device
On Thu, Dec 17, 2015 at 07:56:36PM +0800, MaJun wrote:
> From: Ma Jun <majun258@...wei.com>
>
> For peripheral devices which connect to mbigen,mbigen is a interrupt
> controller. So, we create irq domain for each mbigen device and add
> mbigen irq domain into irq hierarchy structure.
>
> Signed-off-by: Ma Jun <majun258@...wei.com>
> ---
> drivers/irqchip/irq-mbigen.c | 138 ++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 138 insertions(+), 0 deletions(-)
[...]
> +static int mbigen_domain_translate(struct irq_domain *d,
> + struct irq_fwspec *fwspec,
> + unsigned long *hwirq,
> + unsigned int *type)
> +{
> + if (is_of_node(fwspec->fwnode)) {
> + if (fwspec->param_count != 2)
> + return -EINVAL;
> +
> + if ((fwspec->param[0] > MAXIMUM_IRQ_PIN_NUM) ||
> + (fwspec->param[0] < RESERVED_IRQ_PER_MBIGEN_CHIP))
> + return -EINVAL;
> + else
> + *hwirq = fwspec->param[0];
> +
> + /* If there is no valid irq type, just use the default type */
> + if ((fwspec->param[1] == IRQ_TYPE_EDGE_RISING) ||
> + (fwspec->param[1] == IRQ_TYPE_LEVEL_HIGH))
> + *type = fwspec->param[1];
> + else
> + *type = IRQ_TYPE_NONE;
That does not seem like a good idea. The binding requires one of two
types, and the DT is clearly wrong in the else case.
I think for the else case we should return -EINVAL.
Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists