LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 3/9] v4  Add section count to memory_block
From: KAMEZAWA Hiroyuki @ 2010-08-05  4:50 UTC (permalink / raw)
  To: Nathan Fontenot
  Cc: linux-mm, Dave Hansen, Greg KH, linux-kernel, linuxppc-dev
In-Reply-To: <4C581BDD.1040601@austin.ibm.com>

On Tue, 03 Aug 2010 08:38:37 -0500
Nathan Fontenot <nfont@austin.ibm.com> wrote:

> Add a section count property to the memory_block struct to track the number
> of memory sections that have been added/removed from a memory block. This
> allows us to know when the last memory section of a memory block has been
> removed so we can remove the memory block.
> 
> Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

^ permalink raw reply

* Re: [PATCH 4/9] v4  Add mutex for add/remove of memory blocks
From: KAMEZAWA Hiroyuki @ 2010-08-05  4:53 UTC (permalink / raw)
  To: Nathan Fontenot
  Cc: linux-mm, Dave Hansen, Greg KH, linux-kernel, linuxppc-dev
In-Reply-To: <4C581C26.5080007@austin.ibm.com>

On Tue, 03 Aug 2010 08:39:50 -0500
Nathan Fontenot <nfont@austin.ibm.com> wrote:

> Add a new mutex for use in adding and removing of memory blocks.  This
> is needed to avoid any race conditions in which the same memory block could
> be added and removed at the same time.
> 
> Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

But a nitpick (see below)

> ---
>  drivers/base/memory.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> Index: linux-2.6/drivers/base/memory.c
> ===================================================================
> --- linux-2.6.orig/drivers/base/memory.c	2010-08-02 13:35:00.000000000 -0500
> +++ linux-2.6/drivers/base/memory.c	2010-08-02 13:45:34.000000000 -0500
> @@ -27,6 +27,8 @@
>  #include <asm/atomic.h>
>  #include <asm/uaccess.h>
>  
> +static struct mutex mem_sysfs_mutex;
> +

For static symbol of mutex, we usually do
	static DEFINE_MUTEX(mem_sysfs_mutex);

Then, extra calls of mutex_init() is not required.

^ permalink raw reply

* Help with an odd problem sharing memory on the ppc460ex
From: Ayman El-Khashab @ 2010-08-05  4:50 UTC (permalink / raw)
  To: linuxppc-dev

  I've got custom boards that have been running for a while on rev A 
460ex parts but when the rev B parts became available some problems 
surfaced.  We are trying to work around the issues in software.  To make 
this simple, I've got 2 460exs connected together via PCI and PCIe so i 
can switch the transport.  For now, I am using PCI.  I've setup the PIMs 
and POMs to map one CPUs DRAM across the bus to the other CPU.  So they 
have a sort of shared memory scheme.  This works fine in many cases.

I think I have a caching problem though even though I think the cache is 
disabled via u-boot.  What happens is that CPU0 will write into CPU1's 
memory.  CPU1 will still see a stale value though ... I can't figure out 
how this happens.  If CPU0 comes back and reads from CPU1's memory 
though, it gets the correct value.   Now if I reduce the frequency of 
the reads/writes to something low (maybe 1 or 2 per second), then very 
often CPU1 will see the change.  I continue to think it is a cache 
issue, but I am not sure.  Also not sure how to work around that.  Is 
that something I need to do via the TLBs?  Is the cache really disabled 
or does Linux mess with the TLB/cache settings?  When I boot Linux I 
reserve the upper 16Mb of memory (from 112-128Mb space) and then mmap 
that entire region into CPU1's space.  Not sure if when it is reserved 
if it is treated differently by Linux or not.

Any help is greatly appreciated.

Thanks
Ayman

^ permalink raw reply

* Re: [PATCH 5/9] v4  Allow memory_block to span multiple memory sections
From: KAMEZAWA Hiroyuki @ 2010-08-05  4:55 UTC (permalink / raw)
  To: Nathan Fontenot
  Cc: linux-mm, Dave Hansen, Greg KH, linux-kernel, linuxppc-dev
In-Reply-To: <4C581C61.1050408@austin.ibm.com>

On Tue, 03 Aug 2010 08:40:49 -0500
Nathan Fontenot <nfont@austin.ibm.com> wrote:

> Update the memory sysfs code that each sysfs memory directory is now
> considered a memory block that can contain multiple memory sections per
> memory block.  The default size of each memory block is SECTION_SIZE_BITS
> to maintain the current behavior of having a single memory section per
> memory block (i.e. one sysfs directory per memory section).
> 
> For architectures that want to have memory blocks span multiple
> memory sections they need only define their own memory_block_size_bytes()
> routine.
> 
> Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
(But maybe it's better to get ppc guy's Ack.)

^ permalink raw reply

* Re: [PATCH 6/9] v4 Update the find_memory_block declaration
From: KAMEZAWA Hiroyuki @ 2010-08-05  4:59 UTC (permalink / raw)
  To: Nathan Fontenot
  Cc: linux-mm, Dave Hansen, Greg KH, linux-kernel, linuxppc-dev
In-Reply-To: <4C581C99.8090201@austin.ibm.com>

On Tue, 03 Aug 2010 08:41:45 -0500
Nathan Fontenot <nfont@austin.ibm.com> wrote:

> Update the find_memory_block declaration to to take a struct mem_section *
> so that it matches the definition.
> 
> Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

Hmm...my mmotm-0727 has this definition in memory.h...

extern struct memory_block *find_memory_block(struct mem_section *);

What patch makes it unsigned long ?

^ permalink raw reply

* Re: [PATCH 7/9] v4  Update the node sysfs code
From: KAMEZAWA Hiroyuki @ 2010-08-05  5:01 UTC (permalink / raw)
  To: Nathan Fontenot
  Cc: linux-mm, Dave Hansen, Greg KH, linux-kernel, linuxppc-dev
In-Reply-To: <4C581CCB.7070806@austin.ibm.com>

On Tue, 03 Aug 2010 08:42:35 -0500
Nathan Fontenot <nfont@austin.ibm.com> wrote:

> Update the node sysfs code to be aware of the new capability for a memory
> block to contain multiple memory sections.  This requires an additional
> parameter to unregister_mem_sect_under_nodes so that we know which memory
> section of the memory block to unregister.
> 
> Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

^ permalink raw reply

* Re: [PATCH 9/9] v4  Update memory-hotplug documentation
From: KAMEZAWA Hiroyuki @ 2010-08-05  5:04 UTC (permalink / raw)
  To: Nathan Fontenot
  Cc: linux-mm, Dave Hansen, Greg KH, linux-kernel, linuxppc-dev
In-Reply-To: <4C581D30.60300@austin.ibm.com>

On Tue, 03 Aug 2010 08:44:16 -0500
Nathan Fontenot <nfont@austin.ibm.com> wrote:

> Update the memory hotplug documentation to reflect the new behaviors of
> memory blocks reflected in sysfs.
> 
> Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

A request from me:

 Could you clarify what happens if there are memory hole in [start end)_phys_index.
 in Documentation ? (Or add TODO list.)

Thanks,
-Kame


> ---
>  Documentation/memory-hotplug.txt |   40 +++++++++++++++++++++++----------------
>  1 file changed, 24 insertions(+), 16 deletions(-)
> 
> Index: linux-2.6/Documentation/memory-hotplug.txt
> ===================================================================
> --- linux-2.6.orig/Documentation/memory-hotplug.txt	2010-08-02 14:09:28.000000000 -0500
> +++ linux-2.6/Documentation/memory-hotplug.txt	2010-08-02 14:10:36.000000000 -0500
> @@ -126,36 +126,44 @@ config options.
>  --------------------------------
>  4 sysfs files for memory hotplug
>  --------------------------------
> -All sections have their device information under /sys/devices/system/memory as
> +All sections have their device information in sysfs.  Each section is part of
> +a memory block under /sys/devices/system/memory as
>  
>  /sys/devices/system/memory/memoryXXX
> -(XXX is section id.)
> +(XXX is the section id.)
>  
> -Now, XXX is defined as start_address_of_section / section_size.
> +Now, XXX is defined as (start_address_of_section / section_size) of the first
> +section contained in the memory block.
>  
>  For example, assume 1GiB section size. A device for a memory starting at
>  0x100000000 is /sys/device/system/memory/memory4
>  (0x100000000 / 1Gib = 4)
>  This device covers address range [0x100000000 ... 0x140000000)
>  
> -Under each section, you can see 4 files.
> +Under each section, you can see 5 files.
>  
> -/sys/devices/system/memory/memoryXXX/phys_index
> +/sys/devices/system/memory/memoryXXX/start_phys_index
> +/sys/devices/system/memory/memoryXXX/end_phys_index
>  /sys/devices/system/memory/memoryXXX/phys_device
>  /sys/devices/system/memory/memoryXXX/state
>  /sys/devices/system/memory/memoryXXX/removable
>  
> -'phys_index' : read-only and contains section id, same as XXX.
> -'state'      : read-write
> -               at read:  contains online/offline state of memory.
> -               at write: user can specify "online", "offline" command
> -'phys_device': read-only: designed to show the name of physical memory device.
> -               This is not well implemented now.
> -'removable'  : read-only: contains an integer value indicating
> -               whether the memory section is removable or not
> -               removable.  A value of 1 indicates that the memory
> -               section is removable and a value of 0 indicates that
> -               it is not removable.
> +'phys_index'      : read-only and contains section id of the first section
> +		    in the memory block, same as XXX.
> +'end_phys_index'  : read-only and contains section id of the last section
> +		    in the memory block.
> +'state'           : read-write
> +                    at read:  contains online/offline state of memory.
> +                    at write: user can specify "online", "offline" command
> +                    which will be performed on al sections in the block.
> +'phys_device'     : read-only: designed to show the name of physical memory
> +                    device.  This is not well implemented now.
> +'removable'       : read-only: contains an integer value indicating
> +                    whether the memory block is removable or not
> +                    removable.  A value of 1 indicates that the memory
> +                    block is removable and a value of 0 indicates that
> +                    it is not removable. A memory block is removable only if
> +                    every section in the block is removable.
>  
>  NOTE:
>    These directories/files appear after physical memory hotplug phase.
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply

* Re: Relocating bootwrapper causes kernel panic
From: Shawn Jin @ 2010-08-05  5:13 UTC (permalink / raw)
  To: ppcdev
In-Reply-To: <AANLkTi=x-EA59xfn_r5xMuJL6mufObSvSSEOeY9KTjQS@mail.gmail.com>

> I'm trying to relocate the bootwrapper from the default address
> (0x400000) to a higher address (e.g. 0x800000) in order to support a
> larger than 4MB initramfs. However the kernel panic when trying to
> access the device tree blob which was relocated accordingly to a
> higher address. The kernel message from __log_buf is shown below.
>
> The flat tree located at 0xbe4300 as the kerne message showed. Why
> cannot the kernel access this area? No TLB set for this area?
>
> <1>Unable to handle kernel paging request for data at address 0xc0be4308
> <1>Faulting instruction address: 0xc01fdabc
> <4>Oops: Kernel access of bad area, sig: 11 [#1]

Before the flat tree was accessed, I checked the DTLB and didn't find
any entry related to 0xc0be4300. After the exception, I found the
following DTLBs.

30 : 02  c0be4000   4KB ------ -> 00000000
31 : 00  fa000000   8MB VI-S-M -> fa000000

The DTLB#30 doesn't seem right. Why would it map to 0x0? I think this
should be something like 00be4000?

Thanks,
-Shawn.

^ permalink raw reply

* [linux-next] build failure
From: divya @ 2010-08-05  5:32 UTC (permalink / raw)
  To: LKML, linux-next, linuxppc-dev, netdev, jeffrey.t.kirsher

Yestersday's linux-next(2.6.35_next_20100802) build fails with the following error on both system p and x.


   drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_select_queue':
   drivers/net/ixgbe/ixgbe_main.c:6159: error: 'struct ixgbe_fcoe' has no member named 'up'
   drivers/net/ixgbe/ixgbe_main.c: In function 'ixgbe_xmit_frame':
   drivers/net/ixgbe/ixgbe_main.c:6221: error: 'struct ixgbe_fcoe' has no member named 'up'
   make[3]: *** [drivers/net/ixgbe/ixgbe_main.o] Error 1
   make[2]: *** [drivers/net/ixgbe] Error 2
   make[2]: *** Waiting for unfinished jobs....
   make[1]: *** [drivers/net] Error 2
   make: *** [drivers] Error 2

Thanks
Divya

^ permalink raw reply

* Re: Commit 3da34aa brakes MSI support on MPC8308 (possibly all MPC83xx) [REPOST]
From: Kumar Gala @ 2010-08-05  7:01 UTC (permalink / raw)
  To: Ilya Yanok; +Cc: linuxppc-dev, Wolfgang Denk
In-Reply-To: <4C48B3FD.7080006@emcraft.com>


On Jul 22, 2010, at 4:11 PM, Ilya Yanok wrote:

> 23.07.2010 1:09, Ilya Yanok wrote:
>> I hope to disturb you but I haven't got any reply for my first posting...
> 
> I shouldn't be working at night... It's 'hate' not 'hope'...
> 
> Regards, Ilya.

I have a fix, can you test?

- k

^ permalink raw reply

* Re: Relocating bootwrapper causes kernel panic
From: Shawn Jin @ 2010-08-05  7:23 UTC (permalink / raw)
  To: ppcdev
In-Reply-To: <AANLkTin3u=U-L2grncS_UtWqkGnb9bNUy4a4nqkRhQQ9@mail.gmail.com>

>> The flat tree located at 0xbe4300 as the kerne message showed. Why
>> cannot the kernel access this area? No TLB set for this area?
>>
>> <1>Unable to handle kernel paging request for data at address 0xc0be4308
>> <1>Faulting instruction address: 0xc01fdabc
>> <4>Oops: Kernel access of bad area, sig: 11 [#1]
>
> Before the flat tree was accessed, I checked the DTLB and didn't find
> any entry related to 0xc0be4300. After the exception, I found the
> following DTLBs.
>
> 30 : 02 =A0c0be4000 =A0 4KB ------ -> 00000000
> 31 : 00 =A0fa000000 =A0 8MB VI-S-M -> fa000000
>
> The DTLB#30 doesn't seem right. Why would it map to 0x0? I think this
> should be something like 00be4000?

When the early_debug is enabled, the kernel can boot successfully. I
checked the TLB settings and found the following.

28 : 00  c0000000   8MB V--S-M -> 00000000
29 : 00  fa000000   8MB VI-S-M -> fa000000
30 : 00  c0800000   8MB V--S-M -> 00800000
31 : 14  04919000   ?KB V---WM -> 00e45000

So the kernel can access the dtb at 0xbe4300 because of the pinned down DTL=
B#30.

I think the cause is clear now. But how to fix it? Two questions:
1. Should this DTLB miss exception properly set a new TLB entry for
the new dtb address 0xbe4300?
2. If the DTLB miss exception handler is not the right guy to load a
proper TLB entry, how can I set one entry based on the link_address
and the address of the flat dt blob?

Thanks a lot,
-Shawn.

^ permalink raw reply

* Re: [PATCH 00/27] KVM PPC PV framework v3
From: Avi Kivity @ 2010-08-05  7:57 UTC (permalink / raw)
  To: Scott Wood; +Cc: kvm-ppc, linuxppc-dev, Alexander Graf, KVM list
In-Reply-To: <20100803111611.38ca87e6@schlenkerla.am.freescale.net>

  On 08/03/2010 07:16 PM, Scott Wood wrote:
> On Sun, 1 Aug 2010 22:21:37 +0200
> Alexander Graf<agraf@suse.de>  wrote:
>
>> On 01.08.2010, at 16:02, Avi Kivity wrote:
>>
>>> Looks reasonable.  Since it's fair to say I understand nothing about powerpc, I'd like someone who does to review it and ack, please, with an emphasis on the interfaces.
>> Sounds good. Preferably someone with access to the ePAPR spec :).
> The ePAPR-relevant stuff in patches 7, 16, and 17 looks reasonable.
> Did I miss any ePAPR-relevant stuff in the other patches?

Shall I take this as an ACK?

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply

* [PATCH] powerpc/85xx: Fix compile error in mpc85xx_mds.c
From: Kumar Gala @ 2010-08-05  8:01 UTC (permalink / raw)
  To: linuxppc-dev

arch/powerpc/platforms/85xx/mpc85xx_mds.c: In function 'mpc85xx_mds_setup_arch':
arch/powerpc/platforms/85xx/mpc85xx_mds.c:367: error: 'np' undeclared (first use in this function)
arch/powerpc/platforms/85xx/mpc85xx_mds.c:367: error: (Each undeclared identifier is reported only once
arch/powerpc/platforms/85xx/mpc85xx_mds.c:367: error: for each function it appears in.)

Some code cleaned dropped need decleration of 'np'.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index c8be7b5..ebd2b2f 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -357,6 +357,7 @@ static void __init mpc85xx_mds_setup_arch(void)
 {
 #ifdef CONFIG_PCI
 	struct pci_controller *hose;
+	struct device_node *np = NULL;
 #endif
 	dma_addr_t max = 0xffffffff;
 
-- 
1.6.0.6

^ permalink raw reply related

* Re: [PATCH 00/27] KVM PPC PV framework v3
From: Alexander Graf @ 2010-08-05  8:01 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Scott Wood, linuxppc-dev, kvm-ppc, KVM list
In-Reply-To: <4C5A6F01.6050705@redhat.com>


On 05.08.2010, at 09:57, Avi Kivity wrote:

> On 08/03/2010 07:16 PM, Scott Wood wrote:
>> On Sun, 1 Aug 2010 22:21:37 +0200
>> Alexander Graf<agraf@suse.de>  wrote:
>>=20
>>> On 01.08.2010, at 16:02, Avi Kivity wrote:
>>>=20
>>>> Looks reasonable.  Since it's fair to say I understand nothing =
about powerpc, I'd like someone who does to review it and ack, please, =
with an emphasis on the interfaces.
>>> Sounds good. Preferably someone with access to the ePAPR spec :).
>> The ePAPR-relevant stuff in patches 7, 16, and 17 looks reasonable.
>> Did I miss any ePAPR-relevant stuff in the other patches?
>=20
> Shall I take this as an ACK?

Hollis wanted to take a look at it too. But given the fact that I have =
another ~10 patches lying here I'd appreciate if things could get =
committed. If changes are so dramatic that they'd render things =
incompatible, we can always just release both patches for an actual =
kernel release, right?


Alex

^ permalink raw reply

* [PATCH] powerpc/fsl-pci: Fix MSI support on 83xx platforms
From: Kumar Gala @ 2010-08-05  8:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: wd, yanok

The following commit broke 83xx because it assumed the 83xx platforms
exposed the "IMMR" address in BAR0 like the 85xx/86xx/QoriQ devices do:

commit 3da34aae03d498ee62f75aa7467de93cce3030fd
Author: Kumar Gala <galak@kernel.crashing.org>
Date:   Tue May 12 15:51:56 2009 -0500

    powerpc/fsl: Support unique MSI addresses per PCIe Root Complex

However that is not true, so we have to search through the inbound
window settings on 83xx to find which one matches the IMMR address to
determine its PCI address.

Reported-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/sysdev/fsl_msi.c |    9 +++----
 arch/powerpc/sysdev/fsl_pci.c |   43 ++++++++++++++++++++++++++++++++++++++++-
 arch/powerpc/sysdev/fsl_pci.h |    1 +
 3 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 962c2d8..dcd244d 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -24,6 +24,7 @@
 #include <asm/ppc-pci.h>
 #include <asm/mpic.h>
 #include "fsl_msi.h"
+#include "fsl_pci.h"
 
 LIST_HEAD(msi_head);
 
@@ -125,13 +126,11 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
 {
 	struct fsl_msi *msi_data = fsl_msi_data;
 	struct pci_controller *hose = pci_bus_to_host(pdev->bus);
-	u32 base = 0;
+	u64 base = fsl_pci_immrbar_base(hose);
 
-	pci_bus_read_config_dword(hose->bus,
-		PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base);
+	msg->address_lo = msi_data->msi_addr_lo + lower_32_bits(base);
+	msg->address_hi = msi_data->msi_addr_hi + upper_32_bits(base);
 
-	msg->address_lo = msi_data->msi_addr_lo + base;
-	msg->address_hi = msi_data->msi_addr_hi;
 	msg->data = hwirq;
 
 	pr_debug("%s: allocated srs: %d, ibs: %d\n",
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 7e900ec..0c28d93 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1,7 +1,7 @@
 /*
  * MPC83xx/85xx/86xx PCI/PCIE support routing.
  *
- * Copyright 2007-2009 Freescale Semiconductor, Inc.
+ * Copyright 2007-2010 Freescale Semiconductor, Inc.
  * Copyright 2008-2009 MontaVista Software, Inc.
  *
  * Initial author: Xianghua Xiao <x.xiao@freescale.com>
@@ -310,6 +310,16 @@ void fsl_pcibios_fixup_bus(struct pci_bus *bus)
 	}
 }
 
+u64 fsl_pci_immrbar_base(struct pci_controller *hose)
+{
+	u32 base;
+
+	pci_bus_read_config_dword(hose->bus,
+		PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base);
+
+	return base;
+}
+
 int __init fsl_add_bridge(struct device_node *dev, int is_primary)
 {
 	int len;
@@ -428,6 +438,13 @@ struct mpc83xx_pcie_priv {
 	u32 dev_base;
 };
 
+struct pex_inbound_window {
+	u32 ar;
+	u32 tar;
+	u32 barl;
+	u32 barh;
+};
+
 /*
  * With the convention of u-boot, the PCIE outbound window 0 serves
  * as configuration transactions outbound.
@@ -435,6 +452,8 @@ struct mpc83xx_pcie_priv {
 #define PEX_OUTWIN0_BAR		0xCA4
 #define PEX_OUTWIN0_TAL		0xCA8
 #define PEX_OUTWIN0_TAH		0xCAC
+#define PEX_RC_INWIN_BASE	0xE60
+#define PEX_RCIWARn_EN		0x1
 
 static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)
 {
@@ -461,6 +480,28 @@ static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)
 	return PCIBIOS_SUCCESSFUL;
 }
 
+/* Walk the Root Complex Inbound windows to match IMMR base */
+u64 fsl_pci_immrbar_base(struct pci_controller *hose)
+{
+	struct mpc83xx_pcie_priv *pcie = hose->dn->data;
+	struct pex_inbound_window *in = pcie->cfg_type0 + PEX_RC_INWIN_BASE;
+	int i;
+
+	for (i = 0; i < 4; i++) {
+		/* not enabled, skip */
+		if (!in_le32(&in[i].ar) & PEX_RCIWARn_EN)
+			 continue;
+
+		if (get_immrbase() == in_le32(&in[i].tar))
+			return (u64)in_le32(&in[i].barh) << 32 |
+				    in_le32(&in[i].barl);
+	}
+
+	printk(KERN_WARNING "could not find PCI BAR matching IMMR\n");
+
+	return 0;
+}
+
 static void __iomem *mpc83xx_pcie_remap_cfg(struct pci_bus *bus,
 					    unsigned int devfn, int offset)
 {
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index a9d8bbe..8ad72a1 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -88,6 +88,7 @@ struct ccsr_pci {
 extern int fsl_add_bridge(struct device_node *dev, int is_primary);
 extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);
 extern int mpc83xx_add_bridge(struct device_node *dev);
+u64 fsl_pci_immrbar_base(struct pci_controller *hose);
 
 #endif /* __POWERPC_FSL_PCI_H */
 #endif /* __KERNEL__ */
-- 
1.6.0.6

^ permalink raw reply related

* Re: [PATCH 00/27] KVM PPC PV framework v3
From: Avi Kivity @ 2010-08-05  8:05 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Scott Wood, linuxppc-dev, kvm-ppc, KVM list, Hollis Blanchard
In-Reply-To: <55AD06CD-842E-49DC-97CD-AEE401F5B8C5@suse.de>

  On 08/05/2010 11:01 AM, Alexander Graf wrote:
>
>> Shall I take this as an ACK?
> Hollis wanted to take a look at it too. But given the fact that I have another ~10 patches lying here I'd appreciate if things could get committed. If changes are so dramatic that they'd render things incompatible, we can always just release both patches for an actual kernel release, right?

That's true, we have some time to get it right.

Hollis, please let us know either way once you've reviewed things.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply

* Re: Commit 3da34aa brakes MSI support on MPC8308 (possibly all MPC83xx) [REPOST]
From: Ilya Yanok @ 2010-08-05  8:24 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Wolfgang Denk
In-Reply-To: <B6B3F33E-1A50-45A4-ADAE-2CA5C383B404@kernel.crashing.org>

  Hi Kumar,

05.08.2010 11:01, Kumar Gala пишет:
> I have a fix, can you test?

Surely. Where can I find it?

Thanks.

Regards, Ilya.

^ permalink raw reply

* Re: [PATCH 00/27] KVM PPC PV framework v3
From: Avi Kivity @ 2010-08-05  8:25 UTC (permalink / raw)
  To: Alexander Graf; +Cc: linuxppc-dev, KVM list, kvm-ppc
In-Reply-To: <1280407688-9815-1-git-send-email-agraf@suse.de>

  On 07/29/2010 03:47 PM, Alexander Graf wrote:
> On PPC we run PR=0 (kernel mode) code in PR=1 (user mode) and don't use the
> hypervisor extensions.
>
> While that is all great to show that virtualization is possible, there are
> quite some cases where the emulation overhead of privileged instructions is
> killing performance.
>
> This patchset tackles exactly that issue. It introduces a paravirtual framework
> using which KVM and Linux share a page to exchange register state with. That
> way we don't have to switch to the hypervisor just to change a value of a
> privileged register.
>
> To prove my point, I ran the same test I did for the MMU optimizations against
> the PV framework. Here are the results:
>
> [without]
>
> debian-powerpc:~# time for i in {1..1000}; do /bin/echo hello>  /dev/null; done
>
> real    0m14.659s
> user    0m8.967s
> sys     0m5.688s
>
> [with]
>
> debian-powerpc:~# time for i in {1..1000}; do /bin/echo hello>  /dev/null; done
>
> real    0m7.557s
> user    0m4.121s
> sys     0m3.426s
>
>
> So this is a significant performance improvement! I'm quite happy how fast this
> whole thing becomes :)
>
> I tried to take all comments I've heard from people so far about such a PV
> framework into account. In case you told me something before that is a no-go
> and I still did it, please just tell me again.
>
> To make use of this whole thing you also need patches to qemu and openbios. I
> have them in my queue, but want to see this set upstream first before I start
> sending patches to the other projects.
>
> Now go and have fun with fast VMs on PPC! Get yourself a G5 on ebay and start
> experiencing the power yourself. - heh
>

Applied this and your follow on 7-part series, thanks.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply

* Re: [PATCH v4 1/2] powerpc: cleanup APIs for cpu/thread/core mappings
From: Vaidyanathan Srinivasan @ 2010-08-05 11:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Michael Neuling, Paul Mackerras, Anton Blanchard, linuxppc-dev
In-Reply-To: <1280810653.1902.87.camel@pasglop>

* Benjamin Herrenschmidt <benh@kernel.crashing.org> [2010-08-03 14:44:13]:

> On Thu, 2010-07-22 at 06:27 +0530, Vaidyanathan Srinivasan wrote:
> > These APIs take logical cpu number as input
> > Change cpu_first_thread_in_core() to cpu_leftmost_thread_sibling()
> > Change cpu_last_thread_in_core() to cpu_rightmost_thread_sibling()
> 
> I'm still not happy here.
> 
> I don't find leftmost/rightmost to be a "progress" from the previous
> naming. If you really want to change to avoid in_core() at the end, then
> call them first_thread_sibling() and last_thread_sibling().

Hi Ben,

The naming is based on our discussion during the first RFC:
http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-April/081610.html

I am fine with first_thread_sibling() name instead of
cpu_{left,right}most_thread_sibling().  The goal is to distinguish
between APIs returning logical cpu numbers and core indexes.

first_thread_sibling() implies that the parameter and return value are
logical cpu (thread) number.

I will change the name as per your suggestion and post an update.

> Then you change:
> 
> > -static inline int cpu_thread_to_core(int cpu)
> > -{
> > -	return cpu >> threads_shift;
> > -}
> 
>   .../... to:
> 
> > -/* Must be called when no change can occur to cpu_present_mask,
> > +/* Helper routines for cpu to core mapping */
> > +int cpu_core_of_thread(int cpu)
> > +{
> > +	return cpu >> threads_shift;
> > +}
> > +EXPORT_SYMBOL_GPL(cpu_core_of_thread);

The cpu_core_of_thread() name implies that the return type is a core index
and not a logical cpu number.

cpu_core_of_thread(5) = 1
cpu_first_thread_of_core(1) = 4

Do you think cpu_core_number_of_thread() will explain the return type
better?

> Any reason you are making it out of line other than gratuituous
> bloat ? :-)
> 
> > +int cpu_first_thread_of_core(int core)
> > +{
> > +	return core << threads_shift;
> > +}
> > +EXPORT_SYMBOL_GPL(cpu_first_thread_of_core);
> 
> Same.

The reason behind out of line is to avoid exporting threads_shift or
other variables like threads_per_core and have this API exported so
that modules can read them.  If we make these wrapper inline, then we
will have to export the variables themselves which is not a good idea.

Thanks for the review.  

--Vaidy

^ permalink raw reply

* Re: [PATCH][RFC] preempt_count corruption across H_CEDE call with CONFIG_PREEMPT on pseries
From: Vaidyanathan Srinivasan @ 2010-08-05 11:06 UTC (permalink / raw)
  To: Darren Hart
  Cc: Stephen Rothwell, Gautham R Shenoy, Steven Rostedt, linuxppc-dev,
	Will Schmidt, Paul Mackerras, Thomas Gleixner
In-Reply-To: <4C5A41FF.3000605@us.ibm.com>

* Darren Hart <dvhltc@us.ibm.com> [2010-08-04 21:45:51]:

> On 07/23/2010 12:07 AM, Vaidyanathan Srinivasan wrote:
> >* Benjamin Herrenschmidt<benh@kernel.crashing.org>  [2010-07-23 15:11:00]:
> >
> >>On Fri, 2010-07-23 at 10:38 +0530, Vaidyanathan Srinivasan wrote:
> >>>Yes.  extended_cede_processor() will return with interrupts enabled in
> >>>the cpu. (This is done by the hypervisor).  Under normal cases we
> >>>cannot be interrupted because no IO interrupts are routed to us after
> >>>xics_teardown_cpu() and since the CPU is out of the map, nobody will
> >>>send us IPIs.
> >>
> >>What about decrementer ?
> >
> >Decrementer expiry event handling is bit complex.  The event as such
> >may not bring back the extended_cede_processor() cpu, but may be
> >marked pending when we get out of this state eventually.  I will find
> >more information on this event and update.
> 
> Hi Vaidy, have you been able to dig anything up about the
> decrementer expiry?

Hi Darren,

Yes, it is possible that the cpu in extended_cede_processor() can be
woken up by the decrementer.  But the expectation is that we will
return back to this context since we will not have any pending timers.

Our stack should not change even if we get the decrementer interrupts.

--Vaidy

^ permalink raw reply

* Re: [PATCH] asoc/multi-component: fsl: add support for disabled SSI nodes
From: Mark Brown @ 2010-08-05 11:42 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev, alsa-devel, kumar.gala, lrg
In-Reply-To: <1280962268-31407-1-git-send-email-timur@freescale.com>

On Wed, Aug 04, 2010 at 05:51:08PM -0500, Timur Tabi wrote:
> Add support for adding "status = disabled" to an SSI node to incidate that it
> is not wired on the board.  This replaces the not-so-intuitive previous method
> of omitting a codec-handle property.
> 
> Signed-off-by: Timur Tabi <timur@freescale.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

^ permalink raw reply

* Re: [PATCH][RFC] preempt_count corruption across H_CEDE call with CONFIG_PREEMPT on pseries
From: Thomas Gleixner @ 2010-08-05 12:26 UTC (permalink / raw)
  To: Vaidyanathan Srinivasan
  Cc: Stephen Rothwell, Darren Hart, Gautham R Shenoy, Steven Rostedt,
	linuxppc-dev, Will Schmidt, Paul Mackerras
In-Reply-To: <20100805110625.GG3282@dirshya.in.ibm.com>

On Thu, 5 Aug 2010, Vaidyanathan Srinivasan wrote:

> * Darren Hart <dvhltc@us.ibm.com> [2010-08-04 21:45:51]:
> 
> > On 07/23/2010 12:07 AM, Vaidyanathan Srinivasan wrote:
> > >* Benjamin Herrenschmidt<benh@kernel.crashing.org>  [2010-07-23 15:11:00]:
> > >
> > >>On Fri, 2010-07-23 at 10:38 +0530, Vaidyanathan Srinivasan wrote:
> > >>>Yes.  extended_cede_processor() will return with interrupts enabled in
> > >>>the cpu. (This is done by the hypervisor).  Under normal cases we
> > >>>cannot be interrupted because no IO interrupts are routed to us after
> > >>>xics_teardown_cpu() and since the CPU is out of the map, nobody will
> > >>>send us IPIs.
> > >>
> > >>What about decrementer ?
> > >
> > >Decrementer expiry event handling is bit complex.  The event as such
> > >may not bring back the extended_cede_processor() cpu, but may be
> > >marked pending when we get out of this state eventually.  I will find
> > >more information on this event and update.
> > 
> > Hi Vaidy, have you been able to dig anything up about the
> > decrementer expiry?
> 
> Hi Darren,
> 
> Yes, it is possible that the cpu in extended_cede_processor() can be
> woken up by the decrementer.  But the expectation is that we will
> return back to this context since we will not have any pending timers.

The problem is that you might get woken _before_ the timers have been
migrated away. 
 
> Our stack should not change even if we get the decrementer interrupts.

But you should not execute kernel code when you got offlined either.

Thanks,

	tglx

^ permalink raw reply

* Re: [alsa-devel] [PATCH] asoc/multi-component: fsl: add support for disabled SSI nodes
From: Liam Girdwood @ 2010-08-05 12:43 UTC (permalink / raw)
  To: Mark Brown; +Cc: linuxppc-dev, alsa-devel, Timur Tabi, kumar.gala
In-Reply-To: <20100805114215.GC13146@rakim.wolfsonmicro.main>

On Thu, 2010-08-05 at 12:42 +0100, Mark Brown wrote:
> On Wed, Aug 04, 2010 at 05:51:08PM -0500, Timur Tabi wrote:
> > Add support for adding "status = disabled" to an SSI node to incidate that it
> > is not wired on the board.  This replaces the not-so-intuitive previous method
> > of omitting a codec-handle property.
> > 
> > Signed-off-by: Timur Tabi <timur@freescale.com>
> 
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Applied.

Thanks

Liam

^ permalink raw reply

* Re: [PATCH] powerpc: Add vmcoreinfo symbols to allow makdumpfile to filter core files properly
From: Neil Horman @ 2010-08-05 13:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Neil Horman, kexec, linux-kernel, linuxppc-dev, paulus, vgoyal
In-Reply-To: <1280973866.1902.168.camel@pasglop>

On Thu, Aug 05, 2010 at 12:04:26PM +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2010-08-04 at 10:49 -0400, Neil Horman wrote:
> > Ping yet again. Ben, This needs review/acceptance from you or Paul
> > Neil 
> 
> Isn't it already in powerpc-next about to be pulled by Linus ?
> 
Yes, there it is.  Apologies.  For whatever reason, I was looking on the main
branch of your tree.  It didn't occur to me to check your next branch.  Sorry.

> In general, I recommend you check the status of your patches on
> patchwork. I'm nagging Jeremy to add a feature so it emails the
> submitter when the patch status changes :-)
> 
Noted, I'll remember that.  Email from patchwork would be a nice feature. +1
from me. 

Thanks & Regards
Neil

> Cheers,
> Ben.
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply

* RE: [PATCH 0/2 v3] mpc5200 ac97 gpio reset
From: Eric Millbrandt @ 2010-08-05 12:59 UTC (permalink / raw)
  To: 'Mark Brown', Grant Likely; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20100803055216.GA25306@rakim.wolfsonmicro.main>

> -----Original Message-----
> From: linuxppc-dev-bounces+emillbrandt=3Ddekaresearch.com@lists.ozlabs.or=
g
> [mailto:linuxppc-dev-
> bounces+emillbrandt=3Ddekaresearch.com@lists.ozlabs.org] On Behalf Of Mar=
k
> Brown
> Sent: Tuesday, August 03, 2010 01:52
> To: Grant Likely
> Cc: linuxppc-dev@lists.ozlabs.org; Eric Millbrandt
> Subject: Re: [PATCH 0/2 v3] mpc5200 ac97 gpio reset
>
> On Sat, Jul 31, 2010 at 10:42:15PM -0600, Grant Likely wrote:
> > On Sun, Jun 27, 2010 at 4:01 PM, Mark Brown
>
> > > I'm a little concerned with a collision with multi codec here. It'd
> > > be handy if you could keep it separate in case it needs merging
> > > into both trees (or we could merge via ASoC only).
>
> > Hmmm.  Yeah, probably better to take it via your tree then.  I've
> > currently got patch 1 in linux-next, but I'll drop it before asking
> > benh to pull.  Go ahead and add my acked-by.
>
> Looks like multi-component is slightly too late for .36 and I don't have
> the original patch any more since it looked like you were going to be
> carrying it...  could you restore the patch to your tree please?

<ping> Grant, are you going to pick up this series for .36?

Eric

-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

This e-mail and the information, including any attachments, it contains are=
 intended to be a confidential communication only to the person or entity t=
o whom it is addressed and may contain information that is privileged. If t=
he reader of this message is not the intended recipient, you are hereby not=
ified that any dissemination, distribution or copying of this communication=
 is strictly prohibited. If you have received this communication in error, =
please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

^ 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