All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <nathanl@austin.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev list <linuxppc-dev@lists.linuxppc.org>
Subject: Re: [PATCH/RFC] add proc_dir_entry fields to device_node
Date: Mon, 06 Oct 2003 14:12:38 -0500	[thread overview]
Message-ID: <3F81BEA6.50908@austin.ibm.com> (raw)
In-Reply-To: <1065254150.645.16.camel@gaston>

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

> The comment is valid. You cannot change the format of struct
> device_node on ppc32 without breaking BootX booting :(
>
> The solution to this is to finally break it by having a conversion
> step between the BootX-passed device-tree and the in-kernel one

What about something like this as a short term solution?  The ppc64
versions of the macros would store the proc_dir_entry pointers in the
device nodes as they are added, e.g.

#define set_node_proc_entry(node,entry) node->pde = entry
#define set_node_name_link(node,entry) node->name_link = entry
#define set_node_addr_link(node,entry) node->addr_link = entry

while the ppc versions are no-ops.  This would preserve source
compatibility while keeping us from breaking BootX.

Separate patches against kernel.org 2.6.0-test6 attached.

Nathan

[-- Attachment #2: proc_devtree.patch --]
[-- Type: text/plain, Size: 714 bytes --]

diff -ur a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
--- a/fs/proc/proc_devtree.c	2003-09-27 19:50:38.000000000 -0500
+++ b/fs/proc/proc_devtree.c	2003-10-06 12:46:21.000000000 -0500
@@ -53,6 +53,7 @@
 	int l;
 	struct proc_dir_entry *list, **lastp, *al;

+	set_node_proc_entry(np, de);
 	lastp = &list;
 	for (pp = np->properties; pp != 0; pp = pp->next) {
 		/*
@@ -102,6 +103,7 @@
 			al = proc_symlink(child->name, de, ent->name);
 			if (al == 0)
 				break;
+			set_node_name_link(child, al);
 			*lastp = al;
 			lastp = &al->next;
 		}
@@ -112,6 +114,7 @@
 		al = proc_symlink(at, de, ent->name);
 		if (al == 0)
 			break;
+		set_node_addr_link(child, al);
 		*lastp = al;
 		lastp = &al->next;
 	}

[-- Attachment #3: ppc_device_node.patch --]
[-- Type: text/plain, Size: 552 bytes --]

diff -ur a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
--- a/include/asm-ppc/prom.h	2003-09-27 19:50:38.000000000 -0500
+++ b/include/asm-ppc/prom.h	2003-10-06 12:43:12.000000000 -0500
@@ -59,6 +59,11 @@
 	struct	device_node *allnext;	/* next in list of all nodes */
 };

+/* for compatibility with ppc64 */
+#define set_node_proc_entry(node,entry) do { } while(0)
+#define set_node_name_link(node,entry) do { } while(0)
+#define set_node_addr_link(node,entry) do { } while(0)
+
 struct prom_args;
 typedef void (*prom_entry)(struct prom_args *);


  reply	other threads:[~2003-10-06 19:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-03 16:22 [PATCH/RFC] add proc_dir_entry fields to device_node Nathan Lynch
2003-10-04  7:55 ` Benjamin Herrenschmidt
2003-10-06 19:12   ` Nathan Lynch [this message]
2003-10-06 19:40     ` Benjamin Herrenschmidt

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=3F81BEA6.50908@austin.ibm.com \
    --to=nathanl@austin.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.linuxppc.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.