* [RFC PATCH 00/11 Allow PR and HV KVM to coexist in one kernel
From: Aneesh Kumar K.V @ 2013-09-27 10:03 UTC (permalink / raw)
To: agraf, benh, paulus; +Cc: linuxppc-dev, kvm-ppc
Hi All,
This patch series support enabling HV and PR KVM together in the same kernel. We
extend machine property with new property "kvm_type". A value of 1 will force HV
KVM and 2 PR KVM. The default value is 0 which will select the fastest KVM mode.
ie, HV if that is supported otherwise PR.
With Qemu command line having
-machine pseries,accel=kvm,kvm_type=1
[root@llmp24l02 qemu]# bash ../qemu
failed to initialize KVM: Invalid argument
[root@llmp24l02 qemu]# modprobe kvm-pr
[root@llmp24l02 qemu]# bash ../qemu
failed to initialize KVM: Invalid argument
[root@llmp24l02 qemu]# modprobe kvm-hv
[root@llmp24l02 qemu]# bash ../qemu
now with
-machine pseries,accel=kvm,kvm_type=2
[root@llmp24l02 qemu]# rmmod kvm-pr
[root@llmp24l02 qemu]# bash ../qemu
failed to initialize KVM: Invalid argument
[root@llmp24l02 qemu]#
[root@llmp24l02 qemu]# modprobe kvm-pr
[root@llmp24l02 qemu]# bash ../qemu
if don't specify kvm_type machine property, it will take a default value 0,
which means fastest supported.
-aneesh
^ permalink raw reply
* [RFC PATCH 11/11] kvm: powerpc: book3s: Fix module ownership
From: Aneesh Kumar K.V @ 2013-09-27 10:03 UTC (permalink / raw)
To: agraf, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V, kvm-ppc
In-Reply-To: <1380276233-17095-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
This moves /dev/kvm ownership to kvm.ko module. Depending on
which KVM mode we select during VM creation we take a reference
count on respective module
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/kvm_ppc.h | 1 +
arch/powerpc/kvm/book3s.c | 21 +++++++++++++++++++++
arch/powerpc/kvm/book3s_hv.c | 15 ++++++---------
arch/powerpc/kvm/book3s_pr.c | 15 +++++----------
arch/powerpc/kvm/powerpc.c | 19 +++++++++++++++----
5 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index a4a5893..2022720 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -171,6 +171,7 @@ extern int kvmppc_xics_int_on(struct kvm *kvm, u32 irq);
extern int kvmppc_xics_int_off(struct kvm *kvm, u32 irq);
struct kvmppc_ops {
+ struct module *owner;
bool is_hv_enabled;
int (*get_sregs)(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
int (*set_sregs)(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 34e189c..363df6a 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -831,6 +831,10 @@ int kvm_arch_check_processor_compat(void *opaque)
{
int r,cpu;
struct kvmppc_ops *kvm_ops = (struct kvmppc_ops *)opaque;
+
+ if (!kvm_ops)
+ return 0;
+
for_each_online_cpu(cpu) {
smp_call_function_single(cpu,
kvm_ops->check_processor_compat,
@@ -840,6 +844,7 @@ int kvm_arch_check_processor_compat(void *opaque)
}
return r;
}
+EXPORT_SYMBOL_GPL(kvm_arch_check_processor_compat);
EXPORT_SYMBOL_GPL(kvm_get_dirty_log);
EXPORT_SYMBOL_GPL(kvmppc_core_pending_dec);
@@ -851,3 +856,19 @@ EXPORT_SYMBOL_GPL(kvmppc_core_prepare_to_enter);
EXPORT_SYMBOL_GPL(kvmppc_core_queue_dec);
EXPORT_SYMBOL_GPL(kvmppc_free_lpid);
+static int kvmppc_book3s_init(void)
+{
+ int r;
+
+ r = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE);
+ return r;
+}
+
+static void kvmppc_book3s_exit(void)
+{
+ kvm_exit();
+}
+
+module_init(kvmppc_book3s_init);
+module_exit(kvmppc_book3s_exit);
+
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 0a684a7..7bdc780 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -2092,23 +2092,20 @@ static int kvmppc_book3s_init_hv(void)
{
int r;
- if (!kvmppc_pr_ops) {
- r = kvm_init(&kvm_ops_hv, sizeof(struct kvm_vcpu),
- 0, THIS_MODULE);
- if (r)
- return r;
- }
+ r = kvm_arch_check_processor_compat(&kvm_ops_hv);
+ if (r < 0)
+ return r;
+
+ kvm_ops_hv.owner = THIS_MODULE;
kvmppc_hv_ops = &kvm_ops_hv;
- r = kvmppc_mmu_hv_init();
+ r = kvmppc_mmu_hv_init();
return r;
}
static void kvmppc_book3s_exit_hv(void)
{
kvmppc_hv_ops = NULL;
- if (!kvmppc_pr_ops)
- kvm_exit();
}
module_init(kvmppc_book3s_init_hv);
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index e49e4b0..c79fada 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1551,17 +1551,14 @@ static int kvmppc_book3s_init_pr(void)
{
int r;
- if (!kvmppc_hv_ops) {
- r = kvm_init(&kvm_ops_pr, sizeof(struct kvm_vcpu),
- 0, THIS_MODULE);
- if (r)
- return r;
- }
- /* Assign the global value */
+ r = kvm_arch_check_processor_compat(&kvm_ops_pr);
+ if (r < 0)
+ return r;
+
+ kvm_ops_pr.owner = THIS_MODULE;
kvmppc_pr_ops = &kvm_ops_pr;
r = kvmppc_mmu_hpte_sysinit();
-
return r;
}
@@ -1569,8 +1566,6 @@ static void kvmppc_book3s_exit_pr(void)
{
kvmppc_pr_ops = NULL;
kvmppc_mmu_hpte_sysexit();
- if (!kvmppc_hv_ops)
- kvm_exit();
}
module_init(kvmppc_book3s_init_pr);
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 1209229..677fa7e 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -26,6 +26,7 @@
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/file.h>
+#include <linux/module.h>
#include <asm/cputable.h>
#include <asm/uaccess.h>
#include <asm/kvm_ppc.h>
@@ -270,25 +271,32 @@ void kvm_arch_hardware_unsetup(void)
int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
{
+ struct kvmppc_ops *kvm_ops = NULL;
/*
* if we have both HV and PR enabled, default is HV
*/
if (type == 0) {
if (kvmppc_hv_ops)
- kvm->arch.kvm_ops = kvmppc_hv_ops;
+ kvm_ops = kvmppc_hv_ops;
else
- kvm->arch.kvm_ops = kvmppc_pr_ops;
+ kvm_ops = kvmppc_pr_ops;
+ if (!kvm_ops)
+ goto err_out;
} else if (type == KVM_VM_PPC_HV) {
if (!kvmppc_hv_ops)
goto err_out;
- kvm->arch.kvm_ops = kvmppc_hv_ops;
+ kvm_ops = kvmppc_hv_ops;
} else if (type == KVM_VM_PPC_PR) {
if (!kvmppc_pr_ops)
goto err_out;
- kvm->arch.kvm_ops = kvmppc_pr_ops;
+ kvm_ops = kvmppc_pr_ops;
} else
goto err_out;
+ if (kvm_ops->owner && !try_module_get(kvm_ops->owner))
+ return -ENOENT;
+
+ kvm->arch.kvm_ops = kvm_ops;
return kvmppc_core_init_vm(kvm);
err_out:
return -EINVAL;
@@ -311,6 +319,9 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
kvmppc_core_destroy_vm(kvm);
mutex_unlock(&kvm->lock);
+
+ /* drop the module reference */
+ module_put(kvm->arch.kvm_ops->owner);
}
void kvm_arch_sync_events(struct kvm *kvm)
--
1.8.1.2
^ permalink raw reply related
* [RFC PATCH 02/11] kvm: powerpc: book3s: remove kvmppc_handler_highmem label
From: Aneesh Kumar K.V @ 2013-09-27 10:03 UTC (permalink / raw)
To: agraf, benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V, kvm-ppc
In-Reply-To: <1380276233-17095-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
From: Paul Mackerras <paulus@samba.org>
This label is not used now.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
arch/powerpc/kvm/book3s_hv_interrupts.S | 3 ---
arch/powerpc/kvm/book3s_interrupts.S | 3 ---
2 files changed, 6 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_hv_interrupts.S b/arch/powerpc/kvm/book3s_hv_interrupts.S
index 37f1cc4..928142c 100644
--- a/arch/powerpc/kvm/book3s_hv_interrupts.S
+++ b/arch/powerpc/kvm/book3s_hv_interrupts.S
@@ -158,9 +158,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201)
* Interrupts are enabled again at this point.
*/
-.global kvmppc_handler_highmem
-kvmppc_handler_highmem:
-
/*
* Register usage at this point:
*
diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S
index bf8f1ab..279ee3f 100644
--- a/arch/powerpc/kvm/book3s_interrupts.S
+++ b/arch/powerpc/kvm/book3s_interrupts.S
@@ -121,9 +121,6 @@ kvm_start_lightweight:
*
*/
-.global kvmppc_handler_highmem
-kvmppc_handler_highmem:
-
/*
* Register usage at this point:
*
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH 00/51] DMA mask changes
From: Russell King - ARM Linux @ 2013-09-27 8:27 UTC (permalink / raw)
To: Rafał Miłecki
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
linux-ide, devel@driverdev.osuosl.org, linux-samsung-soc,
Linux SCSI List, e1000-devel, b43-dev, linux-media, devicetree,
dri-devel, linux-tegra, linux-omap,
linux-arm-kernel@lists.infradead.org,
Solarflare linux maintainers, Network Development, linux-usb,
linux-wireless@vger.kernel.org, linux-crypto, uclinux-dist-devel,
linux ppc dev
In-Reply-To: <CACna6rxkpYzdD8_Jfi22vA2suUa3k-JM65_gCySQpp4crVCoPg@mail.gmail.com>
On Thu, Sep 26, 2013 at 10:23:08PM +0200, Rafał Miłecki wrote:
> 2013/9/19 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > This email is only being sent to the mailing lists in question, not to
> > anyone personally. The list of individuals is far to great to do that.
> > I'm hoping no mailing lists reject the patches based on the number of
> > recipients.
>
> Huh, I think it was enough to send only 3 patches to the b43-dev@. Like:
> [PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks
> [PATCH 14/51] DMA-API: net: b43: (...)
> [PATCH 15/51] DMA-API: net: b43legacy: (...)
> ;)
>
> I believe Joe has some nice script for doing it that way. When fixing
> some coding style / formatting, he sends only related patches to the
> given ML.
If I did that, then the mailing lists would not get the first patch,
because almost none of the lists would be referred to by patch 1.
Moreover, people complain when they don't have access to the full
patch series - they assume patches are missing for some reason, and
they ask for the rest of the series.
^ permalink raw reply
* Please revert 928bea964827d7824b548c1f8e06eccbbc4d0d7d
From: Benjamin Herrenschmidt @ 2013-09-27 8:28 UTC (permalink / raw)
To: Linus Torvalds
Cc: Bjorn Helgaas, linux-pci, Yinghai Lu, linuxppc-dev,
Linux Kernel list
Hi Linus, Yinghai !
Please consider reverting:
928bea964827d7824b548c1f8e06eccbbc4d0d7d
PCI: Delay enabling bridges until they're needed
(I'd suggest to revert now and maybe merge a better patch later)
This breaks PCI on the PowerPC "powernv" platform (which is booted via
kexec) and probably x86 as well under similar circumstances. It will
basically break PCIe if the bus master bit of the bridge isn't set at
boot (by the firmware for example, or because kexec'ing cleared it).
The reason is that the PCIe port driver will call pci_enable_device() on
the bridge (on everything under the sun actually), which will marked the
device enabled (but will not do a set_master).
Because of that, pci_enable_bridge() later on (called as a result of the
child device driver doing pci_enable_device) will see the bridge as
already enabled and will not call pci_set_master() on it.
Now, this could probably be fixed by simply doing pci_set_master() in
the PCIe port driver, but I find the whole logic very fragile (anything
that "enables" the bridge without setting master or for some reason
clears master will forever fail to re-enable it).
Maybe a better option is to unconditionally do pci_set_mater() in
pci_enable_bridge(), ie, move the call to before the enabled test.
However I am not too happy with that either. My experience with bridges
is that if bus master isn't set, they will also fail to report AER
errors and other similar upstream transactions. We might want to get
these reported properly even if no downstream device got successfully
enabled.
So I think the premises of the patches are flawed, at least on PCI
express, and we should stick to always enabling bridges (at least the
bus master bit on them).
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc/kvmbook3s_hv: propagate H_SET_MODE to the host
From: Laurent Dufour @ 2013-09-27 8:14 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Anton Blanchard
In-Reply-To: <20130925223118.GA2844@iris.ozlabs.ibm.com>
On 26/09/2013 00:31, Paul Mackerras wrote:
> On Wed, Sep 25, 2013 at 02:10:27PM +0200, Laurent Dufour wrote:
>> Follow-up to Anton's H_SET_MODE patch, the host should be taken aware of
>> guest endianess change.
>>
>> The hcall H_SET_MODE is processed in kvm then in the host.
>>
>> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/kvm/book3s_hv.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
>> index 998cad3..4a47c74 100644
>> --- a/arch/powerpc/kvm/book3s_hv.c
>> +++ b/arch/powerpc/kvm/book3s_hv.c
>> @@ -599,6 +599,14 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
>> kvmppc_get_gpr(vcpu, 5),
>> kvmppc_get_gpr(vcpu, 6),
>> kvmppc_get_gpr(vcpu, 7));
>> + /*
>> + * If the hcall succeeded, we propagate it to the host.
>> + * This way, it will be aware of the endianess's change too.
>> + * The assumption is made that the hcall will succeed in the
>> + * host.
>> + */
>> + if (ret == H_SUCCESS)
>> + return RESUME_HOST;
>> break;
>
> The problem with this is that H_SET_MODE isn't just used for setting
> endianness; it also does breakpoint setting (DAWR/X and CIABR), which
> might happen very frequently, so we don't want them being punted up to
> userspace.
>
> Paul.
Hi Paul,
My mistake, the patch was based on a too old kernel missing yours and
Michael's latest patches on H_SET_MODE handling.
I'll propose a new one asap.
Thanks,
Laurent.
^ permalink raw reply
* Re: [PATCH] powerpc/kernel/sysfs: disable writing to purr in non-powernv
From: Benjamin Herrenschmidt @ 2013-09-27 8:05 UTC (permalink / raw)
To: Madhavan Srinivasan; +Cc: linuxppc-dev
In-Reply-To: <1380268926-21338-1-git-send-email-maddy@linux.vnet.ibm.com>
On Fri, 2013-09-27 at 13:32 +0530, Madhavan Srinivasan wrote:
> powerpc/kernel/sysfs.c exports purr with write permission.
> This may be valid for powernv kernel since purr is Hyp resource.
> But writing to the file in PowerVM lpar causes crash.
Testing powernv isn't right, you should test for hypervisor mode.
Cheers,
Ben.
> # echo 0 > purr
> cpu 0x0: Vector: 700 (Program Check) at [c000000000d072b0]
> pc: c00000000001770c: .write_purr+0x1c/0x40
> lr: c000000000017708: .write_purr+0x18/0x40
> sp: c000000000d07530
> msr: 8000000000049032
> current = 0xc000000000c53de0
> paca = 0xc00000000ec70000 softe: 0 irq_happened: 0x01
> pid = 0, comm = swapper/0
> enter ? for help
> [c000000000d075b0] c0000000000fba64
> .generic_smp_call_function_single_interrupt+0x104/0x190
> [c000000000d07650] c000000000037748 .smp_ipi_demux+0xa8/0xf0
> [c000000000d076e0] c000000000035314 .doorbell_exception+0x74/0xb0
> [c000000000d07760] c000000000002950 doorbell_super_common+0x150/0x180
> --- Exception: a01 (Doorbell) at c000000000060904
> .plpar_hcall_norets+0x84/0xd4
> [link register ] c00000000006dbd4 .check_and_cede_processor+0x24/0x40
> [c000000000d07a50] c000000001002558 (unreliable)
> [c000000000d07ac0] c00000000006dd0c .shared_cede_loop+0x2c/0x70
> [c000000000d07b40] c0000000006ae954 .cpuidle_enter_state+0x64/0x150
> [c000000000d07c00] c0000000006aeb30 .cpuidle_idle_call+0xf0/0x300
> [c000000000d07cb0] c000000000062fa0 .pseries_lpar_idle+0x10/0x50
> [c000000000d07d20] c000000000016d14 .arch_cpu_idle+0x64/0x150
> [c000000000d07da0] c0000000000e0060 .cpu_startup_entry+0x1a0/0x2c0
> [c000000000d07e80] c00000000000bca4 .rest_init+0x94/0xb0
> [c000000000d07ef0] c000000000b54530 .start_kernel+0x478/0x494
> [c000000000d07f90] c000000000009be0 .start_here_common+0x20/0x40
> 0:mon>
>
> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/sysfs.c | 19 +++++++++++++++++--
> 1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
> index 27a90b9..d7097c2 100644
> --- a/arch/powerpc/kernel/sysfs.c
> +++ b/arch/powerpc/kernel/sysfs.c
> @@ -179,15 +179,27 @@ SYSFS_PMCSETUP(spurr, SPRN_SPURR);
> SYSFS_PMCSETUP(dscr, SPRN_DSCR);
> SYSFS_PMCSETUP(pir, SPRN_PIR);
>
> +/*
> + Lets only enable Read for Hyp resources and
> + enable Write when needed with a separate function.
> + Lets be conservative and default to pseries.
> +*/
> static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
> static DEVICE_ATTR(spurr, 0400, show_spurr, NULL);
> static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr);
> -static DEVICE_ATTR(purr, 0600, show_purr, store_purr);
> +static DEVICE_ATTR(purr, 0400, show_purr, store_purr);
> static DEVICE_ATTR(pir, 0400, show_pir, NULL);
>
> unsigned long dscr_default = 0;
> EXPORT_SYMBOL(dscr_default);
>
> +static void add_write_permission_dev_attr(void *ptr)
> +{
> + struct device_attribute *attr = (struct device_attribute *)ptr;
> +
> + attr->attr.mode |= (unsigned short) 0200;
> +}
> +
> static ssize_t show_dscr_default(struct device *dev,
> struct device_attribute *attr, char *buf)
> {
> @@ -394,8 +406,11 @@ static void register_cpu_online(unsigned int cpu)
> if (cpu_has_feature(CPU_FTR_MMCRA))
> device_create_file(s, &dev_attr_mmcra);
>
> - if (cpu_has_feature(CPU_FTR_PURR))
> + if (cpu_has_feature(CPU_FTR_PURR)) {
> + if (machine_is(powernv))
> + add_write_permission_dev_attr((void *)&dev_attr_purr);
> device_create_file(s, &dev_attr_purr);
> + }
>
> if (cpu_has_feature(CPU_FTR_SPURR))
> device_create_file(s, &dev_attr_spurr);
^ permalink raw reply
* [PATCH] powerpc/kernel/sysfs: disable writing to purr in non-powernv
From: Madhavan Srinivasan @ 2013-09-27 8:02 UTC (permalink / raw)
To: benh; +Cc: Madhavan Srinivasan, linuxppc-dev
powerpc/kernel/sysfs.c exports purr with write permission.
This may be valid for powernv kernel since purr is Hyp resource.
But writing to the file in PowerVM lpar causes crash.
# echo 0 > purr
cpu 0x0: Vector: 700 (Program Check) at [c000000000d072b0]
pc: c00000000001770c: .write_purr+0x1c/0x40
lr: c000000000017708: .write_purr+0x18/0x40
sp: c000000000d07530
msr: 8000000000049032
current = 0xc000000000c53de0
paca = 0xc00000000ec70000 softe: 0 irq_happened: 0x01
pid = 0, comm = swapper/0
enter ? for help
[c000000000d075b0] c0000000000fba64
.generic_smp_call_function_single_interrupt+0x104/0x190
[c000000000d07650] c000000000037748 .smp_ipi_demux+0xa8/0xf0
[c000000000d076e0] c000000000035314 .doorbell_exception+0x74/0xb0
[c000000000d07760] c000000000002950 doorbell_super_common+0x150/0x180
--- Exception: a01 (Doorbell) at c000000000060904
.plpar_hcall_norets+0x84/0xd4
[link register ] c00000000006dbd4 .check_and_cede_processor+0x24/0x40
[c000000000d07a50] c000000001002558 (unreliable)
[c000000000d07ac0] c00000000006dd0c .shared_cede_loop+0x2c/0x70
[c000000000d07b40] c0000000006ae954 .cpuidle_enter_state+0x64/0x150
[c000000000d07c00] c0000000006aeb30 .cpuidle_idle_call+0xf0/0x300
[c000000000d07cb0] c000000000062fa0 .pseries_lpar_idle+0x10/0x50
[c000000000d07d20] c000000000016d14 .arch_cpu_idle+0x64/0x150
[c000000000d07da0] c0000000000e0060 .cpu_startup_entry+0x1a0/0x2c0
[c000000000d07e80] c00000000000bca4 .rest_init+0x94/0xb0
[c000000000d07ef0] c000000000b54530 .start_kernel+0x478/0x494
[c000000000d07f90] c000000000009be0 .start_here_common+0x20/0x40
0:mon>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
arch/powerpc/kernel/sysfs.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 27a90b9..d7097c2 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -179,15 +179,27 @@ SYSFS_PMCSETUP(spurr, SPRN_SPURR);
SYSFS_PMCSETUP(dscr, SPRN_DSCR);
SYSFS_PMCSETUP(pir, SPRN_PIR);
+/*
+ Lets only enable Read for Hyp resources and
+ enable Write when needed with a separate function.
+ Lets be conservative and default to pseries.
+*/
static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
static DEVICE_ATTR(spurr, 0400, show_spurr, NULL);
static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr);
-static DEVICE_ATTR(purr, 0600, show_purr, store_purr);
+static DEVICE_ATTR(purr, 0400, show_purr, store_purr);
static DEVICE_ATTR(pir, 0400, show_pir, NULL);
unsigned long dscr_default = 0;
EXPORT_SYMBOL(dscr_default);
+static void add_write_permission_dev_attr(void *ptr)
+{
+ struct device_attribute *attr = (struct device_attribute *)ptr;
+
+ attr->attr.mode |= (unsigned short) 0200;
+}
+
static ssize_t show_dscr_default(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -394,8 +406,11 @@ static void register_cpu_online(unsigned int cpu)
if (cpu_has_feature(CPU_FTR_MMCRA))
device_create_file(s, &dev_attr_mmcra);
- if (cpu_has_feature(CPU_FTR_PURR))
+ if (cpu_has_feature(CPU_FTR_PURR)) {
+ if (machine_is(powernv))
+ add_write_permission_dev_attr((void *)&dev_attr_purr);
device_create_file(s, &dev_attr_purr);
+ }
if (cpu_has_feature(CPU_FTR_SPURR))
device_create_file(s, &dev_attr_spurr);
--
1.7.10.4
^ permalink raw reply related
* RE: [PATCH v4 4/4] powerpc/85xx: add sysfs for pw20 state and altivec idle
From: Wang Dongsheng-B40534 @ 2013-09-27 3:34 UTC (permalink / raw)
To: Wood Scott-B07421; +Cc: linuxppc-dev@lists.ozlabs.org, Bhushan Bharat-R65777
In-Reply-To: <1380231435.24959.328.camel@snotra.buserror.net>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogRnJpZGF5LCBTZXB0ZW1iZXIgMjcsIDIwMTMgNTozNyBBTQ0KPiBUbzogV2Fu
ZyBEb25nc2hlbmctQjQwNTM0DQo+IENjOiBCaHVzaGFuIEJoYXJhdC1SNjU3Nzc7IFdvb2QgU2Nv
dHQtQjA3NDIxOyBsaW51eHBwYy0NCj4gZGV2QGxpc3RzLm96bGFicy5vcmcNCj4gU3ViamVjdDog
UmU6IFtQQVRDSCB2NCA0LzRdIHBvd2VycGMvODV4eDogYWRkIHN5c2ZzIGZvciBwdzIwIHN0YXRl
IGFuZA0KPiBhbHRpdmVjIGlkbGUNCj4gDQo+IE9uIFRodSwgMjAxMy0wOS0yNiBhdCAwMToxOCAt
MDUwMCwgV2FuZyBEb25nc2hlbmctQjQwNTM0IHdyb3RlOg0KPiA+DQo+ID4gPiAtLS0tLU9yaWdp
bmFsIE1lc3NhZ2UtLS0tLQ0KPiA+ID4gRnJvbTogQmh1c2hhbiBCaGFyYXQtUjY1Nzc3DQo+ID4g
PiBTZW50OiBUaHVyc2RheSwgU2VwdGVtYmVyIDI2LCAyMDEzIDEyOjIzIFBNDQo+ID4gPiBUbzog
V2FuZyBEb25nc2hlbmctQjQwNTM0OyBXb29k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l90aWNrc19wZXJfdXNlYywg
MTAwMCkiIGlzIGdvb2QgZW5vdWdoLiA6KQ0KDQotZG9uZ3NoZW5nDQoNCj4gLVNjb3R0DQo+IA0K
DQo=
^ permalink raw reply
* RE: [PATCH] powerpc/fsl/defconfig: enable CONFIG_AT803X_PHY
From: Liu Shengzhou-B36685 @ 2013-09-27 2:51 UTC (permalink / raw)
To: Wood Scott-B07421; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1380229898.24959.318.camel@snotra.buserror.net>
DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFdvb2QgU2NvdHQtQjA3NDIx
DQo+IFNlbnQ6IEZyaWRheSwgU2VwdGVtYmVyIDI3LCAyMDEzIDU6MTIgQU0NCj4gVG86IExpdSBT
aGVuZ3pob3UtQjM2Njg1DQo+IENjOiBXb29kIFNjb3R0LUIwNzQyMTsgbGludXhwcGMtZGV2QGxp
c3RzLm96bGFicy5vcmc7IGdhbGFrQGtlcm5lbC5jcmFzaGluZy5vcmcNCj4gU3ViamVjdDogUmU6
IFtQQVRDSF0gcG93ZXJwYy9mc2wvZGVmY29uZmlnOiBlbmFibGUgQ09ORklHX0FUODAzWF9QSFkN
Cj4gDQo+IE9uIFdlZCwgMjAxMy0wOS0yNSBhdCAyMjowMiAtMDUwMCwgTGl1IFNoZW5nemhvdS1C
MzY2ODUgd3JvdGU6DQo+ID4gPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiA+ID4gRnJv
bTogV29vZCBTY290dC1CMDc0MjENCj4gPiA+IFNlbnQ6IFRodXJzZGF5LCBTZXB0ZW1iZXIgMjYs
IDIwMTMgOToyNCBBTQ0KPiA+ID4gVG86IExpdSBTaGVuZ3pob3UtQjM2Njg1DQo+ID4gPiBDYzog
bGludXhwcGMtZGV2QGxpc3RzLm96bGFicy5vcmc7IGdhbGFrQGtlcm5lbC5jcmFzaGluZy5vcmcN
Cj4gPiA+IFN1Y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2Yg
dGhvc2UgYm9hcmRzIGFyZSBjb3JlbmV0MzIgZWl0aGVyLg0KPiANCkdlbmVyYWxseSwgd2UgdXNl
IEFUODAzWCBhcyBsb3ctY29zdCBzb2x1dGlvbiwgaXQncyBwb3NzaWJsZSB0byB1c2UgaXQgb24g
UDEvUDIvUDMgc2VyaWFsLCBjb3JlbmV0NjQgaXMgZm9yIGhpZ2gtZW5kIGNhc2UsIHRoYXQncyB3
aHkgSSBkaWRuJ3QgZW5hYmxlIGl0IGZvciBjb3JlbmV0NjQuDQotU2hlbmd6aG91DQo=
^ permalink raw reply
* Re: [PATCH 31/51] DMA-API: media: omap3isp: use dma_coerce_mask_and_coherent()
From: Laurent Pinchart @ 2013-09-27 1:56 UTC (permalink / raw)
To: Russell King
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
linux-ide, devel, linux-samsung-soc, linux-scsi, e1000-devel,
b43-dev, linux-media, devicetree, dri-devel, linux-tegra,
linux-omap, linux-arm-kernel, Solarflare linux maintainers,
netdev, linux-usb, linux-wireless, linux-crypto,
uclinux-dist-devel, linuxppc-dev, Mauro Carvalho Chehab
In-Reply-To: <E1VMmCg-0007j1-Pi@rmk-PC.arm.linux.org.uk>
Hi Russell,
Thank you for the patch.
On Thursday 19 September 2013 22:56:02 Russell King wrote:
> The code sequence:
> isp->raw_dmamask = DMA_BIT_MASK(32);
> isp->dev->dma_mask = &isp->raw_dmamask;
> isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> bypasses the architectures check on the DMA mask. It can be replaced
> with dma_coerce_mask_and_coherent(), avoiding the direct initialization
> of this mask.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/platform/omap3isp/isp.c | 6 +++---
> drivers/media/platform/omap3isp/isp.h | 3 ---
> 2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index df3a0ec..1c36080 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -2182,9 +2182,9 @@ static int isp_probe(struct platform_device *pdev)
> isp->pdata = pdata;
> isp->ref_count = 0;
>
> - isp->raw_dmamask = DMA_BIT_MASK(32);
> - isp->dev->dma_mask = &isp->raw_dmamask;
> - isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(isp->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> platform_set_drvdata(pdev, isp);
>
> diff --git a/drivers/media/platform/omap3isp/isp.h
> b/drivers/media/platform/omap3isp/isp.h index cd3eff4..ce65d3a 100644
> --- a/drivers/media/platform/omap3isp/isp.h
> +++ b/drivers/media/platform/omap3isp/isp.h
> @@ -152,7 +152,6 @@ struct isp_xclk {
> * @mmio_base_phys: Array with physical L4 bus addresses for ISP register
> * regions.
> * @mmio_size: Array with ISP register regions size in bytes.
> - * @raw_dmamask: Raw DMA mask
> * @stat_lock: Spinlock for handling statistics
> * @isp_mutex: Mutex for serializing requests to ISP.
> * @crashed: Bitmask of crashed entities (indexed by entity ID)
> @@ -190,8 +189,6 @@ struct isp_device {
> unsigned long mmio_base_phys[OMAP3_ISP_IOMEM_LAST];
> resource_size_t mmio_size[OMAP3_ISP_IOMEM_LAST];
>
> - u64 raw_dmamask;
> -
> /* ISP Obj */
> spinlock_t stat_lock; /* common lock for statistic drivers */
> struct mutex isp_mutex; /* For handling ref_count field */
--
Regards,
Laurent Pinchart
^ permalink raw reply
* [PATCH] powerpc/p1010rdb:update mtd of nand to adapt to both old and new p1010rdb
From: Zhao Qiang @ 2013-09-27 1:21 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Zhao Qiang, B36685, R61911
P1010rdb-pa and p1010rdb-pb have different mtd of nand.
So update dts to adapt to both p1010rdb-pa and p1010rdb-pb.
Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
arch/powerpc/boot/dts/p1010rdb-pa.dts | 40 +++++++++++++++++++++++++++++++++++
arch/powerpc/boot/dts/p1010rdb-pb.dts | 34 +++++++++++++++++++++++++++++
arch/powerpc/boot/dts/p1010rdb.dtsi | 40 +----------------------------------
3 files changed, 75 insertions(+), 39 deletions(-)
diff --git a/arch/powerpc/boot/dts/p1010rdb-pa.dts b/arch/powerpc/boot/dts/p1010rdb-pa.dts
index e1688d4..9b4ca89 100644
--- a/arch/powerpc/boot/dts/p1010rdb-pa.dts
+++ b/arch/powerpc/boot/dts/p1010rdb-pa.dts
@@ -18,6 +18,46 @@
/include/ "p1010rdb.dtsi"
};
+&ifc_nand {
+ partition@0 {
+ /* This location must not be altered */
+ /* 1MB for u-boot Bootloader Image */
+ reg = <0x0 0x00100000>;
+ label = "NAND U-Boot Image";
+ read-only;
+ };
+
+ partition@100000 {
+ /* 1MB for DTB Image */
+ reg = <0x00100000 0x00100000>;
+ label = "NAND DTB Image";
+ };
+
+ partition@200000 {
+ /* 4MB for Linux Kernel Image */
+ reg = <0x00200000 0x00400000>;
+ label = "NAND Linux Kernel Image";
+ };
+
+ partition@600000 {
+ /* 4MB for Compressed Root file System Image */
+ reg = <0x00600000 0x00400000>;
+ label = "NAND Compressed RFS Image";
+ };
+
+ partition@a00000 {
+ /* 15MB for JFFS2 based Root file System */
+ reg = <0x00a00000 0x00f00000>;
+ label = "NAND JFFS2 Root File System";
+ };
+
+ partition@1900000 {
+ /* 7MB for User Area */
+ reg = <0x01900000 0x00700000>;
+ label = "NAND User area";
+ };
+};
+
&phy0 {
interrupts = <3 1 0 0>;
};
diff --git a/arch/powerpc/boot/dts/p1010rdb-pb.dts b/arch/powerpc/boot/dts/p1010rdb-pb.dts
index 37f9366..f4c97fd 100644
--- a/arch/powerpc/boot/dts/p1010rdb-pb.dts
+++ b/arch/powerpc/boot/dts/p1010rdb-pb.dts
@@ -18,6 +18,40 @@
/include/ "p1010rdb.dtsi"
};
+&ifc_nand {
+ partition@0 {
+ /* This location must not be altered */
+ /* 2MB for u-boot Image and environment */
+ reg = <0x0 0x00200000>;
+ label = "NAND U-Boot Image and env";
+ read-only;
+ };
+
+ partition@200000 {
+ /* 1MB for DTB Image */
+ reg = <0x00200000 0x00100000>;
+ label = "NAND DTB Image";
+ };
+
+ partition@300000 {
+ /* 5MB for Linux Kernel Image */
+ reg = <0x00300000 0x00500000>;
+ label = "NAND Linux Kernel Image";
+ };
+
+ partition@800000 {
+ /* 56MB for Compressed Root file System Image */
+ reg = <0x00800000 0x03800000>;
+ label = "NAND ROOTFS";
+ };
+
+ partition@4000000 {
+ /* 1984MB for User Area */
+ reg = <0x04000000 0x7c000000>;
+ label = "NAND User area";
+ };
+};
+
&phy0 {
interrupts = <0 1 0 0>;
};
diff --git a/arch/powerpc/boot/dts/p1010rdb.dtsi b/arch/powerpc/boot/dts/p1010rdb.dtsi
index 5e5ca56..61abc18 100644
--- a/arch/powerpc/boot/dts/p1010rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1010rdb.dtsi
@@ -79,49 +79,11 @@ board_ifc: ifc: ifc@ffe1e000 {
};
};
- nand@1,0 {
+ ifc_nand: nand@1,0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "fsl,ifc-nand";
reg = <0x1 0x0 0x10000>;
-
- partition@0 {
- /* This location must not be altered */
- /* 1MB for u-boot Bootloader Image */
- reg = <0x0 0x00100000>;
- label = "NAND U-Boot Image";
- read-only;
- };
-
- partition@100000 {
- /* 1MB for DTB Image */
- reg = <0x00100000 0x00100000>;
- label = "NAND DTB Image";
- };
-
- partition@200000 {
- /* 4MB for Linux Kernel Image */
- reg = <0x00200000 0x00400000>;
- label = "NAND Linux Kernel Image";
- };
-
- partition@600000 {
- /* 4MB for Compressed Root file System Image */
- reg = <0x00600000 0x00400000>;
- label = "NAND Compressed RFS Image";
- };
-
- partition@a00000 {
- /* 15MB for JFFS2 based Root file System */
- reg = <0x00a00000 0x00f00000>;
- label = "NAND JFFS2 Root File System";
- };
-
- partition@1900000 {
- /* 7MB for User Area */
- reg = <0x01900000 0x00700000>;
- label = "NAND User area";
- };
};
cpld@3,0 {
--
1.8.0
^ permalink raw reply related
* [PATCH] powerpc/mpic: Disable preemption when calling mpic_processor_id()
From: Scott Wood @ 2013-09-27 0:18 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Scott Wood, linuxppc-dev
Otherwise, we get a debug traceback due to the use of
smp_processor_id() (or get_paca()) inside hard_smp_processor_id().
mpic_host_map() is just looking for a default CPU, so it doesn't matter
if we migrate after getting the CPU ID.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/sysdev/mpic.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 1be54fa..bdcb858 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1088,8 +1088,14 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq,
* is done here.
*/
if (!mpic_is_ipi(mpic, hw) && (mpic->flags & MPIC_NO_RESET)) {
+ int cpu;
+
+ preempt_disable();
+ cpu = mpic_processor_id(mpic);
+ preempt_enable();
+
mpic_set_vector(virq, hw);
- mpic_set_destination(virq, mpic_processor_id(mpic));
+ mpic_set_destination(virq, cpu);
mpic_irq_set_priority(virq, 8);
}
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH 5/7] iommu: supress loff_t compilation error on powerpc
From: Scott Wood @ 2013-09-26 22:20 UTC (permalink / raw)
To: Bhushan Bharat-R65777
Cc: agraf@suse.de, Wood Scott-B07421, joro@8bytes.org,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
Alex Williamson, linux-pci@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D07183CA4@039-SN2MPN1-011.039d.mgd.msft.net>
On Wed, 2013-09-25 at 22:53 -0500, Bhushan Bharat-R65777 wrote:
>
> > -----Original Message-----
> > From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > Sent: Wednesday, September 25, 2013 10:10 PM
> > To: Bhushan Bharat-R65777
> > Cc: joro@8bytes.org; benh@kernel.crashing.org; galak@kernel.crashing.org; linux-
> > kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; linux-
> > pci@vger.kernel.org; agraf@suse.de; Wood Scott-B07421; iommu@lists.linux-
> > foundation.org; Bhushan Bharat-R65777
> > Subject: Re: [PATCH 5/7] iommu: supress loff_t compilation error on powerpc
> >
> > On Thu, 2013-09-19 at 12:59 +0530, Bharat Bhushan wrote:
> > > Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> > > ---
> > > drivers/vfio/pci/vfio_pci_rdwr.c | 3 ++-
> > > 1 files changed, 2 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c
> > > b/drivers/vfio/pci/vfio_pci_rdwr.c
> > > index 210db24..8a8156a 100644
> > > --- a/drivers/vfio/pci/vfio_pci_rdwr.c
> > > +++ b/drivers/vfio/pci/vfio_pci_rdwr.c
> > > @@ -181,7 +181,8 @@ ssize_t vfio_pci_vga_rw(struct vfio_pci_device *vdev, char
> > __user *buf,
> > > size_t count, loff_t *ppos, bool iswrite) {
> > > int ret;
> > > - loff_t off, pos = *ppos & VFIO_PCI_OFFSET_MASK;
> > > + loff_t off;
> > > + u64 pos = (u64 )(*ppos & VFIO_PCI_OFFSET_MASK);
> > > void __iomem *iomem = NULL;
> > > unsigned int rsrc;
> > > bool is_ioport;
> >
> > What's the compile error that this fixes?
>
> I was getting below error; and after some googling I came to know that this is how it is fixed by other guys.
>
> /home/r65777/linux-vfio/drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2'
> /home/r65777/linux-vfio/drivers/vfio/pci/vfio_pci_rdwr.c:193: undefined reference to `__cmpdi2'
It looks like PPC Linux implements __ucmpdi2, but not the signed
version. That should be fixed, rather than hacking up random code to
avoid it.
-Scott
^ permalink raw reply
* Re: [PATCH] hvc_vio: Do not override preferred console set by kernel parameter
From: Benjamin Herrenschmidt @ 2013-09-26 22:00 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Bastian Blank, Jiri Slaby, Ben Hutchings, linuxppc-dev,
Debian kernel maintainers
In-Reply-To: <20130926212254.GA12564@kroah.com>
On Thu, 2013-09-26 at 14:22 -0700, Greg Kroah-Hartman wrote:
> So, I shouldn't apply this patch? We should do something to fix this,
> if Debian has to drag this patch on for 5 years, that's an indication
> that this might be one solution we should use, right?
Ah sorry, dropped the ball on that one. Yes the patch is an acceptable
band-aid but somebody should work on a better solution :-)
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH v4 4/4] powerpc/85xx: add sysfs for pw20 state and altivec idle
From: Scott Wood @ 2013-09-26 21:37 UTC (permalink / raw)
To: Wang Dongsheng-B40534
Cc: Wood Scott-B07421, linuxppc-dev@lists.ozlabs.org,
Bhushan Bharat-R65777
In-Reply-To: <ABB05CD9C9F68C46A5CEDC7F1543925901090B4F@039-SN2MPN1-021.039d.mgd.msft.net>
On Thu, 2013-09-26 at 01:18 -0500, Wang Dongsheng-B40534 wrote:
>
> > -----Original Message-----
> > From: Bhushan Bharat-R65777
> > Sent: Thursday, September 26, 2013 12:23 PM
> > To: Wang Dongsheng-B40534; Wood Scott-B07421
> > Cc: linuxppc-dev@lists.ozlabs.org
> > Subject: RE: [PATCH v4 4/4] powerpc/85xx: add sysfs for pw20 state and
> > altivec idle
> >
> >
> >
> > > -----Original Message-----
> > > From: Wang Dongsheng-B40534
> > > Sent: Thursday, September 26, 2013 8:02 AM
> > > To: Wood Scott-B07421
> > > Cc: Bhushan Bharat-R65777; linuxppc-dev@lists.ozlabs.org
> > > Subject: RE: [PATCH v4 4/4] powerpc/85xx: add sysfs for pw20 state and
> > > altivec idle
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Wood Scott-B07421
> > > > Sent: Thursday, September 26, 2013 1:57 AM
> > > > To: Wang Dongsheng-B40534
> > > > Cc: Bhushan Bharat-R65777; Wood Scott-B07421; linuxppc-
> > > > dev@lists.ozlabs.org
> > > > Subject: Re: [PATCH v4 4/4] powerpc/85xx: add sysfs for pw20 state
> > > > and altivec idle
> > > >
> > > > On Wed, 2013-09-25 at 03:10 -0500, Wang Dongsheng-B40534 wrote:
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Bhushan Bharat-R65777
> > > > > > Sent: Wednesday, September 25, 2013 2:23 PM
> > > > > > To: Wang Dongsheng-B40534; Wood Scott-B07421
> > > > > > Cc: linuxppc-dev@lists.ozlabs.org; Wang Dongsheng-B40534
> > > > > > Subject: RE: [PATCH v4 4/4] powerpc/85xx: add sysfs for pw20
> > > > > > state and altivec idle
> > > > > >
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Linuxppc-dev [mailto:linuxppc-dev-
> > > > > > > bounces+bharat.bhushan=freescale.com@lists.ozlabs.org] On
> > > > > > > bounces+Behalf Of Dongsheng
> > > > > > > Wang
> > > > > > > Sent: Tuesday, September 24, 2013 2:59 PM
> > > > > > > To: Wood Scott-B07421
> > > > > > > Cc: linuxppc-dev@lists.ozlabs.org; Wang Dongsheng-B40534
> > > > > > > Subject: [PATCH v4 4/4] powerpc/85xx: add sysfs for pw20 state
> > > > > > > and altivec idle
> > > > > > >
> > > > > > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > > > >
> > > > > > > Add a sys interface to enable/diable pw20 state or altivec
> > > > > > > idle, and control the wait entry time.
> > > > > > >
> > > > > > > Enable/Disable interface:
> > > > > > > 0, disable. 1, enable.
> > > > > > > /sys/devices/system/cpu/cpuX/pw20_state
> > > > > > > /sys/devices/system/cpu/cpuX/altivec_idle
> > > > > > >
> > > > > > > Set wait time interface:(Nanosecond)
> > > > > > > /sys/devices/system/cpu/cpuX/pw20_wait_time
> > > > > > > /sys/devices/system/cpu/cpuX/altivec_idle_wait_time
> > > > > > > Example: Base on TBfreq is 41MHZ.
> > > > > > > 1~47(ns): TB[63]
> > > > > > > 48~95(ns): TB[62]
> > > > > > > 96~191(ns): TB[61]
> > > > > > > 192~383(ns): TB[62]
> > > > > > > 384~767(ns): TB[60]
> > > > > > > ...
> > > > > > >
> > > > > > > Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > > > > ---
> > > > > > > *v4:
> > > > > > > Move code from 85xx/common.c to kernel/sysfs.c.
> > > > > > >
> > > > > > > Remove has_pw20_altivec_idle function.
> > > > > > >
> > > > > > > Change wait "entry_bit" to wait time.
> > > > > > >
> > > > > > > arch/powerpc/kernel/sysfs.c | 291
> > > > > > > ++++++++++++++++++++++++++++++++++++++++++++
> > > > > > > 1 file changed, 291 insertions(+)
> > > > > > >
> > > > > > > diff --git a/arch/powerpc/kernel/sysfs.c
> > > > > > > b/arch/powerpc/kernel/sysfs.c index 27a90b9..23fece6 100644
> > > > > > > --- a/arch/powerpc/kernel/sysfs.c
> > > > > > > +++ b/arch/powerpc/kernel/sysfs.c
> > > > > > > @@ -85,6 +85,279 @@ __setup("smt-snooze-delay=",
> > > > > > > setup_smt_snooze_delay);
> > > > > > >
> > > > > > > #endif /* CONFIG_PPC64 */
> > > > > > >
> > > > > > > +#ifdef CONFIG_FSL_SOC
> > > > > > > +#define MAX_BIT 63
> > > > > > > +
> > > > > > > +static u64 pw20_wt;
> > > > > > > +static u64 altivec_idle_wt;
> > > > > > > +
> > > > > > > +static unsigned int get_idle_ticks_bit(u64 ns) {
> > > > > > > + u64 cycle;
> > > > > > > +
> > > > > > > + cycle = div_u64(ns, 1000 / tb_ticks_per_usec);
> > > > > >
> > > > > > When tb_ticks_per_usec > 1000 (timebase frequency > 1GHz) then
> > > > > > this will always be ns, which is not correct, no?
> > > >
> > > > Actually it'll be a divide by zero in that case.
> > > >
> > > tb_ticks_per_usec = ppc_tb_freq / 1000000; Means TB freq should be
> > > more than 1MHZ.
> > >
> > > if ppc_tb_freq less than 1000000, the tb_ticks_per_usec will be a
> > > divide by zero.
> > > If this condition is established, I think kernel cannot work as a
> > normal.
> > >
> > > So I think we need to believe that the variable is not zero.
> >
> > We do believe it is non-zero but greater than 1000 :)
> >
> > > And I think TB freq
> > > should not less than 1MHZ on PPC platform, because if TB freq less
> > > than 1MHZ, the precision time will become very poor and system
> > > response time will be slower.
> >
> > Not sure what you are describing here related to divide by zero we are
> > mentioning.
> > You are talking about if tb_ticks_per_usec is ZERO and we are talking
> > about if (1000/tb_ticks_per_usec) will be zero.
> >
> > BTW, div_u64() handle the case where divider is zero.
How? When I checked yesterday it looked like div_u64() mapped to a
hardware division on 64-bit targets. In any case it's not good to rely
on such behavior.
> cycle = div_u64(ns, 1000 / tb_ticks_per_usec);
> For this, I think we were discussing the two issues:
>
> 1. Scott talking about, when the tb_ticks_per_usec is a zero.
No I wasn't. I was talking about when tb_ticks_per_usec > 1000, and
thus "1000 / tb_ticks_per_usec" is zero. You said that the result would
be ns in that case.
> 2. You are talking about 1000/tb_ticks_per_usec is a zero.
> This situation is about TB freq > 1GHZ.
>
> I will fix this issue. Like I said before,
> "If timebase frequency > 1GHz, this should be "tb_ticks_per_usec / 1000" and to get tb_ticks_per_nsec.
> This should be changed to "cycle = ns * tb_ticks_per_nsec;""
>
> #define TB_FREQ_1GHZ 1000
>
> If (tb_ticks_per_usec > TB_FREQ_1GHZ)
> cycle = ns * (tb_ticks_per_usec / 1000);
> else
> cycle = div_u64(ns, 1000 / tb_ticks_per_usec);
>
> how about this? :)
I suggested an alternative to satisfy your complaint that it's hard to
test one of those if/else branches.
Plus, your version will be quite inaccurate if (e.g.) tb_ticks_per_usec
is 501, or 1999.
-Scott
^ permalink raw reply
* Re: [PATCH V4 3/3] powerpc/85xx: Add TWR-P1025 board support
From: Scott Wood @ 2013-09-26 21:27 UTC (permalink / raw)
To: Xie Xiaobo-R63061
Cc: Wood Scott-B07421, linuxppc-dev@lists.ozlabs.org,
Johnston Michael-R49610
In-Reply-To: <69EC9ED88E3CC04094A78F8074A7986D600530@039-SN1MPN1-003.039d.mgd.msft.net>
On Thu, 2013-09-26 at 04:27 -0500, Xie Xiaobo-R63061 wrote:
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, September 26, 2013 7:10 AM
> > To: Xie Xiaobo-R63061
> > Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Johnston Michael-
> > R49610
> > Subject: Re: [PATCH V4 3/3] powerpc/85xx: Add TWR-P1025 board support
> >
> > On Wed, 2013-09-25 at 04:50 -0500, Xie Xiaobo-R63061 wrote:
> > > Hi Scott,
> > >
> > > See the reply inline.
> > >
> > > > -----Original Message-----
> > > > From: Wood Scott-B07421
> > > > Sent: Wednesday, September 25, 2013 7:22 AM
> > > > To: Xie Xiaobo-R63061
> > > > Cc: linuxppc-dev@lists.ozlabs.org; Johnston Michael-R49610
> > > > Subject: Re: [PATCH V4 3/3] powerpc/85xx: Add TWR-P1025 board
> > > > support
> > > >
> > > > On Tue, 2013-09-24 at 18:48 +0800, Xie Xiaobo wrote:
> > > > > + partition@80000 {
> > > > > + /* 3.5 MB for Linux Kernel Image */
> > > > > + reg = <0x00080000 0x00380000>;
> > > > > + label = "NOR Linux Kernel Image";
> > > > > + };
> > > >
> > > > Is this enough?
> > >
> > > I will enlarge it to 6MB.
> > >
> > > >
> > > > > + partition@400000 {
> > > > > + /* 58.75MB for JFFS2 based Root file System */
> > > > > + reg = <0x00400000 0x03ac0000>;
> > > > > + label = "NOR Root File System";
> > > > > + };
> > > >
> > > > Don't specify jffs2.
> > >
> > > OK, I will remove "jffs2"
> > >
> > > >
> > > > > + /* CS2 for Display */
> > > > > + ssd1289@2,0 {
> > > > > + #address-cells = <1>;
> > > > > + #size-cells = <1>;
> > > > > + compatible = "ssd1289";
> > > > > + reg = <0x2 0x0000 0x0002
> > > > > + 0x2 0x0002 0x0002>;
> > > > > + };
> > > >
> > > > Node names should be generic. What does ssd1289 do? If this is
> > > > actually the display device, then it should be called "display@2,0".
> > >
> > > OK. The ssd1289 is a LCD controller.
> > >
> > > >
> > > > How about a vendor prefix on that compatible? Why
> > > > #address-cells/#size- cells despite no child nodes? Where is a
> > > > binding that says what each of those two reg resources mean?
> > >
> > > I will add the vendor prefix. I review the ssd1289 driver, and the
> > #address-cells/#size-cells were un-used. I will remove them.
> >
> > And a binding?
> >
> > Why do you need two separate reg resources rather than just <2 0 4>?
> > Will they ever be discontiguous?
>
> [Xie] I review the ssd1289 driver code, and found the driver need two reg resources,
The device tree describes the hardware, not the current state of Linux
drivers. Especially drivers that aren't yet in Linux. :-)
> if change the dts, the driver also should be modified accordingly. So I
> remove the ssd1289 node from this patch. I will submit new patch
> include the dts modification, ssd1289 driver and the binding.
Ideally all devices (and bindings) should be described when the device
tree is initally added, regardless of whether you have a driver yet.
-Scott
^ permalink raw reply
* Re: [PATCH] hvc_vio: Do not override preferred console set by kernel parameter
From: Greg Kroah-Hartman @ 2013-09-26 21:22 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Bastian Blank, Jiri Slaby, Ben Hutchings, linuxppc-dev,
Debian kernel maintainers
In-Reply-To: <1378079740.3978.13.camel@pasglop>
On Mon, Sep 02, 2013 at 09:55:40AM +1000, Benjamin Herrenschmidt wrote:
> On Sun, 2013-09-01 at 17:24 +0100, Ben Hutchings wrote:
> > The original version of this was done by Bastian Blank, who wrote:
> >
> > > The problem is the following:
> > > - Architecture specific code sets preferred console to something bogus.
> > > - Command line handling tries to set preferred console but is overruled
> > > by the old setting.
> > >
> > > The udbg0 console is a boot console and independant.
> >
> > References: http://bugs.debian.org/492703
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> > We've been carrying this in Debian for 5 years now, so it's about time
> > it got reviewed.
> >
> > I'm not convinced strstr() is the right way to check the command line
> > (what if there's also a 'netconsole='?).
>
> Also I think the problem should be solved elsewhere :-)
>
> In the end, what that code is trying to do (as are all the other similar
> instances) is to set "this is a good default in case nothing is
> specified *or* what is specified doesn't actually exist".
>
> Of course "doesn't exist" is tricky since the console could be provided
> by a module loaded god knows when ... but in that case, maybe it does
> make sense to stick to one of the known good defaults. After all, init
> will fail without a tty ...
>
> So I'm thinking we should in kernel/printk.c keep track of all those
> "arch defaults" when console= is specified as "latent" consoles, and
> right before starting init, if the specified one didn't work out (we
> have no console with an associated tty), then go through those latent
> ones and pick one that works.
So, I shouldn't apply this patch? We should do something to fix this,
if Debian has to drag this patch on for 5 years, that's an indication
that this might be one solution we should use, right?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] powerpc/fsl/defconfig: enable CONFIG_AT803X_PHY
From: Scott Wood @ 2013-09-26 21:11 UTC (permalink / raw)
To: Liu Shengzhou-B36685; +Cc: Wood Scott-B07421, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <3F453DDFF675A64A89321A1F35281021ADFACA@039-SN1MPN1-003.039d.mgd.msft.net>
On Wed, 2013-09-25 at 22:02 -0500, Liu Shengzhou-B36685 wrote:
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, September 26, 2013 9:24 AM
> > To: Liu Shengzhou-B36685
> > Cc: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > Subject: Re: [PATCH] powerpc/fsl/defconfig: enable CONFIG_AT803X_PHY
> >
> > On Tue, 2013-09-03 at 16:28 +0800, Shengzhou Liu wrote:
> > > Enable CONFIG_AT803X_PHY to support AR8030/8033/8035 PHY.
> > >
> > > Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> > > ---
> > > arch/powerpc/configs/corenet32_smp_defconfig | 1 +
> > > arch/powerpc/configs/mpc85xx_defconfig | 1 +
> > > arch/powerpc/configs/mpc85xx_smp_defconfig | 1 +
> > > 3 files changed, 3 insertions(+), 0 deletions(-)
> >
> > Why not corenet64_smp_defconfig? Which boards have this PHY?
> >
> > -Scott
> >
> Currently AT803X exists on P1010RDB, P1025TWR, etc.
> It seems we don't use AT803X for those boards of corenet64.
Neither of those boards are corenet32 either.
-Scott
^ permalink raw reply
* Re: [PATCH 00/51] DMA mask changes
From: Rafał Miłecki @ 2013-09-26 20:23 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
linux-ide, devel@driverdev.osuosl.org, linux-samsung-soc,
Linux SCSI List, e1000-devel, b43-dev, linux-media, devicetree,
dri-devel, linux-tegra, linux-omap,
linux-arm-kernel@lists.infradead.org,
Solarflare linux maintainers, Network Development, linux-usb,
linux-wireless@vger.kernel.org, linux-crypto, uclinux-dist-devel,
linux ppc dev
In-Reply-To: <20130919212235.GD12758@n2100.arm.linux.org.uk>
2013/9/19 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> This email is only being sent to the mailing lists in question, not to
> anyone personally. The list of individuals is far to great to do that.
> I'm hoping no mailing lists reject the patches based on the number of
> recipients.
Huh, I think it was enough to send only 3 patches to the b43-dev@. Like:
[PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA ma=
sks
[PATCH 14/51] DMA-API: net: b43: (...)
[PATCH 15/51] DMA-API: net: b43legacy: (...)
;)
I believe Joe has some nice script for doing it that way. When fixing
some coding style / formatting, he sends only related patches to the
given ML.
--=20
Rafa=C5=82
^ permalink raw reply
* Re: therm_adt746x: -3 invalid for parameter limit_adjust
From: Christian Kujau @ 2013-09-26 20:07 UTC (permalink / raw)
To: Jean Delvare; +Cc: colin, Andrew Morton, Jingoo Han, linuxppc-dev
In-Reply-To: <20130926113936.24c10b78@endymion.delvare>
On Thu, 26 Sep 2013 at 11:39, Jean Delvare wrote:
> I think it is a bug in:
>
> commit 6072ddc8520b86adfac6939ca32fb6e6c4de017a
> Author: Jingoo Han <jg1.han@samsung.com>
> Date: Thu Sep 12 15:14:07 2013 -0700
>
> kernel: replace strict_strto*() with kstrto*()
>
> The change was a good idea but the code itself is not, it has kstrtoul
> in many places where kstrtol should be used. Please try the following
> patch, hopefully that should fix your problem:
>
Bingo, this did it! Applied to 3.12.0-rc2, the limit is now lowered again:
$ modprobe therm_adt746x limit_adjust=-3
$ dmesg
[...]
adt746x: Lowering max temperatures from 73, 80, 109 to 67, 47, 67
Thanks!
Tested-by: Christian Kujau <lists@nerdbynature.de>
Christian.
> From: Jean Delvare <khali@linux-fr.org>
> Subject: kernel/params: Fix handling of signed integer types
>
> Commit 6072ddc8520b86adfac6939ca32fb6e6c4de017a broke the handling
> of signed integer types, fix it.
>
> Reported-by: Christian Kujau <lists@nerdbynature.de>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Cc: Jingoo Han <jg1.han@samsung.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
> kernel/params.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> --- linux-3.12-rc2.orig/kernel/params.c 2013-09-24 00:41:09.000000000 +0200
> +++ linux-3.12-rc2/kernel/params.c 2013-09-26 11:32:43.434586197 +0200
> @@ -254,11 +254,11 @@ int parse_args(const char *doing,
>
>
> STANDARD_PARAM_DEF(byte, unsigned char, "%hhu", unsigned long, kstrtoul);
> -STANDARD_PARAM_DEF(short, short, "%hi", long, kstrtoul);
> +STANDARD_PARAM_DEF(short, short, "%hi", long, kstrtol);
> STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", unsigned long, kstrtoul);
> -STANDARD_PARAM_DEF(int, int, "%i", long, kstrtoul);
> +STANDARD_PARAM_DEF(int, int, "%i", long, kstrtol);
> STANDARD_PARAM_DEF(uint, unsigned int, "%u", unsigned long, kstrtoul);
> -STANDARD_PARAM_DEF(long, long, "%li", long, kstrtoul);
> +STANDARD_PARAM_DEF(long, long, "%li", long, kstrtol);
> STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, kstrtoul);
>
> int param_set_charp(const char *val, const struct kernel_param *kp)
>
>
> --
> Jean Delvare
>
--
BOFH excuse #353:
Second-system effect.
^ permalink raw reply
* [PATCH 19/21] powerpc: add explicit OF includes
From: Rob Herring @ 2013-09-26 18:50 UTC (permalink / raw)
To: linux-kernel, devicetree
Cc: Rob Herring, Olof Johansson, Paul Mackerras, Grant Likely,
Anatolij Gustschin, linuxppc-dev
In-Reply-To: <1380221456-11192-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
When removing prom.h include by of.h, several OF headers will no longer
be implicitly included. Add explicit includes of of_*.h as needed.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/kernel/epapr_paravirt.c | 1 +
arch/powerpc/platforms/512x/clock.c | 1 +
arch/powerpc/platforms/512x/pdm360ng.c | 2 ++
arch/powerpc/platforms/82xx/mpc8272_ads.c | 2 ++
arch/powerpc/platforms/82xx/pq2fads.c | 2 ++
arch/powerpc/platforms/83xx/suspend.c | 2 ++
arch/powerpc/platforms/86xx/pic.c | 1 +
arch/powerpc/platforms/embedded6xx/flipper-pic.c | 1 +
arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 2 ++
arch/powerpc/platforms/pasemi/gpio_mdio.c | 1 +
arch/powerpc/platforms/powermac/pfunc_base.c | 1 +
arch/powerpc/platforms/powernv/opal-lpc.c | 1 +
arch/powerpc/platforms/powernv/opal.c | 1 +
arch/powerpc/platforms/powernv/setup.c | 1 +
arch/powerpc/platforms/pseries/hotplug-memory.c | 2 ++
arch/powerpc/sysdev/cpm_common.c | 1 +
arch/powerpc/sysdev/fsl_gtm.c | 2 ++
arch/powerpc/sysdev/fsl_pmc.c | 1 +
arch/powerpc/sysdev/mpic.c | 8 ++++----
arch/powerpc/sysdev/mpic_timer.c | 2 ++
20 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
index 6300c13..7898be9 100644
--- a/arch/powerpc/kernel/epapr_paravirt.c
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -18,6 +18,7 @@
*/
#include <linux/of.h>
+#include <linux/of_fdt.h>
#include <asm/epapr_hcalls.h>
#include <asm/cacheflush.h>
#include <asm/code-patching.h>
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index e504166..fd8a376 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -24,6 +24,7 @@
#include <linux/mutex.h>
#include <linux/io.h>
+#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <asm/mpc5xxx.h>
#include <asm/mpc5121.h>
diff --git a/arch/powerpc/platforms/512x/pdm360ng.c b/arch/powerpc/platforms/512x/pdm360ng.c
index 24b314d..116f2325 100644
--- a/arch/powerpc/platforms/512x/pdm360ng.c
+++ b/arch/powerpc/platforms/512x/pdm360ng.c
@@ -14,6 +14,8 @@
#include <linux/kernel.h>
#include <linux/io.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
#include <linux/of_platform.h>
#include <asm/machdep.h>
diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
index 30394b4..6a14cf5 100644
--- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -16,6 +16,8 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
#include <linux/of_platform.h>
#include <linux/io.h>
diff --git a/arch/powerpc/platforms/82xx/pq2fads.c b/arch/powerpc/platforms/82xx/pq2fads.c
index e1dceee..e5f82ec 100644
--- a/arch/powerpc/platforms/82xx/pq2fads.c
+++ b/arch/powerpc/platforms/82xx/pq2fads.c
@@ -15,6 +15,8 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
#include <linux/of_platform.h>
#include <asm/io.h>
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 1d769a2..3d9716c 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -20,6 +20,8 @@
#include <linux/freezer.h>
#include <linux/suspend.h>
#include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/export.h>
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c
index 9982f57..d5b98c0 100644
--- a/arch/powerpc/platforms/86xx/pic.c
+++ b/arch/powerpc/platforms/86xx/pic.c
@@ -10,6 +10,7 @@
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
+#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <asm/mpic.h>
diff --git a/arch/powerpc/platforms/embedded6xx/flipper-pic.c b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
index 53d6eee0..4cde8e7 100644
--- a/arch/powerpc/platforms/embedded6xx/flipper-pic.c
+++ b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
@@ -18,6 +18,7 @@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <asm/io.h>
#include "flipper-pic.h"
diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
index 3006b51..7cab21d 100644
--- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
+++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
@@ -18,6 +18,8 @@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
#include <asm/io.h>
#include "hlwd-pic.h"
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index 0237ab7..15adee5 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -30,6 +30,7 @@
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/phy.h>
+#include <linux/of_address.h>
#include <linux/of_mdio.h>
#include <linux/of_platform.h>
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index f5e3cda..e49d07f 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -4,6 +4,7 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
+#include <linux/of_irq.h>
#include <asm/pmac_feature.h>
#include <asm/pmac_pfunc.h>
diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c
index a7614bb..e7e59e4 100644
--- a/arch/powerpc/platforms/powernv/opal-lpc.c
+++ b/arch/powerpc/platforms/powernv/opal-lpc.c
@@ -17,6 +17,7 @@
#include <asm/firmware.h>
#include <asm/xics.h>
#include <asm/opal.h>
+#include <asm/prom.h>
static int opal_lpc_chip_id = -1;
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 2911abe..f36ff35 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -13,6 +13,7 @@
#include <linux/types.h>
#include <linux/of.h>
+#include <linux/of_fdt.h>
#include <linux/of_platform.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index e239dcf..19884b2 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -23,6 +23,7 @@
#include <linux/irq.h>
#include <linux/seq_file.h>
#include <linux/of.h>
+#include <linux/of_fdt.h>
#include <linux/interrupt.h>
#include <linux/bug.h>
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 9a432de..9590dbb 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -10,12 +10,14 @@
*/
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/memblock.h>
#include <linux/vmalloc.h>
#include <linux/memory.h>
#include <asm/firmware.h>
#include <asm/machdep.h>
+#include <asm/prom.h>
#include <asm/sparsemem.h>
static unsigned long get_memblock_size(void)
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 4dd5341..4f78695 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -22,6 +22,7 @@
#include <linux/spinlock.h>
#include <linux/export.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/slab.h>
#include <asm/udbg.h>
diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c
index 0eb871c..1b980ee 100644
--- a/arch/powerpc/sysdev/fsl_gtm.c
+++ b/arch/powerpc/sysdev/fsl_gtm.c
@@ -19,6 +19,8 @@
#include <linux/list.h>
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/slab.h>
diff --git a/arch/powerpc/sysdev/fsl_pmc.c b/arch/powerpc/sysdev/fsl_pmc.c
index 592a0f8..8cf4aa0 100644
--- a/arch/powerpc/sysdev/fsl_pmc.c
+++ b/arch/powerpc/sysdev/fsl_pmc.c
@@ -18,6 +18,7 @@
#include <linux/suspend.h>
#include <linux/delay.h>
#include <linux/device.h>
+#include <linux/of_address.h>
#include <linux/of_platform.h>
struct pmc_regs {
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 1be54fa..2d30eaf 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -535,7 +535,7 @@ static void __init mpic_scan_ht_pic(struct mpic *mpic, u8 __iomem *devbase,
mpic->fixups[irq].data = readl(base + 4) | 0x80000000;
}
}
-
+
static void __init mpic_scan_ht_pics(struct mpic *mpic)
{
@@ -1475,7 +1475,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
* as a default instead of the value read from the HW.
*/
last_irq = (greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
- >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT;
+ >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT;
if (isu_size)
last_irq = isu_size * MPIC_MAX_ISU - 1;
of_property_read_u32(mpic->node, "last-interrupt-source", &last_irq);
@@ -1625,7 +1625,7 @@ void __init mpic_init(struct mpic *mpic)
/* start with vector = source number, and masked */
u32 vecpri = MPIC_VECPRI_MASK | i |
(8 << MPIC_VECPRI_PRIORITY_SHIFT);
-
+
/* check if protected */
if (mpic->protected && test_bit(i, mpic->protected))
continue;
@@ -1634,7 +1634,7 @@ void __init mpic_init(struct mpic *mpic)
mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), 1 << cpu);
}
}
-
+
/* Init spurious vector */
mpic_write(mpic->gregs, MPIC_INFO(GREG_SPURIOUS), mpic->spurious_vec);
diff --git a/arch/powerpc/sysdev/mpic_timer.c b/arch/powerpc/sysdev/mpic_timer.c
index c06db92..22d7d57 100644
--- a/arch/powerpc/sysdev/mpic_timer.c
+++ b/arch/powerpc/sysdev/mpic_timer.c
@@ -19,7 +19,9 @@
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/of_device.h>
+#include <linux/of_irq.h>
#include <linux/syscore_ops.h>
#include <sysdev/fsl_soc.h>
#include <asm/io.h>
--
1.8.1.2
^ permalink raw reply related
* [PATCH 17/21] of: move of_translate_dma_address to of_address.h
From: Rob Herring @ 2013-09-26 18:50 UTC (permalink / raw)
To: linux-kernel, devicetree
Cc: Grant Likely, Paul Mackerras, linuxppc-dev, Rob Herring
In-Reply-To: <1380221456-11192-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
of_translate_dma_address is implemented in common code, so move the
declaration there too.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/include/asm/prom.h | 4 ----
include/linux/of_address.h | 4 ++++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 43fe002..b8774bd 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -24,10 +24,6 @@
* OF address retreival & translation
*/
-/* Translate a DMA address from device space to CPU space */
-extern u64 of_translate_dma_address(struct device_node *dev,
- const __be32 *in_addr);
-
/* Parse the ibm,dma-window property of an OF node into the busno, phys and
* size parameters.
*/
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index e8a1797..5f6ed6b 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -34,6 +34,10 @@ static inline void of_pci_range_to_resource(struct of_pci_range *range,
res->name = np->full_name;
}
+/* Translate a DMA address from device space to CPU space */
+extern u64 of_translate_dma_address(struct device_node *dev,
+ const __be32 *in_addr);
+
#ifdef CONFIG_OF_ADDRESS
extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
extern bool of_can_translate_address(struct device_node *dev);
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH 2/2] powerpc/powernv: Replace CONFIG_POWERNV_MSI with just CONFIG_PPC_POWERNV
From: Gavin Shan @ 2013-09-26 15:41 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, shangw
In-Reply-To: <1380181937-15156-2-git-send-email-michael@ellerman.id.au>
On Thu, Sep 26, 2013 at 05:52:17PM +1000, Michael Ellerman wrote:
>We currently have a user visible CONFIG_POWERNV_MSI option, but it
>doesn't actually disable MSI for powernv. The MSI code is always built,
>what it does disable is the inclusion of the MSI bitmap code, which
>leads to a build error.
>
>eg, with PPC_POWERNV=y and POWERNV_MSI=n we get:
>
> arch/powerpc/platforms/built-in.o: In function `.pnv_teardown_msi_irqs':
> pci.c:(.text+0x3558): undefined reference to `.msi_bitmap_free_hwirqs'
>
>We don't really need a POWERNV_MSI symbol, just have the MSI bitmap code
>depend directly on PPC_POWERNV.
>
>Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Reviewed-by: Gavin Shan <shangw@linux.vnet.ibm.com>
>---
> arch/powerpc/platforms/powernv/Kconfig | 5 -----
> arch/powerpc/sysdev/Kconfig | 2 +-
> 2 files changed, 1 insertion(+), 6 deletions(-)
>
>diff --git a/arch/powerpc/platforms/powernv/Kconfig b/arch/powerpc/platforms/powernv/Kconfig
>index 6fae5eb..09a5afd 100644
>--- a/arch/powerpc/platforms/powernv/Kconfig
>+++ b/arch/powerpc/platforms/powernv/Kconfig
>@@ -11,11 +11,6 @@ config PPC_POWERNV
> select PPC_UDBG_16550
> default y
>
>-config POWERNV_MSI
>- bool "Support PCI MSI on PowerNV platform"
>- depends on PCI_MSI
>- default y
>-
> config PPC_POWERNV_RTAS
> depends on PPC_POWERNV
> bool "Support for RTAS based PowerNV platforms such as BML"
>diff --git a/arch/powerpc/sysdev/Kconfig b/arch/powerpc/sysdev/Kconfig
>index ab4cb54..8223f78 100644
>--- a/arch/powerpc/sysdev/Kconfig
>+++ b/arch/powerpc/sysdev/Kconfig
>@@ -19,7 +19,7 @@ config PPC_MSI_BITMAP
> default y if MPIC
> default y if FSL_PCI
> default y if PPC4xx_MSI
>- default y if POWERNV_MSI
>+ default y if PPC_POWERNV
>
> source "arch/powerpc/sysdev/xics/Kconfig"
>
Thanks,
Gavin
^ permalink raw reply
* Re: [PATCH 1/2] powerpc/pseries: CONFIG_PSERIES_MSI should depend on PPC_PSERIES
From: Gavin Shan @ 2013-09-26 15:39 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, shangw
In-Reply-To: <1380181937-15156-1-git-send-email-michael@ellerman.id.au>
On Thu, Sep 26, 2013 at 05:52:16PM +1000, Michael Ellerman wrote:
>Previously PSERIES_MSI depended on PPC_PSERIES via EEH. However in
>commit 317f06d "powerpc/eeh: Move common part to kernel directory" we
>made CONFIG_EEH selectable on POWERNV. That leaves us with PSERIES_MSI
>being live even when PSERIES=n. Fix it by making PSERIES_MSI depend
>directly on PPC_PSERIES.
>
>Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Reviewed-by: Gavin Shan <shangw@linux.vnet.ibm.com>
>---
> arch/powerpc/platforms/pseries/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
>index 62b4f80..e666432 100644
>--- a/arch/powerpc/platforms/pseries/Kconfig
>+++ b/arch/powerpc/platforms/pseries/Kconfig
>@@ -34,7 +34,7 @@ config PPC_SPLPAR
>
> config PSERIES_MSI
> bool
>- depends on PCI_MSI && EEH
>+ depends on PCI_MSI && PPC_PSERIES && EEH
> default y
>
> config PSERIES_ENERGY
Thanks,
Gavin
^ 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