WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] [Patch 4/4] [RFC] Xwindow: Modify pci_acpi_scan_roo

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-ia64-devel] [Patch 4/4] [RFC] Xwindow: Modify pci_acpi_scan_root()
From: Jun Kamada <kama@xxxxxxxxxxxxxx>
Date: Fri, 01 Jun 2007 10:24:23 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 31 May 2007 18:23:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1180590046.6221.113.camel@bling>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070530144336.1D7A.KAMA@xxxxxxxxxxxxxx> <1180590046.6221.113.camel@bling>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Alex-san,

Thank you for your helpful comments.

I'm going to modify the patch according to your comments.
BTW, I will make some explanation about following your comment.

On Wed, 30 May 2007 23:40:46 -0600
Alex Williamson <alex.williamson@xxxxxx> wrote:
> Please add some comments on what the code below is trying to accomplish.
> Comments are good ;)
> 
> > +               }
> > +
> > +               if (curr_lvl > prev_lvl) {
> > +                       if (ptr->child != 0) {
> > +                               ptr = ptr->child;
> > +                               curr_lvl++;
> > +                               prev_lvl++;
> > +                       } else if (ptr->sibling != 0) {
> > +                               ptr = ptr->sibling;
> > +                       } else {
> > +                               ptr = ptr->parent;
> > +                               curr_lvl--;
> > +                               prev_lvl++;
> > +                               if (curr_lvl == 0)
> > +                                       goto out;

This function (__make_issue_list()) traverses all elements of the
resource structure list by depth first algorhithm.  

Structure of the list is shown below.

-----
C: Pointer to Child
P: Pointer to Parent
S: Pointer to Sibling

--------------------------------------------------
|                                                 |
|                                                 |
-->|---|-+-|---|                                  |
   | C | P | S +                                  |          <== Level i-1
   |-+-|---|---|                                  |
     |                                            |
   --                                             |
   |                                              |
   -->|---|-+-|---|  |-->|---|-+-|---|  |-->|---|-+-|---|
      | C | P | S +--    | C | P | S +--    | C | P | S |    <== Level i
      |-+-|---|---|      |-+-|---|---|      |-+-|---|---|
        |
      --
      |
      -->|---|-+-|---|
         | C | P | S +                                       <= Level i+1
         |-+-|---|---|

Condition "curr_lvl > prev_lvl" indicates that the "ptr" has gone down
from level i-1 to level i. On that case, "ptr" tries to go down to level
i+1 furthermore (because of depth first) if child exists. However, if
no child exits, "ptr" goes to sibling. If no child and no sibling exist,
"ptr" goes up.

On go up mode (condition "curr_lvl < prev_lvl"), "ptr" tries to go to
sibling and enters go down mode. If no sibling exists, "ptr" goes to
parent.

-----
At this point, I found a bug on the code as shown below. Without the
line, "ptr" cannot go to the other children. I would like to fix it and
re-post.

        } else if (curr_lvl < prev_lvl) {
            if (ptr->sibling != 0) {
                ptr = ptr->sibling;
                prev_lvl = curr_lvl - 1;        <== We need this line.
            } else {
                ptr = ptr->parent;
                curr_lvl--;
                prev_lvl--;
                if (curr_lvl == 0)
                    goto out;
            }


Thanks,

-----
Jun Kamada
Virtual Systems Development Div.
Platform Technology Development Unit
Fujitsu Ltd.
kama@xxxxxxxxxxxxxx



_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel