linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 4/8] powerpc/pseries: fix parsing of initial node path in update_dt_node
Date: Mon, 19 Aug 2013 08:48:23 -0500	[thread overview]
Message-ID: <52122227.6040904@linux.vnet.ibm.com> (raw)
In-Reply-To: <1376544232-24936-5-git-send-email-tyreld@linux.vnet.ibm.com>

On 08/15/2013 12:23 AM, Tyrel Datwyler wrote:
> On the first call to ibm,update-properties for a node the first property
> returned is the full node path. Currently this is not parsed correctly by the
> update_dt_node function. Commit 2e9b7b0 attempted to fix this, but was
> incorrect as it made a wrong assumption about the layout of the first
> property in the work area. Further, if ibm,update-properties must be called
> multiple times for the same node this special property should only be skipped
> after the initial call. The first property descriptor returned consists of
> the property name, property value length, and property value. The property
> name is an empty string, property length is encoded in 4 byte integer, and
> the property value is the node path.
> 
> Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

> ---
>  arch/powerpc/platforms/pseries/mobility.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> index 023e354..ed5426f 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -161,18 +161,19 @@ static int update_dt_node(u32 phandle, s32 scope)
>  
>  		prop_data = rtas_buf + sizeof(*upwa);
>  
> -		/* The first element of the buffer is the path of the node
> -		 * being updated in the form of a 8 byte string length
> -		 * followed by the string. Skip past this to get to the
> -		 * properties being updated.
> +		/* On the first call to ibm,update-properties for a node the
> +		 * the first property value descriptor contains an empty
> +		 * property name, the property value length encoded as u32,
> +		 * and the property value is the node path being updated.
>  		 */
> -		vd = *prop_data++;
> -		prop_data += vd;
> +		if (*prop_data == 0) {
> +			prop_data++;
> +			vd = *(u32 *)prop_data;
> +			prop_data += vd + sizeof(vd);
> +			upwa->nprops--;
> +		}
>  
> -		/* The path we skipped over is counted as one of the elements
> -		 * returned so start counting at one.
> -		 */
> -		for (i = 1; i < upwa->nprops; i++) {
> +		for (i = 0; i < upwa->nprops; i++) {
>  			char *prop_name;
>  
>  			prop_name = prop_data;
> 

  reply	other threads:[~2013-08-19 13:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15  5:23 [PATCH 0/8] powerpc/pseries: fix/cleanup broken mobility device-tree update code Tyrel Datwyler
2013-08-15  5:23 ` [PATCH 1/8] powerpc/pseries: fix creation of loop in device node property list Tyrel Datwyler
2013-08-19 13:43   ` Nathan Fontenot
2013-08-15  5:23 ` [PATCH 2/8] powerpc/pseries: fix over writing of rtas return code in update_dt_node Tyrel Datwyler
2013-08-19 13:44   ` Nathan Fontenot
2013-08-15  5:23 ` [PATCH 3/8] powerpc/pseries: pack update_props_workarea to map correctly to rtas buffer header Tyrel Datwyler
2013-08-19 13:46   ` Nathan Fontenot
2013-08-15  5:23 ` [PATCH 4/8] powerpc/pseries: fix parsing of initial node path in update_dt_node Tyrel Datwyler
2013-08-19 13:48   ` Nathan Fontenot [this message]
2013-08-15  5:23 ` [PATCH 5/8] powerpc/pseries: do all node initialization in dlpar_parse_cc_node Tyrel Datwyler
2013-08-19 13:49   ` Nathan Fontenot
2013-08-15  5:23 ` [PATCH 6/8] powerpc/pseries: make dlpar_configure_connector parent node aware Tyrel Datwyler
2013-08-19 13:53   ` Nathan Fontenot
2013-08-15  5:23 ` [PATCH 7/8] powerpc/pseries: add mising of_node_put in delete_dt_node Tyrel Datwyler
2013-08-19 13:54   ` Nathan Fontenot
2013-08-15  5:23 ` [PATCH 8/8] powerpc/pseries: child nodes are not detached by dlpar_detach_node Tyrel Datwyler
2013-08-19 13:56   ` Nathan Fontenot

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=52122227.6040904@linux.vnet.ibm.com \
    --to=nfont@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=tyreld@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).