* Re: [POWERPC] 8xx: fix swap
From: Kumar Gala @ 2008-03-06 15:56 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras, LKML
In-Reply-To: <20080306135330.6d5462d2@vitb.ru.mvista.com>
On Mar 6, 2008, at 4:53 AM, Vitaly Bordug wrote:
> This makes swap routines operate correctly on the ppc_8xx based
> machines.
> Code has been revalidated on mpc885ads (8M sdram) with recent
> kernel. Based
> on patch from Yuri Tikhonov <yur@emcraft.com> to do the same on arch/
> ppc
> instance.
>
> Recent kernel's size makes swap feature very important on low-memory
> platforms,
> those are actually non-operable without it.
>
> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
> Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
> ---
>
> arch/powerpc/kernel/head_8xx.S | 30 ++++++++++++++++++++++++++
> +++-
> include/asm-powerpc/pgtable-ppc32.h | 8 --------
> 2 files changed, 29 insertions(+), 9 deletions(-)
do we need similar fixes to arch/ppc ?
- k
^ permalink raw reply
* Re: [POWERPC] 8xx: fix swap
From: Vitaly Bordug @ 2008-03-06 16:09 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, LKML
In-Reply-To: <7E836D6E-867B-4A35-9B3D-CD1D52E7F2DC@kernel.crashing.org>
On Thu, 6 Mar 2008 09:56:58 -0600
Kumar Gala wrote:
>
> On Mar 6, 2008, at 4:53 AM, Vitaly Bordug wrote:
>
> > This makes swap routines operate correctly on the ppc_8xx based
> > machines.
> > Code has been revalidated on mpc885ads (8M sdram) with recent
> > kernel. Based
> > on patch from Yuri Tikhonov <yur@emcraft.com> to do the same on
> > arch/ ppc
> > instance.
> >
> > Recent kernel's size makes swap feature very important on
> > low-memory platforms,
> > those are actually non-operable without it.
> >
> > Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
> > Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
> > ---
> >
> > arch/powerpc/kernel/head_8xx.S | 30
> > ++++++++++++++++++++++++++ +++-
> > include/asm-powerpc/pgtable-ppc32.h | 8 --------
> > 2 files changed, 29 insertions(+), 9 deletions(-)
>
> do we need similar fixes to arch/ppc ?
>
there's patch from Yuri that does it for ppc/ - I guess you may just pick it up and place to your tree.
--
Sincerely, Vitaly
^ permalink raw reply
* Re: [POWERPC] 8xx: fix swap
From: Segher Boessenkool @ 2008-03-06 16:12 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, LKML
In-Reply-To: <7E836D6E-867B-4A35-9B3D-CD1D52E7F2DC@kernel.crashing.org>
> do we need similar fixes to arch/ppc ?
Do we care?
arch/ppc needs many fixes, when you have implemented all of that, you
get a clone of arch/powerpc ;-)
Segher
^ permalink raw reply
* Re: [POWERPC] 8xx: fix swap
From: Scott Wood @ 2008-03-06 16:05 UTC (permalink / raw)
To: Kumar Gala; +Cc: Paul Mackerras, LKML, linuxppc-dev
In-Reply-To: <7E836D6E-867B-4A35-9B3D-CD1D52E7F2DC@kernel.crashing.org>
On Thu, Mar 06, 2008 at 09:56:58AM -0600, Kumar Gala wrote:
> On Mar 6, 2008, at 4:53 AM, Vitaly Bordug wrote:
> > arch/powerpc/kernel/head_8xx.S | 30 ++++++++++++++++++++++++++
> > +++-
> > include/asm-powerpc/pgtable-ppc32.h | 8 --------
> > 2 files changed, 29 insertions(+), 9 deletions(-)
>
> do we need similar fixes to arch/ppc ?
Yes, a patch was posted a while ago.
-Scott
^ permalink raw reply
* Performance in Booting Linux w/ Device Tree via U-Boot out of JFFS2 on NAND
From: Grant Erickson @ 2008-03-06 17:30 UTC (permalink / raw)
To: linuxppc-embedded@ozlabs.org
I am continuing some experiments in booting Linux w/ a flattened device tree
via u-boot (1.3.2-rc3) from JFFS2 on NAND on an AMCC "Haleakala" board and
am curious if anyone has come up with some quantitative performance
characterizations of the various options (in all cases, u-boot lives on NOR
flash). The options I am evaluating are:
1) Put uImage and haleakala.dtb in their own "raw" NAND slices and boot with
u-boot nand commands:
static struct mtd_partition nand_parts[] = {
{
.name = "kernel",
.offset = 0,
.size = 0x0400000
},
{
.name = "fdt",
.offset = 0x0400000,
.size = 0x0010000
},
{
.name = "root",
.offset = 0x0410000,
.size = 0x3BF0000
}
};
=> nand read.i 200000 0 400000
=> nand read.i 400000 400000 10000
=> setenv bootargs ${bootargs} console=ttyS0,${baudrate}
=> setenv bootargs ${bootargs} root=/dev/mtdblock9 rootfstype=jffs2
=> bootm 200000 - 400000
Qualitative performance: Nearly instantaneous.
As expected, in this case the qualitative, subjective time to seeing "Linux
version 2.6.25-rc3-00951-g6514352-dirty ..." is nearly instantaneous.
2) Put uImage and haleakala.dtb as files in /boot in the ~12 MB JFFS2 root
file system image in the ~60 MB "root" NAND slice and boot with u-boot
fsload commands:
=> fsload 200000 boot/uImage
=> fsload 400000 boot/haleakala.dtb
=> setenv bootargs ${bootargs} console=ttyS0,${baudrate}
=> setenv bootargs ${bootargs} root=/dev/mtdblock9 rootfstype=jffs2
=> bootm 200000 - 400000
2a) With CFG_JFFS2_SORT_FRAGMENTS enabled.
Qualitative performance: Takes the better part of 30-35 minutes.
As expected with the in-documentation warnings about
CFG_JFFS2_SORT_FRAGMENTS and looking at the code in
u-boot/fs/jffs2/jffs2_nand_1pass.c, the qualitative, subjective time to
seeing the Linux version banner is slow, slow and slow.
2b) With CFG_JFFS2_SORT_FRAGMENTS disabled.
Qualitative performance: Takes about 30 seconds to two minutes.
3) This is a hybrid approach that I am setting up right now and is where I
am curious if anyone has done plots of fsload time on JFFS2 + NAND relative
to file system size.
Here, we use a separate 4 MB "/boot" JFFS2 file system for uImage and
haleakala.dtb files and a 60 MB "/" JFFS2 file system for the root file
system.
static struct mtd_partition nand_parts[] = {
{
.name = "boot",
.offset = 0,
.size = 0x0400000
},
{
.name = "root",
.offset = 0x0400000,
.size = 0x3C00000
}
};
=> fsload 200000 uImage
=> fsload 400000 haleakala.dtb
=> setenv bootargs ${bootargs} console=ttyS0,${baudrate}
=> setenv bootargs ${bootargs} root=/dev/mtdblock9 rootfstype=jffs2
=> bootm 200000 - 400000
3a) With CFG_JFFS2_SORT_FRAGMENTS enabled.
Shouldn't be necessary since the /boot file system would only ever be
accessed read-only and updated by nandwrite, not individual file updates.
3b) With CFG_JFFS2_SORT_FRAGMENTS disabled.
Qualitative performance: TBD <= 2b
Thanks,
Grant Erickson
^ permalink raw reply
* Re: How to boot kernel in JTAG mode
From: David Baird @ 2008-03-06 17:40 UTC (permalink / raw)
To: learn linux; +Cc: Heydeck, linuxppc-embedded
In-Reply-To: <56ef64000803060220r61a9cd87ibf1e92af95fad04a@mail.gmail.com>
On Thu, Mar 6, 2008 at 3:20 AM, learn linux <learn.mips.linux@gmail.com> wrote:
> Hi,
> I am new to this linux and jtag. I want to set up the my board in
> jtag mode so that I could boot the kernel in jtag mode and try to debug the
> kernel.
> I need a general information how to set it up.
Can you give more details? What board? What processor?
^ permalink raw reply
* [PATCH 0/5] 2.6.25-rc3-mm1 hotplug memory remove updates
From: Badari Pulavarty @ 2008-03-06 18:54 UTC (permalink / raw)
To: lkml, linuxppc-dev, paulus; +Cc: Yasunori Goto, Andrew Morton, pbadari
Hi Andrew & Paul,
Here are the updates for hotplug memory remove. Most changes are
PPC specific, but I would like these to be included in next -mm
for easy testing and review, before including in Paul's tree.
eHEA driver folks are verifying if the exported interface
walk_memory_resource() is good enough for their needs. And also,
we are verifying the code on x86_64. Once that is done, we may
be able to cleanup some of the code (make remove_memory() arch
generic).
We still have an issue with not being able to free up the allocations
that came from bootmem. Yasunori Goto wants to clean up that code.
[PATCH 1/5] generic __remove_pages() support
[PATCH 2/5] [PPC] htab_remove_mapping() error handling
[PATCH 3/5] [PPC] hotplug memory notifications for ppc
[PATCH 4/5] [PPC] update lmb for hotplug memory add/remove
[PATCH 5/5] [PPC] provide walk_memory_resource() for ppc
Testing: All the patches are tested on p-series LPAR configuration,
writing to /sysfs & /proc, through DLPAR tools and through HMC.
Testing on x86_64 needs more work.
Thanks,
Badari
^ permalink raw reply
* [PATCH 1/5] generic __remove_pages() support
From: Badari Pulavarty @ 2008-03-06 18:55 UTC (permalink / raw)
To: lkml; +Cc: linuxppc-dev, Andrew Morton, paulus, Yasunori Goto
In-Reply-To: <1204829673.7939.59.camel@dyn9047017100.beaverton.ibm.com>
Generic helper function to remove section mappings and sysfs entries
for the section of the memory we are removing. offline_pages() correctly
adjusted zone and marked the pages reserved.
Issue: If mem_map, usemap allocation could come from different places -
kmalloc, vmalloc, alloc_pages or bootmem. There is no easy way
to find and free up bootmem allocations.
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
---
include/linux/memory_hotplug.h | 4 +++
mm/memory_hotplug.c | 44 +++++++++++++++++++++++++++++++++++++++++
mm/sparse.c | 43 +++++++++++++++++++++++++++++++++++++---
3 files changed, 88 insertions(+), 3 deletions(-)
Index: linux-2.6.25-rc2/mm/memory_hotplug.c
===================================================================
--- linux-2.6.25-rc2.orig/mm/memory_hotplug.c 2008-02-27 12:58:17.000000000 -0800
+++ linux-2.6.25-rc2/mm/memory_hotplug.c 2008-02-27 16:06:50.000000000 -0800
@@ -102,6 +102,21 @@ static int __add_section(struct zone *zo
return register_new_memory(__pfn_to_section(phys_start_pfn));
}
+static int __remove_section(struct zone *zone, struct mem_section *ms)
+{
+ int ret = -EINVAL;
+
+ if (!valid_section(ms))
+ return ret;
+
+ ret = unregister_memory_section(ms);
+ if (ret)
+ return ret;
+
+ sparse_remove_one_section(zone, ms);
+ return 0;
+}
+
/*
* Reasonably generic function for adding memory. It is
* expected that archs that support memory hotplug will
@@ -135,6 +150,35 @@ int __add_pages(struct zone *zone, unsig
}
EXPORT_SYMBOL_GPL(__add_pages);
+int __remove_pages(struct zone *zone, unsigned long phys_start_pfn,
+ unsigned long nr_pages)
+{
+ unsigned long i, ret = 0;
+ int sections_to_remove;
+ unsigned long flags;
+ struct pglist_data *pgdat = zone->zone_pgdat;
+
+ /*
+ * We can only remove entire sections
+ */
+ BUG_ON(phys_start_pfn & ~PAGE_SECTION_MASK);
+ BUG_ON(nr_pages % PAGES_PER_SECTION);
+
+ release_mem_region(phys_start_pfn << PAGE_SHIFT, nr_pages * PAGE_SIZE);
+
+ sections_to_remove = nr_pages / PAGES_PER_SECTION;
+ for (i = 0; i < sections_to_remove; i++) {
+ unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION;
+ pgdat_resize_lock(pgdat, &flags);
+ ret = __remove_section(zone, __pfn_to_section(pfn));
+ pgdat_resize_unlock(pgdat, &flags);
+ if (ret)
+ break;
+ }
+ return ret;
+}
+EXPORT_SYMBOL_GPL(__remove_pages);
+
static void grow_zone_span(struct zone *zone,
unsigned long start_pfn, unsigned long end_pfn)
{
Index: linux-2.6.25-rc2/mm/sparse.c
===================================================================
--- linux-2.6.25-rc2.orig/mm/sparse.c 2008-02-15 12:57:20.000000000 -0800
+++ linux-2.6.25-rc2/mm/sparse.c 2008-02-27 13:02:51.000000000 -0800
@@ -198,12 +198,13 @@ static unsigned long sparse_encode_mem_m
}
/*
- * We need this if we ever free the mem_maps. While not implemented yet,
- * this function is included for parity with its sibling.
+ * Decode mem_map from the coded memmap
*/
-static __attribute((unused))
+static
struct page *sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long pnum)
{
+ /* mask off the extra low bits of information */
+ coded_mem_map &= SECTION_MAP_MASK;
return ((struct page *)coded_mem_map) + section_nr_to_pfn(pnum);
}
@@ -363,6 +364,26 @@ static void __kfree_section_memmap(struc
}
#endif /* CONFIG_SPARSEMEM_VMEMMAP */
+static void free_section_usemap(struct page *memmap, unsigned long *usemap)
+{
+ if (!usemap)
+ return;
+
+ /*
+ * Check to see if allocation came from hot-plug-add
+ */
+ if (PageSlab(virt_to_page(usemap))) {
+ kfree(usemap);
+ if (memmap)
+ __kfree_section_memmap(memmap, PAGES_PER_SECTION);
+ return;
+ }
+
+ /*
+ * Allocations came from bootmem - how do I free up ?
+ */
+}
+
/*
* returns the number of sections whose mem_maps were properly
* set. If this is <=0, then that means that the passed-in
@@ -415,4 +436,20 @@ out:
}
return ret;
}
+
+void sparse_remove_one_section(struct zone *zone, struct mem_section *ms)
+{
+ struct page *memmap = NULL;
+ unsigned long *usemap = NULL;
+
+ if (ms->section_mem_map) {
+ usemap = ms->pageblock_flags;
+ memmap = sparse_decode_mem_map(ms->section_mem_map,
+ __section_nr(ms));
+ ms->section_mem_map = 0;
+ ms->pageblock_flags = NULL;
+ }
+
+ free_section_usemap(memmap, usemap);
+}
#endif
Index: linux-2.6.25-rc2/include/linux/memory_hotplug.h
===================================================================
--- linux-2.6.25-rc2.orig/include/linux/memory_hotplug.h 2008-02-27 12:58:17.000000000 -0800
+++ linux-2.6.25-rc2/include/linux/memory_hotplug.h 2008-02-27 13:00:04.000000000 -0800
@@ -8,6 +8,7 @@
struct page;
struct zone;
struct pglist_data;
+struct mem_section;
#ifdef CONFIG_MEMORY_HOTPLUG
/*
@@ -64,6 +65,8 @@ extern int offline_pages(unsigned long,
/* reasonably generic interface to expand the physical pages in a zone */
extern int __add_pages(struct zone *zone, unsigned long start_pfn,
unsigned long nr_pages);
+extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
+ unsigned long nr_pages);
/*
* Walk thorugh all memory which is registered as resource.
@@ -188,5 +191,6 @@ extern int arch_add_memory(int nid, u64
extern int remove_memory(u64 start, u64 size);
extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
int nr_pages);
+extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
#endif /* __LINUX_MEMORY_HOTPLUG_H */
^ permalink raw reply
* [PATCH 2/5] [PPC] htab_remove_mapping() error handling
From: Badari Pulavarty @ 2008-03-06 18:56 UTC (permalink / raw)
To: lkml; +Cc: linuxppc-dev, Andrew Morton, paulus, Yasunori Goto
In-Reply-To: <1204829673.7939.59.camel@dyn9047017100.beaverton.ibm.com>
If the sub-arch doesn't support hpte_removebolted(), gracefully
return failure rather than success.
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
---
arch/powerpc/mm/hash_utils_64.c | 14 +++++++++-----
include/asm-powerpc/sparsemem.h | 2 +-
2 files changed, 10 insertions(+), 6 deletions(-)
Index: linux-2.6.25-rc3/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- linux-2.6.25-rc3.orig/arch/powerpc/mm/hash_utils_64.c 2008-03-05 10:14:28.000000000 -0800
+++ linux-2.6.25-rc3/arch/powerpc/mm/hash_utils_64.c 2008-03-05 10:18:55.000000000 -0800
@@ -192,7 +192,7 @@ int htab_bolt_mapping(unsigned long vsta
return ret < 0 ? ret : 0;
}
-static void htab_remove_mapping(unsigned long vstart, unsigned long vend,
+static int htab_remove_mapping(unsigned long vstart, unsigned long vend,
int psize, int ssize)
{
unsigned long vaddr;
@@ -202,12 +202,15 @@ static void htab_remove_mapping(unsigned
step = 1 << shift;
if (!ppc_md.hpte_removebolted) {
- printk("Sub-arch doesn't implement hpte_removebolted\n");
- return;
+ printk(KERN_WARNING "Sub-arch doesn't implement "
+ "hpte_removebolted\n");
+ return -EINVAL;
}
for (vaddr = vstart; vaddr < vend; vaddr += step)
ppc_md.hpte_removebolted(vaddr, psize, ssize);
+
+ return 0;
}
static int __init htab_dt_scan_seg_sizes(unsigned long node,
@@ -449,9 +452,10 @@ void create_section_mapping(unsigned lon
mmu_linear_psize, mmu_kernel_ssize));
}
-void remove_section_mapping(unsigned long start, unsigned long end)
+int remove_section_mapping(unsigned long start, unsigned long end)
{
- htab_remove_mapping(start, end, mmu_linear_psize, mmu_kernel_ssize);
+ return htab_remove_mapping(start, end, mmu_linear_psize,
+ mmu_kernel_ssize);
}
#endif /* CONFIG_MEMORY_HOTPLUG */
Index: linux-2.6.25-rc3/include/asm-powerpc/sparsemem.h
===================================================================
--- linux-2.6.25-rc3.orig/include/asm-powerpc/sparsemem.h 2008-03-05 10:14:31.000000000 -0800
+++ linux-2.6.25-rc3/include/asm-powerpc/sparsemem.h 2008-03-05 10:19:09.000000000 -0800
@@ -15,7 +15,7 @@
#ifdef CONFIG_MEMORY_HOTPLUG
extern void create_section_mapping(unsigned long start, unsigned long end);
-extern void remove_section_mapping(unsigned long start, unsigned long end);
+extern int remove_section_mapping(unsigned long start, unsigned long end);
#ifdef CONFIG_NUMA
extern int hot_add_scn_to_nid(unsigned long scn_addr);
#else
^ permalink raw reply
* [PATCH 3/5] [PPC] hotplug memory notifications for ppc
From: Badari Pulavarty @ 2008-03-06 18:57 UTC (permalink / raw)
To: lkml; +Cc: linuxppc-dev, Andrew Morton, paulus, Yasunori Goto
In-Reply-To: <1204829673.7939.59.camel@dyn9047017100.beaverton.ibm.com>
Hotplug memory notifier for ppc64. This gets invoked by writing
the device-node that needs to be removed to /proc/ppc64/ofdt.
We need to adjust the sections and remove sysfs entries by
calling __remove_pages(). Then call arch specific code to
get rid of htab mappings for the section of memory.
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Reviewed-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/Makefile | 1
arch/powerpc/platforms/pseries/hotplug-memory.c | 98 ++++++++++++++++++++++++
2 files changed, 99 insertions(+)
Index: linux-2.6.25-rc2/arch/powerpc/platforms/pseries/hotplug-memory.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.25-rc2/arch/powerpc/platforms/pseries/hotplug-memory.c 2008-02-29 09:25:14.000000000 -0800
@@ -0,0 +1,98 @@
+/*
+ * pseries Memory Hotplug infrastructure.
+ *
+ * Copyright (C) 2008 Badari Pulavarty, IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/of.h>
+#include <asm/firmware.h>
+#include <asm/machdep.h>
+#include <asm/pSeries_reconfig.h>
+
+static int pseries_remove_memory(struct device_node *np)
+{
+ const char *type;
+ const unsigned int *my_index;
+ const unsigned int *regs;
+ u64 start_pfn, start;
+ struct zone *zone;
+ int ret = -EINVAL;
+
+ /*
+ * Check to see if we are actually removing memory
+ */
+ type = of_get_property(np, "device_type", NULL);
+ if (type == NULL || strcmp(type, "memory") != 0)
+ return 0;
+
+ /*
+ * Find the memory index and size of the removing section
+ */
+ my_index = of_get_property(np, "ibm,my-drc-index", NULL);
+ if (!my_index)
+ return ret;
+
+ regs = of_get_property(np, "reg", NULL);
+ if (!regs)
+ return ret;
+
+ start_pfn = section_nr_to_pfn(*my_index & 0xffff);
+ zone = page_zone(pfn_to_page(start_pfn));
+
+ /*
+ * Remove section mappings and sysfs entries for the
+ * section of the memory we are removing.
+ *
+ * NOTE: Ideally, this should be done in generic code like
+ * remove_memory(). But remove_memory() gets called by writing
+ * to sysfs "state" file and we can't remove sysfs entries
+ * while writing to it. So we have to defer it to here.
+ */
+ ret = __remove_pages(zone, start_pfn, regs[3] >> PAGE_SHIFT);
+ if (ret)
+ return ret;
+
+ /*
+ * Remove htab bolted mappings for this section of memory
+ */
+ start = (unsigned long)__va(start_pfn << PAGE_SHIFT);
+ ret = remove_section_mapping(start, start + regs[3]);
+ return ret;
+}
+
+static int pseries_memory_notifier(struct notifier_block *nb,
+ unsigned long action, void *node)
+{
+ int err = NOTIFY_OK;
+
+ switch (action) {
+ case PSERIES_RECONFIG_ADD:
+ break;
+ case PSERIES_RECONFIG_REMOVE:
+ if (pseries_remove_memory(node))
+ err = NOTIFY_BAD;
+ break;
+ default:
+ err = NOTIFY_DONE;
+ break;
+ }
+ return err;
+}
+
+static struct notifier_block pseries_mem_nb = {
+ .notifier_call = pseries_memory_notifier,
+};
+
+static int __init pseries_memory_hotplug_init(void)
+{
+ if (firmware_has_feature(FW_FEATURE_LPAR))
+ pSeries_reconfig_notifier_register(&pseries_mem_nb);
+
+ return 0;
+}
+machine_device_initcall(pseries, pseries_memory_hotplug_init);
Index: linux-2.6.25-rc2/arch/powerpc/platforms/pseries/Makefile
===================================================================
--- linux-2.6.25-rc2.orig/arch/powerpc/platforms/pseries/Makefile 2008-02-28 08:15:53.000000000 -0800
+++ linux-2.6.25-rc2/arch/powerpc/platforms/pseries/Makefile 2008-02-28 08:17:57.000000000 -0800
@@ -14,6 +14,7 @@ obj-$(CONFIG_PCI) += pci.o pci_dlpar.o
obj-$(CONFIG_PCI_MSI) += msi.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o
+obj-$(CONFIG_MEMORY_HOTPLUG) += hotplug-memory.o
obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
obj-$(CONFIG_HVCS) += hvcserver.o
^ permalink raw reply
* [PATCH 4/5] [PPC] update lmb for hotplug memory add/remove
From: Badari Pulavarty @ 2008-03-06 18:58 UTC (permalink / raw)
To: lkml; +Cc: linuxppc-dev, Andrew Morton, paulus, Yasunori Goto
In-Reply-To: <1204829673.7939.59.camel@dyn9047017100.beaverton.ibm.com>
ppc kernel maintains information about logical memory blocks in
lmb.memory structure at the boot time. Its not updated for
hotplug memory add/remove. hotplug memory notifier for memory
add/remove now updates lmb.memory.
This information is useful for eHEA driver to find out the memory
layout and holes.
NOTE: Calls to lmb_add() and lmb_remove() needs to be serialized by
the caller. In this case blocking_notifier_chain(pSeries_reconfig_chain)
does that.
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 43 +++++++++++++++
include/linux/lmb.h | 3 -
lib/lmb.c | 66 ++++++++++++++++++++----
3 files changed, 102 insertions(+), 10 deletions(-)
Index: linux-2.6.25-rc3/lib/lmb.c
===================================================================
--- linux-2.6.25-rc3.orig/lib/lmb.c 2008-03-05 10:44:29.000000000 -0800
+++ linux-2.6.25-rc3/lib/lmb.c 2008-03-05 10:44:56.000000000 -0800
@@ -54,14 +54,13 @@ void lmb_dump_all(void)
#endif /* DEBUG */
}
-static unsigned long __init lmb_addrs_overlap(u64 base1,
- u64 size1, u64 base2, u64 size2)
+static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2,
+ u64 size2)
{
return ((base1 < (base2+size2)) && (base2 < (base1+size1)));
}
-static long __init lmb_addrs_adjacent(u64 base1, u64 size1,
- u64 base2, u64 size2)
+static long lmb_addrs_adjacent(u64 base1, u64 size1, u64 base2, u64 size2)
{
if (base2 == base1 + size1)
return 1;
@@ -71,7 +70,7 @@ static long __init lmb_addrs_adjacent(u6
return 0;
}
-static long __init lmb_regions_adjacent(struct lmb_region *rgn,
+static long lmb_regions_adjacent(struct lmb_region *rgn,
unsigned long r1, unsigned long r2)
{
u64 base1 = rgn->region[r1].base;
@@ -82,7 +81,7 @@ static long __init lmb_regions_adjacent(
return lmb_addrs_adjacent(base1, size1, base2, size2);
}
-static void __init lmb_remove_region(struct lmb_region *rgn, unsigned long r)
+static void lmb_remove_region(struct lmb_region *rgn, unsigned long r)
{
unsigned long i;
@@ -94,7 +93,7 @@ static void __init lmb_remove_region(str
}
/* Assumption: base addr of region 1 < base addr of region 2 */
-static void __init lmb_coalesce_regions(struct lmb_region *rgn,
+static void lmb_coalesce_regions(struct lmb_region *rgn,
unsigned long r1, unsigned long r2)
{
rgn->region[r1].size += rgn->region[r2].size;
@@ -129,7 +128,7 @@ void __init lmb_analyze(void)
}
/* This routine called with relocation disabled. */
-static long __init lmb_add_region(struct lmb_region *rgn, u64 base, u64 size)
+static long lmb_add_region(struct lmb_region *rgn, u64 base, u64 size)
{
unsigned long coalesced = 0;
long adjacent, i;
@@ -195,7 +194,7 @@ static long __init lmb_add_region(struct
}
/* This routine may be called with relocation disabled. */
-long __init lmb_add(u64 base, u64 size)
+long lmb_add(u64 base, u64 size)
{
struct lmb_region *_rgn = &(lmb.memory);
@@ -207,6 +206,55 @@ long __init lmb_add(u64 base, u64 size)
}
+long lmb_remove(u64 base, u64 size)
+{
+ struct lmb_region *rgn = &(lmb.memory);
+ u64 rgnbegin, rgnend;
+ u64 end = base + size;
+ int i;
+
+ rgnbegin = rgnend = 0; /* supress gcc warnings */
+
+ /* Find the region where (base, size) belongs to */
+ for (i=0; i < rgn->cnt; i++) {
+ rgnbegin = rgn->region[i].base;
+ rgnend = rgnbegin + rgn->region[i].size;
+
+ if ((rgnbegin <= base) && (end <= rgnend))
+ break;
+ }
+
+ /* Didn't find the region */
+ if (i == rgn->cnt)
+ return -1;
+
+ /* Check to see if we are removing entire region */
+ if ((rgnbegin == base) && (rgnend == end)) {
+ lmb_remove_region(rgn, i);
+ return 0;
+ }
+
+ /* Check to see if region is matching at the front */
+ if (rgnbegin == base) {
+ rgn->region[i].base = end;
+ rgn->region[i].size -= size;
+ return 0;
+ }
+
+ /* Check to see if the region is matching at the end */
+ if (rgnend == end) {
+ rgn->region[i].size -= size;
+ return 0;
+ }
+
+ /*
+ * We need to split the entry - adjust the current one to the
+ * beginging of the hole and add the region after hole.
+ */
+ rgn->region[i].size = base - rgn->region[i].base;
+ return lmb_add_region(rgn, end, rgnend - end);
+}
+
long __init lmb_reserve(u64 base, u64 size)
{
struct lmb_region *_rgn = &(lmb.reserved);
Index: linux-2.6.25-rc3/arch/powerpc/platforms/pseries/hotplug-memory.c
===================================================================
--- linux-2.6.25-rc3.orig/arch/powerpc/platforms/pseries/hotplug-memory.c 2008-03-05 10:44:51.000000000 -0800
+++ linux-2.6.25-rc3/arch/powerpc/platforms/pseries/hotplug-memory.c 2008-03-05 10:45:06.000000000 -0800
@@ -10,6 +10,7 @@
*/
#include <linux/of.h>
+#include <linux/lmb.h>
#include <asm/firmware.h>
#include <asm/machdep.h>
#include <asm/pSeries_reconfig.h>
@@ -58,6 +59,11 @@ static int pseries_remove_memory(struct
return ret;
/*
+ * Update memory regions for memory remove
+ */
+ lmb_remove(start_pfn << PAGE_SHIFT, regs[3]);
+
+ /*
* Remove htab bolted mappings for this section of memory
*/
start = (unsigned long)__va(start_pfn << PAGE_SHIFT);
@@ -65,6 +71,41 @@ static int pseries_remove_memory(struct
return ret;
}
+static int pseries_add_memory(struct device_node *np)
+{
+ const char *type;
+ const unsigned int *my_index;
+ const unsigned int *regs;
+ u64 start_pfn;
+ int ret = -EINVAL;
+
+ /*
+ * Check to see if we are actually adding memory
+ */
+ type = of_get_property(np, "device_type", NULL);
+ if (type == NULL || strcmp(type, "memory") != 0)
+ return 0;
+
+ /*
+ * Find the memory index and size of the removing section
+ */
+ my_index = of_get_property(np, "ibm,my-drc-index", NULL);
+ if (!my_index)
+ return ret;
+
+ regs = of_get_property(np, "reg", NULL);
+ if (!regs)
+ return ret;
+
+ start_pfn = section_nr_to_pfn(*my_index & 0xffff);
+
+ /*
+ * Update memory region to represent the memory add
+ */
+ lmb_add(start_pfn << PAGE_SHIFT, regs[3]);
+ return 0;
+}
+
static int pseries_memory_notifier(struct notifier_block *nb,
unsigned long action, void *node)
{
@@ -72,6 +113,8 @@ static int pseries_memory_notifier(struc
switch (action) {
case PSERIES_RECONFIG_ADD:
+ if (pseries_add_memory(node))
+ err = NOTIFY_BAD;
break;
case PSERIES_RECONFIG_REMOVE:
if (pseries_remove_memory(node))
Index: linux-2.6.25-rc3/include/linux/lmb.h
===================================================================
--- linux-2.6.25-rc3.orig/include/linux/lmb.h 2008-03-05 10:44:29.000000000 -0800
+++ linux-2.6.25-rc3/include/linux/lmb.h 2008-03-05 10:44:56.000000000 -0800
@@ -40,7 +40,8 @@ extern struct lmb lmb;
extern void __init lmb_init(void);
extern void __init lmb_analyze(void);
-extern long __init lmb_add(u64 base, u64 size);
+extern long lmb_add(u64 base, u64 size);
+extern long lmb_remove(u64 base, u64 size);
extern long __init lmb_reserve(u64 base, u64 size);
extern u64 __init lmb_alloc(u64 size, u64 align);
extern u64 __init lmb_alloc_base(u64 size,
^ permalink raw reply
* [PATCH 5/5] [PPC] provide walk_memory_resource() for ppc
From: Badari Pulavarty @ 2008-03-06 18:59 UTC (permalink / raw)
To: lkml; +Cc: linuxppc-dev, Andrew Morton, paulus, Yasunori Goto
In-Reply-To: <1204829673.7939.59.camel@dyn9047017100.beaverton.ibm.com>
Provide walk_memory_resource() for ppc64. PPC maintains
logic memory region mapping in lmb.memory structures. Walk
through these structures and do the callbacks for the
contiguous chunks.
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
---
arch/powerpc/mm/mem.c | 30 +++++++++++++++++++++++-------
include/linux/lmb.h | 1 +
lib/lmb.c | 33 +++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+), 7 deletions(-)
Index: linux-2.6.25-rc3/lib/lmb.c
===================================================================
--- linux-2.6.25-rc3.orig/lib/lmb.c 2008-03-05 10:28:55.000000000 -0800
+++ linux-2.6.25-rc3/lib/lmb.c 2008-03-05 10:34:01.000000000 -0800
@@ -416,3 +416,36 @@ int __init lmb_is_reserved(u64 addr)
}
return 0;
}
+
+/*
+ * Given a <base, len>, find which memory regions belong to this range.
+ * Adjust the request and return a contiguous chunk.
+ */
+int lmb_find(struct lmb_property *res)
+{
+ int i;
+ u64 rstart, rend;
+
+ rstart = res->base;
+ rend = rstart + res->size - 1;
+
+ for (i = 0; i < lmb.memory.cnt; i++) {
+ u64 start = lmb.memory.region[i].base;
+ u64 end = start + lmb.memory.region[i].size - 1;
+
+ if (start > rend)
+ return -1;
+
+ if ((end >= rstart) && (start < rend)) {
+ /* adjust the request */
+ if (rstart < start)
+ rstart = start;
+ if (rend > end)
+ rend = end;
+ res->base = rstart;
+ res->size = rend - rstart + 1;
+ return 0;
+ }
+ }
+ return -1;
+}
Index: linux-2.6.25-rc3/arch/powerpc/mm/mem.c
===================================================================
--- linux-2.6.25-rc3.orig/arch/powerpc/mm/mem.c 2008-03-05 10:14:28.000000000 -0800
+++ linux-2.6.25-rc3/arch/powerpc/mm/mem.c 2008-03-05 10:32:16.000000000 -0800
@@ -148,19 +148,35 @@ out:
/*
* walk_memory_resource() needs to make sure there is no holes in a given
- * memory range. On PPC64, since this range comes from /sysfs, the range
- * is guaranteed to be valid, non-overlapping and can not contain any
- * holes. By the time we get here (memory add or remove), /proc/device-tree
- * is updated and correct. Only reason we need to check against device-tree
- * would be if we allow user-land to specify a memory range through a
- * system call/ioctl etc. instead of doing offline/online through /sysfs.
+ * memory range. PPC64 does not maintain the memory layout in /proc/iomem.
+ * Instead it maintains it in lmb.memory structures. Walk through the
+ * memory regions, find holes and callback for contiguous regions.
*/
int
walk_memory_resource(unsigned long start_pfn, unsigned long nr_pages, void *arg,
int (*func)(unsigned long, unsigned long, void *))
{
- return (*func)(start_pfn, nr_pages, arg);
+ struct lmb_property res;
+ unsigned long pfn, len;
+ u64 end;
+ int ret = -1;
+
+ res.base = (u64) start_pfn << PAGE_SHIFT;
+ res.size = (u64) nr_pages << PAGE_SHIFT;
+
+ end = res.base + res.size - 1;
+ while ((res.base < end) && (lmb_find(&res) >= 0)) {
+ pfn = (unsigned long)(res.base >> PAGE_SHIFT);
+ len = (unsigned long)(res.size >> PAGE_SHIFT);
+ ret = (*func)(pfn, len, arg);
+ if (ret)
+ break;
+ res.base += (res.size + 1);
+ res.size = (end - res.base + 1);
+ }
+ return ret;
}
+EXPORT_SYMBOL_GPL(walk_memory_resource);
#endif /* CONFIG_MEMORY_HOTPLUG */
Index: linux-2.6.25-rc3/include/linux/lmb.h
===================================================================
--- linux-2.6.25-rc3.orig/include/linux/lmb.h 2008-03-05 10:30:06.000000000 -0800
+++ linux-2.6.25-rc3/include/linux/lmb.h 2008-03-05 10:33:12.000000000 -0800
@@ -52,6 +52,7 @@ extern u64 __init lmb_phys_mem_size(void
extern u64 __init lmb_end_of_DRAM(void);
extern void __init lmb_enforce_memory_limit(u64 memory_limit);
extern int __init lmb_is_reserved(u64 addr);
+extern int lmb_find(struct lmb_property *res);
extern void lmb_dump_all(void);
^ permalink raw reply
* Problems in fixup_device function
From: John Linn @ 2008-03-06 19:21 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 593 bytes --]
I've added some code to virtex_device_fixup and am seeing some strange
side affects. I've added code to read from an iic device and populate
the mac address including ioremap. The code works fine, but the side
affects are not fine.
Anyone have any experience here?
I see the loops_per_jiffy getting hosed like there is some bad code, but
I can't track it down. It moves around badly, like it can come and go
with printk additions or deletions.
I don't know enough about the stack and Linux to know if there could be
a problem there.
Thanks,
John
[-- Attachment #2: Type: text/html, Size: 8016 bytes --]
^ permalink raw reply
* Re: [PATCH 1/5] generic __remove_pages() support
From: Badari Pulavarty @ 2008-03-06 19:29 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linuxppc-dev, Andrew Morton, paulus, lkml, Yasunori Goto
In-Reply-To: <20080306110847.11d7cb26.randy.dunlap@oracle.com>
On Thu, 2008-03-06 at 11:08 -0800, Randy Dunlap wrote:
> On Thu, 06 Mar 2008 10:55:34 -0800 Badari Pulavarty wrote:
>
> > Generic helper function to remove section mappings and sysfs entries
> > for the section of the memory we are removing. offline_pages() correctly
> > adjusted zone and marked the pages reserved.
>
> Such generic (exported, non-static) interfaces could use some
> (kernel-)docs, please.
Sure. Will do.
> > Issue: If mem_map, usemap allocation could come from different places -
> > kmalloc, vmalloc, alloc_pages or bootmem. There is no easy way
> > to find and free up bootmem allocations.
> >
> > Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
> >
> > ---
> > include/linux/memory_hotplug.h | 4 +++
> > mm/memory_hotplug.c | 44 +++++++++++++++++++++++++++++++++++++++++
> > mm/sparse.c | 43 +++++++++++++++++++++++++++++++++++++---
> > 3 files changed, 88 insertions(+), 3 deletions(-)
>
> > Index: linux-2.6.25-rc2/include/linux/memory_hotplug.h
> > ===================================================================
> > --- linux-2.6.25-rc2.orig/include/linux/memory_hotplug.h 2008-02-27 12:58:17.000000000 -0800
> > +++ linux-2.6.25-rc2/include/linux/memory_hotplug.h 2008-02-27 13:00:04.000000000 -0800
> > @@ -64,6 +65,8 @@ extern int offline_pages(unsigned long,
> > /* reasonably generic interface to expand the physical pages in a zone */
> > extern int __add_pages(struct zone *zone, unsigned long start_pfn,
> > unsigned long nr_pages);
> > +extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
> > + unsigned long nr_pages);
> >
> > /*
> > * Walk thorugh all memory which is registered as resource.
>
> through :)
I will fix that.
Thanks,
Badari
^ permalink raw reply
* Re: Problems in fixup_device function
From: Grant Likely @ 2008-03-06 19:38 UTC (permalink / raw)
To: John Linn; +Cc: linuxppc-embedded
In-Reply-To: <20080306192149.4A0A9708064@mail119-dub.bigfish.com>
On Thu, Mar 6, 2008 at 12:21 PM, John Linn <John.Linn@xilinx.com> wrote:
>
>
>
>
> I've added some code to virtex_device_fixup and am seeing some strange side
> affects. I've added code to read from an iic device and populate the mac
> address including ioremap. The code works fine, but the side affects are
> not fine.
Specifically, what are you trying to do? Are you modifying the data
in the platform device?
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* RE: Problems in fixup_device function
From: John Linn @ 2008-03-06 19:40 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-embedded
In-Reply-To: <fa686aa40803061138s8ed3d6r53cff6324fdf99f2@mail.gmail.com>
I am loading the mac address into the data of the platform device.
-- John
-----Original Message-----
From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of
Grant Likely
Sent: Thursday, March 06, 2008 12:39 PM
To: John Linn
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Problems in fixup_device function
On Thu, Mar 6, 2008 at 12:21 PM, John Linn <John.Linn@xilinx.com> wrote:
>
>
>
>
> I've added some code to virtex_device_fixup and am seeing some strange
side
> affects. I've added code to read from an iic device and populate the
mac
> address including ioremap. The code works fine, but the side affects
are
> not fine.
Specifically, what are you trying to do? Are you modifying the data
in the platform device?
Cheers,
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 1/2] firewire: endianess fix
From: Gabriel Paubert @ 2008-03-06 20:23 UTC (permalink / raw)
To: Stefan Richter
Cc: Kristian Hoegsberg, linux-kernel, linuxppc-dev, sparclinux,
Jarod Wilson, linux1394-devel, Sam Ravnborg, Harvey Harrison
In-Reply-To: <47CF2C08.5000609@s5r6.in-berlin.de>
On Thu, Mar 06, 2008 at 12:26:00AM +0100, Stefan Richter wrote:
> Gabriel Paubert wrote:
> >>>I have a Pismo which I use on a virtually
> >>>daily basis (and about to remove the last remnants of MacOS on it).
> >>>However I have disabled Firewire because it would not sleep and wake
> >>>up properly.
> ...
> >For now I have only tested the new stack with a 6 year old 1.8" disk
> >and everything works, including suspend to RAM. The kernel is 2.6.25-rc4
> >plus additional pull from linux1394-2.6.git: 2.6.25-rc4-00032-g8d36ba4.
>
> That's great. Thanks for testing.
The old stack also works. I forgot to mention that with the new
stack (not with the old) there is a message when going to sleep:
firewire_ohci: pci_set_power_state failed with -5
but it is harmless, and if I understand correctly due to the
fact that the power management on this chip is not implemented
through capability fields in the PCI configuration space.
Gabriel
^ permalink raw reply
* Re: [PATCH 1/5] generic __remove_pages() support
From: Randy Dunlap @ 2008-03-06 19:08 UTC (permalink / raw)
To: Badari Pulavarty; +Cc: linuxppc-dev, Andrew Morton, paulus, lkml, Yasunori Goto
In-Reply-To: <1204829734.7939.61.camel@dyn9047017100.beaverton.ibm.com>
On Thu, 06 Mar 2008 10:55:34 -0800 Badari Pulavarty wrote:
> Generic helper function to remove section mappings and sysfs entries
> for the section of the memory we are removing. offline_pages() correctly
> adjusted zone and marked the pages reserved.
Such generic (exported, non-static) interfaces could use some
(kernel-)docs, please.
> Issue: If mem_map, usemap allocation could come from different places -
> kmalloc, vmalloc, alloc_pages or bootmem. There is no easy way
> to find and free up bootmem allocations.
>
> Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
>
> ---
> include/linux/memory_hotplug.h | 4 +++
> mm/memory_hotplug.c | 44 +++++++++++++++++++++++++++++++++++++++++
> mm/sparse.c | 43 +++++++++++++++++++++++++++++++++++++---
> 3 files changed, 88 insertions(+), 3 deletions(-)
> Index: linux-2.6.25-rc2/include/linux/memory_hotplug.h
> ===================================================================
> --- linux-2.6.25-rc2.orig/include/linux/memory_hotplug.h 2008-02-27 12:58:17.000000000 -0800
> +++ linux-2.6.25-rc2/include/linux/memory_hotplug.h 2008-02-27 13:00:04.000000000 -0800
> @@ -64,6 +65,8 @@ extern int offline_pages(unsigned long,
> /* reasonably generic interface to expand the physical pages in a zone */
> extern int __add_pages(struct zone *zone, unsigned long start_pfn,
> unsigned long nr_pages);
> +extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
> + unsigned long nr_pages);
>
> /*
> * Walk thorugh all memory which is registered as resource.
through :)
---
~Randy
^ permalink raw reply
* Re: Xilinx Temac link detect
From: khollan @ 2008-03-06 20:44 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <15616042.post@talk.nabble.com>
I figure I could write a C program to talk to the ioctl in the TEMAC driver
and read the PHY register. Does anyone have example code for talking to
network ioctl's?
Thanks
Kevin
--
View this message in context: http://www.nabble.com/Xilinx-Temac-link-detect-tp15616042p15883376.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [PATCH 1/5] generic __remove_pages() support
From: Dave Hansen @ 2008-03-06 20:54 UTC (permalink / raw)
To: Badari Pulavarty; +Cc: linuxppc-dev, Andrew Morton, paulus, lkml, Yasunori Goto
In-Reply-To: <1204829734.7939.61.camel@dyn9047017100.beaverton.ibm.com>
On Thu, 2008-03-06 at 10:55 -0800, Badari Pulavarty wrote:
> + if (memmap)
> + __kfree_section_memmap(memmap, PAGES_PER_SECTION);
> + return;
> + }
> +
> + /*
> + * Allocations came from bootmem - how do I free up ?
> + */
> +
Shouldn't we figure this one out before merging?
I think we at least need a printk() there.
-- Dave
^ permalink raw reply
* Re: [PATCH 1/5] generic __remove_pages() support
From: Badari Pulavarty @ 2008-03-06 21:42 UTC (permalink / raw)
To: Dave Hansen; +Cc: linuxppc-dev, Andrew Morton, paulus, lkml, Yasunori Goto
In-Reply-To: <1204836859.4772.32.camel@nimitz.home.sr71.net>
On Thu, 2008-03-06 at 12:54 -0800, Dave Hansen wrote:
> On Thu, 2008-03-06 at 10:55 -0800, Badari Pulavarty wrote:
> > + if (memmap)
> > + __kfree_section_memmap(memmap, PAGES_PER_SECTION);
> > + return;
> > + }
> > +
> > + /*
> > + * Allocations came from bootmem - how do I free up ?
> > + */
> > +
>
> Shouldn't we figure this one out before merging?
>
> I think we at least need a printk() there.
I can add a printk(). I am hoping Yasunori Goto has something to
handle this, before we really merge into mainline.
Thanks,
Badari
^ permalink raw reply
* Please pull pasemi.git for-2.6.26 branch
From: Olof Johansson @ 2008-03-06 21:44 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, pasemi-linux
Hi Paul,
Please pull from 'for-2.6.26' branch of
master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi.git for-2.6.26
to receive the following updates. They have all been posted to the list
previously, and had only minor updates to remove a couple of compiler
warnings:
arch/powerpc/platforms/pasemi/dma_lib.c | 144 ++++++++++++++
drivers/net/Makefile | 3
drivers/net/pasemi_mac.c | 324 ++++++++++++++++++++++++++------
drivers/net/pasemi_mac.h | 35 +++
drivers/net/pasemi_mac_ethtool.c | 159 +++++++++++++++
include/asm-powerpc/pasemi_dma.h | 77 +++++++
6 files changed, 681 insertions(+), 61 deletions(-)
Olof Johansson (6):
pasemi_mac: Move RX/TX section enablement to dma_lib
[POWERPC] pasemi: Add flag management functions to dma_lib
[POWERPC] pasemi: Add function engine management functions to dma_lib
pasemi_mac: jumbo frame support
pasemi_mac: Enable GSO by default
pasemi_mac: basic ethtool support
^ permalink raw reply
* Re: Please pull pasemi.git for-2.6.26 branch
From: Paul Mackerras @ 2008-03-06 22:15 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev, pasemi-linux
In-Reply-To: <20080306214406.GA2631@lixom.net>
Olof Johansson writes:
> Please pull from 'for-2.6.26' branch of
>
> master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi.git for-2.6.26
>
> to receive the following updates. They have all been posted to the list
> previously, and had only minor updates to remove a couple of compiler
> warnings:
>
> arch/powerpc/platforms/pasemi/dma_lib.c | 144 ++++++++++++++
> drivers/net/Makefile | 3
> drivers/net/pasemi_mac.c | 324 ++++++++++++++++++++++++++------
> drivers/net/pasemi_mac.h | 35 +++
> drivers/net/pasemi_mac_ethtool.c | 159 +++++++++++++++
> include/asm-powerpc/pasemi_dma.h | 77 +++++++
> 6 files changed, 681 insertions(+), 61 deletions(-)
Is Jeff Garzik OK with those pasemi_mac_* updates going via my tree?
Paul.
^ permalink raw reply
* RE: Xilinx Temac link detect
From: John Linn @ 2008-03-06 22:14 UTC (permalink / raw)
To: khollan, linuxppc-embedded
In-Reply-To: <15883376.post@talk.nabble.com>
Hi Kevin,
I couldn't find any example laying around, so I took a shot at it based
on other non-network examples we had. I've not personally done it so
bear that in mind.
I have not tried to compile any of this, just stole parts for places and
pasted in.
Hope it helps,
John
#include <ioctl.h>
/*
* FD of the IIC device opened.
*/
int Fdtemac;
struct mii_ioctl_data ioctl_data;=09
/*
* Open the device.
*/
Fdtemac =3D open("/dev/TBD", O_RDWR);
if(Fdtemac < 0)
{
printf("Cannot open the temac device\n");
return -1;
}
/* setup the inputs to the ioctl call */
ioctl_data.phy_num =3D TBD;
ioctl_data.reg_num =3D TBD;
=09
/*
* Read the phy register
*/
Register =3D ioctl(Fdtemac, SIOCGMIIREG, &ioctl_data);
if(Status < 0)
{
/* failure */
return 0;
}
/* results should be in ioctl_data.val_out I think
}
>From the temac linux adapter, a snippet showing the the ioctl function.
xenet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct mii_ioctl_data *data =3D (struct mii_ioctl_data *)
&rq->ifr_data;
case SIOCGMIIREG: /* Read GMII PHY register. */
ret =3D XTemac_PhyRead(&lp->Emac, data->phy_id,
data->reg_num, &data->val_out);
}
from linux/mii.h
/* This structure is used in all SIOCxMIIxxx ioctl calls */
struct mii_ioctl_data {
__u16 phy_id;
__u16 reg_num;
__u16 val_in;
__u16 val_out;
};
from linux/if.h
struct ifreq=20
{
#define IFHWADDRLEN 6
union
{
char ifrn_name[IFNAMSIZ]; /* if name, e.g.
"en0" */
} ifr_ifrn;
=09
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
struct sockaddr ifru_netmask;
struct sockaddr ifru_hwaddr;
short ifru_flags;
int ifru_ivalue;
int ifru_mtu;
struct ifmap ifru_map;
char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ];
void __user * ifru_data;
struct if_settings ifru_settings;
} ifr_ifru;
};
-----Original Message-----
From: linuxppc-embedded-bounces+john.linn=3Dxilinx.com@ozlabs.org
[mailto:linuxppc-embedded-bounces+john.linn=3Dxilinx.com@ozlabs.org] On
Behalf Of khollan
Sent: Thursday, March 06, 2008 1:44 PM
To: linuxppc-embedded@ozlabs.org
Subject: Re: Xilinx Temac link detect
I figure I could write a C program to talk to the ioctl in the TEMAC
driver
and read the PHY register. Does anyone have example code for talking to
network ioctl's?
Thanks
Kevin
--=20
View this message in context:
http://www.nabble.com/Xilinx-Temac-link-detect-tp15616042p15883376.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* Re: Please pull pasemi.git for-2.6.26 branch
From: Olof Johansson @ 2008-03-06 22:32 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, pasemi-linux, jgarzik
In-Reply-To: <18384.27914.34609.721913@cargo.ozlabs.ibm.com>
On Fri, Mar 07, 2008 at 09:15:38AM +1100, Paul Mackerras wrote:
> Olof Johansson writes:
>
> > Please pull from 'for-2.6.26' branch of
> >
> > master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi.git for-2.6.26
> >
> > to receive the following updates. They have all been posted to the list
> > previously, and had only minor updates to remove a couple of compiler
> > warnings:
> >
> > arch/powerpc/platforms/pasemi/dma_lib.c | 144 ++++++++++++++
> > drivers/net/Makefile | 3
> > drivers/net/pasemi_mac.c | 324 ++++++++++++++++++++++++++------
> > drivers/net/pasemi_mac.h | 35 +++
> > drivers/net/pasemi_mac_ethtool.c | 159 +++++++++++++++
> > include/asm-powerpc/pasemi_dma.h | 77 +++++++
> > 6 files changed, 681 insertions(+), 61 deletions(-)
>
> Is Jeff Garzik OK with those pasemi_mac_* updates going via my tree?
Yes, he explicitly asked for it last week:
http://ozlabs.org/pipermail/linuxppc-dev/2008-February/052227.html
-Olof
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox