Re: [PATCH] [powerpc] Export memory limit via device tree
On 07/11/2012 11:06 AM, Benjamin Herrenschmidt wrote: diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index c957b12..0c9695d 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -207,6 +207,12 @@ static struct property crashk_size_prop = { .value = _size, }; +static struct property memory_limit_prop = { + .name = "linux,memory-limit", + .length = sizeof(phys_addr_t), + .value = _limit, +}; + AFAIK. phys_addr_t can change size, so instead make it point to a known fixes size quantity (a u64). Ben, Sorry for the delay in the response. Some of the other properties are also of phys_addr_t, (e.g linux,crashkernel-base, linux,kernel-end ). Should we fix them as well ? Or Should we leave this also a phys_addr_t and let the userspace handle it ? + + /* memory-limit is needed for constructing the crash regions */ + prop = of_find_property(node, memory_limit_prop.name, NULL); + if (prop) + prom_remove_property(node, prop); + + if (memory_limit) + prom_add_property(node, _limit_prop); + There's a patch floating around making prom_update_property properly handle both pre-existing and non-pre-existing props, you should probably base yourself on top of it. I'm about to stick that patch in powerpc -next OK. I am testing the new patch based on the above commit. I will wait for the clarification on the issue of the type, before I post it here. Thanks Suzuki -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [powerpc] Export memory limit via device tree
On 07/11/2012 11:06 AM, Benjamin Herrenschmidt wrote: diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index c957b12..0c9695d 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -207,6 +207,12 @@ static struct property crashk_size_prop = { .value = crashk_size, }; +static struct property memory_limit_prop = { + .name = linux,memory-limit, + .length = sizeof(phys_addr_t), + .value = memory_limit, +}; + AFAIK. phys_addr_t can change size, so instead make it point to a known fixes size quantity (a u64). Ben, Sorry for the delay in the response. Some of the other properties are also of phys_addr_t, (e.g linux,crashkernel-base, linux,kernel-end ). Should we fix them as well ? Or Should we leave this also a phys_addr_t and let the userspace handle it ? + + /* memory-limit is needed for constructing the crash regions */ + prop = of_find_property(node, memory_limit_prop.name, NULL); + if (prop) + prom_remove_property(node, prop); + + if (memory_limit) + prom_add_property(node, memory_limit_prop); + There's a patch floating around making prom_update_property properly handle both pre-existing and non-pre-existing props, you should probably base yourself on top of it. I'm about to stick that patch in powerpc -next OK. I am testing the new patch based on the above commit. I will wait for the clarification on the issue of the type, before I post it here. Thanks Suzuki -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [powerpc] Export memory limit via device tree
> diff --git a/arch/powerpc/kernel/machine_kexec.c > b/arch/powerpc/kernel/machine_kexec.c > index c957b12..0c9695d 100644 > --- a/arch/powerpc/kernel/machine_kexec.c > +++ b/arch/powerpc/kernel/machine_kexec.c > @@ -207,6 +207,12 @@ static struct property crashk_size_prop = { > .value = _size, > }; > > +static struct property memory_limit_prop = { > + .name = "linux,memory-limit", > + .length = sizeof(phys_addr_t), > + .value = _limit, > +}; > + AFAIK. phys_addr_t can change size, so instead make it point to a known fixes size quantity (a u64). > + > + /* memory-limit is needed for constructing the crash regions */ > + prop = of_find_property(node, memory_limit_prop.name, NULL); > + if (prop) > + prom_remove_property(node, prop); > + > + if (memory_limit) > + prom_add_property(node, _limit_prop); > + There's a patch floating around making prom_update_property properly handle both pre-existing and non-pre-existing props, you should probably base yourself on top of it. I'm about to stick that patch in powerpc -next Cheers, Ben. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [powerpc] Export memory limit via device tree
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index c957b12..0c9695d 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -207,6 +207,12 @@ static struct property crashk_size_prop = { .value = crashk_size, }; +static struct property memory_limit_prop = { + .name = linux,memory-limit, + .length = sizeof(phys_addr_t), + .value = memory_limit, +}; + AFAIK. phys_addr_t can change size, so instead make it point to a known fixes size quantity (a u64). + + /* memory-limit is needed for constructing the crash regions */ + prop = of_find_property(node, memory_limit_prop.name, NULL); + if (prop) + prom_remove_property(node, prop); + + if (memory_limit) + prom_add_property(node, memory_limit_prop); + There's a patch floating around making prom_update_property properly handle both pre-existing and non-pre-existing props, you should probably base yourself on top of it. I'm about to stick that patch in powerpc -next Cheers, Ben. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/