* [PATCH 2/2] powerpc: add "force config cmd line" Kconfig option
From: Sebastian Andrzej Siewior @ 2014-02-20 20:48 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev, Sebastian Andrzej Siewior, Paul Mackerras
In-Reply-To: <1392929297-12837-1-git-send-email-bigeasy@linutronix.de>
powerpc uses early_init_dt_scan_chosen() from common fdt code. By
enabling this option, the common code can take the built in
command line over the one that is comming from bootloader / DT.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/powerpc/Kconfig | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf34..957d3e5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -618,6 +618,15 @@ config CMDLINE
some command-line options at build time by entering them here. In
most cases you will need to specify the root device here.
+config CMDLINE_FORCE
+ bool "Always use the default kernel command string"
+ depends on CMDLINE_BOOL
+ help
+ Always use the default kernel command string, even if the boot
+ loader passes other arguments to the kernel.
+ This is useful if you cannot or don't want to change the
+ command-line options your boot loader passes to the kernel.
+
config EXTRA_TARGETS
string "Additional default image types"
help
--
1.9.0.rc3
^ permalink raw reply related
* [PATCH 1/2] powerpc: 85xx rdb: move np pointer to avoid builderror
From: Sebastian Andrzej Siewior @ 2014-02-20 20:48 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev, Sebastian Andrzej Siewior, Paul Mackerras
If CONFIG_UCC_GETH or CONFIG_SERIAL_QE is not defined then we get a
warning about an used variable which leads to a build error.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index e15bdd1..232a6a7 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -86,10 +86,6 @@ void __init mpc85xx_rdb_pic_init(void)
*/
static void __init mpc85xx_rdb_setup_arch(void)
{
-#ifdef CONFIG_QUICC_ENGINE
- struct device_node *np;
-#endif
-
if (ppc_md.progress)
ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
@@ -101,6 +97,7 @@ static void __init mpc85xx_rdb_setup_arch(void)
mpc85xx_qe_init();
#if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
if (machine_is(p1025_rdb)) {
+ struct device_node *np;
struct ccsr_guts __iomem *guts;
--
1.9.0.rc3
^ permalink raw reply related
* [PATCH 2/9] ps3-vuart: don't use PREPARE_WORK
From: Tejun Heo @ 2014-02-20 20:44 UTC (permalink / raw)
To: laijs; +Cc: Tejun Heo, Geoff Levand, cbe-oss-dev, linuxppc-dev, linux-kernel
In-Reply-To: <1392929071-16555-1-git-send-email-tj@kernel.org>
PREPARE_[DELAYED_]WORK() are being phased out. They have few users
and a nasty surprise in terms of reentrancy guarantee as workqueue
considers work items to be different if they don't have the same work
function.
ps3_vuart wasn't overriding the work item with multiple work functions
but was using NULL for INIT_WORK() and then single PREPARE_WORK() to
set the work function. We can simply invoke INIT_WORK() with the work
function and remove the PREPARE_WORK() usage.
Not tested at all.
It would probably be best to route this with other related updates
through the workqueue tree.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Geoff Levand <geoff@infradead.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: cbe-oss-dev@lists.ozlabs.org
---
drivers/ps3/ps3-vuart.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/ps3/ps3-vuart.c b/drivers/ps3/ps3-vuart.c
index fb73008..bc1e513 100644
--- a/drivers/ps3/ps3-vuart.c
+++ b/drivers/ps3/ps3-vuart.c
@@ -699,8 +699,6 @@ int ps3_vuart_read_async(struct ps3_system_bus_device *dev, unsigned int bytes)
BUG_ON(!bytes);
- PREPARE_WORK(&priv->rx_list.work.work, ps3_vuart_work);
-
spin_lock_irqsave(&priv->rx_list.lock, flags);
if (priv->rx_list.bytes_held >= bytes) {
dev_dbg(&dev->core, "%s:%d: schedule_work %xh bytes\n",
@@ -1052,7 +1050,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
INIT_LIST_HEAD(&priv->rx_list.head);
spin_lock_init(&priv->rx_list.lock);
- INIT_WORK(&priv->rx_list.work.work, NULL);
+ INIT_WORK(&priv->rx_list.work.work, ps3_vuart_work);
priv->rx_list.work.trigger = 0;
priv->rx_list.work.dev = dev;
--
1.8.5.3
^ permalink raw reply related
* P4080 + EHCI controller question
From: Ruchika @ 2014-02-20 19:36 UTC (permalink / raw)
To: linuxppc-dev
Hi,
I've been trying to understand why the uboot code is unable to work with
USB1.1 devices.
On a USB analyzer:
I notice on an analyzer that there are no SOF or IN tokens seen on the
bus at all. The only after the very first setup packet is sent and ACK'd.
The board has a hub chip on it connected to the USB controller via a
Ulpi interface.
Uboot debug indicates that the transfer times out and was still "Active"
The kernel code indicates that a companion driver handles 1.1 devices.
Does this mean there are 2 HCD's, one for HS and one for FS/LS in the
kernel ?
Thank you
^ permalink raw reply
* Re: Question about EHCI on P4080
From: Ruchika @ 2014-02-20 18:56 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <530598D7.5080602@servergy.com>
linuxppc,
Is there another mailing list which is more appropriate ?
If so I'd be happy to get a recommendation.
Thank you
Regards
ruchika
On 2/19/2014 11:55 PM, Ruchika wrote:
> Hi,
> I've been trying to understand why the uboot code is unable to work with
> USB1.1 devices.
> On a USB analyzer:
> I notice on an analyzer that there are no SOF or IN tokens seen on the
> bus at all. The only after the very first setup packet is sent and ACK'd.
>
> The board has a hub chip on it connected to the USB controller via a
> Ulpi interface.
>
> Uboot debug indicates that the transfer times out and was still "Active"
>
> The kernel code indicates that a companion driver handles 1.1 devices.
> Does this mean there are 2 HCD's, one for HS and one for FS/LS in the
> kernel ?
> Thank you
>
>
> ruchika
^ permalink raw reply
* Re: [PATCH 1/3] mm: return NUMA_NO_NODE in local_memory_node if zonelists are not setup
From: Nishanth Aravamudan @ 2014-02-20 18:28 UTC (permalink / raw)
To: Christoph Lameter
Cc: Michal Hocko, linux-mm, Mel Gorman, David Rientjes, Joonsoo Kim,
linuxppc-dev, Anton Blanchard
In-Reply-To: <alpine.DEB.2.10.1402201004460.11829@nuc>
On 20.02.2014 [10:05:39 -0600], Christoph Lameter wrote:
> On Wed, 19 Feb 2014, Nishanth Aravamudan wrote:
>
> > We can call local_memory_node() before the zonelists are setup. In that
> > case, first_zones_zonelist() will not set zone and the reference to
> > zone->node will Oops. Catch this case, and, since we presumably running
> > very early, just return that any node will do.
>
> Really? Isnt there some way to avoid this call if zonelists are not setup
> yet?
How do I best determine if zonelists aren't setup yet?
The call-path in question (after my series is applied) is:
arch/powerpc/kernel/setup_64.c::setup_arch ->
arch/powerpc/mm/numa.c::do_init_bootmem() ->
cpu_numa_callback() ->
numa_setup_cpu() ->
map_cpu_to_node() ->
update_numa_cpu_node() ->
set_cpu_numa_mem()
and setup_arch() is called before build_all_zonelists(NULL, NULL) in
start_kernel(). This seemed like the most reasonable path, as it's used
on hotplug as well.
I'm open to suggestsions!
Thanks,
Nish
^ permalink raw reply
* [PATCH 4/4] KVM: PPC: Bookehv: Get vcpu's last instruction for emulation
From: Mihai Caraman @ 2014-02-20 16:30 UTC (permalink / raw)
To: kvm-ppc; +Cc: Mihai Caraman, linuxppc-dev, kvm
In-Reply-To: <1392913821-4520-1-git-send-email-mihai.caraman@freescale.com>
Load external pid (lwepx) instruction faults (when called from
KVM with guest context) needs to be handled by KVM. This implies
additional code in DO_KVM macro to identify the source of the
exception (which oiginate from KVM host rather than the guest).
The hook requires to check the Exception Syndrome Register
ESR[EPID] and External PID Load Context Register EPLC[EGS] for
some exceptions (DTLB_MISS, DSI and LRAT). Doing this on Data TLB
miss exception is obvious intrusive for the host.
Get rid of lwepx and acquire last instuction in kvmppc_get_last_inst()
by searching for the physical address and kmap it. This fixes an
infinite loop caused by lwepx's data TLB miss handled in the host
and the TODO for TLB eviction and execute-but-not-read entries.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
---
arch/powerpc/kvm/bookehv_interrupts.S | 37 +++----------
arch/powerpc/kvm/e500_mmu_host.c | 93 +++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+), 28 deletions(-)
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index 20c7a54..c50490c 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -119,38 +119,14 @@
1:
.if \flags & NEED_EMU
- /*
- * This assumes you have external PID support.
- * To support a bookehv CPU without external PID, you'll
- * need to look up the TLB entry and create a temporary mapping.
- *
- * FIXME: we don't currently handle if the lwepx faults. PR-mode
- * booke doesn't handle it either. Since Linux doesn't use
- * broadcast tlbivax anymore, the only way this should happen is
- * if the guest maps its memory execute-but-not-read, or if we
- * somehow take a TLB miss in the middle of this entry code and
- * evict the relevant entry. On e500mc, all kernel lowmem is
- * bolted into TLB1 large page mappings, and we don't use
- * broadcast invalidates, so we should not take a TLB miss here.
- *
- * Later we'll need to deal with faults here. Disallowing guest
- * mappings that are execute-but-not-read could be an option on
- * e500mc, but not on chips with an LRAT if it is used.
- */
-
- mfspr r3, SPRN_EPLC /* will already have correct ELPID and EGS */
PPC_STL r15, VCPU_GPR(R15)(r4)
PPC_STL r16, VCPU_GPR(R16)(r4)
PPC_STL r17, VCPU_GPR(R17)(r4)
PPC_STL r18, VCPU_GPR(R18)(r4)
PPC_STL r19, VCPU_GPR(R19)(r4)
- mr r8, r3
PPC_STL r20, VCPU_GPR(R20)(r4)
- rlwimi r8, r6, EPC_EAS_SHIFT - MSR_IR_LG, EPC_EAS
PPC_STL r21, VCPU_GPR(R21)(r4)
- rlwimi r8, r6, EPC_EPR_SHIFT - MSR_PR_LG, EPC_EPR
PPC_STL r22, VCPU_GPR(R22)(r4)
- rlwimi r8, r10, EPC_EPID_SHIFT, EPC_EPID
PPC_STL r23, VCPU_GPR(R23)(r4)
PPC_STL r24, VCPU_GPR(R24)(r4)
PPC_STL r25, VCPU_GPR(R25)(r4)
@@ -160,10 +136,15 @@
PPC_STL r29, VCPU_GPR(R29)(r4)
PPC_STL r30, VCPU_GPR(R30)(r4)
PPC_STL r31, VCPU_GPR(R31)(r4)
- mtspr SPRN_EPLC, r8
- isync
- lwepx r9, 0, r5
- mtspr SPRN_EPLC, r3
+
+ /*
+ * We don't use external PID support. lwepx faults would need to be
+ * handled by KVM and this implies aditional code in DO_KVM (for
+ * DTB_MISS, DSI and LRAT) to check ESR[EPID] and EPLC[EGS] which
+ * is too intrusive for the host. Get last instuction in
+ * kvmppc_get_last_inst().
+ */
+ li r9, KVM_INST_FETCH_FAILED
stw r9, VCPU_LAST_INST(r4)
.endif
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index 6025cb7..1b4cb41 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -598,9 +598,102 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr,
}
}
+#ifdef CONFIG_KVM_BOOKE_HV
+int kvmppc_ld_inst(struct kvm_vcpu *vcpu, u32 *instr)
+{
+ gva_t geaddr;
+ hpa_t addr;
+ hfn_t pfn;
+ hva_t eaddr;
+ u32 mas0, mas1, mas2, mas3;
+ u64 mas7_mas3;
+ struct page *page;
+ unsigned int addr_space, psize_shift;
+ bool pr;
+ unsigned long flags;
+
+ /* Search TLB for guest pc to get the real address */
+ geaddr = kvmppc_get_pc(vcpu);
+ addr_space = (vcpu->arch.shared->msr & MSR_IS) >> MSR_IR_LG;
+
+ local_irq_save(flags);
+ mtspr(SPRN_MAS6, (vcpu->arch.pid << MAS6_SPID_SHIFT) | addr_space);
+ mtspr(SPRN_MAS5, MAS5_SGS | vcpu->kvm->arch.lpid);
+ isync();
+ asm volatile("tlbsx 0, %[geaddr]\n" : : [geaddr] "r" (geaddr));
+ mtspr(SPRN_MAS5, 0);
+ mtspr(SPRN_MAS8, 0);
+ mas0 = mfspr(SPRN_MAS0);
+ mas1 = mfspr(SPRN_MAS1);
+ mas2 = mfspr(SPRN_MAS2);
+ mas3 = mfspr(SPRN_MAS3);
+ mas7_mas3 = (((u64) mfspr(SPRN_MAS7)) << 32) | mfspr(SPRN_MAS3);
+ local_irq_restore(flags);
+
+ /*
+ * If the TLB entry for guest pc was evicted, return to the guest.
+ * There are high chances to find a valid TLB entry next time.
+ */
+ if (!(mas1 & MAS1_VALID))
+ return EMULATE_AGAIN;
+
+ /*
+ * Another thread may rewrite the TLB entry in parallel, don't
+ * execute from the address if the execute permission is not set
+ */
+ pr = vcpu->arch.shared->msr & MSR_PR;
+ if ((pr && (!(mas3 & MAS3_UX))) || ((!pr) && (!(mas3 & MAS3_SX)))) {
+ kvmppc_core_queue_inst_storage(vcpu, 0);
+ return EMULATE_AGAIN;
+ }
+
+ /*
+ * We will map the real address through a cacheable page, so we will
+ * not support cache-inhibited guest pages. Fortunately emulated
+ * instructions should not live there.
+ */
+ if (mas2 & MAS2_I) {
+ printk(KERN_CRIT "Instuction emulation from cache-inhibited "
+ "guest pages is not supported\n");
+ return EMULATE_FAIL;
+ }
+
+ /* Get page size */
+ if (MAS0_GET_TLBSEL(mas0) == 0)
+ psize_shift = PAGE_SHIFT;
+ else
+ psize_shift = MAS1_GET_TSIZE(mas1) + 10;
+
+ /* Map a page and get guest's instruction */
+ addr = (mas7_mas3 & (~0ULL << psize_shift)) |
+ (geaddr & ((1ULL << psize_shift) - 1ULL));
+ pfn = addr >> PAGE_SHIFT;
+
+ if (unlikely(!pfn_valid(pfn))) {
+ printk(KERN_CRIT "Invalid frame number\n");
+ return EMULATE_FAIL;
+ }
+
+ /* Guard us against emulation from devices area */
+ if (unlikely(!page_is_ram(pfn))) {
+ printk(KERN_CRIT "Instruction emulation from non-RAM host "
+ "pages is not supported\n");
+ return EMULATE_FAIL;
+ }
+
+ page = pfn_to_page(pfn);
+ eaddr = (unsigned long)kmap_atomic(page);
+ eaddr |= addr & ~PAGE_MASK;
+ *instr = *(u32 *)eaddr;
+ kunmap_atomic((u32 *)eaddr);
+
+ return EMULATE_DONE;
+}
+#else
int kvmppc_ld_inst(struct kvm_vcpu *vcpu, u32 *instr) {
return EMULATE_FAIL;
};
+#endif
/************* MMU Notifiers *************/
--
1.7.3.4
^ permalink raw reply related
* [PATCH 2/4] KVM: PPC: Book3e: Add TLBSEL/TSIZE defines for MAS0/1
From: Mihai Caraman @ 2014-02-20 16:30 UTC (permalink / raw)
To: kvm-ppc; +Cc: Mihai Caraman, linuxppc-dev, kvm
In-Reply-To: <1392913821-4520-1-git-send-email-mihai.caraman@freescale.com>
Add mising defines MAS0_GET_TLBSEL() and MAS1_GET_TSIZE() for Book3E.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
---
arch/powerpc/include/asm/mmu-book3e.h | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h
index 936db36..2b23313 100644
--- a/arch/powerpc/include/asm/mmu-book3e.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -40,7 +40,10 @@
/* MAS registers bit definitions */
-#define MAS0_TLBSEL(x) (((x) << 28) & 0x30000000)
+#define MAS0_TLBSEL_MASK 0x30000000
+#define MAS0_TLBSEL_SHIFT 28
+#define MAS0_TLBSEL(x) (((x) << MAS0_TLBSEL_SHIFT) & MAS0_TLBSEL_MASK)
+#define MAS0_GET_TLBSEL(mas0) (((mas0) & MAS0_TLBSEL_MASK) >> MAS0_TLBSEL_SHIFT)
#define MAS0_ESEL_MASK 0x0FFF0000
#define MAS0_ESEL_SHIFT 16
#define MAS0_ESEL(x) (((x) << MAS0_ESEL_SHIFT) & MAS0_ESEL_MASK)
@@ -58,6 +61,7 @@
#define MAS1_TSIZE_MASK 0x00000f80
#define MAS1_TSIZE_SHIFT 7
#define MAS1_TSIZE(x) (((x) << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK)
+#define MAS1_GET_TSIZE(mas1) (((mas1) & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT)
#define MAS2_EPN (~0xFFFUL)
#define MAS2_X0 0x00000040
--
1.7.3.4
^ permalink raw reply related
* [PATCH 1/4] KVM: PPC: e500mc: Revert "add load inst fixup"
From: Mihai Caraman @ 2014-02-20 16:30 UTC (permalink / raw)
To: kvm-ppc; +Cc: Mihai Caraman, linuxppc-dev, kvm
Load external pid (lwepx) execution faults, generated by KVM accessing
guest contexts, needs to be handled by KVM. In the current implementation
the host kernel handles lwepx faults, searching for the faulting address
with its own Logical Partition ID (LPID) context! In case a host
translation is found, the execution returns to the lwepx instruction
instead of the fixup ending up in an infinite loop.
Revert the commit 1d628af7 "add load inst fixup". We will address lwepx
issue in a subsequent patch without the need of fixups.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
---
arch/powerpc/kvm/bookehv_interrupts.S | 26 +-------------------------
1 files changed, 1 insertions(+), 25 deletions(-)
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index e8ed7d6..20c7a54 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -29,7 +29,6 @@
#include <asm/asm-compat.h>
#include <asm/asm-offsets.h>
#include <asm/bitsperlong.h>
-#include <asm/thread_info.h>
#ifdef CONFIG_64BIT
#include <asm/exception-64e.h>
@@ -162,32 +161,9 @@
PPC_STL r30, VCPU_GPR(R30)(r4)
PPC_STL r31, VCPU_GPR(R31)(r4)
mtspr SPRN_EPLC, r8
-
- /* disable preemption, so we are sure we hit the fixup handler */
- CURRENT_THREAD_INFO(r8, r1)
- li r7, 1
- stw r7, TI_PREEMPT(r8)
-
isync
-
- /*
- * In case the read goes wrong, we catch it and write an invalid value
- * in LAST_INST instead.
- */
-1: lwepx r9, 0, r5
-2:
-.section .fixup, "ax"
-3: li r9, KVM_INST_FETCH_FAILED
- b 2b
-.previous
-.section __ex_table,"a"
- PPC_LONG_ALIGN
- PPC_LONG 1b,3b
-.previous
-
+ lwepx r9, 0, r5
mtspr SPRN_EPLC, r3
- li r7, 0
- stw r7, TI_PREEMPT(r8)
stw r9, VCPU_LAST_INST(r4)
.endif
--
1.7.3.4
^ permalink raw reply related
* [PATCH 3/4] KVM: PPC: Alow kvmppc_get_last_inst() to fail
From: Mihai Caraman @ 2014-02-20 16:30 UTC (permalink / raw)
To: kvm-ppc; +Cc: Mihai Caraman, linuxppc-dev, kvm
In-Reply-To: <1392913821-4520-1-git-send-email-mihai.caraman@freescale.com>
On booke3e we got the last instruction on the exist path, using
load external pid (lwepx) dedicated instruction. The current
implementation proved to be buggy, and the alternative, to hook
lwepx exceptions into KVM, is considered too intrusive for host.
In the proposed solution we gets the instruction by mapping the
memory in the host, which requires to locate the guest TLB entry.
This may fail if the guest TLB entry gets evicted. In the failure
case we will force a TLB update, by reexecuting the guest instruction
which generates a guest TLB miss exception.
Alex G. suggested to get the last instruction on kvmppc_get_last_inst()
call and to handle the TLB seach miss on its call chain. This patch
allows the function to fail, by returning an emulation_result error code,
and handles the EMULATE_AGAIN error code in the emulation layer
(leading to guest instruction reexecution).
Emulation_result common structure is not accesible from specific
booke headers, so this patch moves kvmppc_get_last_inst() definitions
to booke3 source files.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
Please sanity check Book3S changes, I did the integration blindly.
---
arch/powerpc/include/asm/kvm_book3s.h | 29 ----------------------------
arch/powerpc/include/asm/kvm_booke.h | 5 ----
arch/powerpc/include/asm/kvm_ppc.h | 2 +
arch/powerpc/kvm/book3s.c | 31 ++++++++++++++++++++++++++++++
arch/powerpc/kvm/book3s_paired_singles.c | 29 ++++++++++++++++-----------
arch/powerpc/kvm/book3s_pr.c | 27 +++++++++++++++++--------
arch/powerpc/kvm/booke.c | 16 ++++++++++++++-
arch/powerpc/kvm/booke.h | 5 ++++
arch/powerpc/kvm/e500_mmu_host.c | 5 ++++
arch/powerpc/kvm/emulate.c | 19 ++++++++++++-----
arch/powerpc/kvm/powerpc.c | 10 +++++++-
11 files changed, 114 insertions(+), 64 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index bc23b1b..6048eea 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -271,35 +271,6 @@ static inline ulong kvmppc_get_pc(struct kvm_vcpu *vcpu)
return vcpu->arch.pc;
}
-static inline u32 kvmppc_get_last_inst(struct kvm_vcpu *vcpu)
-{
- ulong pc = kvmppc_get_pc(vcpu);
-
- /* Load the instruction manually if it failed to do so in the
- * exit path */
- if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
- kvmppc_ld(vcpu, &pc, sizeof(u32), &vcpu->arch.last_inst, false);
-
- return vcpu->arch.last_inst;
-}
-
-/*
- * Like kvmppc_get_last_inst(), but for fetching a sc instruction.
- * Because the sc instruction sets SRR0 to point to the following
- * instruction, we have to fetch from pc - 4.
- */
-static inline u32 kvmppc_get_last_sc(struct kvm_vcpu *vcpu)
-{
- ulong pc = kvmppc_get_pc(vcpu) - 4;
-
- /* Load the instruction manually if it failed to do so in the
- * exit path */
- if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
- kvmppc_ld(vcpu, &pc, sizeof(u32), &vcpu->arch.last_inst, false);
-
- return vcpu->arch.last_inst;
-}
-
static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu)
{
return vcpu->arch.fault_dar;
diff --git a/arch/powerpc/include/asm/kvm_booke.h b/arch/powerpc/include/asm/kvm_booke.h
index dd8f615..7a85a69 100644
--- a/arch/powerpc/include/asm/kvm_booke.h
+++ b/arch/powerpc/include/asm/kvm_booke.h
@@ -63,11 +63,6 @@ static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu)
return vcpu->arch.xer;
}
-static inline u32 kvmppc_get_last_inst(struct kvm_vcpu *vcpu)
-{
- return vcpu->arch.last_inst;
-}
-
static inline void kvmppc_set_ctr(struct kvm_vcpu *vcpu, ulong val)
{
vcpu->arch.ctr = val;
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index c8317fb..bc0cd21 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -71,6 +71,8 @@ extern int kvmppc_sanity_check(struct kvm_vcpu *vcpu);
extern int kvmppc_subarch_vcpu_init(struct kvm_vcpu *vcpu);
extern void kvmppc_subarch_vcpu_uninit(struct kvm_vcpu *vcpu);
+extern int kvmppc_get_last_inst(struct kvm_vcpu *vcpu, u32 *inst);
+
/* Core-specific hooks */
extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr,
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 8912608..a86f7a4 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -461,6 +461,37 @@ mmio:
}
EXPORT_SYMBOL_GPL(kvmppc_ld);
+int kvmppc_get_last_inst(struct kvm_vcpu *vcpu, u32 *inst)
+{
+ ulong pc = kvmppc_get_pc(vcpu);
+
+ /* Load the instruction manually if it failed to do so in the
+ * exit path */
+ if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
+ kvmppc_ld(vcpu, &pc, sizeof(u32), &vcpu->arch.last_inst, false);
+ *inst = vcpu->arch.last_inst;
+
+ return EMULATE_DONE;
+}
+
+/*
+ * Like kvmppc_get_last_inst(), but for fetching a sc instruction.
+ * Because the sc instruction sets SRR0 to point to the following
+ * instruction, we have to fetch from pc - 4.
+ */
+int kvmppc_get_last_sc(struct kvm_vcpu *vcpu, u32 *inst)
+{
+ ulong pc = kvmppc_get_pc(vcpu) - 4;
+
+ /* Load the instruction manually if it failed to do so in the
+ * exit path */
+ if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
+ kvmppc_ld(vcpu, &pc, sizeof(u32), &vcpu->arch.last_inst, false);
+ *inst = vcpu->arch.last_inst;
+
+ return EMULATE_DONE;
+}
+
int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
{
return 0;
diff --git a/arch/powerpc/kvm/book3s_paired_singles.c b/arch/powerpc/kvm/book3s_paired_singles.c
index a59a25a..80c533e 100644
--- a/arch/powerpc/kvm/book3s_paired_singles.c
+++ b/arch/powerpc/kvm/book3s_paired_singles.c
@@ -640,19 +640,24 @@ static int kvmppc_ps_one_in(struct kvm_vcpu *vcpu, bool rc,
int kvmppc_emulate_paired_single(struct kvm_run *run, struct kvm_vcpu *vcpu)
{
- u32 inst = kvmppc_get_last_inst(vcpu);
+ u32 inst;
enum emulation_result emulated = EMULATE_DONE;
-
- int ax_rd = inst_get_field(inst, 6, 10);
- int ax_ra = inst_get_field(inst, 11, 15);
- int ax_rb = inst_get_field(inst, 16, 20);
- int ax_rc = inst_get_field(inst, 21, 25);
- short full_d = inst_get_field(inst, 16, 31);
-
- u64 *fpr_d = &vcpu->arch.fpr[ax_rd];
- u64 *fpr_a = &vcpu->arch.fpr[ax_ra];
- u64 *fpr_b = &vcpu->arch.fpr[ax_rb];
- u64 *fpr_c = &vcpu->arch.fpr[ax_rc];
+ int ax_rd, ax_ra, ax_rb, ax_rc;
+ short full_d;
+ u64 *fpr_d, *fpr_a, *fpr_b, *fpr_c;
+
+ kvmppc_get_last_inst(vcpu, &inst);
+
+ ax_rd = inst_get_field(inst, 6, 10);
+ ax_ra = inst_get_field(inst, 11, 15);
+ ax_rb = inst_get_field(inst, 16, 20);
+ ax_rc = inst_get_field(inst, 21, 25);
+ full_d = inst_get_field(inst, 16, 31);
+
+ fpr_d = &vcpu->arch.fpr[ax_rd];
+ fpr_a = &vcpu->arch.fpr[ax_ra];
+ fpr_b = &vcpu->arch.fpr[ax_rb];
+ fpr_c = &vcpu->arch.fpr[ax_rc];
bool rcomp = (inst & 1) ? true : false;
u32 cr = kvmppc_get_cr(vcpu);
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 5b9e906..b0d884d 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -624,9 +624,10 @@ void kvmppc_giveup_ext(struct kvm_vcpu *vcpu, ulong msr)
static int kvmppc_read_inst(struct kvm_vcpu *vcpu)
{
ulong srr0 = kvmppc_get_pc(vcpu);
- u32 last_inst = kvmppc_get_last_inst(vcpu);
+ u32 last_inst;
int ret;
+ kvmppc_get_last_inst(vcpu, &last_inst);
ret = kvmppc_ld(vcpu, &srr0, sizeof(u32), &last_inst, false);
if (ret == -ENOENT) {
ulong msr = vcpu->arch.shared->msr;
@@ -890,15 +891,17 @@ int kvmppc_handle_exit_pr(struct kvm_run *run, struct kvm_vcpu *vcpu,
{
enum emulation_result er;
ulong flags;
+ u32 last_inst;
program_interrupt:
flags = vcpu->arch.shadow_srr1 & 0x1f0000ull;
+ kvmppc_get_last_inst(vcpu, &last_inst);
if (vcpu->arch.shared->msr & MSR_PR) {
#ifdef EXIT_DEBUG
- printk(KERN_INFO "Userspace triggered 0x700 exception at 0x%lx (0x%x)\n", kvmppc_get_pc(vcpu), kvmppc_get_last_inst(vcpu));
+ printk(KERN_INFO "Userspace triggered 0x700 exception at 0x%lx (0x%x)\n", kvmppc_get_pc(vcpu), last_inst);
#endif
- if ((kvmppc_get_last_inst(vcpu) & 0xff0007ff) !=
+ if ((last_inst & 0xff0007ff) !=
(INS_DCBZ & 0xfffffff7)) {
kvmppc_core_queue_program(vcpu, flags);
r = RESUME_GUEST;
@@ -917,7 +920,7 @@ program_interrupt:
break;
case EMULATE_FAIL:
printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n",
- __func__, kvmppc_get_pc(vcpu), kvmppc_get_last_inst(vcpu));
+ __func__, kvmppc_get_pc(vcpu), last_inst);
kvmppc_core_queue_program(vcpu, flags);
r = RESUME_GUEST;
break;
@@ -934,8 +937,11 @@ program_interrupt:
break;
}
case BOOK3S_INTERRUPT_SYSCALL:
+ {
+ u32 last_sc;
+ kvmppc_get_last_sc(vcpu, &last_sc);
if (vcpu->arch.papr_enabled &&
- (kvmppc_get_last_sc(vcpu) == 0x44000022) &&
+ (last_sc == 0x44000022) &&
!(vcpu->arch.shared->msr & MSR_PR)) {
/* SC 1 papr hypercalls */
ulong cmd = kvmppc_get_gpr(vcpu, 3);
@@ -980,6 +986,7 @@ program_interrupt:
r = RESUME_GUEST;
}
break;
+ }
case BOOK3S_INTERRUPT_FP_UNAVAIL:
case BOOK3S_INTERRUPT_ALTIVEC:
case BOOK3S_INTERRUPT_VSX:
@@ -1008,15 +1015,17 @@ program_interrupt:
break;
}
case BOOK3S_INTERRUPT_ALIGNMENT:
+ {
+ u32 last_inst;
+ kvmppc_get_last_inst(vcpu, &last_inst);
if (kvmppc_read_inst(vcpu) == EMULATE_DONE) {
- vcpu->arch.shared->dsisr = kvmppc_alignment_dsisr(vcpu,
- kvmppc_get_last_inst(vcpu));
- vcpu->arch.shared->dar = kvmppc_alignment_dar(vcpu,
- kvmppc_get_last_inst(vcpu));
+ vcpu->arch.shared->dsisr = kvmppc_alignment_dsisr(vcpu, last_inst);
+ vcpu->arch.shared->dar = kvmppc_alignment_dar(vcpu, last_inst);
kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
}
r = RESUME_GUEST;
break;
+ }
case BOOK3S_INTERRUPT_MACHINE_CHECK:
case BOOK3S_INTERRUPT_TRACE:
kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 0591e05..886e511 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -201,7 +201,7 @@ static void kvmppc_core_queue_data_storage(struct kvm_vcpu *vcpu,
kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DATA_STORAGE);
}
-static void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu,
+void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu,
ulong esr_flags)
{
vcpu->arch.queued_esr = esr_flags;
@@ -772,6 +772,9 @@ static int emulation_exit(struct kvm_run *run, struct kvm_vcpu *vcpu)
* they were actually modified by emulation. */
return RESUME_GUEST_NV;
+ case EMULATE_AGAIN:
+ return RESUME_GUEST;
+
case EMULATE_DO_DCR:
run->exit_reason = KVM_EXIT_DCR;
return RESUME_HOST;
@@ -1943,6 +1946,17 @@ void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu)
vcpu->kvm->arch.kvm_ops->vcpu_put(vcpu);
}
+int kvmppc_get_last_inst(struct kvm_vcpu *vcpu, u32 *inst)
+{
+ int result = EMULATE_DONE;
+
+ if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
+ result = kvmppc_ld_inst(vcpu, &vcpu->arch.last_inst);
+ *inst = vcpu->arch.last_inst;
+
+ return result;
+}
+
int __init kvmppc_booke_init(void)
{
#ifndef CONFIG_KVM_BOOKE_HV
diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
index 09bfd9b..c7c60c2 100644
--- a/arch/powerpc/kvm/booke.h
+++ b/arch/powerpc/kvm/booke.h
@@ -90,6 +90,9 @@ void kvmppc_vcpu_disable_spe(struct kvm_vcpu *vcpu);
void kvmppc_booke_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
void kvmppc_booke_vcpu_put(struct kvm_vcpu *vcpu);
+void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu,
+ ulong esr_flags);
+
enum int_class {
INT_CLASS_NONCRIT,
INT_CLASS_CRIT,
@@ -123,6 +126,8 @@ extern int kvmppc_core_emulate_mtspr_e500(struct kvm_vcpu *vcpu, int sprn,
extern int kvmppc_core_emulate_mfspr_e500(struct kvm_vcpu *vcpu, int sprn,
ulong *spr_val);
+extern int kvmppc_ld_inst(struct kvm_vcpu *vcpu, u32 *instr) ;
+
/*
* Load up guest vcpu FP state if it's needed.
* It also set the MSR_FP in thread so that host know
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index ecf2247..6025cb7 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -34,6 +34,7 @@
#include "e500.h"
#include "timing.h"
#include "e500_mmu_host.h"
+#include "booke.h"
#include "trace_booke.h"
@@ -597,6 +598,10 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr,
}
}
+int kvmppc_ld_inst(struct kvm_vcpu *vcpu, u32 *instr) {
+ return EMULATE_FAIL;
+};
+
/************* MMU Notifiers *************/
int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 2f9a087..24a8e50 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -225,19 +225,26 @@ static int kvmppc_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
* from opcode tables in the future. */
int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
{
- u32 inst = kvmppc_get_last_inst(vcpu);
- int ra = get_ra(inst);
- int rs = get_rs(inst);
- int rt = get_rt(inst);
- int sprn = get_sprn(inst);
- enum emulation_result emulated = EMULATE_DONE;
+ u32 inst;
+ int ra, rs, rt, sprn;
+ enum emulation_result emulated;
int advance = 1;
/* this default type might be overwritten by subcategories */
kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
+ emulated = kvmppc_get_last_inst(vcpu, &inst);
+ if (emulated != EMULATE_DONE) {
+ return emulated;
+ }
+
pr_debug("Emulating opcode %d / %d\n", get_op(inst), get_xop(inst));
+ ra = get_ra(inst);
+ rs = get_rs(inst);
+ rt = get_rt(inst);
+ sprn = get_sprn(inst);
+
switch (get_op(inst)) {
case OP_TRAP:
#ifdef CONFIG_PPC_BOOK3S
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 9ae9768..b611a5d 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -228,6 +228,9 @@ int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
* actually modified. */
r = RESUME_GUEST_NV;
break;
+ case EMULATE_AGAIN:
+ r = RESUME_GUEST;
+ break;
case EMULATE_DO_MMIO:
run->exit_reason = KVM_EXIT_MMIO;
/* We must reload nonvolatiles because "update" load/store
@@ -237,11 +240,14 @@ int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
r = RESUME_HOST_NV;
break;
case EMULATE_FAIL:
+ {
+ u32 last_inst;
+ kvmppc_get_last_inst(vcpu, &last_inst);
/* XXX Deliver Program interrupt to guest. */
- printk(KERN_EMERG "%s: emulation failed (%08x)\n", __func__,
- kvmppc_get_last_inst(vcpu));
+ printk(KERN_EMERG "%s: emulation failed (%08x)\n", __func__, last_inst);
r = RESUME_HOST;
break;
+ }
default:
WARN_ON(1);
r = RESUME_GUEST;
--
1.7.3.4
^ permalink raw reply related
* Re: [PATCH 1/3] mm: return NUMA_NO_NODE in local_memory_node if zonelists are not setup
From: Christoph Lameter @ 2014-02-20 16:05 UTC (permalink / raw)
To: Nishanth Aravamudan
Cc: Michal Hocko, linux-mm, Mel Gorman, David Rientjes, Joonsoo Kim,
linuxppc-dev, Anton Blanchard
In-Reply-To: <20140219231714.GB413@linux.vnet.ibm.com>
On Wed, 19 Feb 2014, Nishanth Aravamudan wrote:
> We can call local_memory_node() before the zonelists are setup. In that
> case, first_zones_zonelist() will not set zone and the reference to
> zone->node will Oops. Catch this case, and, since we presumably running
> very early, just return that any node will do.
Really? Isnt there some way to avoid this call if zonelists are not setup
yet?
^ permalink raw reply
* Re: [RFC PATCH 2/3] topology: support node_numa_mem() for determining the fallback node
From: Christoph Lameter @ 2014-02-20 16:02 UTC (permalink / raw)
To: David Rientjes
Cc: Han Pingtian, Nishanth Aravamudan, Pekka Enberg,
Linux Memory Management List, Paul Mackerras, Anton Blanchard,
Matt Mackall, Joonsoo Kim, linuxppc-dev, Wanpeng Li
In-Reply-To: <alpine.DEB.2.02.1402191404030.31921@chino.kir.corp.google.com>
On Wed, 19 Feb 2014, David Rientjes wrote:
> On Tue, 18 Feb 2014, Christoph Lameter wrote:
>
> > Its an optimization to avoid calling the page allocator to figure out if
> > there is memory available on a particular node.
> Thus this patch breaks with memory hot-add for a memoryless node.
As soon as the per cpu slab is exhausted the node number of the so far
"empty" node will be used for allocation. That will be sucessfull and the
node will no longer be marked as empty.
^ permalink raw reply
* Re: [PATCH v2] powerpc: select MEMORY for FSL_IFC to not break existing .config files
From: Paul Gortmaker @ 2014-02-20 14:40 UTC (permalink / raw)
To: Prabhakar Kushwaha, Greg Kroah-Hartman
Cc: Arnd Bergmann, linux-next, linux-mtd, Scott Wood, Paul Mackerras,
linuxppc-dev, David Woodhouse
In-Reply-To: <53059B47.8000103@freescale.com>
On 14-02-20 01:05 AM, Prabhakar Kushwaha wrote:
>
> On 2/20/2014 4:16 AM, Paul Gortmaker wrote:
>> commit d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc ("driver/memory:Move
>> Freescale IFC driver to a common driver") introduces this build
>> regression into the mpc85xx_defconfig:
>>
>> drivers/built-in.o: In function `fsl_ifc_nand_remove':
>> drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
>> drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
>> drivers/built-in.o: In function `fsl_ifc_nand_probe':
>> drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
>> drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
>> drivers/built-in.o: In function `match_bank':
>> drivers/mtd/nand/fsl_ifc_nand.c:1013: undefined reference to `convert_ifc_address'
>> drivers/built-in.o: In function `fsl_ifc_nand_probe':
>> drivers/mtd/nand/fsl_ifc_nand.c:1059: undefined reference to `fsl_ifc_ctrl_dev'
>> drivers/mtd/nand/fsl_ifc_nand.c:1080: undefined reference to `fsl_ifc_ctrl_dev'
>> drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
>> drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
>> make: *** [vmlinux] Error 1
>>
>> This happens because there is nothing to descend us into the
>> drivers/memory directory in the mpc85xx_defconfig. It wasn't
>> selecting CONFIG_MEMORY. So we never built drivers/memory/fsl_ifc.o
>> and so we have nothing to link the above symbols against.
>>
>> Since the goal of the original commit was to relocate the driver to
>> an arch independent location, it only makes sense to relocate the
>> Kconfig setting there as well. But that alone won't fix the build
>> failure; for that we ensure whoever selects FSL_IFC also selects MEMORY.
>>
>> Cc: Prabhakar Kushwaha <prabhakar@freescale.com>
>> Cc: Scott Wood <scottwood@freescale.com>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: David Woodhouse <dwmw2@infradead.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> ---
>>
>> [v2: fix the mislocated FSL_IFC as per Scott's comment. It still
>> probably makes sense to go in via Greg's char-misc/char-misc-next
>> (vs. powerpc-next) since that is where the regression was introduced.]
>>
>> arch/powerpc/Kconfig | 4 ----
>> drivers/memory/Kconfig | 4 ++++
>> drivers/mtd/nand/Kconfig | 1 +
>> 3 files changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 957bf344c0f5..b9fcecc706ab 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -736,10 +736,6 @@ config FSL_LBC
>> controller. Also contains some common code used by
>> drivers for specific local bus peripherals.
>>
>> -config FSL_IFC
>> - bool
>> - depends on FSL_SOC
>> -
>> config FSL_GTM
>> bool
>> depends on PPC_83xx || QUICC_ENGINE || CPM2
>> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
>> index 29a11db365bc..a3640fe9852f 100644
>> --- a/drivers/memory/Kconfig
>> +++ b/drivers/memory/Kconfig
>> @@ -50,4 +50,8 @@ config TEGRA30_MC
>> analysis, especially for IOMMU/SMMU(System Memory Management
>> Unit) module.
>>
>> +config FSL_IFC
>> + bool
>> + depends on FSL_SOC
>> +
>> endif
>> diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
>> index 90ff447bf043..a4bee41ad5cb 100644
>> --- a/drivers/mtd/nand/Kconfig
>> +++ b/drivers/mtd/nand/Kconfig
>> @@ -428,6 +428,7 @@ config MTD_NAND_FSL_IFC
>> tristate "NAND support for Freescale IFC controller"
>> depends on MTD_NAND && FSL_SOC
>> select FSL_IFC
>> + select MEMORY
>> help
>> Various Freescale chips e.g P1010, include a NAND Flash machine
>> with built-in hardware ECC capabilities.
>
> Hi All,
>
> I am not sure which version of patch is being picked here.
>
> Latest version is v8 and it is a "patch set" and it do enable
> CONFIG_MEMORY in powerpc/configs
It really doesn't matter what the latest version is, if the
maintainer has already taken an earlier version and merged it.
In that case one needs to work with the maintainer to determine
whether they want a new version, or a delta/fixup commit on the
old one.
>
> 1. driver/memory:Move Freescale IFC driver to a common driver
> http://patchwork.ozlabs.org/patch/315531/
So, this has the Kconfig move part, but the one currently in
char-misc does not. And it still needs the "select".
>
> 2. powerpc/config: Enable memory driver
> http://patchwork.ozlabs.org/patch/315532/
Updating the defconfigs is fine, but incomplete in itself. You
still need the IFC users to select MEMORY, otherwise you still
introduce build failures for anyone else who chooses IFC but
does not choose MEMORY.
In short, the char-misc tree still needs the v2 patch above.
Paul.
--
>
> Regards,
> Prabhakar
>
>
>
>
>
^ permalink raw reply
* [PATCH] powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly
From: Tony Breeds @ 2014-02-20 10:13 UTC (permalink / raw)
To: Benjamin Herrenschmidt, LinuxPPC-dev
Currently we're storing a host endian RTAS token in
rtas_stop_self_args.token. We then pass that directly to rtas. This is
fine on big endian however on little endian the token is not what we
expect.
This will typically result in hitting:
panic("Alas, I survived.\n");
To fix this we always use the stop-self token in host order and always
convert it to be32 before passing this to rtas.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Cc: stable@vger.kernel.org
---
arch/powerpc/platforms/pseries/hotplug-cpu.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 82789e7..0ea99e3 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -35,12 +35,7 @@
#include "offline_states.h"
/* This version can't take the spinlock, because it never returns */
-static struct rtas_args rtas_stop_self_args = {
- .token = RTAS_UNKNOWN_SERVICE,
- .nargs = 0,
- .nret = 1,
- .rets = &rtas_stop_self_args.args[0],
-};
+static int rtas_stop_self_token = RTAS_UNKNOWN_SERVICE;
static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) =
CPU_STATE_OFFLINE;
@@ -93,15 +88,20 @@ void set_default_offline_state(int cpu)
static void rtas_stop_self(void)
{
- struct rtas_args *args = &rtas_stop_self_args;
+ struct rtas_args args = {
+ .token = cpu_to_be32(rtas_stop_self_token),
+ .nargs = 0,
+ .nret = 1,
+ .rets = &args.args[0],
+ };
local_irq_disable();
- BUG_ON(args->token == RTAS_UNKNOWN_SERVICE);
+ BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE);
printk("cpu %u (hwid %u) Ready to die...\n",
smp_processor_id(), hard_smp_processor_id());
- enter_rtas(__pa(args));
+ enter_rtas(__pa(&args));
panic("Alas, I survived.\n");
}
@@ -392,10 +392,10 @@ static int __init pseries_cpu_hotplug_init(void)
}
}
- rtas_stop_self_args.token = rtas_token("stop-self");
+ rtas_stop_self_token = rtas_token("stop-self");
qcss_tok = rtas_token("query-cpu-stopped-state");
- if (rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE ||
+ if (rtas_stop_self_token == RTAS_UNKNOWN_SERVICE ||
qcss_tok == RTAS_UNKNOWN_SERVICE) {
printk(KERN_INFO "CPU Hotplug not supported by firmware "
"- disabling.\n");
--
1.8.1.4
^ permalink raw reply related
* Re: ppc: RECLAIM_DISTANCE 10?
From: Michal Hocko @ 2014-02-20 9:55 UTC (permalink / raw)
To: Nishanth Aravamudan
Cc: linux-mm, linuxppc-dev, Anton Blanchard, LKML, David Rientjes
In-Reply-To: <20140219163345.GD27108@linux.vnet.ibm.com>
On Wed 19-02-14 08:33:45, Nishanth Aravamudan wrote:
> On 19.02.2014 [08:24:38 -0800], Nishanth Aravamudan wrote:
> > On 18.02.2014 [17:43:38 -0800], David Rientjes wrote:
> > > On Tue, 18 Feb 2014, Nishanth Aravamudan wrote:
> > >
> > > > How about the following?
> > > >
> > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > > > index 5de4337..1a0eced 100644
> > > > --- a/mm/page_alloc.c
> > > > +++ b/mm/page_alloc.c
> > > > @@ -1854,7 +1854,8 @@ static void __paginginit init_zone_allows_reclaim(int nid)
> > > > int i;
> > > >
> > > > for_each_online_node(i)
> > > > - if (node_distance(nid, i) <= RECLAIM_DISTANCE)
> > > > + if (node_distance(nid, i) <= RECLAIM_DISTANCE ||
> > > > + !NODE_DATA(i)->node_present_pages)
> > > > node_set(i, NODE_DATA(nid)->reclaim_nodes);
> > > > else
> > > > zone_reclaim_mode = 1;
> > >
> > > [ I changed the above from NODE_DATA(nid) -> NODE_DATA(i) as you caught
> > > so we're looking at the right code. ]
> > >
> > > That can't be right, it would allow reclaiming from a memoryless node. I
> > > think what you want is
> >
> > Gah, you're right.
> >
> > > for_each_online_node(i) {
> > > if (!node_present_pages(i))
> > > continue;
> > > if (node_distance(nid, i) <= RECLAIM_DISTANCE) {
> > > node_set(i, NODE_DATA(nid)->reclaim_nodes);
> > > continue;
> > > }
> > > /* Always try to reclaim locally */
> > > zone_reclaim_mode = 1;
> > > }
> > >
> > > but we really should be able to do for_each_node_state(i, N_MEMORY) here
> > > and memoryless nodes should already be excluded from that mask.
> >
> > Yep, I found that afterwards, which simplifies the logic. I'll add this
> > to my series :)
>
> In looking at the code, I am wondering about the following:
>
> init_zone_allows_reclaim() is called for each nid from
> free_area_init_node(). Which means that calculate_node_totalpages for
> other "later" nids and check_for_memory() [which sets up the N_MEMORY
> nodemask] hasn't been called yet.
>
> So, would it make sense to pull up the
> /* Any memory on that node */
> if (pgdat->node_present_pages)
> node_set_state(nid, N_MEMORY);
> check_for_memory(pgdat, nid);
> into free_area_init_node()?
Dunno, but it shouldn't be needed because nodes are set N_MEMORY earlier
in early_calculate_totalpages as mentioned in other email.
--
Michal Hocko
SUSE Labs
^ permalink raw reply
* Re: [PATCH v2] powerpc: select MEMORY for FSL_IFC to not break existing .config files
From: Prabhakar Kushwaha @ 2014-02-20 6:05 UTC (permalink / raw)
To: Paul Gortmaker, Greg Kroah-Hartman
Cc: Arnd Bergmann, linux-next, linux-mtd, Scott Wood, Paul Mackerras,
linuxppc-dev, David Woodhouse
In-Reply-To: <1392850000-4601-1-git-send-email-paul.gortmaker@windriver.com>
On 2/20/2014 4:16 AM, Paul Gortmaker wrote:
> commit d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc ("driver/memory:Move
> Freescale IFC driver to a common driver") introduces this build
> regression into the mpc85xx_defconfig:
>
> drivers/built-in.o: In function `fsl_ifc_nand_remove':
> drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
> drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
> drivers/built-in.o: In function `fsl_ifc_nand_probe':
> drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
> drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
> drivers/built-in.o: In function `match_bank':
> drivers/mtd/nand/fsl_ifc_nand.c:1013: undefined reference to `convert_ifc_address'
> drivers/built-in.o: In function `fsl_ifc_nand_probe':
> drivers/mtd/nand/fsl_ifc_nand.c:1059: undefined reference to `fsl_ifc_ctrl_dev'
> drivers/mtd/nand/fsl_ifc_nand.c:1080: undefined reference to `fsl_ifc_ctrl_dev'
> drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
> drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
> make: *** [vmlinux] Error 1
>
> This happens because there is nothing to descend us into the
> drivers/memory directory in the mpc85xx_defconfig. It wasn't
> selecting CONFIG_MEMORY. So we never built drivers/memory/fsl_ifc.o
> and so we have nothing to link the above symbols against.
>
> Since the goal of the original commit was to relocate the driver to
> an arch independent location, it only makes sense to relocate the
> Kconfig setting there as well. But that alone won't fix the build
> failure; for that we ensure whoever selects FSL_IFC also selects MEMORY.
>
> Cc: Prabhakar Kushwaha <prabhakar@freescale.com>
> Cc: Scott Wood <scottwood@freescale.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> [v2: fix the mislocated FSL_IFC as per Scott's comment. It still
> probably makes sense to go in via Greg's char-misc/char-misc-next
> (vs. powerpc-next) since that is where the regression was introduced.]
>
> arch/powerpc/Kconfig | 4 ----
> drivers/memory/Kconfig | 4 ++++
> drivers/mtd/nand/Kconfig | 1 +
> 3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 957bf344c0f5..b9fcecc706ab 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -736,10 +736,6 @@ config FSL_LBC
> controller. Also contains some common code used by
> drivers for specific local bus peripherals.
>
> -config FSL_IFC
> - bool
> - depends on FSL_SOC
> -
> config FSL_GTM
> bool
> depends on PPC_83xx || QUICC_ENGINE || CPM2
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index 29a11db365bc..a3640fe9852f 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -50,4 +50,8 @@ config TEGRA30_MC
> analysis, especially for IOMMU/SMMU(System Memory Management
> Unit) module.
>
> +config FSL_IFC
> + bool
> + depends on FSL_SOC
> +
> endif
> diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
> index 90ff447bf043..a4bee41ad5cb 100644
> --- a/drivers/mtd/nand/Kconfig
> +++ b/drivers/mtd/nand/Kconfig
> @@ -428,6 +428,7 @@ config MTD_NAND_FSL_IFC
> tristate "NAND support for Freescale IFC controller"
> depends on MTD_NAND && FSL_SOC
> select FSL_IFC
> + select MEMORY
> help
> Various Freescale chips e.g P1010, include a NAND Flash machine
> with built-in hardware ECC capabilities.
Hi All,
I am not sure which version of patch is being picked here.
Latest version is v8 and it is a "patch set" and it do enable
CONFIG_MEMORY in powerpc/configs
1. driver/memory:Move Freescale IFC driver to a common driver
http://patchwork.ozlabs.org/patch/315531/
2. powerpc/config: Enable memory driver
http://patchwork.ozlabs.org/patch/315532/
Regards,
Prabhakar
^ permalink raw reply
* Question about EHCI on P4080
From: Ruchika @ 2014-02-20 5:55 UTC (permalink / raw)
To: linuxppc-dev
Hi,
I've been trying to understand why the uboot code is unable to work with
USB1.1 devices.
On a USB analyzer:
I notice on an analyzer that there are no SOF or IN tokens seen on the
bus at all. The only after the very first setup packet is sent and ACK'd.
The board has a hub chip on it connected to the USB controller via a
Ulpi interface.
Uboot debug indicates that the transfer times out and was still "Active"
The kernel code indicates that a companion driver handles 1.1 devices.
Does this mean there are 2 HCD's, one for HS and one for FS/LS in the
kernel ?
Thank you
ruchika
^ permalink raw reply
* Re: [PATCH] of: give priority to the compatible match in __of_match_node()
From: Stephen N Chivers @ 2014-02-20 2:05 UTC (permalink / raw)
To: Grant Likely
Cc: Chris Proctor, Kevin Hao, Arnd Bergmann,
devicetree@vger.kernel.org, Stephen N Chivers, Paul Gortmaker,
Rob Herring, Rob Herring, Scott Wood, linuxppc-dev,
Sebastian Hesselbarth
In-Reply-To: <20140219204134.E4A2DC4088D@trevor.secretlab.ca>
Grant Likely <glikely@secretlab.ca> wrote on 02/20/2014 07:41:34 AM:
> From: Grant Likely <grant.likely@linaro.org>
> To: Paul Gortmaker <paul.gortmaker@windriver.com>, Rob Herring
> <robherring2@gmail.com>
> Cc: Kevin Hao <haokexin@gmail.com>, "devicetree@vger.kernel.org"
> <devicetree@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de>, Chris
> Proctor <cproctor@csc.com.au>, Stephen N Chivers
> <schivers@csc.com.au>, Rob Herring <robh+dt@kernel.org>, Scott Wood
> <scottwood@freescale.com>, linuxppc-dev <linuxppc-
> dev@lists.ozlabs.org>, Sebastian Hesselbarth
<sebastian.hesselbarth@gmail.com>
> Date: 02/20/2014 07:41 AM
> Subject: Re: [PATCH] of: give priority to the compatible match in
> __of_match_node()
> Sent by: Grant Likely <glikely@secretlab.ca>
>
> On Wed, 19 Feb 2014 13:25:54 -0500, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > On Thu, Feb 13, 2014 at 2:01 PM, Rob Herring <robherring2@gmail.com>
wrote:
> > > On Wed, Feb 12, 2014 at 5:38 AM, Kevin Hao <haokexin@gmail.com>
wrote:
> > >> When the device node do have a compatible property, we definitely
> > >> prefer the compatible match besides the type and name. Only if
> > >> there is no such a match, we then consider the candidate which
> > >> doesn't have compatible entry but do match the type or name with
> > >> the device node.
> > >>
> > >> This is based on a patch from Sebastian Hesselbarth.
> > >> http://patchwork.ozlabs.org/patch/319434/
> > >>
> > >> I did some code refactoring and also fixed a bug in the original
patch.
> > >
> > > I'm inclined to just revert this once again and avoid possibly
> > > breaking yet another platform.
> >
> > Well, for what it is worth, today's (Feb19th) linux-next tree fails to
boot
> > on my sbc8548. It fails with:
>
> I think I've got it fixed now with the latest series. Please try the
> devicetree/merge branch on git://git.secretlab.ca/git/linux
I have tested this with the following platforms: MVME5100, MVME4100,
SAM440EP and MPC8349MITXGP. All boot and reach the login state on the
serial console.
The MVME4100 is a MPC8548 platform like the SBC8548 and
suffered from the same PHY address is too large problem
when used with todays linux-next.
Tested-by: Stephen Chivers <schivers@csc.com>
>
> g.
>
> > -----------------------------------------------
> > libphy: Freescale PowerQUICC MII Bus: probed
> > mdio_bus ethernet@e002400: /soc8548@e0000000/ethernet@24000/mdio@520
> > PHY address 1312 is too large
> > libphy: Freescale PowerQUICC MII Bus: probed
> > libphy: Freescale PowerQUICC MII Bus: probed
> > mdio_bus ethernet@e002500: /soc8548@e0000000/ethernet@25000/mdio@520
> > PHY address 1312 is too large
> > libphy: Freescale PowerQUICC MII Bus: probed
> > TCP: cubic registered
> > Initializing XFRM netlink socket
> > NET: Registered protocol family 17
> > <fail nfs mount>
> > -----------------------------------------------
> >
> > On a normal boot, we should see this:
> > -----------------------------------------------
> > libphy: Freescale PowerQUICC MII Bus: probed
> > libphy: Freescale PowerQUICC MII Bus: probed
> > fsl-gianfar e0024000.ethernet: enabled errata workarounds, flags: 0x4
> > fsl-gianfar e0024000.ethernet eth0: mac: 02:e0:0c:00:05:fd
> > fsl-gianfar e0024000.ethernet eth0: Running with NAPI enabled
> > fsl-gianfar e0024000.ethernet eth0: RX BD ring size for Q[0]: 256
> > fsl-gianfar e0024000.ethernet eth0: TX BD ring size for Q[0]: 256
> > fsl-gianfar e0025000.ethernet: enabled errata workarounds, flags: 0x4
> > fsl-gianfar e0025000.ethernet eth1: mac: 02:e0:0c:00:06:fd
> > fsl-gianfar e0025000.ethernet eth1: Running with NAPI enabled
> > fsl-gianfar e0025000.ethernet eth1: RX BD ring size for Q[0]: 256
> > fsl-gianfar e0025000.ethernet eth1: TX BD ring size for Q[0]: 256
> > TCP: cubic registered
> > Initializing XFRM netlink socket
> > NET: Registered protocol family 17
> > -----------------------------------------------
> >
> >
> > Git bisect says:
> >
> > ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4 is the first bad commit
> > commit ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4
> > Author: Kevin Hao <haokexin@gmail.com>
> > Date: Tue Feb 18 15:57:30 2014 +0800
> >
> > of: reimplement the matching method for __of_match_node()
> >
> > In the current implementation of __of_match_node(), it will
compare
> > each given match entry against all the node's compatible strings
> > with of_device_is_compatible().
> >
> > To achieve multiple compatible strings per node with ordering from
> > specific to generic, this requires given matches to be ordered
from
> > specific to generic. For most of the drivers this is not true and
> > also an alphabetical ordering is more sane there.
> >
> > Therefore, we define a following priority order for the match, and
> > then scan all the entries to find the best match.
> > 1. specific compatible && type && name
> > 2. specific compatible && type
> > 3. specific compatible && name
> > 4. specific compatible
> > 5. general compatible && type && name
> > 6. general compatible && type
> > 7. general compatible && name
> > 8. general compatible
> > 9. type && name
> > 10. type
> > 11. name
> >
> > This is based on some pseudo-codes provided by Grant Likely.
> >
> > Signed-off-by: Kevin Hao <haokexin@gmail.com>
> > [grant.likely: Changed multiplier to 4 which makes more sense]
> > Signed-off-by: Grant Likely <grant.likely@linaro.org>
> >
> > :040000 040000 8f5dd19174417aece63b308ff299a5dbe2efa5a0
> > 8401b0e3903e23e973845ee75b26b04345d803d2 M drivers
> >
> > As a double check, I checked out the head of linux-next, and did a
> > revert of the above commit, and my sbc8548 can then boot properly.
> >
> > Not doing anything fancy ; using the defconfig exactly as-is, and
> > ensuring the dtb is fresh from linux-next HEAD of today.
> >
> > Thanks,
> > Paul.
> > --
> >
> > >
> > > However, I think I would like to see this structured differently. We
> > > basically have 2 ways of matching: the existing pre-3.14 way and the
> > > desired match on best compatible only. All new bindings should match
> > > with the new way and the old way needs to be kept for compatibility.
> > > So lets structure the code that way. Search the match table first
for
> > > best compatible with name and type NULL, then search the table the
old
> > > way. I realize it appears you are doing this, but it is not clear
this
> > > is the intent of the code. I would like to see this written as a
patch
> > > with commit 105353145eafb3ea919 reverted first and you add a new
match
> > > function to call first and then fallback to the existing function.
> > >
> > > Rob
> > >
> > >>
> > >> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> > >> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> > >> ---
> > >> drivers/of/base.c | 55 ++++++++++++++++++++++++++++++++++++
> +------------------
> > >> 1 file changed, 37 insertions(+), 18 deletions(-)
> > >>
> > >> diff --git a/drivers/of/base.c b/drivers/of/base.c
> > >> index ff85450d5683..9d655df458bd 100644
> > >> --- a/drivers/of/base.c
> > >> +++ b/drivers/of/base.c
> > >> @@ -730,32 +730,45 @@ out:
> > >> }
> > >> EXPORT_SYMBOL(of_find_node_with_property);
> > >>
> > >> +static int of_match_type_or_name(const struct device_node *node,
> > >> + const struct of_device_id *m)
> > >> +{
> > >> + int match = 1;
> > >> +
> > >> + if (m->name[0])
> > >> + match &= node->name && !strcmp(m->name,
node->name);
> > >> +
> > >> + if (m->type[0])
> > >> + match &= node->type && !strcmp(m->type,
node->type);
> > >> +
> > >> + return match;
> > >> +}
> > >> +
> > >> static
> > >> const struct of_device_id *__of_match_node(const struct
> of_device_id *matches,
> > >> const struct
> device_node *node)
> > >> {
> > >> const char *cp;
> > >> int cplen, l;
> > >> + const struct of_device_id *m;
> > >> + int match;
> > >>
> > >> if (!matches)
> > >> return NULL;
> > >>
> > >> cp = __of_get_property(node, "compatible", &cplen);
> > >> - do {
> > >> - const struct of_device_id *m = matches;
> > >> + while (cp && (cplen > 0)) {
> > >> + m = matches;
> > >>
> > >> /* Check against matches with current
> compatible string */
> > >> while (m->name[0] || m->type[0] ||
m->compatible[0]) {
> > >> - int match = 1;
> > >> - if (m->name[0])
> > >> - match &= node->name
> > >> - && !strcmp(m->name,
node->name);
> > >> - if (m->type[0])
> > >> - match &= node->type
> > >> - && !strcmp(m->type,
node->type);
> > >> - if (m->compatible[0])
> > >> - match &= cp
> > >> - && !of_compat_cmp
> (m->compatible, cp,
> > >> + if (!m->compatible[0]) {
> > >> + m++;
> > >> + continue;
> > >> + }
> > >> +
> > >> + match = of_match_type_or_name(node, m);
> > >> + match &= cp &&
!of_compat_cmp(m->compatible, cp,
> > >> strlen
> (m->compatible));
> > >> if (match)
> > >> return m;
> > >> @@ -763,12 +776,18 @@ const struct of_device_id
> *__of_match_node(const struct of_device_id *matches,
> > >> }
> > >>
> > >> /* Get node's next compatible string */
> > >> - if (cp) {
> > >> - l = strlen(cp) + 1;
> > >> - cp += l;
> > >> - cplen -= l;
> > >> - }
> > >> - } while (cp && (cplen > 0));
> > >> + l = strlen(cp) + 1;
> > >> + cp += l;
> > >> + cplen -= l;
> > >> + }
> > >> +
> > >> + m = matches;
> > >> + /* Check against matches without compatible string */
> > >> + while (m->name[0] || m->type[0] || m->compatible[0]) {
> > >> + if (!m->compatible[0] &&
of_match_type_or_name(node, m))
> > >> + return m;
> > >> + m++;
> > >> + }
> > >>
> > >> return NULL;
> > >> }
> > >> --
> > >> 1.8.5.3
> > >>
> > >> --
> > >> To unsubscribe from this list: send the line "unsubscribe
devicetree" in
> > >> the body of a message to majordomo@vger.kernel.org
> > >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > _______________________________________________
> > > Linuxppc-dev mailing list
> > > Linuxppc-dev@lists.ozlabs.org
> > > https://lists.ozlabs.org/listinfo/linuxppc-dev
>
^ permalink raw reply
* Re: [PATCH 1/3] mm: return NUMA_NO_NODE in local_memory_node if zonelists are not setup
From: Nishanth Aravamudan @ 2014-02-19 23:32 UTC (permalink / raw)
To: Michal Hocko, Mel Gorman, linux-mm, Christoph Lameter,
David Rientjes, Joonsoo Kim, Ben Herrenschmidt, Anton Blanchard,
linuxppc-dev, akpm
In-Reply-To: <20140219231714.GB413@linux.vnet.ibm.com>
[ Grr, sorry for not including you originally Andrew, if this ends up
being ok with others, it will probably need to go through your tree. ]
On 19.02.2014 [15:17:14 -0800], Nishanth Aravamudan wrote:
> We can call local_memory_node() before the zonelists are setup. In that
> case, first_zones_zonelist() will not set zone and the reference to
> zone->node will Oops. Catch this case, and, since we presumably running
> very early, just return that any node will do.
>
> Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Michal Hocko <mhocko@suse.cz>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Christoph Lameter <cl@linux.com>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
> Cc: Anton Blanchard <anton@samba.org>
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index e3758a0..5de4337 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3650,6 +3650,8 @@ int local_memory_node(int node)
> gfp_zone(GFP_KERNEL),
> NULL,
> &zone);
> + if (!zone)
> + return NUMA_NO_NODE;
> return zone->node;
> }
> #endif
^ permalink raw reply
* [PATCH 3/3] powerpc: enable CONFIG_HAVE_MEMORYLESS_NODES
From: Nishanth Aravamudan @ 2014-02-19 23:23 UTC (permalink / raw)
To: Michal Hocko, Mel Gorman, linux-mm, Christoph Lameter,
David Rientjes, Joonsoo Kim, Ben Herrenschmidt, Anton Blanchard,
linuxppc-dev
In-Reply-To: <20140219232221.GD413@linux.vnet.ibm.com>
Anton Blanchard found an issue with an LPAR that had no memory in Node
0. Christoph Lameter recommended, as one possible solution, to use
numa_mem_id() for locality of the nearest memory node-wise. However,
numa_mem_id() [and the other related APIs] are only useful if
CONFIG_HAVE_MEMORYLESS_NODES is set. This is only the case for ia64
currently, but clearly we can have memoryless nodes on ppc64. Add the
Kconfig option and define it to be the same value as CONFIG_NUMA.
On the LPAR in question, which was very inefficiently using slabs, this
took the slab consumption at boot from roughly 7GB to roughly 4GB.
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: linuxppc-dev@lists.ozlabs.org
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a84816c..0f5cd68 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -449,6 +449,9 @@ config NODES_SHIFT
default "4"
depends on NEED_MULTIPLE_NODES
+config HAVE_MEMORYLESS_NODES
+ def_bool NUMA
+
config USE_PERCPU_NUMA_NODE_ID
def_bool y
depends on NUMA
^ permalink raw reply related
* [PATCH 2/3 v2] powerpc: enable CONFIG_HAVE_PERCPU_NUMA_NODE_ID
From: Nishanth Aravamudan @ 2014-02-19 23:22 UTC (permalink / raw)
To: Michal Hocko, Mel Gorman, linux-mm, Christoph Lameter,
David Rientjes, Joonsoo Kim, Ben Herrenschmidt, Anton Blanchard,
linuxppc-dev
In-Reply-To: <20140219231800.GC413@linux.vnet.ibm.com>
[Apologies, I sent a stale version of this patch a moment ago...]
In order to enable CONFIG_HAVE_MEMORYLESS_NODES, it is necessary to have
somewhere to store the cpu <-> local-memory-node mapping. We could
create another powerpc-specific lookup table, but the generic functions
in include/linux/topology.h (protected by HAVE_PERCPU_NUMA_NODE_ID) are
sufficient. This also allows us to remove the existing powerpc-specific
cpu <-> node lookup table.
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf34..a84816c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -449,6 +449,10 @@ config NODES_SHIFT
default "4"
depends on NEED_MULTIPLE_NODES
+config USE_PERCPU_NUMA_NODE_ID
+ def_bool y
+ depends on NUMA
+
config ARCH_SELECT_MEMORY_MODEL
def_bool y
depends on PPC64
diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h
index 7b58917..c8fbd1c 100644
--- a/arch/powerpc/include/asm/mmzone.h
+++ b/arch/powerpc/include/asm/mmzone.h
@@ -29,7 +29,6 @@ extern struct pglist_data *node_data[];
* Following are specific to this numa platform.
*/
-extern int numa_cpu_lookup_table[];
extern cpumask_var_t node_to_cpumask_map[];
#ifdef CONFIG_MEMORY_HOTPLUG
extern unsigned long max_pfn;
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index d0b5fca..8bbe8cc 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -20,19 +20,6 @@ struct device_node;
#include <asm/mmzone.h>
-static inline int cpu_to_node(int cpu)
-{
- int nid;
-
- nid = numa_cpu_lookup_table[cpu];
-
- /*
- * During early boot, the numa-cpu lookup table might not have been
- * setup for all CPUs yet. In such cases, default to node 0.
- */
- return (nid < 0) ? 0 : nid;
-}
-
#define parent_node(node) (node)
#define cpumask_of_node(node) ((node) == -1 ? \
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ac2621a..f45e68d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -739,6 +739,9 @@ void start_secondary(void *unused)
}
traverse_core_siblings(cpu, true);
+ set_cpu_numa_node(cpu, cpu_to_node(cpu));
+ set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu)));
+
smp_wmb();
notify_cpu_starting(cpu);
set_cpu_online(cpu, true);
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 30a42e2..57e2809 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -46,11 +46,9 @@ static char *cmdline __initdata;
static int numa_debug;
#define dbg(args...) if (numa_debug) { printk(KERN_INFO args); }
-int numa_cpu_lookup_table[NR_CPUS];
cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
struct pglist_data *node_data[MAX_NUMNODES];
-EXPORT_SYMBOL(numa_cpu_lookup_table);
EXPORT_SYMBOL(node_to_cpumask_map);
EXPORT_SYMBOL(node_data);
@@ -154,22 +152,25 @@ static void __init get_node_active_region(unsigned long pfn,
}
}
-static void reset_numa_cpu_lookup_table(void)
+static void reset_numa_cpu_node(void)
{
unsigned int cpu;
- for_each_possible_cpu(cpu)
- numa_cpu_lookup_table[cpu] = -1;
+ for_each_possible_cpu(cpu) {
+ set_cpu_numa_node(cpu, -1);
+ set_cpu_numa_mem(cpu, -1);
+ }
}
-static void update_numa_cpu_lookup_table(unsigned int cpu, int node)
+static void update_numa_cpu_node(unsigned int cpu, int node)
{
- numa_cpu_lookup_table[cpu] = node;
+ set_cpu_numa_node(cpu, node);
+ set_cpu_numa_mem(cpu, local_memory_node(node));
}
static void map_cpu_to_node(int cpu, int node)
{
- update_numa_cpu_lookup_table(cpu, node);
+ update_numa_cpu_node(cpu, node);
dbg("adding cpu %d to node %d\n", cpu, node);
@@ -180,7 +181,7 @@ static void map_cpu_to_node(int cpu, int node)
#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR)
static void unmap_cpu_from_node(unsigned long cpu)
{
- int node = numa_cpu_lookup_table[cpu];
+ int node = cpu_to_node(cpu);
dbg("removing cpu %lu from node %d\n", cpu, node);
@@ -545,7 +546,7 @@ static int numa_setup_cpu(unsigned long lcpu)
* directly instead of querying the firmware, since it represents
* the most recent mapping notified to us by the platform (eg: VPHN).
*/
- if ((nid = numa_cpu_lookup_table[lcpu]) >= 0) {
+ if ((nid = cpu_to_node(lcpu)) >= 0) {
map_cpu_to_node(lcpu, nid);
return nid;
}
@@ -1119,7 +1120,7 @@ void __init do_init_bootmem(void)
*/
setup_node_to_cpumask_map();
- reset_numa_cpu_lookup_table();
+ reset_numa_cpu_node();
register_cpu_notifier(&ppc64_numa_nb);
cpu_numa_callback(&ppc64_numa_nb, CPU_UP_PREPARE,
(void *)(unsigned long)boot_cpuid);
@@ -1518,7 +1519,7 @@ static int update_lookup_table(void *data)
base = cpu_first_thread_sibling(update->cpu);
for (j = 0; j < threads_per_core; j++) {
- update_numa_cpu_lookup_table(base + j, nid);
+ update_numa_cpu_node(base + j, nid);
}
}
@@ -1571,7 +1572,7 @@ int arch_update_cpu_topology(void)
if (new_nid < 0 || !node_online(new_nid))
new_nid = first_online_node;
- if (new_nid == numa_cpu_lookup_table[cpu]) {
+ if (new_nid == cpu_to_node(cpu)) {
cpumask_andnot(&cpu_associativity_changes_mask,
&cpu_associativity_changes_mask,
cpu_sibling_mask(cpu));
@@ -1583,7 +1584,7 @@ int arch_update_cpu_topology(void)
ud = &updates[i++];
ud->cpu = sibling;
ud->new_nid = new_nid;
- ud->old_nid = numa_cpu_lookup_table[sibling];
+ ud->old_nid = cpu_to_node(sibling);
cpumask_set_cpu(sibling, &updated_cpus);
if (i < weight)
ud->next = &updates[i];
^ permalink raw reply related
* [PATCH 2/3] powerpc: enable CONFIG_HAVE_PERCPU_NUMA_NODE_ID
From: Nishanth Aravamudan @ 2014-02-19 23:18 UTC (permalink / raw)
To: Michal Hocko, Mel Gorman, linux-mm, Christoph Lameter,
David Rientjes, Joonsoo Kim, Ben Herrenschmidt, Anton Blanchard,
linuxppc-dev
In-Reply-To: <20140219231714.GB413@linux.vnet.ibm.com>
In order to enable CONFIG_HAVE_MEMORYLESS_NODES, it is necessary to have
somewhere to store the cpu <-> local-memory-node mapping. We could
create another powerpc-specific lookup table, but the generic functions
in include/linux/topology.h (protected by HAVE_PERCPU_NUMA_NODE_ID) are
sufficient. This also allows us to remove the existing powerpc-specific
cpu <-> node lookup table.
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h
index 7b58917..c8fbd1c 100644
--- a/arch/powerpc/include/asm/mmzone.h
+++ b/arch/powerpc/include/asm/mmzone.h
@@ -29,7 +29,6 @@ extern struct pglist_data *node_data[];
* Following are specific to this numa platform.
*/
-extern int numa_cpu_lookup_table[];
extern cpumask_var_t node_to_cpumask_map[];
#ifdef CONFIG_MEMORY_HOTPLUG
extern unsigned long max_pfn;
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index d0b5fca..8bbe8cc 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -20,19 +20,6 @@ struct device_node;
#include <asm/mmzone.h>
-static inline int cpu_to_node(int cpu)
-{
- int nid;
-
- nid = numa_cpu_lookup_table[cpu];
-
- /*
- * During early boot, the numa-cpu lookup table might not have been
- * setup for all CPUs yet. In such cases, default to node 0.
- */
- return (nid < 0) ? 0 : nid;
-}
-
#define parent_node(node) (node)
#define cpumask_of_node(node) ((node) == -1 ? \
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ac2621a..f45e68d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -739,6 +739,9 @@ void start_secondary(void *unused)
}
traverse_core_siblings(cpu, true);
+ set_cpu_numa_node(cpu, cpu_to_node(cpu));
+ set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu)));
+
smp_wmb();
notify_cpu_starting(cpu);
set_cpu_online(cpu, true);
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 30a42e2..57e2809 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -46,11 +46,9 @@ static char *cmdline __initdata;
static int numa_debug;
#define dbg(args...) if (numa_debug) { printk(KERN_INFO args); }
-int numa_cpu_lookup_table[NR_CPUS];
cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
struct pglist_data *node_data[MAX_NUMNODES];
-EXPORT_SYMBOL(numa_cpu_lookup_table);
EXPORT_SYMBOL(node_to_cpumask_map);
EXPORT_SYMBOL(node_data);
@@ -154,22 +152,25 @@ static void __init get_node_active_region(unsigned long pfn,
}
}
-static void reset_numa_cpu_lookup_table(void)
+static void reset_numa_cpu_node(void)
{
unsigned int cpu;
- for_each_possible_cpu(cpu)
- numa_cpu_lookup_table[cpu] = -1;
+ for_each_possible_cpu(cpu) {
+ set_cpu_numa_node(cpu, -1);
+ set_cpu_numa_mem(cpu, -1);
+ }
}
-static void update_numa_cpu_lookup_table(unsigned int cpu, int node)
+static void update_numa_cpu_node(unsigned int cpu, int node)
{
- numa_cpu_lookup_table[cpu] = node;
+ set_cpu_numa_node(cpu, node);
+ set_cpu_numa_mem(cpu, local_memory_node(node));
}
static void map_cpu_to_node(int cpu, int node)
{
- update_numa_cpu_lookup_table(cpu, node);
+ update_numa_cpu_node(cpu, node);
dbg("adding cpu %d to node %d\n", cpu, node);
@@ -180,7 +181,7 @@ static void map_cpu_to_node(int cpu, int node)
#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR)
static void unmap_cpu_from_node(unsigned long cpu)
{
- int node = numa_cpu_lookup_table[cpu];
+ int node = cpu_to_node(cpu);
dbg("removing cpu %lu from node %d\n", cpu, node);
@@ -545,7 +546,7 @@ static int numa_setup_cpu(unsigned long lcpu)
* directly instead of querying the firmware, since it represents
* the most recent mapping notified to us by the platform (eg: VPHN).
*/
- if ((nid = numa_cpu_lookup_table[lcpu]) >= 0) {
+ if ((nid = cpu_to_node(lcpu)) >= 0) {
map_cpu_to_node(lcpu, nid);
return nid;
}
@@ -1119,7 +1120,7 @@ void __init do_init_bootmem(void)
*/
setup_node_to_cpumask_map();
- reset_numa_cpu_lookup_table();
+ reset_numa_cpu_node();
register_cpu_notifier(&ppc64_numa_nb);
cpu_numa_callback(&ppc64_numa_nb, CPU_UP_PREPARE,
(void *)(unsigned long)boot_cpuid);
@@ -1518,7 +1519,7 @@ static int update_lookup_table(void *data)
base = cpu_first_thread_sibling(update->cpu);
for (j = 0; j < threads_per_core; j++) {
- update_numa_cpu_lookup_table(base + j, nid);
+ update_numa_cpu_node(base + j, nid);
}
}
@@ -1571,7 +1572,7 @@ int arch_update_cpu_topology(void)
if (new_nid < 0 || !node_online(new_nid))
new_nid = first_online_node;
- if (new_nid == numa_cpu_lookup_table[cpu]) {
+ if (new_nid == cpu_to_node(cpu)) {
cpumask_andnot(&cpu_associativity_changes_mask,
&cpu_associativity_changes_mask,
cpu_sibling_mask(cpu));
@@ -1583,7 +1584,7 @@ int arch_update_cpu_topology(void)
ud = &updates[i++];
ud->cpu = sibling;
ud->new_nid = new_nid;
- ud->old_nid = numa_cpu_lookup_table[sibling];
+ ud->old_nid = cpu_to_node(sibling);
cpumask_set_cpu(sibling, &updated_cpus);
if (i < weight)
ud->next = &updates[i];
^ permalink raw reply related
* [PATCH 1/3] mm: return NUMA_NO_NODE in local_memory_node if zonelists are not setup
From: Nishanth Aravamudan @ 2014-02-19 23:17 UTC (permalink / raw)
To: Michal Hocko, Mel Gorman, linux-mm, Christoph Lameter,
David Rientjes, Joonsoo Kim, Ben Herrenschmidt, Anton Blanchard,
linuxppc-dev
In-Reply-To: <20140219231641.GA413@linux.vnet.ibm.com>
We can call local_memory_node() before the zonelists are setup. In that
case, first_zones_zonelist() will not set zone and the reference to
zone->node will Oops. Catch this case, and, since we presumably running
very early, just return that any node will do.
Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: Anton Blanchard <anton@samba.org>
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e3758a0..5de4337 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3650,6 +3650,8 @@ int local_memory_node(int node)
gfp_zone(GFP_KERNEL),
NULL,
&zone);
+ if (!zone)
+ return NUMA_NO_NODE;
return zone->node;
}
#endif
^ permalink raw reply related
* [PATCH 0/3] powerpc: support memoryless nodes
From: Nishanth Aravamudan @ 2014-02-19 23:16 UTC (permalink / raw)
To: Nish Aravamudan
Cc: Michal Hocko, linux-mm, Mel Gorman, David Rientjes,
Christoph Lameter, linuxppc-dev, Joonsoo Kim, Anton Blanchard
We have seen several issues recently on powerpc LPARs with memoryless
node NUMA configurations, e.g. (an extreme case):
numactl --hardware
available: 2 nodes (0,3)
node 0 cpus:
node 0 size: 0 MB
node 0 free: 0 MB
node 3 cpus: 0 1 2 3
node 3 size: 8142 MB
node 3 free: 7765 MB
node distances:
node 0 3
0: 10 20
3: 20 10
powerpc doesn't set CONFIG_HAVE_MEMORYLESS_NODES, so we are missing out
on a lot of the core-kernel support necessary. This series attempts to
fix this by enabling the config option, which requires a few other
changes as well.
1/3: mm: return NUMA_NO_NODE in local_memory_node if zonelists are not
setup
2/3: powerpc: enable CONFIG_HAVE_PERCPU_NUMA_NODE_ID
3/3: powerpc: enable CONFIG_HAVE_MEMORYLESS_NODES
I have tested this series with Christoph's patch (currently being
discussed): http://www.spinics.net/lists/linux-mm/msg69452.html
Thanks,
Nish
^ permalink raw reply
* [PATCH v2] powerpc: select MEMORY for FSL_IFC to not break existing .config files
From: Paul Gortmaker @ 2014-02-19 22:46 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Arnd Bergmann, Paul Gortmaker, linux-next, linux-mtd, Scott Wood,
Paul Mackerras, linuxppc-dev, David Woodhouse, Prabhakar Kushwaha
In-Reply-To: <1392848350.6733.809.camel@snotra.buserror.net>
commit d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc ("driver/memory:Move
Freescale IFC driver to a common driver") introduces this build
regression into the mpc85xx_defconfig:
drivers/built-in.o: In function `fsl_ifc_nand_remove':
drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
drivers/built-in.o: In function `fsl_ifc_nand_probe':
drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
drivers/built-in.o: In function `match_bank':
drivers/mtd/nand/fsl_ifc_nand.c:1013: undefined reference to `convert_ifc_address'
drivers/built-in.o: In function `fsl_ifc_nand_probe':
drivers/mtd/nand/fsl_ifc_nand.c:1059: undefined reference to `fsl_ifc_ctrl_dev'
drivers/mtd/nand/fsl_ifc_nand.c:1080: undefined reference to `fsl_ifc_ctrl_dev'
drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
make: *** [vmlinux] Error 1
This happens because there is nothing to descend us into the
drivers/memory directory in the mpc85xx_defconfig. It wasn't
selecting CONFIG_MEMORY. So we never built drivers/memory/fsl_ifc.o
and so we have nothing to link the above symbols against.
Since the goal of the original commit was to relocate the driver to
an arch independent location, it only makes sense to relocate the
Kconfig setting there as well. But that alone won't fix the build
failure; for that we ensure whoever selects FSL_IFC also selects MEMORY.
Cc: Prabhakar Kushwaha <prabhakar@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
[v2: fix the mislocated FSL_IFC as per Scott's comment. It still
probably makes sense to go in via Greg's char-misc/char-misc-next
(vs. powerpc-next) since that is where the regression was introduced.]
arch/powerpc/Kconfig | 4 ----
drivers/memory/Kconfig | 4 ++++
drivers/mtd/nand/Kconfig | 1 +
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf344c0f5..b9fcecc706ab 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -736,10 +736,6 @@ config FSL_LBC
controller. Also contains some common code used by
drivers for specific local bus peripherals.
-config FSL_IFC
- bool
- depends on FSL_SOC
-
config FSL_GTM
bool
depends on PPC_83xx || QUICC_ENGINE || CPM2
diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 29a11db365bc..a3640fe9852f 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -50,4 +50,8 @@ config TEGRA30_MC
analysis, especially for IOMMU/SMMU(System Memory Management
Unit) module.
+config FSL_IFC
+ bool
+ depends on FSL_SOC
+
endif
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 90ff447bf043..a4bee41ad5cb 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -428,6 +428,7 @@ config MTD_NAND_FSL_IFC
tristate "NAND support for Freescale IFC controller"
depends on MTD_NAND && FSL_SOC
select FSL_IFC
+ select MEMORY
help
Various Freescale chips e.g P1010, include a NAND Flash machine
with built-in hardware ECC capabilities.
--
1.8.5.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox