LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/3] mm: add notifier in pageblock isolation for balloon drivers
From: akpm @ 2009-11-17 22:40 UTC (permalink / raw)
  To: benh
  Cc: mel, geralds, linuxppc-dev, paulus, brking, schwidefsky, akpm,
	mingo, kamezawa.hiroyu

From: Robert Jennings <rcj@linux.vnet.ibm.com>

Memory balloon drivers can allocate a large amount of memory which is not
movable but could be freed to accomodate memory hotplug remove.

Prior to calling the memory hotplug notifier chain the memory in the
pageblock is isolated.  Currently, if the migrate type is not
MIGRATE_MOVABLE the isolation will not proceed, causing the memory removal
for that page range to fail.

Rather than failing pageblock isolation if the migrateteype is not
MIGRATE_MOVABLE, this patch checks if all of the pages in the pageblock,
and not on the LRU, are owned by a registered balloon driver (or other
entity) using a notifier chain.  If all of the non-movable pages are owned
by a balloon, they can be freed later through the memory notifier chain
and the range can still be isolated in set_migratetype_isolate().

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Gerald Schaefer <geralds@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/base/memory.c  |   19 +++++++++++++
 include/linux/memory.h |   27 ++++++++++++++++++
 mm/page_alloc.c        |   57 ++++++++++++++++++++++++++++++++++-----
 3 files changed, 96 insertions(+), 7 deletions(-)

diff -puN drivers/base/memory.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers drivers/base/memory.c
--- a/drivers/base/memory.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
+++ a/drivers/base/memory.c
@@ -63,6 +63,20 @@ void unregister_memory_notifier(struct n
 }
 EXPORT_SYMBOL(unregister_memory_notifier);
 
+static ATOMIC_NOTIFIER_HEAD(memory_isolate_chain);
+
+int register_memory_isolate_notifier(struct notifier_block *nb)
+{
+	return atomic_notifier_chain_register(&memory_isolate_chain, nb);
+}
+EXPORT_SYMBOL(register_memory_isolate_notifier);
+
+void unregister_memory_isolate_notifier(struct notifier_block *nb)
+{
+	atomic_notifier_chain_unregister(&memory_isolate_chain, nb);
+}
+EXPORT_SYMBOL(unregister_memory_isolate_notifier);
+
 /*
  * register_memory - Setup a sysfs device for a memory block
  */
@@ -157,6 +171,11 @@ int memory_notify(unsigned long val, voi
 	return blocking_notifier_call_chain(&memory_chain, val, v);
 }
 
+int memory_isolate_notify(unsigned long val, void *v)
+{
+	return atomic_notifier_call_chain(&memory_isolate_chain, val, v);
+}
+
 /*
  * MEMORY_HOTPLUG depends on SPARSEMEM in mm/Kconfig, so it is
  * OK to have direct references to sparsemem variables in here.
diff -puN include/linux/memory.h~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers include/linux/memory.h
--- a/include/linux/memory.h~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
+++ a/include/linux/memory.h
@@ -50,6 +50,19 @@ struct memory_notify {
 	int status_change_nid;
 };
 
+/*
+ * During pageblock isolation, count the number of pages within the
+ * range [start_pfn, start_pfn + nr_pages) which are owned by code
+ * in the notifier chain.
+ */
+#define MEM_ISOLATE_COUNT	(1<<0)
+
+struct memory_isolate_notify {
+	unsigned long start_pfn;	/* Start of range to check */
+	unsigned int nr_pages;		/* # pages in range to check */
+	unsigned int pages_found;	/* # pages owned found by callbacks */
+};
+
 struct notifier_block;
 struct mem_section;
 
@@ -76,14 +89,28 @@ static inline int memory_notify(unsigned
 {
 	return 0;
 }
+static inline int register_memory_isolate_notifier(struct notifier_block *nb)
+{
+	return 0;
+}
+static inline void unregister_memory_isolate_notifier(struct notifier_block *nb)
+{
+}
+static inline int memory_isolate_notify(unsigned long val, void *v)
+{
+	return 0;
+}
 #else
 extern int register_memory_notifier(struct notifier_block *nb);
 extern void unregister_memory_notifier(struct notifier_block *nb);
+extern int register_memory_isolate_notifier(struct notifier_block *nb);
+extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
 extern int register_new_memory(int, struct mem_section *);
 extern int unregister_memory_section(struct mem_section *);
 extern int memory_dev_init(void);
 extern int remove_memory_block(unsigned long, struct mem_section *, int);
 extern int memory_notify(unsigned long val, void *v);
+extern int memory_isolate_notify(unsigned long val, void *v);
 extern struct memory_block *find_memory_block(struct mem_section *);
 #define CONFIG_MEM_BLOCK_SIZE	(PAGES_PER_SECTION<<PAGE_SHIFT)
 enum mem_add_context { BOOT, HOTPLUG };
diff -puN mm/page_alloc.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers mm/page_alloc.c
--- a/mm/page_alloc.c~mm-add-notifier-in-pageblock-isolation-for-balloon-drivers
+++ a/mm/page_alloc.c
@@ -48,6 +48,7 @@
 #include <linux/page_cgroup.h>
 #include <linux/debugobjects.h>
 #include <linux/kmemleak.h>
+#include <linux/memory.h>
 #include <trace/events/kmem.h>
 
 #include <asm/tlbflush.h>
@@ -5002,23 +5003,65 @@ void set_pageblock_flags_group(struct pa
 int set_migratetype_isolate(struct page *page)
 {
 	struct zone *zone;
-	unsigned long flags;
+	struct page *curr_page;
+	unsigned long flags, pfn, iter;
+	unsigned long immobile = 0;
+	struct memory_isolate_notify arg;
+	int notifier_ret;
 	int ret = -EBUSY;
 	int zone_idx;
 
 	zone = page_zone(page);
 	zone_idx = zone_idx(zone);
+
 	spin_lock_irqsave(&zone->lock, flags);
+	if (get_pageblock_migratetype(page) == MIGRATE_MOVABLE ||
+	    zone_idx == ZONE_MOVABLE) {
+		ret = 0;
+		goto out;
+	}
+
+	pfn = page_to_pfn(page);
+	arg.start_pfn = pfn;
+	arg.nr_pages = pageblock_nr_pages;
+	arg.pages_found = 0;
+
 	/*
-	 * In future, more migrate types will be able to be isolation target.
+	 * It may be possible to isolate a pageblock even if the
+	 * migratetype is not MIGRATE_MOVABLE. The memory isolation
+	 * notifier chain is used by balloon drivers to return the
+	 * number of pages in a range that are held by the balloon
+	 * driver to shrink memory. If all the pages are accounted for
+	 * by balloons, are free, or on the LRU, isolation can continue.
+	 * Later, for example, when memory hotplug notifier runs, these
+	 * pages reported as "can be isolated" should be isolated(freed)
+	 * by the balloon driver through the memory notifier chain.
 	 */
-	if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE &&
-	    zone_idx != ZONE_MOVABLE)
+	notifier_ret = memory_isolate_notify(MEM_ISOLATE_COUNT, &arg);
+	notifier_ret = notifier_to_errno(notifier_ret);
+	if (notifier_ret || !arg.pages_found)
 		goto out;
-	set_pageblock_migratetype(page, MIGRATE_ISOLATE);
-	move_freepages_block(zone, page, MIGRATE_ISOLATE);
-	ret = 0;
+
+	for (iter = pfn; iter < (pfn + pageblock_nr_pages); iter++) {
+		if (!pfn_valid_within(pfn))
+			continue;
+
+		curr_page = pfn_to_page(iter);
+		if (!page_count(curr_page) || PageLRU(curr_page))
+			continue;
+
+		immobile++;
+	}
+
+	if (arg.pages_found == immobile)
+		ret = 0;
+
 out:
+	if (!ret) {
+		set_pageblock_migratetype(page, MIGRATE_ISOLATE);
+		move_freepages_block(zone, page, MIGRATE_ISOLATE);
+	}
+
 	spin_unlock_irqrestore(&zone->lock, flags);
 	if (!ret)
 		drain_all_pages();
_

^ permalink raw reply

* [PATCH 0/4] Merge OF dynamic patches
From: Nathan Fontenot @ 2009-11-17 21:04 UTC (permalink / raw)
  To: linuxppc-dev, devicetree-discuss, microblaze-uclinux

This set of patches merges the common dynamic device tree
updating routines of_attach_node() and of_detach_node() to
drivers/of/of_dynamic.c.

Built and tested on powerpc, I have no access to build/test
this on microblaze.

-Nathan Fontenot

1/4 - Merge of_attach_node
2/4 - Merge of_detach_node
3/4 - Makefile/Kconfig updates
4/4 - Move declarations to linux/of.h

^ permalink raw reply

* Re: spi_mpc8xxx.c: chip select polarity problem
From: Anton Vorontsov @ 2009-11-17 20:22 UTC (permalink / raw)
  To: Torsten Fleischer; +Cc: linuxppc-dev
In-Reply-To: <200911172109.28841.to-fleischer@t-online.de>

On Tue, Nov 17, 2009 at 09:09:28PM +0100, Torsten Fleischer wrote:
> On Mon, Nov 16, 2009 at 19:00PM, Anton Vorontsov wrote:
> [...]
> > > So it might be better to fix up initial value in the platform code?
> > 
> > Oh, we actually cannot, because the driver calls
> > gpio_direction_output().
> > 
> > And since we don't know the mode prior to SPI device's driver
> > probe() finished, we'll have to set up an initial state in the
> > first SPI transfer. I.e. something like this:
> 
> In most cases the device drivers perform SPI transfers already in their 
> probe() function. How can it be ensured that the CS of all other devices are 
> inactive even if they are not initialized at that time?

Good question. Oh, well... then we have to use spi-cs-high,
no matter that it is a duplication of the 'compatible' property.
SPI bus drivers don't know all the devices and their CS level,
and so spi-cs-high is the only way to tell that information. :-(

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [RFC PATCH 1/5] Rework OpenFirmware GPIO handling
From: Wolfram Sang @ 2009-11-17 20:08 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Dmitry Eremin-Solenikov, linuxppc-dev, devicetree-discuss,
	David Brownell, Paul Mackerras
In-Reply-To: <20091117161244.GA6849@oksana.dev.rtsoft.ru>

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

> And it turned out that the only sane solution is to write
> OF-pdata-hooks for the each driver (that we do for many drivers
> already):

Or to support Grant in getting rid of of_platform :)

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: spi_mpc8xxx.c: chip select polarity problem
From: Torsten Fleischer @ 2009-11-17 20:09 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev
In-Reply-To: <20091116180008.GA6748@oksana.dev.rtsoft.ru>

On Mon, Nov 16, 2009 at 19:00PM, Anton Vorontsov wrote:
[...]
> > So it might be better to fix up initial value in the platform code?
> 
> Oh, we actually cannot, because the driver calls
> gpio_direction_output().
> 
> And since we don't know the mode prior to SPI device's driver
> probe() finished, we'll have to set up an initial state in the
> first SPI transfer. I.e. something like this:

In most cases the device drivers perform SPI transfers already in their 
probe() function. How can it be ensured that the CS of all other devices are 
inactive even if they are not initialized at that time?

Regards
Torsten Fleischer

^ permalink raw reply

* Re: spi_mpc8xxx.c: chip select polarity problem
From: Anton Vorontsov @ 2009-11-17 23:28 UTC (permalink / raw)
  To: Torsten Fleischer; +Cc: linuxppc-dev
In-Reply-To: <20091117202211.GB27574@oksana.dev.rtsoft.ru>

On Tue, Nov 17, 2009 at 11:22:11PM +0300, Anton Vorontsov wrote:
> On Tue, Nov 17, 2009 at 09:09:28PM +0100, Torsten Fleischer wrote:
> > On Mon, Nov 16, 2009 at 19:00PM, Anton Vorontsov wrote:
> > [...]
> > > > So it might be better to fix up initial value in the platform code?
> > > 
> > > Oh, we actually cannot, because the driver calls
> > > gpio_direction_output().
> > > 
> > > And since we don't know the mode prior to SPI device's driver
> > > probe() finished, we'll have to set up an initial state in the
> > > first SPI transfer. I.e. something like this:
> > 
> > In most cases the device drivers perform SPI transfers already in their 
> > probe() function. How can it be ensured that the CS of all other devices are 
> > inactive even if they are not initialized at that time?
> 
> Good question. Oh, well... then we have to use spi-cs-high,
> no matter that it is a duplication of the 'compatible' property.
> SPI bus drivers don't know all the devices and their CS level,
> and so spi-cs-high is the only way to tell that information. :-(

Oh. On the other hand, we can postpone the gpio_direction_output()
call, and still require that the platform code (or firmware)
should be responsible for setting a sane default values on the
chip selects.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* [patch 06/13] powerpc: Fixup last users of irq_chip->typename
From: Thomas Gleixner @ 2009-11-17 22:50 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, linuxppc-dev
In-Reply-To: <20091117224852.846805939@linutronix.de>

The typename member of struct irq_chip was kept for migration purposes
and is obsolete since more than 2 years. Fix up the leftovers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
---
 arch/powerpc/kernel/irq.c                       |    6 +++---
 arch/powerpc/platforms/512x/mpc5121_ads_cpld.c  |    2 +-
 arch/powerpc/platforms/52xx/media5200.c         |    2 +-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c       |    2 +-
 arch/powerpc/platforms/52xx/mpc52xx_pic.c       |    8 ++++----
 arch/powerpc/platforms/82xx/pq2ads-pci-pic.c    |    2 +-
 arch/powerpc/platforms/85xx/socrates_fpga_pic.c |    2 +-
 arch/powerpc/platforms/86xx/gef_pic.c           |    2 +-
 arch/powerpc/platforms/cell/axon_msi.c          |    2 +-
 arch/powerpc/platforms/cell/beat_interrupt.c    |    2 +-
 arch/powerpc/platforms/cell/interrupt.c         |    4 ++--
 arch/powerpc/platforms/cell/spider-pic.c        |    2 +-
 arch/powerpc/platforms/iseries/irq.c            |    2 +-
 arch/powerpc/platforms/powermac/pic.c           |    2 +-
 arch/powerpc/platforms/ps3/interrupt.c          |    2 +-
 arch/powerpc/platforms/pseries/xics.c           |    4 ++--
 arch/powerpc/sysdev/cpm1.c                      |    2 +-
 arch/powerpc/sysdev/cpm2_pic.c                  |    2 +-
 arch/powerpc/sysdev/fsl_msi.c                   |    2 +-
 arch/powerpc/sysdev/i8259.c                     |    2 +-
 arch/powerpc/sysdev/ipic.c                      |    4 ++--
 arch/powerpc/sysdev/mpc8xx_pic.c                |    2 +-
 arch/powerpc/sysdev/mpic.c                      |    6 +++---
 arch/powerpc/sysdev/mpic_pasemi_msi.c           |    2 +-
 arch/powerpc/sysdev/mpic_u3msi.c                |    2 +-
 arch/powerpc/sysdev/qe_lib/qe_ic.c              |    2 +-
 arch/powerpc/sysdev/tsi108_pci.c                |    2 +-
 arch/powerpc/sysdev/uic.c                       |    2 +-
 arch/powerpc/sysdev/xilinx_intc.c               |    4 ++--
 29 files changed, 40 insertions(+), 40 deletions(-)

Index: linux-2.6/arch/powerpc/kernel/irq.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/irq.c
+++ linux-2.6/arch/powerpc/kernel/irq.c
@@ -203,7 +203,7 @@ int show_interrupts(struct seq_file *p, 
 		seq_printf(p, "%10u ", kstat_irqs(i));
 #endif /* CONFIG_SMP */
 		if (desc->chip)
-			seq_printf(p, " %s ", desc->chip->typename);
+			seq_printf(p, " %s ", desc->chip->name);
 		else
 			seq_puts(p, "  None      ");
 		seq_printf(p, "%s", (desc->status & IRQ_LEVEL) ? "Level " : "Edge  ");
@@ -1071,8 +1071,8 @@ static int virq_debug_show(struct seq_fi
 			seq_printf(m, "%5d  ", i);
 			seq_printf(m, "0x%05lx  ", virq_to_hw(i));
 
-			if (desc->chip && desc->chip->typename)
-				p = desc->chip->typename;
+			if (desc->chip && desc->chip->name)
+				p = desc->chip->name;
 			else
 				p = none;
 			seq_printf(m, "%-15s  ", p);
Index: linux-2.6/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
+++ linux-2.6/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
@@ -79,7 +79,7 @@ cpld_unmask_irq(unsigned int irq)
 }
 
 static struct irq_chip cpld_pic = {
-	.typename = " CPLD PIC ",
+	.name = " CPLD PIC ",
 	.mask = cpld_mask_irq,
 	.ack = cpld_mask_irq,
 	.unmask = cpld_unmask_irq,
Index: linux-2.6/arch/powerpc/platforms/52xx/media5200.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/52xx/media5200.c
+++ linux-2.6/arch/powerpc/platforms/52xx/media5200.c
@@ -74,7 +74,7 @@ static void media5200_irq_mask(unsigned 
 }
 
 static struct irq_chip media5200_irq_chip = {
-	.typename = "Media5200 FPGA",
+	.name = "Media5200 FPGA",
 	.unmask = media5200_irq_unmask,
 	.mask = media5200_irq_mask,
 	.mask_ack = media5200_irq_mask,
Index: linux-2.6/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ linux-2.6/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -149,7 +149,7 @@ static int mpc52xx_gpt_irq_set_type(unsi
 }
 
 static struct irq_chip mpc52xx_gpt_irq_chip = {
-	.typename = "MPC52xx GPT",
+	.name = "MPC52xx GPT",
 	.unmask = mpc52xx_gpt_irq_unmask,
 	.mask = mpc52xx_gpt_irq_mask,
 	.ack = mpc52xx_gpt_irq_ack,
Index: linux-2.6/arch/powerpc/platforms/52xx/mpc52xx_pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ linux-2.6/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -220,7 +220,7 @@ static int mpc52xx_extirq_set_type(unsig
 }
 
 static struct irq_chip mpc52xx_extirq_irqchip = {
-	.typename = "MPC52xx External",
+	.name = "MPC52xx External",
 	.mask = mpc52xx_extirq_mask,
 	.unmask = mpc52xx_extirq_unmask,
 	.ack = mpc52xx_extirq_ack,
@@ -258,7 +258,7 @@ static void mpc52xx_main_unmask(unsigned
 }
 
 static struct irq_chip mpc52xx_main_irqchip = {
-	.typename = "MPC52xx Main",
+	.name = "MPC52xx Main",
 	.mask = mpc52xx_main_mask,
 	.mask_ack = mpc52xx_main_mask,
 	.unmask = mpc52xx_main_unmask,
@@ -291,7 +291,7 @@ static void mpc52xx_periph_unmask(unsign
 }
 
 static struct irq_chip mpc52xx_periph_irqchip = {
-	.typename = "MPC52xx Peripherals",
+	.name = "MPC52xx Peripherals",
 	.mask = mpc52xx_periph_mask,
 	.mask_ack = mpc52xx_periph_mask,
 	.unmask = mpc52xx_periph_unmask,
@@ -335,7 +335,7 @@ static void mpc52xx_sdma_ack(unsigned in
 }
 
 static struct irq_chip mpc52xx_sdma_irqchip = {
-	.typename = "MPC52xx SDMA",
+	.name = "MPC52xx SDMA",
 	.mask = mpc52xx_sdma_mask,
 	.unmask = mpc52xx_sdma_unmask,
 	.ack = mpc52xx_sdma_ack,
Index: linux-2.6/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ linux-2.6/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -69,7 +69,7 @@ static void pq2ads_pci_unmask_irq(unsign
 }
 
 static struct irq_chip pq2ads_pci_ic = {
-	.typename = "PQ2 ADS PCI",
+	.name = "PQ2 ADS PCI",
 	.name = "PQ2 ADS PCI",
 	.end = pq2ads_pci_unmask_irq,
 	.mask = pq2ads_pci_mask_irq,
Index: linux-2.6/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
+++ linux-2.6/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
@@ -232,7 +232,7 @@ static int socrates_fpga_pic_set_type(un
 }
 
 static struct irq_chip socrates_fpga_pic_chip = {
-	.typename       = " FPGA-PIC ",
+	.name       = " FPGA-PIC ",
 	.ack		= socrates_fpga_pic_ack,
 	.mask           = socrates_fpga_pic_mask,
 	.mask_ack       = socrates_fpga_pic_mask_ack,
Index: linux-2.6/arch/powerpc/platforms/86xx/gef_pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/86xx/gef_pic.c
+++ linux-2.6/arch/powerpc/platforms/86xx/gef_pic.c
@@ -149,7 +149,7 @@ static void gef_pic_unmask(unsigned int 
 }
 
 static struct irq_chip gef_pic_chip = {
-	.typename	= "gefp",
+	.name	= "gefp",
 	.mask		= gef_pic_mask,
 	.mask_ack	= gef_pic_mask_ack,
 	.unmask		= gef_pic_unmask,
Index: linux-2.6/arch/powerpc/platforms/cell/axon_msi.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/axon_msi.c
+++ linux-2.6/arch/powerpc/platforms/cell/axon_msi.c
@@ -312,7 +312,7 @@ static struct irq_chip msic_irq_chip = {
 	.mask		= mask_msi_irq,
 	.unmask		= unmask_msi_irq,
 	.shutdown	= unmask_msi_irq,
-	.typename	= "AXON-MSI",
+	.name	= "AXON-MSI",
 };
 
 static int msic_host_map(struct irq_host *h, unsigned int virq,
Index: linux-2.6/arch/powerpc/platforms/cell/beat_interrupt.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/beat_interrupt.c
+++ linux-2.6/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -110,7 +110,7 @@ static void beatic_end_irq(unsigned int 
 }
 
 static struct irq_chip beatic_pic = {
-	.typename = " CELL-BEAT ",
+	.name = " CELL-BEAT ",
 	.unmask = beatic_unmask_irq,
 	.mask = beatic_mask_irq,
 	.eoi = beatic_end_irq,
Index: linux-2.6/arch/powerpc/platforms/cell/interrupt.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/interrupt.c
+++ linux-2.6/arch/powerpc/platforms/cell/interrupt.c
@@ -88,7 +88,7 @@ static void iic_eoi(unsigned int irq)
 }
 
 static struct irq_chip iic_chip = {
-	.typename = " CELL-IIC ",
+	.name = " CELL-IIC ",
 	.mask = iic_mask,
 	.unmask = iic_unmask,
 	.eoi = iic_eoi,
@@ -133,7 +133,7 @@ static void iic_ioexc_cascade(unsigned i
 
 
 static struct irq_chip iic_ioexc_chip = {
-	.typename = " CELL-IOEX",
+	.name = " CELL-IOEX",
 	.mask = iic_mask,
 	.unmask = iic_unmask,
 	.eoi = iic_ioexc_eoi,
Index: linux-2.6/arch/powerpc/platforms/cell/spider-pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spider-pic.c
+++ linux-2.6/arch/powerpc/platforms/cell/spider-pic.c
@@ -168,7 +168,7 @@ static int spider_set_irq_type(unsigned 
 }
 
 static struct irq_chip spider_pic = {
-	.typename = " SPIDER   ",
+	.name = " SPIDER   ",
 	.unmask = spider_unmask_irq,
 	.mask = spider_mask_irq,
 	.ack = spider_ack_irq,
Index: linux-2.6/arch/powerpc/platforms/iseries/irq.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/iseries/irq.c
+++ linux-2.6/arch/powerpc/platforms/iseries/irq.c
@@ -273,7 +273,7 @@ static void iseries_end_IRQ(unsigned int
 }
 
 static struct irq_chip iseries_pic = {
-	.typename	= "iSeries irq controller",
+	.name	= "iSeries irq controller",
 	.startup	= iseries_startup_IRQ,
 	.shutdown	= iseries_shutdown_IRQ,
 	.unmask		= iseries_enable_IRQ,
Index: linux-2.6/arch/powerpc/platforms/powermac/pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/powermac/pic.c
+++ linux-2.6/arch/powerpc/platforms/powermac/pic.c
@@ -195,7 +195,7 @@ static int pmac_retrigger(unsigned int v
 }
 
 static struct irq_chip pmac_pic = {
-	.typename	= " PMAC-PIC ",
+	.name	= " PMAC-PIC ",
 	.startup	= pmac_startup_irq,
 	.mask		= pmac_mask_irq,
 	.ack		= pmac_ack_irq,
Index: linux-2.6/arch/powerpc/platforms/ps3/interrupt.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/ps3/interrupt.c
+++ linux-2.6/arch/powerpc/platforms/ps3/interrupt.c
@@ -152,7 +152,7 @@ static void ps3_chip_eoi(unsigned int vi
  */
 
 static struct irq_chip ps3_irq_chip = {
-	.typename = "ps3",
+	.name = "ps3",
 	.mask = ps3_chip_mask,
 	.unmask = ps3_chip_unmask,
 	.eoi = ps3_chip_eoi,
Index: linux-2.6/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pseries/xics.c
+++ linux-2.6/arch/powerpc/platforms/pseries/xics.c
@@ -388,7 +388,7 @@ static int xics_set_affinity(unsigned in
 }
 
 static struct irq_chip xics_pic_direct = {
-	.typename = " XICS     ",
+	.name = " XICS     ",
 	.startup = xics_startup,
 	.mask = xics_mask_irq,
 	.unmask = xics_unmask_irq,
@@ -397,7 +397,7 @@ static struct irq_chip xics_pic_direct =
 };
 
 static struct irq_chip xics_pic_lpar = {
-	.typename = " XICS     ",
+	.name = " XICS     ",
 	.startup = xics_startup,
 	.mask = xics_mask_irq,
 	.unmask = xics_unmask_irq,
Index: linux-2.6/arch/powerpc/sysdev/cpm1.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/cpm1.c
+++ linux-2.6/arch/powerpc/sysdev/cpm1.c
@@ -77,7 +77,7 @@ static void cpm_end_irq(unsigned int irq
 }
 
 static struct irq_chip cpm_pic = {
-	.typename = " CPM PIC ",
+	.name = " CPM PIC ",
 	.mask = cpm_mask_irq,
 	.unmask = cpm_unmask_irq,
 	.eoi = cpm_end_irq,
Index: linux-2.6/arch/powerpc/sysdev/cpm2_pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/cpm2_pic.c
+++ linux-2.6/arch/powerpc/sysdev/cpm2_pic.c
@@ -182,7 +182,7 @@ static int cpm2_set_irq_type(unsigned in
 }
 
 static struct irq_chip cpm2_pic = {
-	.typename = " CPM2 SIU ",
+	.name = " CPM2 SIU ",
 	.mask = cpm2_mask_irq,
 	.unmask = cpm2_unmask_irq,
 	.ack = cpm2_ack,
Index: linux-2.6/arch/powerpc/sysdev/fsl_msi.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/fsl_msi.c
+++ linux-2.6/arch/powerpc/sysdev/fsl_msi.c
@@ -47,7 +47,7 @@ static struct irq_chip fsl_msi_chip = {
 	.mask		= mask_msi_irq,
 	.unmask		= unmask_msi_irq,
 	.ack		= fsl_msi_end_irq,
-	.typename	= " FSL-MSI  ",
+	.name	= " FSL-MSI  ",
 };
 
 static int fsl_msi_host_map(struct irq_host *h, unsigned int virq,
Index: linux-2.6/arch/powerpc/sysdev/i8259.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/i8259.c
+++ linux-2.6/arch/powerpc/sysdev/i8259.c
@@ -135,7 +135,7 @@ static void i8259_unmask_irq(unsigned in
 }
 
 static struct irq_chip i8259_pic = {
-	.typename	= " i8259    ",
+	.name	= " i8259    ",
 	.mask		= i8259_mask_irq,
 	.disable	= i8259_mask_irq,
 	.unmask		= i8259_unmask_irq,
Index: linux-2.6/arch/powerpc/sysdev/ipic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/ipic.c
+++ linux-2.6/arch/powerpc/sysdev/ipic.c
@@ -660,7 +660,7 @@ static int ipic_set_irq_type(unsigned in
 
 /* level interrupts and edge interrupts have different ack operations */
 static struct irq_chip ipic_level_irq_chip = {
-	.typename	= " IPIC  ",
+	.name	= " IPIC  ",
 	.unmask		= ipic_unmask_irq,
 	.mask		= ipic_mask_irq,
 	.mask_ack	= ipic_mask_irq,
@@ -668,7 +668,7 @@ static struct irq_chip ipic_level_irq_ch
 };
 
 static struct irq_chip ipic_edge_irq_chip = {
-	.typename	= " IPIC  ",
+	.name	= " IPIC  ",
 	.unmask		= ipic_unmask_irq,
 	.mask		= ipic_mask_irq,
 	.mask_ack	= ipic_mask_irq_and_ack,
Index: linux-2.6/arch/powerpc/sysdev/mpc8xx_pic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mpc8xx_pic.c
+++ linux-2.6/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -94,7 +94,7 @@ static int mpc8xx_set_irq_type(unsigned 
 }
 
 static struct irq_chip mpc8xx_pic = {
-	.typename = " MPC8XX SIU ",
+	.name = " MPC8XX SIU ",
 	.unmask = mpc8xx_unmask_irq,
 	.mask = mpc8xx_mask_irq,
 	.ack = mpc8xx_ack,
Index: linux-2.6/arch/powerpc/sysdev/mpic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mpic.c
+++ linux-2.6/arch/powerpc/sysdev/mpic.c
@@ -1062,19 +1062,19 @@ struct mpic * __init mpic_alloc(struct d
 	mpic->name = name;
 
 	mpic->hc_irq = mpic_irq_chip;
-	mpic->hc_irq.typename = name;
+	mpic->hc_irq.name = name;
 	if (flags & MPIC_PRIMARY)
 		mpic->hc_irq.set_affinity = mpic_set_affinity;
 #ifdef CONFIG_MPIC_U3_HT_IRQS
 	mpic->hc_ht_irq = mpic_irq_ht_chip;
-	mpic->hc_ht_irq.typename = name;
+	mpic->hc_ht_irq.name = name;
 	if (flags & MPIC_PRIMARY)
 		mpic->hc_ht_irq.set_affinity = mpic_set_affinity;
 #endif /* CONFIG_MPIC_U3_HT_IRQS */
 
 #ifdef CONFIG_SMP
 	mpic->hc_ipi = mpic_ipi_chip;
-	mpic->hc_ipi.typename = name;
+	mpic->hc_ipi.name = name;
 #endif /* CONFIG_SMP */
 
 	mpic->flags = flags;
Index: linux-2.6/arch/powerpc/sysdev/mpic_pasemi_msi.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mpic_pasemi_msi.c
+++ linux-2.6/arch/powerpc/sysdev/mpic_pasemi_msi.c
@@ -60,7 +60,7 @@ static struct irq_chip mpic_pasemi_msi_c
 	.eoi		= mpic_end_irq,
 	.set_type	= mpic_set_irq_type,
 	.set_affinity	= mpic_set_affinity,
-	.typename	= "PASEMI-MSI ",
+	.name		= "PASEMI-MSI ",
 };
 
 static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
Index: linux-2.6/arch/powerpc/sysdev/mpic_u3msi.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/mpic_u3msi.c
+++ linux-2.6/arch/powerpc/sysdev/mpic_u3msi.c
@@ -42,7 +42,7 @@ static struct irq_chip mpic_u3msi_chip =
 	.eoi		= mpic_end_irq,
 	.set_type	= mpic_set_irq_type,
 	.set_affinity	= mpic_set_affinity,
-	.typename	= "MPIC-U3MSI",
+	.name		= "MPIC-U3MSI",
 };
 
 static u64 read_ht_magic_addr(struct pci_dev *pdev, unsigned int pos)
Index: linux-2.6/arch/powerpc/sysdev/qe_lib/qe_ic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ linux-2.6/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -237,7 +237,7 @@ static void qe_ic_mask_irq(unsigned int 
 }
 
 static struct irq_chip qe_ic_irq_chip = {
-	.typename = " QEIC  ",
+	.name = " QEIC  ",
 	.unmask = qe_ic_unmask_irq,
 	.mask = qe_ic_mask_irq,
 	.mask_ack = qe_ic_mask_irq,
Index: linux-2.6/arch/powerpc/sysdev/tsi108_pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/tsi108_pci.c
+++ linux-2.6/arch/powerpc/sysdev/tsi108_pci.c
@@ -376,7 +376,7 @@ static void tsi108_pci_irq_end(u_int irq
  */
 
 static struct irq_chip tsi108_pci_irq = {
-	.typename = "tsi108_PCI_int",
+	.name = "tsi108_PCI_int",
 	.mask = tsi108_pci_irq_disable,
 	.ack = tsi108_pci_irq_ack,
 	.end = tsi108_pci_irq_end,
Index: linux-2.6/arch/powerpc/sysdev/uic.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/uic.c
+++ linux-2.6/arch/powerpc/sysdev/uic.c
@@ -177,7 +177,7 @@ static int uic_set_irq_type(unsigned int
 }
 
 static struct irq_chip uic_irq_chip = {
-	.typename	= " UIC  ",
+	.name		= " UIC  ",
 	.unmask		= uic_unmask_irq,
 	.mask		= uic_mask_irq,
  	.mask_ack	= uic_mask_ack_irq,
Index: linux-2.6/arch/powerpc/sysdev/xilinx_intc.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/xilinx_intc.c
+++ linux-2.6/arch/powerpc/sysdev/xilinx_intc.c
@@ -106,7 +106,7 @@ static void xilinx_intc_level_unmask(uns
 }
 
 static struct irq_chip xilinx_intc_level_irqchip = {
-	.typename = "Xilinx Level INTC",
+	.name = "Xilinx Level INTC",
 	.mask = xilinx_intc_mask,
 	.mask_ack = xilinx_intc_mask,
 	.unmask = xilinx_intc_level_unmask,
@@ -133,7 +133,7 @@ static void xilinx_intc_edge_ack(unsigne
 }
 
 static struct irq_chip xilinx_intc_edge_irqchip = {
-	.typename = "Xilinx Edge  INTC",
+	.name = "Xilinx Edge  INTC",
 	.mask = xilinx_intc_mask,
 	.unmask = xilinx_intc_edge_unmask,
 	.ack = xilinx_intc_edge_ack,

^ permalink raw reply

* Re: [RFC PATCH 1/5] Rework OpenFirmware GPIO handling
From: Anton Vorontsov @ 2009-11-17 20:18 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: David Brownell, Dmitry Eremin-Solenikov, devicetree-discuss,
	linuxppc-dev, Paul Mackerras
In-Reply-To: <20091117200821.GA3154@pengutronix.de>

On Tue, Nov 17, 2009 at 09:08:21PM +0100, Wolfram Sang wrote:
> > And it turned out that the only sane solution is to write
> > OF-pdata-hooks for the each driver (that we do for many drivers
> > already):
> 
> Or to support Grant in getting rid of of_platform :)

No, of_platform is completely other stuff. This won't help I2C/SPI
drivers.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH] net/can: add driver for mscan family & mpc52xx_mscan
From: Wolfgang Grandegger @ 2009-11-17 19:17 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: socketcan-core, netdev, David Miller, linuxppc-dev
In-Reply-To: <4B02EABA.3060905@grandegger.com>

Wolfgang Grandegger wrote:
> Wolfram Sang wrote:
>> Hi Grant,
>>
>> Wolfgang commented on some points already, I will pick up the other remarks,
>> just one question:
>>
>>>> +       clk_src = of_get_property(np, "fsl,mscan-clk-src", NULL);
>>>> +       if (clk_src && strcmp(clk_src, "ip") == 0)
>>> Should protect against non-null.  strncmp() maybe?
>> "ip" is null-terminated, or what do you mean?
> 
> Imagine somebody defines:
> 
>   fsl,mscan-clk-src = <0xbaeee>;

Forget my comment. I will not harm in the above case. I was just worried
about non-null-teminated strings.

Wolfgang.

^ permalink raw reply

* [PATCH] [SCSI] mpt fusion: Fix 32 bit platforms with 64 bit resources.
From: pbathija @ 2009-11-18  0:16 UTC (permalink / raw)
  To: linux-scsi; +Cc: linuxppc-dev, Eric.Moore, Pravin Bathija

From: Pravin Bathija <pbathija@amcc.com>

  Powerpc 44x uses 36 bit real address while the real address defined
  in MPT Fusion driver is of type 32 bit. This causes ioremap to fail and driver
  fails to initialize. This fix changes the data types representing the real
  address from unsigned long 32-bit types to "phys_addr_t" which is 64-bit. The
  driver has been tested, the disks get discovered correctly and can do IO. Removed
  ioremap and used hose->io_base_virt for IO space to make it platform independent.
Content-Type: text/plain; charset=utf-8

Signed-off-by: Pravin Bathija <pbathija@amcc.com>
Acked-by: Feng Kan <fkan@amcc.com>
Acked-by: Prodyut Hazarika <phazarika@amcc.com>
Acked-by: Loc Ho <lho@amcc.com>
Acked-by: Tirumala Reddy Marri <tmarri@amcc.com>
Acked-by: Victor Gallardo <vgallardo@amcc.com>
---
 drivers/message/fusion/mptbase.c |   38 ++++++++++++++++++++++++++++----------
 drivers/message/fusion/mptbase.h |    5 +++--
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 5d496a9..9bca4bd 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1510,11 +1510,12 @@ static int
 mpt_mapresources(MPT_ADAPTER *ioc)
 {
 	u8		__iomem *mem;
+	u8		__iomem *port;
 	int		 ii;
-	unsigned long	 mem_phys;
-	unsigned long	 port;
-	u32		 msize;
-	u32		 psize;
+	resource_size_t	 mem_phys;
+	resource_size_t	 port_phys;
+	resource_size_t	 msize;
+	resource_size_t	 psize;
 	u8		 revision;
 	int		 r = -ENODEV;
 	struct pci_dev *pdev;
@@ -1552,14 +1553,24 @@ mpt_mapresources(MPT_ADAPTER *ioc)
 	}
 
 	mem_phys = msize = 0;
-	port = psize = 0;
+	port_phys = psize = 0;
 	for (ii = 0; ii < DEVICE_COUNT_RESOURCE; ii++) {
 		if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
 			if (psize)
 				continue;
 			/* Get I/O space! */
-			port = pci_resource_start(pdev, ii);
+			port_phys = pci_resource_start(pdev, ii);
 			psize = pci_resource_len(pdev, ii);
+			struct pci_controller *hose =
+						pci_bus_to_host(pdev->bus);
+			port = hose->io_base_virt;
+			if (port == NULL) {
+				printk(MYIOC_s_ERR_FMT " : ERROR - Unable to"
+					"map adapter port !\n", ioc->name);
+				return -EINVAL;
+			}
+			ioc->pio_mem_phys = port_phys;
+			ioc->pio_chip = (SYSIF_REGS __iomem *)port;
 		} else {
 			if (msize)
 				continue;
@@ -1580,15 +1591,16 @@ mpt_mapresources(MPT_ADAPTER *ioc)
 		return -EINVAL;
 	}
 	ioc->memmap = mem;
-	dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %lx\n",
-	    ioc->name, mem, mem_phys));
+	dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %llx\n",
+	    ioc->name, mem, (u64)mem_phys));
 
 	ioc->mem_phys = mem_phys;
 	ioc->chip = (SYSIF_REGS __iomem *)mem;
 
 	/* Save Port IO values in case we need to do downloadboot */
-	ioc->pio_mem_phys = port;
-	ioc->pio_chip = (SYSIF_REGS __iomem *)port;
+	ioc->portmap = port;
+	dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "port=%p, port_phys=%llx\n",
+			ioc->name, port, (u64)port_phys));
 
 	return 0;
 }
@@ -1822,6 +1834,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
 		if (ioc->alt_ioc)
 			ioc->alt_ioc->alt_ioc = NULL;
 		iounmap(ioc->memmap);
+		iounmap(ioc->portmap);
 		if (r != -5)
 			pci_release_selected_regions(pdev, ioc->bars);
 
@@ -2583,6 +2596,11 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
 		ioc->memmap = NULL;
 	}
 
+	if (ioc->portmap != NULL) {
+		iounmap(ioc->portmap);
+		ioc->portmap = NULL;
+	}
+
 	pci_disable_device(ioc->pcidev);
 	pci_release_selected_regions(ioc->pcidev, ioc->bars);
 
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index b3e981d..7091f13 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -584,8 +584,8 @@ typedef struct _MPT_ADAPTER
 	SYSIF_REGS __iomem	*chip;		/* == c8817000 (mmap) */
 	SYSIF_REGS __iomem	*pio_chip;	/* Programmed IO (downloadboot) */
 	u8			 bus_type;
-	u32			 mem_phys;	/* == f4020000 (mmap) */
-	u32			 pio_mem_phys;	/* Programmed IO (downloadboot) */
+	resource_size_t		 mem_phys;	/* == f4020000 (mmap) */
+	resource_size_t		 pio_mem_phys;	/* Programmed IO (downloadboot) */
 	int			 mem_size;	/* mmap memory size */
 	int			 number_of_buses;
 	int			 devices_per_bus;
@@ -635,6 +635,7 @@ typedef struct _MPT_ADAPTER
 	int			bars;		/* bitmask of BAR's that must be configured */
 	int			msi_enable;
 	u8			__iomem *memmap;	/* mmap address */
+	u8			__iomem *portmap;	/* mmap port address */
 	struct Scsi_Host	*sh;		/* Scsi Host pointer */
 	SpiCfgData		spi_data;	/* Scsi config. data */
 	RaidCfgData		raid_data;	/* Raid config. data */
-- 
1.5.5

^ permalink raw reply related

* [PATCH] [PPC4xx] Fix device tree dts file for katmai board.
From: pbathija @ 2009-11-18  0:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Pravin Bathija

From: Pravin Bathija <pbathija@amcc.com>

   Set size cell value to 2 for 4GB memory support in katmai. Also set PCI-E
   node inbound DMA ranges size to 4GB for correct boot up of katmai.
Content-Type: text/plain; charset=utf-8

Signed-off-by: Pravin Bathija <pbathija@amcc.com>
Acked-by: Feng Kan <fkan@amcc.com>
Acked-by: Prodyut Hazarika <phazarika@amcc.com>
Acked-by: Loc Ho <lho@amcc.com>
Acked-by: Tirumala Reddy Marri <tmarri@amcc.com>
Acked-by: Victor Gallardo <vgallardo@amcc.com>
---
 arch/powerpc/boot/dts/katmai.dts |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/boot/dts/katmai.dts b/arch/powerpc/boot/dts/katmai.dts
index 077819b..8b40fd8 100644
--- a/arch/powerpc/boot/dts/katmai.dts
+++ b/arch/powerpc/boot/dts/katmai.dts
@@ -16,7 +16,7 @@
 
 / {
 	#address-cells = <2>;
-	#size-cells = <1>;
+	#size-cells = <2>;
 	model = "amcc,katmai";
 	compatible = "amcc,katmai";
 	dcr-parent = <&{/cpus/cpu@0}>;
@@ -49,7 +49,7 @@
 
 	memory {
 		device_type = "memory";
-		reg = <0x00000000 0x00000000 0x00000000>; /* Filled in by zImage */
+		reg = < 0x0 0x00000000 0x0 0x00000000>; /* Filled in by zImage */
 	};
 
 	UIC0: interrupt-controller0 {
@@ -245,8 +245,8 @@
 			ranges = <0x02000000 0x00000000 0x80000000 0x0000000d 0x80000000 0x00000000 0x80000000
 				  0x01000000 0x00000000 0x00000000 0x0000000c 0x08000000 0x00000000 0x00010000>;
 
-			/* Inbound 2GB range starting at 0 */
-			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+			/* Inbound 4GB range starting at 0 */
+			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x1 0x00000000>;
 
 			/* This drives busses 0 to 0xf */
 			bus-range = <0x0 0xf>;
@@ -289,8 +289,8 @@
 			ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
 				  0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
 
-			/* Inbound 2GB range starting at 0 */
-			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+			/* Inbound 4GB range starting at 0 */
+			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x1 0x00000000>;
 
 			/* This drives busses 10 to 0x1f */
 			bus-range = <0x10 0x1f>;
@@ -330,8 +330,8 @@
 			ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
 				  0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
 
-			/* Inbound 2GB range starting at 0 */
-			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+			/* Inbound 4GB range starting at 0 */
+			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x1 0x00000000>;
 
 			/* This drives busses 10 to 0x1f */
 			bus-range = <0x20 0x2f>;
@@ -371,8 +371,8 @@
 			ranges = <0x02000000 0x00000000 0x80000000 0x0000000f 0x00000000 0x00000000 0x80000000
 				  0x01000000 0x00000000 0x00000000 0x0000000f 0x80020000 0x00000000 0x00010000>;
 
-			/* Inbound 2GB range starting at 0 */
-			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+			/* Inbound 4GB range starting at 0 */
+			dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x1 0x00000000>;
 
 			/* This drives busses 10 to 0x1f */
 			bus-range = <0x30 0x3f>;
-- 
1.5.5

^ permalink raw reply related

* Re: [PATCH] [PPC4xx] Fix device tree dts file for katmai board.
From: Josh Boyer @ 2009-11-18  0:25 UTC (permalink / raw)
  To: pbathija; +Cc: linuxppc-dev, sr
In-Reply-To: <1258503588-7844-1-git-send-email-pbathija@amcc.com>

On Tue, Nov 17, 2009 at 04:19:48PM -0800, pbathija@amcc.com wrote:
>From: Pravin Bathija <pbathija@amcc.com>
>
>   Set size cell value to 2 for 4GB memory support in katmai. Also set PCI-E
>   node inbound DMA ranges size to 4GB for correct boot up of katmai.
>Content-Type: text/plain; charset=utf-8
>
>Signed-off-by: Pravin Bathija <pbathija@amcc.com>
>Acked-by: Feng Kan <fkan@amcc.com>
>Acked-by: Prodyut Hazarika <phazarika@amcc.com>
>Acked-by: Loc Ho <lho@amcc.com>
>Acked-by: Tirumala Reddy Marri <tmarri@amcc.com>
>Acked-by: Victor Gallardo <vgallardo@amcc.com>

This conflicts with one I already have queued up in my next branch.  It also
seems to lack some of the changes that patch has.

Stefan, can you look this over and work out with Pravin what to do?

josh

^ permalink raw reply

* Re: [PATCH] net/can: add driver for mscan family & mpc52xx_mscan
From: Wolfgang Grandegger @ 2009-11-17 18:26 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: socketcan-core, David Miller, linuxppc-dev, netdev
In-Reply-To: <20091116184416.GA21491@pengutronix.de>

Wolfram Sang wrote:
> Hi Grant,
> 
> Wolfgang commented on some points already, I will pick up the other remarks,
> just one question:
> 
>>> +       clk_src = of_get_property(np, "fsl,mscan-clk-src", NULL);
>>> +       if (clk_src && strcmp(clk_src, "ip") == 0)
>> Should protect against non-null.  strncmp() maybe?
> 
> "ip" is null-terminated, or what do you mean?

Imagine somebody defines:

  fsl,mscan-clk-src = <0xbaeee>;

Wolfgang.

^ permalink raw reply

* [PATCH] ibm_newemac: Fix EMACx_TRTR[TRT] bit shifts
From: Dave Mitchell @ 2009-11-18  0:56 UTC (permalink / raw)
  To: netdev; +Cc: linuxppc-dev, dmitchell

The TRT bit shifts were reversed for EMAC4 and non-EMAC4 during the 
port from ibm_emac to ibm_newemac. This patch corrects that error.

Signed-off-by: Dave Mitchell <dmitchell@appliedmicro.com>
Acked-by: Feng Kan <fkan@appliedmicro.com>
Acked-by: Prodyut Hazarika <phazarika@appliedmicro.com>
---
 For those curious, these bits control the TX threshold.
 
 drivers/net/ibm_newemac/emac.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ibm_newemac/emac.h b/drivers/net/ibm_newemac/emac.h
index d34adf9..f2751cb 100644
--- a/drivers/net/ibm_newemac/emac.h
+++ b/drivers/net/ibm_newemac/emac.h
@@ -263,8 +263,8 @@ struct emac_regs {
 
 
 /* EMACx_TRTR */
-#define EMAC_TRTR_SHIFT_EMAC4		27
-#define EMAC_TRTR_SHIFT			24
+#define EMAC_TRTR_SHIFT_EMAC4		24
+#define EMAC_TRTR_SHIFT		27
 
 /* EMAC specific TX descriptor control fields (write access) */
 #define EMAC_TX_CTRL_GFCS		0x0200
-- 
1.6.3.2

^ permalink raw reply related

* [PATCH 1/4] Merge of_attach_node
From: Nathan Fontenot @ 2009-11-18  2:53 UTC (permalink / raw)
  To: linuxppc-dev, devicetree-discuss, microblaze-uclinux
In-Reply-To: <4B030FC2.9070401@austin.ibm.com>

Merge the common of_attach_node() routine from powerpc and microblaze to
drivers/of/of_dynamic.c

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: test-devicetree/arch/microblaze/kernel/prom.c
===================================================================
--- test-devicetree.orig/arch/microblaze/kernel/prom.c	2009-11-17 13:52:45.000000000 -0600
+++ test-devicetree/arch/microblaze/kernel/prom.c	2009-11-17 14:17:05.000000000 -0600
@@ -957,21 +957,6 @@
 EXPORT_SYMBOL(of_node_put);
 
 /*
- * Plug a device node into the tree and global list.
- */
-void of_attach_node(struct device_node *np)
-{
-	unsigned long flags;
-
-	write_lock_irqsave(&devtree_lock, flags);
-	np->sibling = np->parent->child;
-	np->allnext = allnodes;
-	np->parent->child = np;
-	allnodes = np;
-	write_unlock_irqrestore(&devtree_lock, flags);
-}
-
-/*
  * "Unplug" a node from the device tree.  The caller must hold
  * a reference to the node.  The memory associated with the node
  * is not freed until its refcount goes to zero.
Index: test-devicetree/arch/powerpc/kernel/prom.c
===================================================================
--- test-devicetree.orig/arch/powerpc/kernel/prom.c	2009-11-17 13:52:45.000000000 -0600
+++ test-devicetree/arch/powerpc/kernel/prom.c	2009-11-17 14:17:05.000000000 -0600
@@ -1413,21 +1413,6 @@
 EXPORT_SYMBOL(of_node_put);
 
 /*
- * Plug a device node into the tree and global list.
- */
-void of_attach_node(struct device_node *np)
-{
-	unsigned long flags;
-
-	write_lock_irqsave(&devtree_lock, flags);
-	np->sibling = np->parent->child;
-	np->allnext = allnodes;
-	np->parent->child = np;
-	allnodes = np;
-	write_unlock_irqrestore(&devtree_lock, flags);
-}
-
-/*
  * "Unplug" a node from the device tree.  The caller must hold
  * a reference to the node.  The memory associated with the node
  * is not freed until its refcount goes to zero.
Index: test-devicetree/drivers/of/of_dynamic.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ test-devicetree/drivers/of/of_dynamic.c	2009-11-17 14:18:11.000000000 -0600
@@ -0,0 +1,36 @@
+/*
+ * Procedures for creating, accessing and interpreting the device tree.
+ *
+ * Paul Mackerras	August 1996.
+ * Copyright (C) 1996-2005 Paul Mackerras.
+ *
+ *  Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
+ *    {engebret|bergner}@us.ibm.com
+ *
+ *      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>
+
+/* temporary while merging */
+extern struct device_node *allnodes;
+extern rwlock_t devtree_lock;
+
+/*
+ * Plug a device node into the tree and global list.
+ */
+void of_attach_node(struct device_node *np)
+{
+	unsigned long flags;
+
+	write_lock_irqsave(&devtree_lock, flags);
+	np->sibling = np->parent->child;
+	np->allnext = allnodes;
+	np->parent->child = np;
+	allnodes = np;
+	write_unlock_irqrestore(&devtree_lock, flags);
+}
+

^ permalink raw reply

* [PATCH 2/4] Merge of_detach_node
From: Nathan Fontenot @ 2009-11-18  2:55 UTC (permalink / raw)
  To: linuxppc-dev, devicetree-discuss, microblaze-uclinux
In-Reply-To: <4B030FC2.9070401@austin.ibm.com>

Merge the common of_detach_node() from powerpc and microblaze into the common
drivers/of/of_dynamic.c

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: test-devicetree/arch/microblaze/kernel/prom.c
===================================================================
--- test-devicetree.orig/arch/microblaze/kernel/prom.c	2009-11-17 14:17:05.000000000 -0600
+++ test-devicetree/arch/microblaze/kernel/prom.c	2009-11-17 14:18:18.000000000 -0600
@@ -957,50 +957,6 @@
 EXPORT_SYMBOL(of_node_put);
 
 /*
- * "Unplug" a node from the device tree.  The caller must hold
- * a reference to the node.  The memory associated with the node
- * is not freed until its refcount goes to zero.
- */
-void of_detach_node(struct device_node *np)
-{
-	struct device_node *parent;
-	unsigned long flags;
-
-	write_lock_irqsave(&devtree_lock, flags);
-
-	parent = np->parent;
-	if (!parent)
-		goto out_unlock;
-
-	if (allnodes == np)
-		allnodes = np->allnext;
-	else {
-		struct device_node *prev;
-		for (prev = allnodes;
-		     prev->allnext != np;
-		     prev = prev->allnext)
-			;
-		prev->allnext = np->allnext;
-	}
-
-	if (parent->child == np)
-		parent->child = np->sibling;
-	else {
-		struct device_node *prevsib;
-		for (prevsib = np->parent->child;
-		     prevsib->sibling != np;
-		     prevsib = prevsib->sibling)
-			;
-		prevsib->sibling = np->sibling;
-	}
-
-	of_node_set_flag(np, OF_DETACHED);
-
-out_unlock:
-	write_unlock_irqrestore(&devtree_lock, flags);
-}
-
-/*
  * Add a property to a node
  */
 int prom_add_property(struct device_node *np, struct property *prop)
Index: test-devicetree/arch/powerpc/kernel/prom.c
===================================================================
--- test-devicetree.orig/arch/powerpc/kernel/prom.c	2009-11-17 14:17:05.000000000 -0600
+++ test-devicetree/arch/powerpc/kernel/prom.c	2009-11-17 14:18:18.000000000 -0600
@@ -1412,50 +1412,6 @@
 }
 EXPORT_SYMBOL(of_node_put);
 
-/*
- * "Unplug" a node from the device tree.  The caller must hold
- * a reference to the node.  The memory associated with the node
- * is not freed until its refcount goes to zero.
- */
-void of_detach_node(struct device_node *np)
-{
-	struct device_node *parent;
-	unsigned long flags;
-
-	write_lock_irqsave(&devtree_lock, flags);
-
-	parent = np->parent;
-	if (!parent)
-		goto out_unlock;
-
-	if (allnodes == np)
-		allnodes = np->allnext;
-	else {
-		struct device_node *prev;
-		for (prev = allnodes;
-		     prev->allnext != np;
-		     prev = prev->allnext)
-			;
-		prev->allnext = np->allnext;
-	}
-
-	if (parent->child == np)
-		parent->child = np->sibling;
-	else {
-		struct device_node *prevsib;
-		for (prevsib = np->parent->child;
-		     prevsib->sibling != np;
-		     prevsib = prevsib->sibling)
-			;
-		prevsib->sibling = np->sibling;
-	}
-
-	of_node_set_flag(np, OF_DETACHED);
-
-out_unlock:
-	write_unlock_irqrestore(&devtree_lock, flags);
-}
-
 #ifdef CONFIG_PPC_PSERIES
 /*
  * Fix up the uninitialized fields in a new device node:
Index: test-devicetree/drivers/of/of_dynamic.c
===================================================================
--- test-devicetree.orig/drivers/of/of_dynamic.c	2009-11-17 14:18:11.000000000 -0600
+++ test-devicetree/drivers/of/of_dynamic.c	2009-11-17 14:18:18.000000000 -0600
@@ -34,3 +34,46 @@
 	write_unlock_irqrestore(&devtree_lock, flags);
 }
 
+/*
+ * "Unplug" a node from the device tree.  The caller must hold
+ * a reference to the node.  The memory associated with the node
+ * is not freed until its refcount goes to zero.
+ */
+void of_detach_node(struct device_node *np)
+{
+	struct device_node *parent;
+	unsigned long flags;
+
+	write_lock_irqsave(&devtree_lock, flags);
+
+	parent = np->parent;
+	if (!parent)
+		goto out_unlock;
+
+	if (allnodes == np)
+		allnodes = np->allnext;
+	else {
+		struct device_node *prev;
+		for (prev = allnodes;
+		     prev->allnext != np;
+		     prev = prev->allnext)
+			;
+		prev->allnext = np->allnext;
+	}
+
+	if (parent->child == np)
+		parent->child = np->sibling;
+	else {
+		struct device_node *prevsib;
+		for (prevsib = np->parent->child;
+		     prevsib->sibling != np;
+		     prevsib = prevsib->sibling)
+			;
+		prevsib->sibling = np->sibling;
+	}
+
+	of_node_set_flag(np, OF_DETACHED);
+
+out_unlock:
+	write_unlock_irqrestore(&devtree_lock, flags);
+}

^ permalink raw reply

* [PATCH 3/4] Makefile and Kconfig updates for of_dynamci
From: Nathan Fontenot @ 2009-11-18  2:56 UTC (permalink / raw)
  To: linuxppc-dev, devicetree-discuss, microblaze-uclinux
In-Reply-To: <4B030FC2.9070401@austin.ibm.com>

Update the Kconfig and Makefile files for drivers/of, powerpc and microblaze
to properly configure for CONFIG_OF_DYNAMIC to build the of_dynamic code.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: test-devicetree/arch/microblaze/Kconfig
===================================================================
--- test-devicetree.orig/arch/microblaze/Kconfig	2009-11-17 13:52:45.000000000 -0600
+++ test-devicetree/arch/microblaze/Kconfig	2009-11-17 14:01:06.000000000 -0600
@@ -111,6 +111,7 @@
 
 config OF
 	def_bool y
+	select OF_DYNAMIC
 
 config PROC_DEVICETREE
 	bool "Support for device tree in /proc"
Index: test-devicetree/arch/powerpc/Kconfig
===================================================================
--- test-devicetree.orig/arch/powerpc/Kconfig	2009-11-17 13:52:45.000000000 -0600
+++ test-devicetree/arch/powerpc/Kconfig	2009-11-17 14:01:06.000000000 -0600
@@ -163,6 +163,7 @@
 
 config OF
 	def_bool y
+	select OF_DYNAMIC
 
 config PPC_UDBG_16550
 	bool
Index: test-devicetree/drivers/of/Kconfig
===================================================================
--- test-devicetree.orig/drivers/of/Kconfig	2009-11-17 13:52:48.000000000 -0600
+++ test-devicetree/drivers/of/Kconfig	2009-11-17 14:01:06.000000000 -0600
@@ -1,3 +1,7 @@
+config OF_DYNAMIC
+	bool
+	depends on OF
+
 config OF_DEVICE
 	def_bool y
 	depends on OF && (SPARC || PPC_OF || MICROBLAZE)
Index: test-devicetree/drivers/of/Makefile
===================================================================
--- test-devicetree.orig/drivers/of/Makefile	2009-11-17 13:52:48.000000000 -0600
+++ test-devicetree/drivers/of/Makefile	2009-11-17 14:01:06.000000000 -0600
@@ -1,4 +1,5 @@
 obj-y = base.o
+obj-$(CONFIG_OF_DYNAMIC) += of_dynamic.o
 obj-$(CONFIG_OF_DEVICE) += device.o platform.o
 obj-$(CONFIG_OF_GPIO)   += gpio.o
 obj-$(CONFIG_OF_I2C)	+= of_i2c.o

^ permalink raw reply

* [PATCH 4/4] Move of_node[attach,detach] declarations to linux/of.h
From: Nathan Fontenot @ 2009-11-18  2:57 UTC (permalink / raw)
  To: linuxppc-dev, devicetree-discuss, microblaze-uclinux
In-Reply-To: <4B030FC2.9070401@austin.ibm.com>

Merge the declarations of of_attach_node and of_detach_node from the asm/prom.h
headers of powerpc and microblaze into linux/of.h.

This update also requires adding linux/of.h to the include list for
powerpc/platforms/pseries/reconfig.h.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: test-devicetree/arch/microblaze/include/asm/prom.h
===================================================================
--- test-devicetree.orig/arch/microblaze/include/asm/prom.h	2009-11-17 14:17:03.000000000 -0600
+++ test-devicetree/arch/microblaze/include/asm/prom.h	2009-11-17 14:18:25.000000000 -0600
@@ -139,10 +139,6 @@
 		of_flat_dt_is_compatible(unsigned long node, const char *name);
 extern unsigned long __init of_get_flat_dt_root(void);
 
-/* For updating the device tree at runtime */
-extern void of_attach_node(struct device_node *);
-extern void of_detach_node(struct device_node *);
-
 /* Other Prototypes */
 extern void finish_device_tree(void);
 extern void unflatten_device_tree(void);
Index: test-devicetree/arch/powerpc/include/asm/prom.h
===================================================================
--- test-devicetree.orig/arch/powerpc/include/asm/prom.h	2009-11-17 14:17:03.000000000 -0600
+++ test-devicetree/arch/powerpc/include/asm/prom.h	2009-11-17 14:18:25.000000000 -0600
@@ -137,10 +137,6 @@
 extern int __init of_flat_dt_is_compatible(unsigned long node, const char *name);
 extern unsigned long __init of_get_flat_dt_root(void);
 
-/* For updating the device tree at runtime */
-extern void of_attach_node(struct device_node *);
-extern void of_detach_node(struct device_node *);
-
 /* Other Prototypes */
 extern void finish_device_tree(void);
 extern void unflatten_device_tree(void);
Index: test-devicetree/arch/powerpc/platforms/pseries/reconfig.c
===================================================================
--- test-devicetree.orig/arch/powerpc/platforms/pseries/reconfig.c	2009-11-17 14:17:03.000000000 -0600
+++ test-devicetree/arch/powerpc/platforms/pseries/reconfig.c	2009-11-17 14:18:25.000000000 -0600
@@ -15,6 +15,7 @@
 #include <linux/kref.h>
 #include <linux/notifier.h>
 #include <linux/proc_fs.h>
+#include <linux/of.h>
 
 #include <asm/prom.h>
 #include <asm/machdep.h>
Index: test-devicetree/include/linux/of.h
===================================================================
--- test-devicetree.orig/include/linux/of.h	2009-11-17 14:17:03.000000000 -0600
+++ test-devicetree/include/linux/of.h	2009-11-17 14:18:25.000000000 -0600
@@ -84,4 +84,10 @@
 	const char *list_name, const char *cells_name, int index,
 	struct device_node **out_node, const void **out_args);
 
+#ifdef CONFIG_OF_DYNAMIC
+/* For updating the device tree at runtime */
+extern void of_attach_node(struct device_node *);
+extern void of_detach_node(struct device_node *);
+#endif
+
 #endif /* _LINUX_OF_H */

^ permalink raw reply

* Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!
From: David Gibson @ 2009-11-18  2:36 UTC (permalink / raw)
  To: Sachin Sant; +Cc: Linux/PPC Development, linux-next
In-Reply-To: <4B02529F.1060801@in.ibm.com>

On Tue, Nov 17, 2009 at 01:07:03PM +0530, Sachin Sant wrote:
> David Gibson wrote:
> >Hrm.  Ok.  I am truly baffled.  Well, below is a revised debug patch
> >which I hope will shed some sort of light on things.  I do also notice
> Thanks for the debug patch. I have attached the collected information.
> 
> >from your full log that it looks like the bug is happening shortly
> >after we start userspace.  So it may be differences in my userspace
> >set up that meant I haven't been able to reproduce it.  I'll have
> >another look at that when I get a chance.
> Let me know if you need access to the system on which i can recreate the
> bug. I can make that system available for you to debug this issue.

That's probably a good idea.  I'm still pretty baffled by this, so it
will probably take several more rounds of debug patches to start
getting a handle on it.


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* Re: [PATCH]  [SCSI] mpt fusion: Fix 32 bit platforms with 64 bit resources.
From: Benjamin Herrenschmidt @ 2009-11-18  5:41 UTC (permalink / raw)
  To: pbathija; +Cc: linuxppc-dev, Eric.Moore, linux-scsi
In-Reply-To: <1258503401-7779-1-git-send-email-pbathija@amcc.com>

On Tue, 2009-11-17 at 16:16 -0800, pbathija@amcc.com wrote:
> From: Pravin Bathija <pbathija@amcc.com>
> 
>   Powerpc 44x uses 36 bit real address while the real address defined
>   in MPT Fusion driver is of type 32 bit. This causes ioremap to fail and driver
>   fails to initialize. This fix changes the data types representing the real
>   address from unsigned long 32-bit types to "phys_addr_t" which is 64-bit. The
>   driver has been tested, the disks get discovered correctly and can do IO. Removed
>   ioremap and used hose->io_base_virt for IO space to make it platform independent.
> Content-Type: text/plain; charset=utf-8

Except that this is all wrong :-) You basically made it powerpc specific
since none of that pci controller stuff is generic. I don't understand
what you are trying to do though. The -only- change you need to do is
to change the longs into resource_size_t.

IO Port numbers are "special" and handled as such already (and besides
are never bigger than 32-bit neither, at least on x86 and powerpc).

Just leave the PIO code alone, hopefully, if the driver isn't full of
crack, the code should be fine already. If the driver does something
wrong then you can attempt to fix it separately.

The only problem that you need to address afaik, is purely that
pci_resource_start() can return a resource_size_t which can be 64-bit,
and as such it is broken for the driver to manipulate and store that
value as an unsigned long or a u32.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set
From: Benjamin Herrenschmidt @ 2009-11-18  6:00 UTC (permalink / raw)
  To: michael
  Cc: Mel Gorman, linuxppc-dev, Michael Neuling, Paul Mackerras,
	linux-kernel
In-Reply-To: <1258462358.24093.83.camel@concordia>

On Tue, 2009-11-17 at 23:52 +1100, Michael Ellerman wrote:
> 
> In fact this series makes me wonder whether we can drop support for a
> single kernel image with pseries XICS & MPIC support.

Nope. Not happening. We should just hide CONFIG_XICS just like
CONFIG_MPIC, it should be select'ed by the platform (which today is only
pseries but that might change).

> If we could drop that requirement we could have a single set of names,
> ie. API, for the irq routines and build either the XICS or MPIC
> versions.

And so we would have the ability to build a kernel that supports in a
single binary every platform, as is the case today, ie, pseries,
powermac, pa6t, cell, etc... _BUT_ for pseries support, we would have to
choose at compile time whether to support old or new machines ? Sounds
backward to me :-)

> That would avoid all the code that needs a setup_foo_xics() and
> setup_foo_mpic() - it'd just be setup_foo(), implemented by either the
> XICS or MPIC code.

And that would save us what ? one page on a pSeries machine ? yeah !

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set
From: Benjamin Herrenschmidt @ 2009-11-18  6:05 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <1258459659-11770-1-git-send-email-mel@csn.ul.ie>

On Tue, 2009-11-17 at 12:07 +0000, Mel Gorman wrote:
> KConfig doesn't require CONFIG_XICS to be set with CONFIG_PSERIES but if
> it's not set, there are numerous small build errors. This is a small series
> of patches to allow CONFIG_XICS to be unset in the config.
> 
> XICS appears to be some sort of interrupt controller but I'm not sure how
> common it is on systems that require CONFIG_PSERIES. If CONFIG_PSERIES
> universally requires CONFIG_XICS, the better path might be to force it to
> be set.
> 
> Testing was building with make oldconfig a configuration from 2.6.31 on
> a PPC970.

CONFIG_XICS should be made invisible and selected by PSERIES.

Cheers,
Ben.

^ permalink raw reply

* Value of .bootpg and TEXT_BASE for ppc440 in U-Boot
From: Mihir Punjabi @ 2009-11-18  6:13 UTC (permalink / raw)
  To: u-boot, linuxppc-dev, Linuxppc-embedded; +Cc: mihir124

Hi,

I am currently trying to port U-Boot onto a board with PPC440x5. My board has 16MB of flash whose base address is 0xFC000000.

I have set ".bootpg" in u-boot.lds to 0xFCFFF000 (End of Flash - 4 KB) and "TEXT_BASE" in config.mk to 0xFCF80000 (End of Flash - 512 KB). I obtained an error saying "Not enough room for program headers (allocated 3, need 4)"

I get the above error even if I set ".bootpg" to 0xFCF80000 (End of Flash - 512 KB) & "TEXT_BASE" to 0xFCF00000 (End of Flash - 1 MB) - I know these are high values, but just wanted to ensure that enough space is available.
But, I still got the same error.

Can someone tell me what the problem here is? Is my understanding that ".bootpg" should be at a value (End of Flash - 4 KB) wrong?

Further, I harcoded the "SIZEOF_HEADERS" in u-boot.lds to 1024, reverted ".bootpg" to 0xFCFFF000 & "TEXT_BASE" to 0xFCF80000.

I obtained the following error:
cpu/ppc4xx/resetvec.o:(.resetvec+0x0): relocation truncated to fit: R_PPC_REL24 against symbol `_start_440' defined in .bootpg section in cpu/ppc4xx/start.o

Please let me know what exactly should .bootpg & TEXT_BASE be set to?

I am suspecting these 2 values because my code compiles successfully if I:
1) Set TEXT_BASE to 0xFFFC0000
2) Remove the hardcoding of "SIZEOF_HEADERS" & 
3) Set .bootpg to 0xFFFFF000 (set by all ppc440 boards)

Thanks and Regards,
Mihir Punjabi



      

^ permalink raw reply

* Re: [PATCH] [PPC4xx] Fix device tree dts file for katmai board.
From: Stefan Roese @ 2009-11-18  9:57 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linuxppc-dev, pbathija
In-Reply-To: <1258503588-7844-1-git-send-email-pbathija@amcc.com>

Hi Pravin,

On Wednesday 18 November 2009 01:19:48 pbathija@amcc.com wrote:
> From: Pravin Bathija <pbathija@amcc.com>
> 
>    Set size cell value to 2 for 4GB memory support in katmai. Also set
>  PCI-E node inbound DMA ranges size to 4GB for correct boot up of katmai.

As Josh already mentioned, I already submitted a patch which partly covers 
this 4GB support:

http://patchwork.ozlabs.org/patch/36768/

I suggest that you rebase your patch (only with the DMA ranges stuff) and 
resend it.

Cheers,
Stefan

^ permalink raw reply

* Re: [PATCH] spi/mpc52xx-spi: cleanups
From: Wolfram Sang @ 2009-11-18  9:58 UTC (permalink / raw)
  To: Luotao Fu; +Cc: spi-devel-general, linuxppc-dev
In-Reply-To: <20091117144300.GB4850@pengutronix.de>

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

> > -		rc |= request_irq(ms->irq1, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM,
> > +		rc |= request_irq(ms->irq1, mpc52xx_spi_irq, 0,
> >  				  "mpc5200-spi-spiF", ms);
> 
> The "spiF" here is probably also a typo.

Ack. Grant, if you think it is worth you may modify my patch to avoid a resend.
If it is easier for you, I will do the resend, of course.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox