All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Zoltan Kiss <zoltan.kiss@huawei.com>,
	Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>,
	Xen-devel <xen-devel@lists.xen.org>,
	Frediano Ziglio <frediano.ziglio@huawei.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>
Subject: Re: [PATCH v8 2/4] xen/arm: Check for interrupt controller directly
Date: Tue, 03 Mar 2015 15:10:16 +0000	[thread overview]
Message-ID: <54F5CED8.3060404@linaro.org> (raw)
In-Reply-To: <CAHt6W4dM0SGj1BXiKRyeb9naqoxA9iFiAvsjHJOuD38vzzHC0w@mail.gmail.com>

On 03/03/15 15:07, Frediano Ziglio wrote:
> 2015-03-03 14:45 GMT+00:00 Julien Grall <julien.grall@linaro.org>:
>> Hello Frediano,
>>
>> On 03/03/15 11:19, Frediano Ziglio wrote:
>>> This check allow to detect mail interrupt controller even if it does
>>
>> main
>>
>>> not match one of the standard ones.
>>> This allow boards with non standard controllers to be handled correctly
>>> without having to manually edit the global list every time.
>>>
>>> Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
>>> ---
>>>  xen/arch/arm/domain_build.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>> index 9f1f59f..83951a3 100644
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -1069,7 +1069,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
>>>
>>>      /* Replace these nodes with our own. Note that the original may be
>>>       * used_by DOMID_XEN so this check comes first. */
>>> -    if ( dt_match_node(gic_matches, node) )
>>> +    if ( node == dt_interrupt_controller || dt_match_node(gic_matches, node) )
>>>          return make_gic_node(d, kinfo->fdt, node);
>>
>> What about if the device tree exposes multiple GICs? By mistake we will
>> expose the secondaries GIC if they are not standard.
>>
>> As I suggested on a previous mail, I would prefer to introduce a new
>> callback to check if the node is a GIC.
>>
> 
> I think something like this would make all happy (I hope, I tested and
> works correctly on my board):

This looks good to me.

Regards,

> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 9f1f59f..aaa3b97 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1035,12 +1035,6 @@ static int handle_node(struct domain *d, struct
> kernel_info *kinfo,
>          DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"),
>          { /* sentinel */ },
>      };
> -    static const struct dt_device_match gic_matches[] __initconst =
> -    {
> -        DT_MATCH_GIC_V2,
> -        DT_MATCH_GIC_V3,
> -        { /* sentinel */ },
> -    };
>      static const struct dt_device_match timer_matches[] __initconst =
>      {
>          DT_MATCH_TIMER,
> @@ -1069,7 +1063,7 @@ static int handle_node(struct domain *d, struct
> kernel_info *kinfo,
> 
>      /* Replace these nodes with our own. Note that the original may be
>       * used_by DOMID_XEN so this check comes first. */
> -    if ( dt_match_node(gic_matches, node) )
> +    if ( device_get_class(node) == DEVICE_GIC )
>          return make_gic_node(d, kinfo->fdt, node);
>      if ( dt_match_node(timer_matches, node) )
>          return make_timer_node(d, kinfo->fdt, node);
> 


-- 
Julien Grall

  reply	other threads:[~2015-03-03 15:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 11:19 [PATCH v8 0/4] xen/arm: Add support for Huawei hip04-d01 platform Frediano Ziglio
2015-03-03 11:19 ` [PATCH v8 1/4] xen/arm: Duplicate gic-v2.c file to support hip04 platform version Frediano Ziglio
2015-03-03 11:19 ` [PATCH v8 2/4] xen/arm: Check for interrupt controller directly Frediano Ziglio
2015-03-03 14:45   ` Julien Grall
2015-03-03 15:07     ` Frediano Ziglio
2015-03-03 15:10       ` Julien Grall [this message]
2015-03-05 16:36     ` Ian Campbell
2015-03-09 10:55       ` Julien Grall
2015-03-09 16:08         ` Ian Campbell
2015-03-09 16:41           ` Frediano Ziglio
2015-03-09 17:03             ` Ian Campbell
2015-03-03 11:19 ` [PATCH v8 3/4] xen/arm: Make gic-v2 code handle hip04-d01 platform Frediano Ziglio
2015-03-03 15:07   ` Julien Grall
2015-03-03 15:36     ` Frediano Ziglio
2015-03-03 15:42       ` Julien Grall
2015-03-05  9:31         ` Frediano Ziglio
2015-03-05 10:36           ` Julien Grall
2015-03-03 11:19 ` [PATCH v8 4/4] xen/arm: Force dom0 to use normal GICv2 driver on Hip04 platform Frediano Ziglio

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=54F5CED8.3060404@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=freddy77@gmail.com \
    --cc=frediano.ziglio@huawei.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=zoltan.kiss@huawei.com \
    /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.