* RE: PCIE device errors after linux kernel upgrade
From: Zang Roy-R61911 @ 2013-08-07 3:35 UTC (permalink / raw)
To: Leon Ravich, Johannes Thumshirn
Cc: Bjorn Helgaas, linux-pci@vger.kernel.org, linuxppc-dev
In-Reply-To: <CAPWoNkKo6Cfg0Hr2QYBXVnUrC-UQwES65UUHfSvR3nBvZrfFoA@mail.gmail.com>
> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-bounces+tie-
> fei.zang=3Dfreescale.com@lists.ozlabs.org] On Behalf Of Leon Ravich
> Sent: Tuesday, August 06, 2013 3:26 PM
> To: Johannes Thumshirn
> Cc: Bjorn Helgaas; linux-pci@vger.kernel.org; linuxppc-dev
> Subject: Re: PCIE device errors after linux kernel upgrade
>=20
> Hi Johannes
> no panic just reboot.
> it is not the first read, it takes few minutes of work with pcie to
> reboot.
You may need to check the error code in EDAC driver as Johannes suggested.
Roy
^ permalink raw reply
* Re: [PATCH 00/11] Add compression support to pstore
From: Tony Luck @ 2013-08-07 3:25 UTC (permalink / raw)
To: Aruna Balakrishnaiah
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org,
linux-kernel@vger.kernel.org, keescook@chromium.org
In-Reply-To: <5201A9BD.4090503@linux.vnet.ibm.com>
On Tue, Aug 6, 2013 at 6:58 PM, Aruna Balakrishnaiah
<aruna@linux.vnet.ibm.com> wrote:
> The patch looks right. I will clean it up. Does the issue still persist
> after this?
Things seem to be working - but testing has hardly been extensive (just
a couple of forced panics).
I do have one other question. In this code:
>> if (compressed && (type == PSTORE_TYPE_DMESG)) {
>> big_buf_sz = (psinfo->bufsize * 100) / 45;
Where does the magic multiply by 1.45 come from? Is that always enough
for the decompression of "dmesg" type data to succeed?
-Tony
^ permalink raw reply
* Re: [PATCH] powerpc/eeh: Add procfs entry for PowerNV
From: Gavin Shan @ 2013-08-07 2:34 UTC (permalink / raw)
To: Mike Qiu; +Cc: linuxppc-dev, shangw
In-Reply-To: <1375842314-26555-1-git-send-email-qiudayu@linux.vnet.ibm.com>
On Tue, Aug 06, 2013 at 10:25:14PM -0400, Mike Qiu wrote:
>The procfs entry for global statistics has been missed on PowerNV
>platform and the patch is going to add that.
>
>Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Acked-by: Gavin Shan <shangw@linux.vnet.ibm.com>
>---
> arch/powerpc/kernel/eeh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
>index 39954fe..0e12bb1 100644
>--- a/arch/powerpc/kernel/eeh.c
>+++ b/arch/powerpc/kernel/eeh.c
>@@ -1063,7 +1063,7 @@ static const struct file_operations proc_eeh_operations = {
>
> static int __init eeh_init_proc(void)
> {
>- if (machine_is(pseries))
>+ if (machine_is(pseries) || machine_is(powernv))
> proc_create("powerpc/eeh", 0, NULL, &proc_eeh_operations);
> return 0;
> }
Thanks,
Gavin
^ permalink raw reply
* Re: [PATCH] powerpc/eeh: Fix undefined variable
From: Gavin Shan @ 2013-08-07 2:34 UTC (permalink / raw)
To: Mike Qiu; +Cc: linuxppc-dev, shangw
In-Reply-To: <1375842286-26521-1-git-send-email-qiudayu@linux.vnet.ibm.com>
On Tue, Aug 06, 2013 at 10:24:46PM -0400, Mike Qiu wrote:
>'pe_no' hasn't been defined, it should be an typo error,
>it should be 'frozen_pe_no'.
>
>Also '__func__' should be added to IODA_EEH_DBG(),
>
>Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Acked-by: Gavin Shan <shangw@linux.vnet.ibm.com>
>---
> arch/powerpc/platforms/powernv/eeh-ioda.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
>index 0cd1c4a..a49bee7 100644
>--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
>+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
>@@ -843,7 +843,8 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
> * specific PHB.
> */
> IODA_EEH_DBG("%s: Error (%d, %d, %d) on PHB#%x\n",
>- err_type, severity, pe_no, hose->global_number);
>+ __func__, err_type, severity,
>+ frozen_pe_no, hose->global_number);
> switch (err_type) {
> case OPAL_EEH_IOC_ERROR:
> if (severity == OPAL_EEH_SEV_IOC_DEAD) {
Thanks,
Gavin
^ permalink raw reply
* [PATCH] powerpc/eeh: Add procfs entry for PowerNV
From: Mike Qiu @ 2013-08-07 2:25 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Mike Qiu, shangw
The procfs entry for global statistics has been missed on PowerNV
platform and the patch is going to add that.
Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
---
arch/powerpc/kernel/eeh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 39954fe..0e12bb1 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -1063,7 +1063,7 @@ static const struct file_operations proc_eeh_operations = {
static int __init eeh_init_proc(void)
{
- if (machine_is(pseries))
+ if (machine_is(pseries) || machine_is(powernv))
proc_create("powerpc/eeh", 0, NULL, &proc_eeh_operations);
return 0;
}
--
1.8.2.1
^ permalink raw reply related
* [PATCH] powerpc/eeh: Fix undefined variable
From: Mike Qiu @ 2013-08-07 2:24 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Mike Qiu, shangw
'pe_no' hasn't been defined, it should be an typo error,
it should be 'frozen_pe_no'.
Also '__func__' should be added to IODA_EEH_DBG(),
Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/eeh-ioda.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 0cd1c4a..a49bee7 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -843,7 +843,8 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
* specific PHB.
*/
IODA_EEH_DBG("%s: Error (%d, %d, %d) on PHB#%x\n",
- err_type, severity, pe_no, hose->global_number);
+ __func__, err_type, severity,
+ frozen_pe_no, hose->global_number);
switch (err_type) {
case OPAL_EEH_IOC_ERROR:
if (severity == OPAL_EEH_SEV_IOC_DEAD) {
--
1.8.2.1
^ permalink raw reply related
* Re: [PATCH 00/11] Add compression support to pstore
From: Aruna Balakrishnaiah @ 2013-08-07 1:58 UTC (permalink / raw)
To: Tony Luck
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org,
linux-kernel@vger.kernel.org, keescook@chromium.org
In-Reply-To: <CA+8MBbKA+P4vs3utSKQ-LPMW3ybrWOp=f3FH6ahv1YtwnMm5KA@mail.gmail.com>
On Wednesday 07 August 2013 05:06 AM, Tony Luck wrote:
> On Mon, Aug 5, 2013 at 2:20 PM, Tony Luck <tony.luck@gmail.com> wrote:
>> Still have problems booting if there are any compressed images in ERST
>> to be inflated.
> So I took another look at this part of the code ... and saw a couple of issues:
>
> while ((size = psi->read(&id, &type, &count, &time, &buf, &compressed,
> psi)) > 0) {
> if (compressed && (type == PSTORE_TYPE_DMESG)) {
> big_buf_sz = (psinfo->bufsize * 100) / 45;
> big_buf = allocate_buf_for_decompression(big_buf_sz);
>
> if (big_buf || stream.workspace)
>>>> Did you mean "&&" here rather that "||"?
Yes right, it should be &&.
> unzipped_len = pstore_decompress(buf, big_buf,
> size, big_buf_sz);
>>>> Need an "else" here to set unzipped_len to -1 (or set it to -1 down
>>>> at the bottom of the loop ready for next time around.
> if (unzipped_len > 0) {
> buf = big_buf;
>>>> This sets us up for problems. First, you just overwrote the address
>>>> of the buffer that psi->read allocated - so we have a memory leak. But
>>>> worse than that we now double free the same buffer below when we
>>>> kfree(buf) and then kfree(big_buf)
> size = unzipped_len;
> compressed = false;
> } else {
> pr_err("pstore: decompression failed;"
> "returned %d\n", unzipped_len);
> compressed = true;
> }
> }
> rc = pstore_mkfile(type, psi->name, id, count, buf,
> compressed, (size_t)size, time, psi);
> kfree(buf);
> kfree(stream.workspace);
> kfree(big_buf);
> buf = NULL;
> stream.workspace = NULL;
> big_buf = NULL;
> if (rc && (rc != -EEXIST || !quiet))
> failed++;
> }
>
>
> See attached patch that fixes these - but the code still looks like it
> could be cleaned up a bit more.
The patch looks right. I will clean it up. Does the issue still persist after this?
> -Tony
^ permalink raw reply
* Re: [PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s
From: Paul Mackerras @ 2013-08-07 1:47 UTC (permalink / raw)
To: Scott Wood
Cc: Wood Scott-B07421, kvm@vger.kernel.org, agraf@suse.de,
kvm-ppc@vger.kernel.org, Bhushan Bharat-R65777,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1375837894.5600.64.camel@snotra.buserror.net>
On Tue, Aug 06, 2013 at 08:11:34PM -0500, Scott Wood wrote:
> On Wed, 2013-08-07 at 10:24 +1000, Paul Mackerras wrote:
> > On Tue, Aug 06, 2013 at 07:02:48AM +0000, Bhushan Bharat-R65777 wrote:
> > >
> > > I am trying to me the Linux pte search and update generic so that this can be used for powerpc as well.
> > >
> > > I am not sure which of the below two should be ok, please help
> >
> > Given that the BookE code uses gfn_to_pfn_memslot() to get the host
> > pfn, and then kvm_set_pfn_dirty(pfn) on pages that you're going to let
> > the guest write to, I don't think you need to set the dirty and/or
> > accessed bits in the Linux PTE explicitly. If you care about the
> > WIMGE bits you can do find_linux_pte_or_hugepte() and just look at the
> > PTE, but you really should be using mmu_notifier_retry() to guard
> > against concurrent changes to the Linux PTE. See the HV KVM code or
> > patch 21 of my recent series to see how it's used.
>
> Hmm... we only get a callback on invalidate_range_start(), not
> invalidate_range_end() (and even if we did get a callback for the
> latter, it'd probably be racy). So we may have a problem here
> regardless of getting WIMG from the PTE, unless it's guaranteed that
> hva_to_pfn() will fail after invalidate_range_start().
No, it's not guaranteed. You have to use mmu_notifier_retry(). It
tells you if either (a) some sort of invalidation has happened since
you snapshotted kvm->mmu_notifier_seq, or (b) an
invalidate_range_start...end sequence is currently in progress. In
either case you should discard any PTE or pfn information you
collected and retry.
> > You probably should be calling kvm_set_pfn_accessed() as well.
>
> Yeah... I think it'll only affect the quality of page-out decisions (as
> opposed to corruption and such), but still it should be fixed.
Right.
Paul.
^ permalink raw reply
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
From: Zhang Haijun @ 2013-08-07 1:28 UTC (permalink / raw)
To: Haijun Zhang
Cc: linux-mmc, AFLEMING, cbouatmailru, scottwood, cjb, linuxppc-dev,
Xie Xiaobo-R63061
In-Reply-To: <1375251927-3330-1-git-send-email-Haijun.Zhang@freescale.com>
On 07/31/2013 02:25 PM, Haijun Zhang wrote:
> Add function to support get voltage from device-tree.
> If there are voltage-range specified in device-tree node, this function
> will parse it and return the avail voltage mask.
>
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> - Update the parameters of function
>
> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/mmc/core.h | 1 +
> 2 files changed, 47 insertions(+)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 49a5bca..ce9c957 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -27,6 +27,7 @@
> #include <linux/fault-inject.h>
> #include <linux/random.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
>
> #include <linux/mmc/card.h>
> #include <linux/mmc/host.h>
> @@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
> }
> EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
>
> +#ifdef CONFIG_OF
> +
> +/*
> + * mmc_of_parse_voltage - return mask of supported voltages
> + * @np: The device node need to be parsed.
> + *
> + * 1. Return zero: voltage-ranges unspecified in device-tree.
> + * 2. Return negative errno: voltage-range is invalid.
> + * 3. Return ocr_mask: a mask of voltages that parse from device-tree
> + * node can be provided to MMC/SD/SDIO devices.
> + */
> +
> +u32 mmc_of_parse_voltage(struct device_node *np)
> +{
> + const u32 *voltage_ranges;
> + int num_ranges, i;
> + u32 ocr_mask = 0;
> +
> + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
> + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
> + if (!voltage_ranges || !num_ranges) {
> + pr_info("%s: voltage-ranges unspecified\n", np->full_name);
> + return 0;
> + }
> +
> + for (i = 0; i < num_ranges; i++) {
> + const int j = i * 2;
> + u32 mask;
> +
> + mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
> + be32_to_cpu(voltage_ranges[j + 1]));
> + if (!mask) {
> + pr_err("%s: voltage-range #%d is invalid\n",
> + np->full_name, i);
> + return -EINVAL;
> + }
> + ocr_mask |= mask;
> + }
> +
> + return ocr_mask;
> +}
> +EXPORT_SYMBOL(mmc_of_parse_voltage);
> +
> +#endif /* CONFIG_OF */
> +
> #ifdef CONFIG_REGULATOR
>
> /**
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 443243b..e3f8fe3 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
> }
>
> extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
> +extern u32 mmc_of_parse_voltage(struct device_node *np);
>
> #endif /* LINUX_MMC_CORE_H */
Hi, Anton
Could you give some advice for this patch set?
--
Thanks & Regards
Haijun
^ permalink raw reply
* [PATCH v3 7/7] powerpc/fsl_booke: enable the relocatable for the kdump kernel
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala; +Cc: linuxppc
In-Reply-To: <1375838315-27797-1-git-send-email-haokexin@gmail.com>
The RELOCATABLE is more flexible and without any alignment restriction.
And it is a superset of DYNAMIC_MEMSTART. So use it by default for
a kdump kernel.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v3: no change.
v2: A new patch in v2.
arch/powerpc/Kconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 57dc8f9..7553d72 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -376,8 +376,7 @@ config KEXEC
config CRASH_DUMP
bool "Build a kdump crash kernel"
depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP)
- select RELOCATABLE if PPC64 || 44x
- select DYNAMIC_MEMSTART if FSL_BOOKE
+ select RELOCATABLE if PPC64 || 44x || FSL_BOOKE
help
Build a kernel suitable for use as a kdump capture kernel.
The same kernel binary can be used as production kernel and dump
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 6/7] powerpc/fsl_booke: make sure PAGE_OFFSET map to memstart_addr for relocatable kernel
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala; +Cc: linuxppc
In-Reply-To: <1375838315-27797-1-git-send-email-haokexin@gmail.com>
This is always true for a non-relocatable kernel. Otherwise the kernel
would get stuck. But for a relocatable kernel, it seems a little
complicated. When booting a relocatable kernel, we just align the
kernel start addr to 64M and map the PAGE_OFFSET from there. The
relocation will base on this virtual address. But if this address
is not the same as the memstart_addr, we will have to change the
map of PAGE_OFFSET to the real memstart_addr and do another relocation
again.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v3:
* Typo fix.
* Refactor relocate_init, no function change.
* Map only 64M memory before the second relocation.
* Comments update.
v2: A new patch in v2.
arch/powerpc/kernel/head_fsl_booke.S | 75 +++++++++++++++++++++++++++++++++---
arch/powerpc/mm/fsl_booke_mmu.c | 37 +++++++++++++++---
arch/powerpc/mm/mmu_decl.h | 2 +-
3 files changed, 102 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 7e9724e..c3989d9 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -84,6 +84,39 @@ _ENTRY(_start);
mr r23,r3
mr r25,r4
+ bl 0f
+0: mflr r8
+ addis r3,r8,(is_second_reloc - 0b)@ha
+ lwz r19,(is_second_reloc - 0b)@l(r3)
+
+ /* Check if this is the second relocation. */
+ cmpwi r19,1
+ bne 1f
+
+ /*
+ * For the second relocation, we already get the real memstart_addr
+ * from device tree. So we will map PAGE_OFFSET to memstart_addr,
+ * then the virtual address of start kernel should be:
+ * PAGE_OFFSET + (kernstart_addr - memstart_addr)
+ * Since the offset between kernstart_addr and memstart_addr should
+ * never be beyond 1G, so we can just use the lower 32bit of them
+ * for the calculation.
+ */
+ lis r3,PAGE_OFFSET@h
+
+ addis r4,r8,(kernstart_addr - 0b)@ha
+ addi r4,r4,(kernstart_addr - 0b)@l
+ lwz r5,4(r4)
+
+ addis r6,r8,(memstart_addr - 0b)@ha
+ addi r6,r6,(memstart_addr - 0b)@l
+ lwz r7,4(r6)
+
+ subf r5,r7,r5
+ add r3,r3,r5
+ b 2f
+
+1:
/*
* We have the runtime (virutal) address of our base.
* We calculate our shift of offset from a 64M page.
@@ -97,7 +130,7 @@ _ENTRY(_start);
subf r3,r5,r6 /* r3 = r6 - r5 */
add r3,r4,r3 /* Required Virtual Address */
- bl relocate
+2: bl relocate
#endif
/* We try to not make any assumptions about how the boot loader
@@ -121,10 +154,19 @@ _ENTRY(_start);
_ENTRY(__early_start)
+#ifdef CONFIG_RELOCATABLE
+ /*
+ * For the second relocation, we already set the right tlb entries
+ * for the kernel space, so skip the code in fsl_booke_entry_mapping.S
+ */
+ cmpwi r19,1
+ beq set_ivor
+#endif
#define ENTRY_MAPPING_BOOT_SETUP
#include "fsl_booke_entry_mapping.S"
#undef ENTRY_MAPPING_BOOT_SETUP
+set_ivor:
/* Establish the interrupt vector offsets */
SET_IVOR(0, CriticalInput);
SET_IVOR(1, MachineCheck);
@@ -210,11 +252,13 @@ _ENTRY(__early_start)
bl early_init
#ifdef CONFIG_RELOCATABLE
+ mr r3,r30
+ mr r4,r31
#ifdef CONFIG_PHYS_64BIT
- mr r3,r23
- mr r4,r25
+ mr r5,r23
+ mr r6,r25
#else
- mr r3,r25
+ mr r5,r25
#endif
bl relocate_init
#endif
@@ -1220,6 +1264,9 @@ _GLOBAL(switch_to_as1)
/*
* Restore to the address space 0 and also invalidate the tlb entry created
* by switch_to_as1.
+ * r3 - the tlb entry which should be invalidated
+ * r4 - __pa(PAGE_OFFSET in AS0) - __pa(PAGE_OFFSET in AS1)
+ * r5 - device tree virtual address. If r4 is 0, r5 is ignored.
*/
_GLOBAL(restore_to_as0)
mflr r0
@@ -1228,7 +1275,15 @@ _GLOBAL(restore_to_as0)
0: mflr r9
addi r9,r9,1f - 0b
- mfmsr r7
+ /*
+ * We may map the PAGE_OFFSET in AS0 to a different physical address,
+ * so we need calculate the right jump and device tree address based
+ * on the offset passed by r4.
+ */
+ subf r9,r4,r9
+ subf r5,r4,r5
+
+2: mfmsr r7
li r8,(MSR_IS | MSR_DS)
andc r7,r7,r8
@@ -1247,9 +1302,19 @@ _GLOBAL(restore_to_as0)
mtspr SPRN_MAS1,r9
tlbwe
isync
+
+ cmpwi r4,0
+ bne 3f
mtlr r0
blr
+ /*
+ * The PAGE_OFFSET will map to a different physical address,
+ * jump to _start to do another relocation again.
+ */
+3: mr r3,r5
+ bl _start
+
/*
* We put a few things here that have to be page-aligned. This stuff
* goes at the beginning of the data segment, which is page-aligned.
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 1d54f6d..048d716 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -224,7 +224,7 @@ void __init adjust_total_lowmem(void)
i = switch_to_as1();
__max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM);
- restore_to_as0(i);
+ restore_to_as0(i, 0, 0);
pr_info("Memory CAM mapping: ");
for (i = 0; i < tlbcam_index - 1; i++)
@@ -245,17 +245,25 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
}
#ifdef CONFIG_RELOCATABLE
-notrace void __init relocate_init(phys_addr_t start)
+int __initdata is_second_reloc;
+notrace void __init relocate_init(u64 dt_ptr, phys_addr_t start)
{
unsigned long base = KERNELBASE;
+ kernstart_addr = start;
+ if (is_second_reloc) {
+ virt_phys_offset = PAGE_OFFSET - memstart_addr;
+ return;
+ }
+
/*
* Relocatable kernel support based on processing of dynamic
- * relocation entries.
- * Compute the virt_phys_offset :
+ * relocation entries. Before we get the real memstart_addr,
+ * We will compute the virt_phys_offset like this:
* virt_phys_offset = stext.run - kernstart_addr
*
- * stext.run = (KERNELBASE & ~0x3ffffff) + (kernstart_addr & 0x3ffffff)
+ * stext.run = (KERNELBASE & ~0x3ffffff) +
+ * (kernstart_addr & 0x3ffffff)
* When we relocate, we have :
*
* (kernstart_addr & 0x3ffffff) = (stext.run & 0x3ffffff)
@@ -265,10 +273,27 @@ notrace void __init relocate_init(phys_addr_t start)
* (kernstart_addr & ~0x3ffffff)
*
*/
- kernstart_addr = start;
start &= ~0x3ffffff;
base &= ~0x3ffffff;
virt_phys_offset = base - start;
+ early_get_first_memblock_info(__va(dt_ptr), NULL);
+ /*
+ * We now get the memstart_addr, then we should check if this
+ * address is the same as what the PAGE_OFFSET map to now. If
+ * not we have to change the map of PAGE_OFFSET to memstart_addr
+ * and do a second relocation.
+ */
+ if (start != memstart_addr) {
+ int n, offset = memstart_addr - start;
+
+ is_second_reloc = 1;
+ n = switch_to_as1();
+ /* map a 64M area for the second relocation */
+ map_mem_in_cams(0x4000000UL, CONFIG_LOWMEM_CAM_NUM);
+ restore_to_as0(n, offset, __va(dt_ptr));
+ /* We should never reach here */
+ panic("Relocation error");
+ }
}
#endif
#endif
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index eefbf7b..91da910 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -149,7 +149,7 @@ extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(unsigned long top);
extern void adjust_total_lowmem(void);
extern int switch_to_as1(void);
-extern void restore_to_as0(int esel);
+extern void restore_to_as0(int esel, int offset, void *dt_ptr);
#endif
extern void loadcam_entry(unsigned int index);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 5/7] powerpc: introduce early_get_first_memblock_info
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala, Benjamin Herrenschmidt; +Cc: linuxppc
In-Reply-To: <1375838315-27797-1-git-send-email-haokexin@gmail.com>
For a relocatable kernel since it can be loaded at any place, there
is no any relation between the kernel start addr and the memstart_addr.
So we can't calculate the memstart_addr from kernel start addr. And
also we can't wait to do the relocation after we get the real
memstart_addr from device tree because it is so late. So introduce
a new function we can use to get the first memblock address and size
in a very early stage (before machine_init).
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v3: Introduce a variable to avoid to mess the memblock.
v2: A new patch in v2.
arch/powerpc/kernel/prom.c | 41 ++++++++++++++++++++++++++++++++++++++++-
include/linux/of_fdt.h | 1 +
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index eb23ac9..bfd525e 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -521,6 +521,20 @@ static int __init early_init_dt_scan_memory_ppc(unsigned long node,
return early_init_dt_scan_memory(node, uname, depth, data);
}
+/*
+ * For a relocatable kernel, we need to get the memstart_addr first,
+ * then use it to calculate the virtual kernel start address. This has
+ * to happen at a very early stage (before machine_init). In this case,
+ * we just want to get the memstart_address and would not like to mess the
+ * memblock at this stage. So introduce a variable to skip the memblock_add()
+ * for this reason.
+ */
+#ifdef CONFIG_RELOCATABLE
+static int add_mem_to_memblock = 1;
+#else
+#define add_mem_to_memblock 1
+#endif
+
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{
#ifdef CONFIG_PPC64
@@ -541,7 +555,8 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
}
/* Add the chunk to the MEMBLOCK list */
- memblock_add(base, size);
+ if (add_mem_to_memblock)
+ memblock_add(base, size);
}
void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
@@ -753,6 +768,30 @@ void __init early_init_devtree(void *params)
DBG(" <- early_init_devtree()\n");
}
+#ifdef CONFIG_RELOCATABLE
+/*
+ * This function run before early_init_devtree, so we have to init
+ * initial_boot_params.
+ */
+void __init early_get_first_memblock_info(void *params, phys_addr_t *size)
+{
+ /* Setup flat device-tree pointer */
+ initial_boot_params = params;
+
+ /*
+ * Scan the memory nodes and set add_mem_to_memblock to 0 to avoid
+ * mess the memblock.
+ */
+ add_mem_to_memblock = 0;
+ of_scan_flat_dt(early_init_dt_scan_root, NULL);
+ of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
+ add_mem_to_memblock = 1;
+
+ if (size)
+ *size = first_memblock_size;
+}
+#endif
+
/*******
*
* New implementation of the OF "find" APIs, return a refcounted
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index ed136ad..befe744 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -117,6 +117,7 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname,
/* Other Prototypes */
extern void unflatten_device_tree(void);
extern void early_init_devtree(void *);
+extern void early_get_first_memblock_info(void *, phys_addr_t *);
#else /* CONFIG_OF_FLATTREE */
static inline void unflatten_device_tree(void) {}
#endif /* CONFIG_OF_FLATTREE */
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 3/7] powerpc: enable the relocatable support for the fsl booke 32bit kernel
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala; +Cc: linuxppc
In-Reply-To: <1375838315-27797-1-git-send-email-haokexin@gmail.com>
This is based on the codes in the head_44x.S. The difference is that
the init tlb size we used is 64M. With this patch we can only load the
kernel at address between memstart_addr ~ memstart_addr + 64M. We will
fix this restriction in the following patches.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v3:
* Use the 64M align.
* typo fix.
v2: Move the code to set kernstart_addr and virt_phys_offset to a c function.
So we can expand it easily later.
arch/powerpc/Kconfig | 2 +-
arch/powerpc/kernel/fsl_booke_entry_mapping.S | 2 ++
arch/powerpc/kernel/head_fsl_booke.S | 37 +++++++++++++++++++++++++++
arch/powerpc/mm/fsl_booke_mmu.c | 28 ++++++++++++++++++++
4 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 3bf72cd..57dc8f9 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -859,7 +859,7 @@ config DYNAMIC_MEMSTART
config RELOCATABLE
bool "Build a relocatable kernel"
- depends on ADVANCED_OPTIONS && FLATMEM && 44x
+ depends on ADVANCED_OPTIONS && FLATMEM && (44x || FSL_BOOKE)
select NONSTATIC_KERNEL
help
This builds a kernel image that is capable of running at the
diff --git a/arch/powerpc/kernel/fsl_booke_entry_mapping.S b/arch/powerpc/kernel/fsl_booke_entry_mapping.S
index a92c79b..f22e7e4 100644
--- a/arch/powerpc/kernel/fsl_booke_entry_mapping.S
+++ b/arch/powerpc/kernel/fsl_booke_entry_mapping.S
@@ -176,6 +176,8 @@ skpinv: addi r6,r6,1 /* Increment */
/* 7. Jump to KERNELBASE mapping */
lis r6,(KERNELBASE & ~0xfff)@h
ori r6,r6,(KERNELBASE & ~0xfff)@l
+ rlwinm r7,r25,0,0x03ffffff
+ add r6,r7,r6
#elif defined(ENTRY_MAPPING_KEXEC_SETUP)
/*
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 377bd81..f6ec9a3 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -73,6 +73,33 @@ _ENTRY(_start);
li r24,0 /* CPU number */
li r23,0 /* phys kernel start (high) */
+#ifdef CONFIG_RELOCATABLE
+ bl 0f /* Get our runtime address */
+0: mflr r3 /* Make it accessible */
+ addis r3,r3,(_stext - 0b)@ha
+ addi r3,r3,(_stext - 0b)@l /* Get our current runtime base */
+
+ /* Translate _stext address to physical, save in r23/r25 */
+ bl get_phys_addr
+ mr r23,r3
+ mr r25,r4
+
+ /*
+ * We have the runtime (virutal) address of our base.
+ * We calculate our shift of offset from a 64M page.
+ * We could map the 64M page we belong to at PAGE_OFFSET and
+ * get going from there.
+ */
+ lis r4,KERNELBASE@h
+ ori r4,r4,KERNELBASE@l
+ rlwinm r6,r25,0,0x3ffffff /* r6 = PHYS_START % 64M */
+ rlwinm r5,r4,0,0x3ffffff /* r5 = KERNELBASE % 64M */
+ subf r3,r5,r6 /* r3 = r6 - r5 */
+ add r3,r4,r3 /* Required Virtual Address */
+
+ bl relocate
+#endif
+
/* We try to not make any assumptions about how the boot loader
* setup or used the TLBs. We invalidate all mappings from the
* boot loader and load a single entry in TLB1[0] to map the
@@ -182,6 +209,16 @@ _ENTRY(__early_start)
bl early_init
+#ifdef CONFIG_RELOCATABLE
+#ifdef CONFIG_PHYS_64BIT
+ mr r3,r23
+ mr r4,r25
+#else
+ mr r3,r25
+#endif
+ bl relocate_init
+#endif
+
#ifdef CONFIG_DYNAMIC_MEMSTART
lis r3,kernstart_addr@ha
la r3,kernstart_addr@l(r3)
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 07ba45b..ce4a116 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -241,4 +241,32 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
/* 64M mapped initially according to head_fsl_booke.S */
memblock_set_current_limit(min_t(u64, limit, 0x04000000));
}
+
+#ifdef CONFIG_RELOCATABLE
+notrace void __init relocate_init(phys_addr_t start)
+{
+ unsigned long base = KERNELBASE;
+
+ /*
+ * Relocatable kernel support based on processing of dynamic
+ * relocation entries.
+ * Compute the virt_phys_offset :
+ * virt_phys_offset = stext.run - kernstart_addr
+ *
+ * stext.run = (KERNELBASE & ~0x3ffffff) + (kernstart_addr & 0x3ffffff)
+ * When we relocate, we have :
+ *
+ * (kernstart_addr & 0x3ffffff) = (stext.run & 0x3ffffff)
+ *
+ * hence:
+ * virt_phys_offset = (KERNELBASE & ~0x3ffffff) -
+ * (kernstart_addr & ~0x3ffffff)
+ *
+ */
+ kernstart_addr = start;
+ start &= ~0x3ffffff;
+ base &= ~0x3ffffff;
+ virt_phys_offset = base - start;
+}
+#endif
#endif
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 4/7] powerpc/fsl_booke: set the tlb entry for the kernel address in AS1
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala; +Cc: linuxppc
In-Reply-To: <1375838315-27797-1-git-send-email-haokexin@gmail.com>
We use the tlb1 entries to map low mem to the kernel space. In the
current code, it assumes that the first tlb entry would cover the
kernel image. But this is not true for some special cases, such as
when we run a relocatable kernel above the 64M or set
CONFIG_KERNEL_START above 64M. So we choose to switch to address
space 1 before setting these tlb entries.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v3: Typo fix.
v2: A new patch in v2.
arch/powerpc/kernel/head_fsl_booke.S | 81 ++++++++++++++++++++++++++++++++++++
arch/powerpc/mm/fsl_booke_mmu.c | 2 +
arch/powerpc/mm/mmu_decl.h | 2 +
3 files changed, 85 insertions(+)
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index f6ec9a3..7e9724e 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -1170,6 +1170,87 @@ __secondary_hold_acknowledge:
#endif
/*
+ * Create a tlb entry with the same effective and physical address as
+ * the tlb entry used by the current running code. But set the TS to 1.
+ * Then switch to the address space 1. It will return with the r3 set to
+ * the ESEL of the new created tlb.
+ */
+_GLOBAL(switch_to_as1)
+ mflr r5
+
+ /* Find a entry not used */
+ mfspr r3,SPRN_TLB1CFG
+ andi. r3,r3,0xfff
+ mfspr r4,SPRN_PID
+ rlwinm r4,r4,16,0x3fff0000 /* turn PID into MAS6[SPID] */
+ mtspr SPRN_MAS6,r4
+1: lis r4,0x1000 /* Set MAS0(TLBSEL) = 1 */
+ addi r3,r3,-1
+ rlwimi r4,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
+ mtspr SPRN_MAS0,r4
+ tlbre
+ mfspr r4,SPRN_MAS1
+ andis. r4,r4,MAS1_VALID@h
+ bne 1b
+
+ /* Get the tlb entry used by the current running code */
+ bl 0f
+0: mflr r4
+ tlbsx 0,r4
+
+ mfspr r4,SPRN_MAS1
+ ori r4,r4,MAS1_TS /* Set the TS = 1 */
+ mtspr SPRN_MAS1,r4
+
+ mfspr r4,SPRN_MAS0
+ rlwinm r4,r4,0,~MAS0_ESEL_MASK
+ rlwimi r4,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
+ mtspr SPRN_MAS0,r4
+ tlbwe
+ isync
+ sync
+
+ mfmsr r4
+ ori r4,r4,MSR_IS | MSR_DS
+ mtspr SPRN_SRR0,r5
+ mtspr SPRN_SRR1,r4
+ sync
+ rfi
+
+/*
+ * Restore to the address space 0 and also invalidate the tlb entry created
+ * by switch_to_as1.
+*/
+_GLOBAL(restore_to_as0)
+ mflr r0
+
+ bl 0f
+0: mflr r9
+ addi r9,r9,1f - 0b
+
+ mfmsr r7
+ li r8,(MSR_IS | MSR_DS)
+ andc r7,r7,r8
+
+ mtspr SPRN_SRR0,r9
+ mtspr SPRN_SRR1,r7
+ sync
+ rfi
+
+ /* Invalidate the temporary tlb entry for AS1 */
+1: lis r9,0x1000 /* Set MAS0(TLBSEL) = 1 */
+ rlwimi r9,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */
+ mtspr SPRN_MAS0,r9
+ tlbre
+ mfspr r9,SPRN_MAS1
+ rlwinm r9,r9,0,2,31 /* Clear MAS1 Valid and IPPROT */
+ mtspr SPRN_MAS1,r9
+ tlbwe
+ isync
+ mtlr r0
+ blr
+
+/*
* We put a few things here that have to be page-aligned. This stuff
* goes at the beginning of the data segment, which is page-aligned.
*/
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index ce4a116..1d54f6d 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -222,7 +222,9 @@ void __init adjust_total_lowmem(void)
/* adjust lowmem size to __max_low_memory */
ram = min((phys_addr_t)__max_low_memory, (phys_addr_t)total_lowmem);
+ i = switch_to_as1();
__max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM);
+ restore_to_as0(i);
pr_info("Memory CAM mapping: ");
for (i = 0; i < tlbcam_index - 1; i++)
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index 83eb5d5..eefbf7b 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -148,6 +148,8 @@ extern unsigned long calc_cam_sz(unsigned long ram, unsigned long virt,
extern void MMU_init_hw(void);
extern unsigned long mmu_mapin_ram(unsigned long top);
extern void adjust_total_lowmem(void);
+extern int switch_to_as1(void);
+extern void restore_to_as0(int esel);
#endif
extern void loadcam_entry(unsigned int index);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 1/7] powerpc/fsl_booke: protect the access to MAS7
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala; +Cc: linuxppc
In-Reply-To: <1375838315-27797-1-git-send-email-haokexin@gmail.com>
The e500v1 doesn't implement the MAS7, so we should avoid to access
this register on that implementations. In the current kernel, the
access to MAS7 are protected by either CONFIG_PHYS_64BIT or
MMU_FTR_BIG_PHYS. Since some code are executed before the code
patching, we have to use CONFIG_PHYS_64BIT in these cases.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v3: Use ifdef CONFIG_PHYS_64BIT for the code running before code patching.
v2: A new patch in v2.
arch/powerpc/kernel/head_fsl_booke.S | 2 ++
arch/powerpc/mm/hugetlbpage-book3e.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index d10a7ca..304e6f2 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -82,7 +82,9 @@ _ENTRY(_start);
and r19,r3,r18 /* r19 = page offset */
andc r31,r20,r18 /* r31 = page base */
or r31,r31,r19 /* r31 = devtree phys addr */
+#ifdef CONFIG_PHYS_64BIT
mfspr r30,SPRN_MAS7
+#endif
li r25,0 /* phys kernel start (low) */
li r24,0 /* CPU number */
diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c
index 3bc7006..ac63e7e 100644
--- a/arch/powerpc/mm/hugetlbpage-book3e.c
+++ b/arch/powerpc/mm/hugetlbpage-book3e.c
@@ -103,7 +103,8 @@ void book3e_hugetlb_preload(struct vm_area_struct *vma, unsigned long ea,
if (mmu_has_feature(MMU_FTR_USE_PAIRED_MAS)) {
mtspr(SPRN_MAS7_MAS3, mas7_3);
} else {
- mtspr(SPRN_MAS7, upper_32_bits(mas7_3));
+ if (mmu_has_feature(MMU_FTR_BIG_PHYS))
+ mtspr(SPRN_MAS7, upper_32_bits(mas7_3));
mtspr(SPRN_MAS3, lower_32_bits(mas7_3));
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 2/7] powerpc/fsl_booke: introduce get_phys_addr function
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala; +Cc: linuxppc
In-Reply-To: <1375838315-27797-1-git-send-email-haokexin@gmail.com>
Move the codes which translate a effective address to physical address
to a separate function. So it can be reused by other code.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v3: Use ifdef CONFIG_PHYS_64BIT to protect the access to MAS7
v2: A new patch in v2.
arch/powerpc/kernel/head_fsl_booke.S | 50 +++++++++++++++++++++---------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 304e6f2..377bd81 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -65,26 +65,9 @@ _ENTRY(_start);
nop
/* Translate device tree address to physical, save in r30/r31 */
- mfmsr r16
- mfspr r17,SPRN_PID
- rlwinm r17,r17,16,0x3fff0000 /* turn PID into MAS6[SPID] */
- rlwimi r17,r16,28,0x00000001 /* turn MSR[DS] into MAS6[SAS] */
- mtspr SPRN_MAS6,r17
-
- tlbsx 0,r3 /* must succeed */
-
- mfspr r16,SPRN_MAS1
- mfspr r20,SPRN_MAS3
- rlwinm r17,r16,25,0x1f /* r17 = log2(page size) */
- li r18,1024
- slw r18,r18,r17 /* r18 = page size */
- addi r18,r18,-1
- and r19,r3,r18 /* r19 = page offset */
- andc r31,r20,r18 /* r31 = page base */
- or r31,r31,r19 /* r31 = devtree phys addr */
-#ifdef CONFIG_PHYS_64BIT
- mfspr r30,SPRN_MAS7
-#endif
+ bl get_phys_addr
+ mr r30,r3
+ mr r31,r4
li r25,0 /* phys kernel start (low) */
li r24,0 /* CPU number */
@@ -858,6 +841,33 @@ KernelSPE:
#endif /* CONFIG_SPE */
/*
+ * Translate the effec addr in r3 to phys addr. The phys addr will be put
+ * into r3(higher 32bit) and r4(lower 32bit)
+ */
+get_phys_addr:
+ mfmsr r8
+ mfspr r9,SPRN_PID
+ rlwinm r9,r9,16,0x3fff0000 /* turn PID into MAS6[SPID] */
+ rlwimi r9,r8,28,0x00000001 /* turn MSR[DS] into MAS6[SAS] */
+ mtspr SPRN_MAS6,r9
+
+ tlbsx 0,r3 /* must succeed */
+
+ mfspr r8,SPRN_MAS1
+ mfspr r12,SPRN_MAS3
+ rlwinm r9,r8,25,0x1f /* r9 = log2(page size) */
+ li r10,1024
+ slw r10,r10,r9 /* r10 = page size */
+ addi r10,r10,-1
+ and r11,r3,r10 /* r11 = page offset */
+ andc r4,r12,r10 /* r4 = page base */
+ or r4,r4,r11 /* r4 = devtree phys addr */
+#ifdef CONFIG_PHYS_64BIT
+ mfspr r3,SPRN_MAS7
+#endif
+ blr
+
+/*
* Global functions
*/
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 0/7] powerpc: enable the relocatable support for fsl booke 32bit kernel
From: Kevin Hao @ 2013-08-07 1:18 UTC (permalink / raw)
To: Scott Wood, Kumar Gala; +Cc: linuxppc
v3:
The main changes include:
* Drop the patch 5 in v2 (memblock: introduce the memblock_reinit function)
* Change to use the 64M boot init tlb.
Please refer to the comment section of each patch for more detail.
This patch series passed the kdump test with kernel option "crashkernel=64M@32M"
and "crashkernel=64M@80M" on a p2020rdb board.
v2:
These patches are based on the Ben's next branch. In this version we choose
to do a second relocation if the PAGE_OFFSET is not mapped to the memstart_addr
and we also choose to set the tlb1 entries for the kernel space in address
space 1. With this implementation:
* We can load the kernel at any place between
memstart_addr ~ memstart_addr + 768M
* We can reserve any memory between memstart_addr ~ memstart_addr + 768M
for a kdump kernel.
I have done a kdump boot on a p2020rdb kernel with the memory reserved by
'crashkernel=32M@320M'.
v1:
Currently the fsl booke 32bit kernel is using the DYNAMIC_MEMSTART relocation
method. But the RELOCATABLE method is more flexible and has less alignment
restriction. So enable this feature on this platform and use it by
default for the kdump kernel.
These patches have passed the kdump boot test on a p2020rdb board.
---
Kevin Hao (7):
powerpc/fsl_booke: protect the access to MAS7
powerpc/fsl_booke: introduce get_phys_addr function
powerpc: enable the relocatable support for the fsl booke 32bit kernel
powerpc/fsl_booke: set the tlb entry for the kernel address in AS1
powerpc: introduce early_get_first_memblock_info
powerpc/fsl_booke: make sure PAGE_OFFSET map to memstart_addr for
relocatable kernel
powerpc/fsl_booke: enable the relocatable for the kdump kernel
arch/powerpc/Kconfig | 5 +-
arch/powerpc/kernel/fsl_booke_entry_mapping.S | 2 +
arch/powerpc/kernel/head_fsl_booke.S | 231 ++++++++++++++++++++++++--
arch/powerpc/kernel/prom.c | 41 ++++-
arch/powerpc/mm/fsl_booke_mmu.c | 55 ++++++
arch/powerpc/mm/hugetlbpage-book3e.c | 3 +-
arch/powerpc/mm/mmu_decl.h | 2 +
include/linux/of_fdt.h | 1 +
8 files changed, 317 insertions(+), 23 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s
From: Scott Wood @ 2013-08-07 1:11 UTC (permalink / raw)
To: Paul Mackerras
Cc: Wood Scott-B07421, kvm@vger.kernel.org, agraf@suse.de,
kvm-ppc@vger.kernel.org, Bhushan Bharat-R65777,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20130807002408.GE19254@iris.ozlabs.ibm.com>
On Wed, 2013-08-07 at 10:24 +1000, Paul Mackerras wrote:
> On Tue, Aug 06, 2013 at 07:02:48AM +0000, Bhushan Bharat-R65777 wrote:
> >
> > I am trying to me the Linux pte search and update generic so that this can be used for powerpc as well.
> >
> > I am not sure which of the below two should be ok, please help
>
> Given that the BookE code uses gfn_to_pfn_memslot() to get the host
> pfn, and then kvm_set_pfn_dirty(pfn) on pages that you're going to let
> the guest write to, I don't think you need to set the dirty and/or
> accessed bits in the Linux PTE explicitly. If you care about the
> WIMGE bits you can do find_linux_pte_or_hugepte() and just look at the
> PTE, but you really should be using mmu_notifier_retry() to guard
> against concurrent changes to the Linux PTE. See the HV KVM code or
> patch 21 of my recent series to see how it's used.
Hmm... we only get a callback on invalidate_range_start(), not
invalidate_range_end() (and even if we did get a callback for the
latter, it'd probably be racy). So we may have a problem here
regardless of getting WIMG from the PTE, unless it's guaranteed that
hva_to_pfn() will fail after invalidate_range_start().
> You probably should be calling kvm_set_pfn_accessed() as well.
Yeah... I think it'll only affect the quality of page-out decisions (as
opposed to corruption and such), but still it should be fixed.
-Scott
^ permalink raw reply
* Re: [PATCH 5/6 v2] kvm: powerpc: booke: Add linux pte lookup like booke3s
From: Paul Mackerras @ 2013-08-07 0:24 UTC (permalink / raw)
To: Bhushan Bharat-R65777
Cc: Wood Scott-B07421, kvm@vger.kernel.org, agraf@suse.de,
kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D070FBE3B@039-SN2MPN1-012.039d.mgd.msft.net>
On Tue, Aug 06, 2013 at 07:02:48AM +0000, Bhushan Bharat-R65777 wrote:
>
> I am trying to me the Linux pte search and update generic so that this can be used for powerpc as well.
>
> I am not sure which of the below two should be ok, please help
Given that the BookE code uses gfn_to_pfn_memslot() to get the host
pfn, and then kvm_set_pfn_dirty(pfn) on pages that you're going to let
the guest write to, I don't think you need to set the dirty and/or
accessed bits in the Linux PTE explicitly. If you care about the
WIMGE bits you can do find_linux_pte_or_hugepte() and just look at the
PTE, but you really should be using mmu_notifier_retry() to guard
against concurrent changes to the Linux PTE. See the HV KVM code or
patch 21 of my recent series to see how it's used. You probably
should be calling kvm_set_pfn_accessed() as well.
Paul.
^ permalink raw reply
* Re: [PATCH] net/fsl_pq_mdio: fix handling of TBIPA register
From: Scott Wood @ 2013-08-06 23:55 UTC (permalink / raw)
To: Lutz Jaenicke; +Cc: linuxppc-dev
In-Reply-To: <1375830655.5600.24.camel@snotra.buserror.net>
On Tue, 2013-08-06 at 18:10 -0500, Scott Wood wrote:
> On Thu, 2013-08-01 at 19:49 +0200, Lutz Jaenicke wrote:
> > The TBIPA register is part of gianfar's full register set. When starting
> > from the MII registers, the start address of struct gfar needs to
> > be determined via container_of().
> > Experienced with mpc8313 and "fsl,gianfar-mdio" device tree entries.
> >
> > Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
> > ---
> > drivers/net/ethernet/freescale/fsl_pq_mdio.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> > index c93a056..9485fdb 100644
> > --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> > +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> > @@ -193,7 +193,8 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus)
> > */
> > static uint32_t __iomem *get_gfar_tbipa(void __iomem *p)
> > {
> > - struct gfar __iomem *enet_regs = p;
> > + struct gfar __iomem *enet_regs =
> > + container_of(p, struct gfar, gfar_mii_regs);
> >
> > return &enet_regs->tbipa;
> > }
>
> Please send this to the netdev list/maintainer.
Though, do we have any guarantee that p is contained by a "struct gfar"?
It looks like the code of_iomap()s the reg of the mdio node, which is
just the MDIO registers. Don't access outside that area.
Of course, this register probably *should* be described in the MDIO node
(see http://patchwork.ozlabs.org/patch/250766/), but since it isn't,
we'll need to either find the associated full gianfar device and ask it
to set tbipa, or look up the physical address of tbipa and do a separate
ioremap. I know that in practice we'll have at least 4K-granular
mappings and thus tbipa will be there, but it's best to avoid such
hacks.
-Scott
^ permalink raw reply
* Re: [PATCH V2 5/6] cpuidle/powerpc: Backend-powerpc idle driver for powernv and pseries.
From: Scott Wood @ 2013-08-06 23:41 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Deepthi Dharwar, linux-pm, daniel.lezcano, rjw, linux-kernel,
dongsheng.wang, srivatsa.bhat, preeti, linuxppc-dev
In-Reply-To: <1375831851.12557.74.camel@pasglop>
On Wed, 2013-08-07 at 09:30 +1000, Benjamin Herrenschmidt wrote:
> On Tue, 2013-08-06 at 18:08 -0500, Scott Wood wrote:
> > Here's another example. get_lppaca() will only build on book3s -- and
> > yet we get requests for e500 code to use this file.
>
> Indeed, Besides there is already accessors afaik for lppaca that compile
> to nothing on E (and if not they would be trivial to add).
I don't see such an accessor, but if there were, what would happen when
the caller goes on to dereference that nothing?
There is an accessor for shared_proc specifically (in the spinlock code)
-- not that it would be much help on booke to just compile away that
check and always select one of the pseries state tables over the other.
-Scott
^ permalink raw reply
* Re: [PATCH 00/11] Add compression support to pstore
From: Tony Luck @ 2013-08-06 23:36 UTC (permalink / raw)
To: Aruna Balakrishnaiah
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org,
linux-kernel@vger.kernel.org, keescook@chromium.org
In-Reply-To: <CA+8MBbK9oZJO+RJGC-7riO=Kz=UbRcAvQ-nDi=2GLyvEDpoc7g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2244 bytes --]
On Mon, Aug 5, 2013 at 2:20 PM, Tony Luck <tony.luck@gmail.com> wrote:
> Still have problems booting if there are any compressed images in ERST
> to be inflated.
So I took another look at this part of the code ... and saw a couple of issues:
while ((size = psi->read(&id, &type, &count, &time, &buf, &compressed,
psi)) > 0) {
if (compressed && (type == PSTORE_TYPE_DMESG)) {
big_buf_sz = (psinfo->bufsize * 100) / 45;
big_buf = allocate_buf_for_decompression(big_buf_sz);
if (big_buf || stream.workspace)
>>> Did you mean "&&" here rather that "||"?
unzipped_len = pstore_decompress(buf, big_buf,
size, big_buf_sz);
>>> Need an "else" here to set unzipped_len to -1 (or set it to -1 down
>>> at the bottom of the loop ready for next time around.
if (unzipped_len > 0) {
buf = big_buf;
>>> This sets us up for problems. First, you just overwrote the address
>>> of the buffer that psi->read allocated - so we have a memory leak. But
>>> worse than that we now double free the same buffer below when we
>>> kfree(buf) and then kfree(big_buf)
size = unzipped_len;
compressed = false;
} else {
pr_err("pstore: decompression failed;"
"returned %d\n", unzipped_len);
compressed = true;
}
}
rc = pstore_mkfile(type, psi->name, id, count, buf,
compressed, (size_t)size, time, psi);
kfree(buf);
kfree(stream.workspace);
kfree(big_buf);
buf = NULL;
stream.workspace = NULL;
big_buf = NULL;
if (rc && (rc != -EEXIST || !quiet))
failed++;
}
See attached patch that fixes these - but the code still looks like it
could be cleaned up a bit more.
-Tony
[-- Attachment #2: pstore.patch --]
[-- Type: application/octet-stream, Size: 807 bytes --]
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 3446c99..f891758 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -474,12 +474,14 @@ void pstore_get_records(int quiet)
big_buf_sz = (psinfo->bufsize * 100) / 45;
big_buf = allocate_buf_for_decompression(big_buf_sz);
- if (big_buf || stream.workspace)
+ if (big_buf && stream.workspace)
unzipped_len = pstore_decompress(buf, big_buf,
size, big_buf_sz);
if (unzipped_len > 0) {
+ kfree(buf);
buf = big_buf;
+ big_buf = NULL;
size = unzipped_len;
compressed = false;
} else {
@@ -496,6 +498,7 @@ void pstore_get_records(int quiet)
buf = NULL;
stream.workspace = NULL;
big_buf = NULL;
+ unzipped_len = -1;
if (rc && (rc != -EEXIST || !quiet))
failed++;
}
^ permalink raw reply related
* Re: [PATCH V2 5/6] cpuidle/powerpc: Backend-powerpc idle driver for powernv and pseries.
From: Benjamin Herrenschmidt @ 2013-08-06 23:30 UTC (permalink / raw)
To: Scott Wood
Cc: Deepthi Dharwar, linux-pm, daniel.lezcano, rjw, linux-kernel,
dongsheng.wang, srivatsa.bhat, preeti, linuxppc-dev
In-Reply-To: <1375830520.5600.23.camel@snotra.buserror.net>
On Tue, 2013-08-06 at 18:08 -0500, Scott Wood wrote:
> Here's another example. get_lppaca() will only build on book3s -- and
> yet we get requests for e500 code to use this file.
Indeed, Besides there is already accessors afaik for lppaca that compile
to nothing on E (and if not they would be trivial to add).
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 63/63] powerpc: Add pseries_le_defconfig
From: Michael Neuling @ 2013-08-06 23:31 UTC (permalink / raw)
To: Anton Blanchard; +Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <1375804940-22050-64-git-send-email-anton@samba.org>
Anton Blanchard <anton@samba.org> wrote:
> This is the pseries_defconfig with CONFIG_CPU_LITTLE_ENDIAN enabled
> and CONFIG_VIRTUALIZATION disabled (required until we fix some
> endian issues in KVM).
The CONFIG_VIRTUALIZATION disabling should be done in the Kconfig not
here.
I'm not that keen on another defconfig. benh is already talking about
having a powernv defconfig. I'm worried we are going to fragment the
defconfigs. If you want something special like LE, then change the
default one.
Mikey
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/powerpc/configs/pseries_le_defconfig | 347 ++++++++++++++++++++++++++++++
> 1 file changed, 347 insertions(+)
> create mode 100644 arch/powerpc/configs/pseries_le_defconfig
>
> diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig
> new file mode 100644
> index 0000000..a30db45
> --- /dev/null
> +++ b/arch/powerpc/configs/pseries_le_defconfig
> @@ -0,0 +1,347 @@
> +CONFIG_PPC64=y
> +CONFIG_ALTIVEC=y
> +CONFIG_VSX=y
> +CONFIG_SMP=y
> +CONFIG_NR_CPUS=2048
> +CONFIG_EXPERIMENTAL=y
> +CONFIG_SYSVIPC=y
> +CONFIG_POSIX_MQUEUE=y
> +CONFIG_AUDIT=y
> +CONFIG_AUDITSYSCALL=y
> +CONFIG_IRQ_DOMAIN_DEBUG=y
> +CONFIG_NO_HZ=y
> +CONFIG_HIGH_RES_TIMERS=y
> +CONFIG_TASKSTATS=y
> +CONFIG_TASK_DELAY_ACCT=y
> +CONFIG_TASK_XACCT=y
> +CONFIG_TASK_IO_ACCOUNTING=y
> +CONFIG_IKCONFIG=y
> +CONFIG_IKCONFIG_PROC=y
> +CONFIG_CGROUPS=y
> +CONFIG_CGROUP_FREEZER=y
> +CONFIG_CGROUP_DEVICE=y
> +CONFIG_CPUSETS=y
> +CONFIG_CGROUP_CPUACCT=y
> +CONFIG_BLK_DEV_INITRD=y
> +# CONFIG_COMPAT_BRK is not set
> +CONFIG_PROFILING=y
> +CONFIG_OPROFILE=y
> +CONFIG_KPROBES=y
> +CONFIG_JUMP_LABEL=y
> +CONFIG_MODULES=y
> +CONFIG_MODULE_UNLOAD=y
> +CONFIG_MODVERSIONS=y
> +CONFIG_MODULE_SRCVERSION_ALL=y
> +CONFIG_PARTITION_ADVANCED=y
> +CONFIG_EFI_PARTITION=y
> +CONFIG_PPC_SPLPAR=y
> +CONFIG_SCANLOG=m
> +CONFIG_PPC_SMLPAR=y
> +CONFIG_DTL=y
> +# CONFIG_PPC_PMAC is not set
> +CONFIG_RTAS_FLASH=m
> +CONFIG_IBMEBUS=y
> +CONFIG_HZ_100=y
> +CONFIG_BINFMT_MISC=m
> +CONFIG_PPC_TRANSACTIONAL_MEM=y
> +CONFIG_HOTPLUG_CPU=y
> +CONFIG_KEXEC=y
> +CONFIG_IRQ_ALL_CPUS=y
> +CONFIG_MEMORY_HOTPLUG=y
> +CONFIG_MEMORY_HOTREMOVE=y
> +CONFIG_PPC_64K_PAGES=y
> +CONFIG_PPC_SUBPAGE_PROT=y
> +CONFIG_SCHED_SMT=y
> +CONFIG_PPC_DENORMALISATION=y
> +CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI_RPA=m
> +CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
> +CONFIG_PACKET=y
> +CONFIG_UNIX=y
> +CONFIG_XFRM_USER=m
> +CONFIG_NET_KEY=m
> +CONFIG_INET=y
> +CONFIG_IP_MULTICAST=y
> +CONFIG_NET_IPIP=y
> +CONFIG_SYN_COOKIES=y
> +CONFIG_INET_AH=m
> +CONFIG_INET_ESP=m
> +CONFIG_INET_IPCOMP=m
> +# CONFIG_IPV6 is not set
> +CONFIG_NETFILTER=y
> +CONFIG_NF_CONNTRACK=m
> +CONFIG_NF_CONNTRACK_EVENTS=y
> +CONFIG_NF_CT_PROTO_UDPLITE=m
> +CONFIG_NF_CONNTRACK_FTP=m
> +CONFIG_NF_CONNTRACK_IRC=m
> +CONFIG_NF_CONNTRACK_TFTP=m
> +CONFIG_NF_CT_NETLINK=m
> +CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
> +CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
> +CONFIG_NETFILTER_XT_TARGET_MARK=m
> +CONFIG_NETFILTER_XT_TARGET_NFLOG=m
> +CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
> +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
> +CONFIG_NETFILTER_XT_MATCH_COMMENT=m
> +CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
> +CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
> +CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
> +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
> +CONFIG_NETFILTER_XT_MATCH_DCCP=m
> +CONFIG_NETFILTER_XT_MATCH_DSCP=m
> +CONFIG_NETFILTER_XT_MATCH_ESP=m
> +CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
> +CONFIG_NETFILTER_XT_MATCH_HELPER=m
> +CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
> +CONFIG_NETFILTER_XT_MATCH_LENGTH=m
> +CONFIG_NETFILTER_XT_MATCH_LIMIT=m
> +CONFIG_NETFILTER_XT_MATCH_MAC=m
> +CONFIG_NETFILTER_XT_MATCH_MARK=m
> +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
> +CONFIG_NETFILTER_XT_MATCH_OWNER=m
> +CONFIG_NETFILTER_XT_MATCH_POLICY=m
> +CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
> +CONFIG_NETFILTER_XT_MATCH_QUOTA=m
> +CONFIG_NETFILTER_XT_MATCH_RATEEST=m
> +CONFIG_NETFILTER_XT_MATCH_REALM=m
> +CONFIG_NETFILTER_XT_MATCH_RECENT=m
> +CONFIG_NETFILTER_XT_MATCH_SCTP=m
> +CONFIG_NETFILTER_XT_MATCH_STATE=m
> +CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
> +CONFIG_NETFILTER_XT_MATCH_STRING=m
> +CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
> +CONFIG_NETFILTER_XT_MATCH_TIME=m
> +CONFIG_NETFILTER_XT_MATCH_U32=m
> +CONFIG_NF_CONNTRACK_IPV4=m
> +CONFIG_IP_NF_QUEUE=m
> +CONFIG_IP_NF_IPTABLES=m
> +CONFIG_IP_NF_MATCH_AH=m
> +CONFIG_IP_NF_MATCH_ECN=m
> +CONFIG_IP_NF_MATCH_TTL=m
> +CONFIG_IP_NF_FILTER=m
> +CONFIG_IP_NF_TARGET_REJECT=m
> +CONFIG_IP_NF_TARGET_ULOG=m
> +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
> +CONFIG_DEVTMPFS=y
> +CONFIG_DEVTMPFS_MOUNT=y
> +CONFIG_PROC_DEVICETREE=y
> +CONFIG_PARPORT=m
> +CONFIG_PARPORT_PC=m
> +CONFIG_BLK_DEV_FD=m
> +CONFIG_BLK_DEV_LOOP=y
> +CONFIG_BLK_DEV_NBD=m
> +CONFIG_BLK_DEV_RAM=y
> +CONFIG_BLK_DEV_RAM_SIZE=65536
> +CONFIG_IDE=y
> +CONFIG_BLK_DEV_IDECD=y
> +CONFIG_BLK_DEV_GENERIC=y
> +CONFIG_BLK_DEV_AMD74XX=y
> +CONFIG_BLK_DEV_SD=y
> +CONFIG_CHR_DEV_ST=y
> +CONFIG_BLK_DEV_SR=y
> +CONFIG_BLK_DEV_SR_VENDOR=y
> +CONFIG_CHR_DEV_SG=y
> +CONFIG_SCSI_MULTI_LUN=y
> +CONFIG_SCSI_CONSTANTS=y
> +CONFIG_SCSI_FC_ATTRS=y
> +CONFIG_SCSI_CXGB3_ISCSI=m
> +CONFIG_SCSI_CXGB4_ISCSI=m
> +CONFIG_SCSI_BNX2_ISCSI=m
> +CONFIG_BE2ISCSI=m
> +CONFIG_SCSI_MPT2SAS=m
> +CONFIG_SCSI_IBMVSCSI=y
> +CONFIG_SCSI_IBMVFC=m
> +CONFIG_SCSI_SYM53C8XX_2=y
> +CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
> +CONFIG_SCSI_IPR=y
> +CONFIG_SCSI_QLA_FC=m
> +CONFIG_SCSI_QLA_ISCSI=m
> +CONFIG_SCSI_LPFC=m
> +CONFIG_ATA=y
> +# CONFIG_ATA_SFF is not set
> +CONFIG_MD=y
> +CONFIG_BLK_DEV_MD=y
> +CONFIG_MD_LINEAR=y
> +CONFIG_MD_RAID0=y
> +CONFIG_MD_RAID1=y
> +CONFIG_MD_RAID10=m
> +CONFIG_MD_RAID456=m
> +CONFIG_MD_MULTIPATH=m
> +CONFIG_MD_FAULTY=m
> +CONFIG_BLK_DEV_DM=y
> +CONFIG_DM_CRYPT=m
> +CONFIG_DM_SNAPSHOT=m
> +CONFIG_DM_MIRROR=m
> +CONFIG_DM_ZERO=m
> +CONFIG_DM_MULTIPATH=m
> +CONFIG_BONDING=m
> +CONFIG_DUMMY=m
> +CONFIG_NETCONSOLE=y
> +CONFIG_NETPOLL_TRAP=y
> +CONFIG_TUN=m
> +CONFIG_VORTEX=y
> +CONFIG_ACENIC=m
> +CONFIG_ACENIC_OMIT_TIGON_I=y
> +CONFIG_PCNET32=y
> +CONFIG_TIGON3=y
> +CONFIG_CHELSIO_T1=m
> +CONFIG_BE2NET=m
> +CONFIG_S2IO=m
> +CONFIG_IBMVETH=y
> +CONFIG_EHEA=y
> +CONFIG_E100=y
> +CONFIG_E1000=y
> +CONFIG_E1000E=y
> +CONFIG_IXGB=m
> +CONFIG_IXGBE=m
> +CONFIG_MLX4_EN=m
> +CONFIG_MYRI10GE=m
> +CONFIG_QLGE=m
> +CONFIG_NETXEN_NIC=m
> +CONFIG_PPP=m
> +CONFIG_PPP_BSDCOMP=m
> +CONFIG_PPP_DEFLATE=m
> +CONFIG_PPPOE=m
> +CONFIG_PPP_ASYNC=m
> +CONFIG_PPP_SYNC_TTY=m
> +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> +CONFIG_INPUT_EVDEV=m
> +CONFIG_INPUT_MISC=y
> +CONFIG_INPUT_PCSPKR=m
> +# CONFIG_SERIO_SERPORT is not set
> +CONFIG_SERIAL_8250=y
> +CONFIG_SERIAL_8250_CONSOLE=y
> +CONFIG_SERIAL_ICOM=m
> +CONFIG_SERIAL_JSM=m
> +CONFIG_HVC_CONSOLE=y
> +CONFIG_HVC_RTAS=y
> +CONFIG_HVCS=m
> +CONFIG_IBM_BSR=m
> +CONFIG_GEN_RTC=y
> +CONFIG_RAW_DRIVER=y
> +CONFIG_MAX_RAW_DEVS=1024
> +CONFIG_FB=y
> +CONFIG_FIRMWARE_EDID=y
> +CONFIG_FB_OF=y
> +CONFIG_FB_MATROX=y
> +CONFIG_FB_MATROX_MILLENIUM=y
> +CONFIG_FB_MATROX_MYSTIQUE=y
> +CONFIG_FB_MATROX_G=y
> +CONFIG_FB_RADEON=y
> +CONFIG_FB_IBM_GXT4500=y
> +CONFIG_LCD_PLATFORM=m
> +# CONFIG_VGA_CONSOLE is not set
> +CONFIG_FRAMEBUFFER_CONSOLE=y
> +CONFIG_LOGO=y
> +CONFIG_HID_GYRATION=y
> +CONFIG_HID_PANTHERLORD=y
> +CONFIG_HID_PETALYNX=y
> +CONFIG_HID_SAMSUNG=y
> +CONFIG_HID_SONY=y
> +CONFIG_HID_SUNPLUS=y
> +CONFIG_USB_HIDDEV=y
> +CONFIG_USB=y
> +CONFIG_USB_MON=m
> +CONFIG_USB_EHCI_HCD=y
> +# CONFIG_USB_EHCI_HCD_PPC_OF is not set
> +CONFIG_USB_OHCI_HCD=y
> +CONFIG_USB_STORAGE=m
> +CONFIG_INFINIBAND=m
> +CONFIG_INFINIBAND_USER_MAD=m
> +CONFIG_INFINIBAND_USER_ACCESS=m
> +CONFIG_INFINIBAND_MTHCA=m
> +CONFIG_INFINIBAND_EHCA=m
> +CONFIG_INFINIBAND_CXGB3=m
> +CONFIG_INFINIBAND_CXGB4=m
> +CONFIG_MLX4_INFINIBAND=m
> +CONFIG_INFINIBAND_IPOIB=m
> +CONFIG_INFINIBAND_IPOIB_CM=y
> +CONFIG_INFINIBAND_SRP=m
> +CONFIG_INFINIBAND_ISER=m
> +CONFIG_EXT2_FS=y
> +CONFIG_EXT2_FS_XATTR=y
> +CONFIG_EXT2_FS_POSIX_ACL=y
> +CONFIG_EXT2_FS_SECURITY=y
> +CONFIG_EXT2_FS_XIP=y
> +CONFIG_EXT3_FS=y
> +CONFIG_EXT3_FS_POSIX_ACL=y
> +CONFIG_EXT3_FS_SECURITY=y
> +CONFIG_EXT4_FS=y
> +CONFIG_EXT4_FS_POSIX_ACL=y
> +CONFIG_EXT4_FS_SECURITY=y
> +CONFIG_REISERFS_FS=y
> +CONFIG_REISERFS_FS_XATTR=y
> +CONFIG_REISERFS_FS_POSIX_ACL=y
> +CONFIG_REISERFS_FS_SECURITY=y
> +CONFIG_JFS_FS=m
> +CONFIG_JFS_POSIX_ACL=y
> +CONFIG_JFS_SECURITY=y
> +CONFIG_XFS_FS=m
> +CONFIG_XFS_POSIX_ACL=y
> +CONFIG_BTRFS_FS=m
> +CONFIG_BTRFS_FS_POSIX_ACL=y
> +CONFIG_NILFS2_FS=m
> +CONFIG_AUTOFS4_FS=m
> +CONFIG_FUSE_FS=m
> +CONFIG_ISO9660_FS=y
> +CONFIG_UDF_FS=m
> +CONFIG_MSDOS_FS=y
> +CONFIG_VFAT_FS=y
> +CONFIG_PROC_KCORE=y
> +CONFIG_TMPFS=y
> +CONFIG_TMPFS_POSIX_ACL=y
> +CONFIG_HUGETLBFS=y
> +CONFIG_CRAMFS=m
> +CONFIG_SQUASHFS=m
> +CONFIG_SQUASHFS_XATTR=y
> +CONFIG_SQUASHFS_LZO=y
> +CONFIG_SQUASHFS_XZ=y
> +CONFIG_NFS_FS=y
> +CONFIG_NFS_V3_ACL=y
> +CONFIG_NFS_V4=y
> +CONFIG_NFSD=m
> +CONFIG_NFSD_V3_ACL=y
> +CONFIG_NFSD_V4=y
> +CONFIG_CIFS=m
> +CONFIG_CIFS_XATTR=y
> +CONFIG_CIFS_POSIX=y
> +CONFIG_NLS_DEFAULT="utf8"
> +CONFIG_NLS_CODEPAGE_437=y
> +CONFIG_NLS_ASCII=y
> +CONFIG_NLS_ISO8859_1=y
> +CONFIG_NLS_UTF8=y
> +CONFIG_CRC_T10DIF=y
> +CONFIG_MAGIC_SYSRQ=y
> +CONFIG_DEBUG_KERNEL=y
> +CONFIG_LOCKUP_DETECTOR=y
> +CONFIG_DEBUG_STACK_USAGE=y
> +CONFIG_LATENCYTOP=y
> +CONFIG_SCHED_TRACER=y
> +CONFIG_BLK_DEV_IO_TRACE=y
> +CONFIG_DEBUG_STACKOVERFLOW=y
> +CONFIG_CODE_PATCHING_SELFTEST=y
> +CONFIG_FTR_FIXUP_SELFTEST=y
> +CONFIG_MSI_BITMAP_SELFTEST=y
> +CONFIG_XMON=y
> +CONFIG_XMON_DEFAULT=y
> +CONFIG_CRYPTO_NULL=m
> +CONFIG_CRYPTO_TEST=m
> +CONFIG_CRYPTO_PCBC=m
> +CONFIG_CRYPTO_HMAC=y
> +CONFIG_CRYPTO_MICHAEL_MIC=m
> +CONFIG_CRYPTO_TGR192=m
> +CONFIG_CRYPTO_WP512=m
> +CONFIG_CRYPTO_ANUBIS=m
> +CONFIG_CRYPTO_BLOWFISH=m
> +CONFIG_CRYPTO_CAST6=m
> +CONFIG_CRYPTO_KHAZAD=m
> +CONFIG_CRYPTO_SALSA20=m
> +CONFIG_CRYPTO_SERPENT=m
> +CONFIG_CRYPTO_TEA=m
> +CONFIG_CRYPTO_TWOFISH=m
> +CONFIG_CRYPTO_LZO=m
> +# CONFIG_CRYPTO_ANSI_CPRNG is not set
> +CONFIG_CRYPTO_DEV_NX=y
> +CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
> +# CONFIG_VIRTUALIZATION is not set
> +CONFIG_CPU_LITTLE_ENDIAN=y
> --
> 1.8.1.2
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
^ permalink raw reply
* Re: [PATCH] net/fsl_pq_mdio: fix handling of TBIPA register
From: Scott Wood @ 2013-08-06 23:10 UTC (permalink / raw)
To: Lutz Jaenicke; +Cc: linuxppc-dev
In-Reply-To: <1375379355-18594-1-git-send-email-ljaenicke@innominate.com>
On Thu, 2013-08-01 at 19:49 +0200, Lutz Jaenicke wrote:
> The TBIPA register is part of gianfar's full register set. When starting
> from the MII registers, the start address of struct gfar needs to
> be determined via container_of().
> Experienced with mpc8313 and "fsl,gianfar-mdio" device tree entries.
>
> Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
> ---
> drivers/net/ethernet/freescale/fsl_pq_mdio.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> index c93a056..9485fdb 100644
> --- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> +++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
> @@ -193,7 +193,8 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus)
> */
> static uint32_t __iomem *get_gfar_tbipa(void __iomem *p)
> {
> - struct gfar __iomem *enet_regs = p;
> + struct gfar __iomem *enet_regs =
> + container_of(p, struct gfar, gfar_mii_regs);
>
> return &enet_regs->tbipa;
> }
Please send this to the netdev list/maintainer.
-Scott
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox