* Re: [PATCH v9 11/13] powerpc: select HAVE_SECCOMP_FILTER and provide seccomp_execve
From: Benjamin Herrenschmidt @ 2011-11-28 0:14 UTC (permalink / raw)
To: Will Drewry
Cc: fweisbec, scarybeasts, djm, linux-kernel, rostedt, jmorris,
torvalds, kees.cook, Paul Mackerras, mingo, tglx, linuxppc-dev,
segoon
In-Reply-To: <1314682083.2488.73.camel@pasglop>
On Tue, 2011-08-30 at 15:28 +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2011-06-23 at 19:36 -0500, Will Drewry wrote:
> > Facilitate the use of CONFIG_SECCOMP_FILTER by wrapping compatibility
> > system call numbering for execve and selecting HAVE_SECCOMP_FILTER.
> >
> > v9: rebase on to bccaeafd7c117acee36e90d37c7e05c19be9e7bf
> >
> > Signed-off-by: Will Drewry <wad@chromium.org>
>
> Seen these around for a while ... :-)
>
> I don't see a harm in the patches per-se tho I haven't reviewed the
> actual seccomp filter stuff and it's good (or bad) behaviour on ppc.
Did that stuff every got anywhere ? I don't see HAVE_SECCOMP_FILTER
upsteam ... should I just drop the powerpc patch from patchwork ?
Cheers,
Ben.
^ permalink raw reply
* MPIC cleanup series
From: Benjamin Herrenschmidt @ 2011-11-27 23:51 UTC (permalink / raw)
To: Kyle Moffett; +Cc: linuxppc-dev
Hi Kyle !
I can't reply to the patches themselves easily unfortunately as I
accidentally deleted them from my mailer :-)
Overall I really look your series. It doesn't quite apply cleanly
anymore so I'll as you for a new shoot after you address the comments
below, at which point, if you're fast enough, I'll stick it in -next :-)
Just a couple of comments on some of the patches:
- 5/10: search for open-pic device-tree node if NULL
The idea is fine, however most callers ignore the device-type and only
compare on compatible, while you replace that with a match entry that
seems to require matching on both. This is likely to break stuff. The
"type" part of te march entry should be NULL I believe.
- 9/10: cache the node
of_node_get() is your friend.
- 10/10: Makes me a bit nervous. It 'looks' right but I wouldn't bet on
Apple device-trees being sane vs. chaining. I would like a test that
doesn't do the cascade if the mpic is a primary to at least limit the
risk of messup.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc/40x: Add APM8018X SOC support
From: Benjamin Herrenschmidt @ 2011-11-27 23:19 UTC (permalink / raw)
To: Tanmay Inamdar; +Cc: linuxppc-dev, linux-kernel, Arnd Bergmann
In-Reply-To: <CACoXjcnfCM8Z5qFfrHtxsXkpf492LVbkDA3X=a9dRv9Lcv7Asw@mail.gmail.com>
On Fri, 2011-11-25 at 17:49 +0530, Tanmay Inamdar wrote:
>
> >
> > +#if defined(CONFIG_APM8018X)
> > +/* CPR */
> > +#define DCRN_CPR0_CONFIG_ADDR 0xa
> > +#define DCRN_CPR1_CONFIG_DATA 0xb
> > +/* AHB */
> > +#define DCRN_SDR1_CONFIG_ADDR 0xc
> > +#define DCRN_SDR1_CONFIG_DATA 0xd
> > +#else
> > /* CPRs (440GX and 440SP/440SPe) */
> > #define DCRN_CPR0_CONFIG_ADDR 0xc
> > #define DCRN_CPR0_CONFIG_DATA 0xd
> > +#endif /* CONFIG_APM8018X */
>
>
> same comment as above.
>
> Some existing drivers use these macros. If I change the names, I will
> have to update the
> driver code.
Right, the best approach is to create a small wrapper that provides cpr
and sdr accesses using helpers. That way you can:
- Properly lock since it's all indirect
- Obtain the right DCRs at boot time, stick them in variables
and use them at runtime, avoiding the hard coded constants completely
- Make the code generally look much better
Ie. Provide something like read_sdr1() and write_sdr1() accessors and
change the drivers to use them.
> > diff --git a/arch/powerpc/kernel/cputable.c
> b/arch/powerpc/kernel/cputable.c
> > index edae5bb..e5c51a6 100644
> > --- a/arch/powerpc/kernel/cputable.c
> > +++ b/arch/powerpc/kernel/cputable.c
> > @@ -1505,6 +1505,58 @@ static struct cpu_spec __initdata
> cpu_specs[] = {
> > .machine_check = machine_check_4xx,
> > .platform = "ppc405",
> > },
> > + { /* APM80186-SK */
> > + .pvr_mask = 0xffffffff,
> > + .pvr_value = 0x7ff11432,
>
>
> If you mask out the lower bits, you only need a single entry
> instead of
> four identical ones.
>
> You are right. But each PVR represent different version of SOC. If I
> create single entry, then I will have to give generic cpu_name which I
> don't want.
Note that you should really tell you designers to move away from using
the PVR to identify the SoC's. This is BAD and isn't sustainable long
run. Stick to representing the core itself in the PVR and provide a
different mechanism to identify the SoC (different SPR would do, or even
a DCR).
> > --- a/arch/powerpc/kernel/udbg_16550.c
> > +++ b/arch/powerpc/kernel/udbg_16550.c
> > @@ -18,6 +18,19 @@ extern void real_writeb(u8 data, volatile
> u8 __iomem *addr);
> > extern u8 real_205_readb(volatile u8 __iomem *addr);
> > extern void real_205_writeb(u8 data, volatile u8 __iomem
> *addr);
> >
> > +#ifdef CONFIG_UART_16550_WORD_ADDRESSABLE
> > +struct NS16550 {
> > + /* this struct must be packed */
> > + unsigned char rbr; /* 0 */ u8 s0[3];
> > + unsigned char ier; /* 1 */ u8 s1[3];
> > + unsigned char fcr; /* 2 */ u8 s2[3];
> > + unsigned char lcr; /* 3 */ u8 s3[3];
> > + unsigned char mcr; /* 4 */ u8 s4[3];
> > + unsigned char lsr; /* 5 */ u8 s5[3];
> > + unsigned char msr; /* 6 */ u8 s6[3];
> > + unsigned char scr; /* 7 */ u8 s7[3];
> > +};
> > +#else
> > struct NS16550 {
> > /* this struct must be packed */
> > unsigned char rbr; /* 0 */
> > @@ -29,6 +42,7 @@ struct NS16550 {
> > unsigned char msr; /* 6 */
> > unsigned char scr; /* 7 */
> > };
> > +#endif /* CONFIG_UART_16550_WORD_ADDRESSABLE */
> >
>
>
> Same things as with the register definitions. Please make this
> run-time selectable to allow build-time configurations that
> support both layouts.
>
> Yes. I will try to find better solution.
Cheers,
Ben.
^ permalink raw reply
* Re: [RFC PATCH v2 4/4] cpuidle: (POWER) Handle power_save=off
From: Benjamin Herrenschmidt @ 2011-11-27 23:07 UTC (permalink / raw)
To: Deepthi Dharwar; +Cc: linuxppc-dev, linux-pm, linux-kernel, linux-pm
In-Reply-To: <20111117112906.9191.54050.stgit@localhost6.localdomain6>
On Thu, 2011-11-17 at 16:59 +0530, Deepthi Dharwar wrote:
> This patch makes pseries_idle_driver not to be registered when
> power_save=off kernel boot option is specified. The
> boot_option_idle_override variable used here is similar to
> its usage on x86.
Quick Q. With your changes, the CPU will never get into idle at all
until cpuidle initializes and the driver loads.
That means not only much later in the boot process, but potentially
never if the distro has the driver as a module and fails to load it, or
similar.
Can't that be an issue ? Shouldn't we keep at least one of the basic
idle functions as a fallback ?
Cheers,
Ben.
^ permalink raw reply
* Re: [RFC PATCH v2 3/4] cpuidle: (POWER) Enable cpuidle and directly call cpuidle_idle_call() for pSeries
From: Benjamin Herrenschmidt @ 2011-11-27 23:05 UTC (permalink / raw)
To: Deepthi Dharwar; +Cc: linuxppc-dev, linux-pm, linux-kernel, linux-pm
In-Reply-To: <20111117112852.9191.34256.stgit@localhost6.localdomain6>
On Thu, 2011-11-17 at 16:58 +0530, Deepthi Dharwar wrote:
> This patch enables cpuidle for pSeries and cpuidle_idle_call() is
> directly called from the idle loop. As a result pseries_idle cpuidle
> driver registered with cpuidle subsystem comes into action. This patch
> also removes the routines pseries_shared_idle_sleep and
> pseries_dedicated_idle_sleep as they are now implemented as part of
> pseries_idle cpuidle driver.
>
> Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
> Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
> Signed-off-by: Arun R Bharadwaj <arun.r.bharadwaj@gmail.com>
> ---
> arch/powerpc/platforms/Kconfig | 6 ++
> arch/powerpc/platforms/pseries/setup.c | 86 +-------------------------------
> include/linux/cpuidle.h | 2 -
> 3 files changed, 8 insertions(+), 86 deletions(-)
>
> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
> index e458872..0d2a028 100644
> --- a/arch/powerpc/platforms/Kconfig
> +++ b/arch/powerpc/platforms/Kconfig
> @@ -211,6 +211,12 @@ config PPC_PASEMI_CPUFREQ
>
> endmenu
>
> +menu "CPUIdle driver"
> +
> +source "drivers/cpuidle/Kconfig"
> +
> +endmenu
> +
> config PPC601_SYNC_FIX
> bool "Workarounds for PPC601 bugs"
> depends on 6xx && (PPC_PREP || PPC_PMAC)
> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
> index 9c6716a..f624e74 100644
> --- a/arch/powerpc/platforms/pseries/setup.c
> +++ b/arch/powerpc/platforms/pseries/setup.c
> @@ -39,6 +39,7 @@
> #include <linux/irq.h>
> #include <linux/seq_file.h>
> #include <linux/root_dev.h>
> +#include <linux/cpuidle.h>
>
> #include <asm/mmu.h>
> #include <asm/processor.h>
> @@ -74,9 +75,6 @@ EXPORT_SYMBOL(CMO_PageSize);
>
> int fwnmi_active; /* TRUE if an FWNMI handler is present */
>
> -static void pseries_shared_idle_sleep(void);
> -static void pseries_dedicated_idle_sleep(void);
> -
> static struct device_node *pSeries_mpic_node;
>
> static void pSeries_show_cpuinfo(struct seq_file *m)
> @@ -374,18 +372,9 @@ static void __init pSeries_setup_arch(void)
>
> pSeries_nvram_init();
>
> - /* Choose an idle loop */
> if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
> vpa_init(boot_cpuid);
> - if (get_lppaca()->shared_proc) {
> - printk(KERN_DEBUG "Using shared processor idle loop\n");
> - ppc_md.power_save = pseries_shared_idle_sleep;
> - } else {
> - printk(KERN_DEBUG "Using dedicated idle loop\n");
> - ppc_md.power_save = pseries_dedicated_idle_sleep;
> - }
> - } else {
> - printk(KERN_DEBUG "Using default idle loop\n");
> + ppc_md.power_save = (void *)cpuidle_idle_call;
> }
I very very much dislike that cast. You should not have to cast a
function pointer ... EVER.
> if (firmware_has_feature(FW_FEATURE_LPAR))
> @@ -586,77 +575,6 @@ static int __init pSeries_probe(void)
> return 1;
> }
>
Cheers,
Ben.
^ permalink raw reply
* Re: [RFC PATCH v2 2/4] cpuidle: (POWER) cpuidle driver for pSeries
From: Benjamin Herrenschmidt @ 2011-11-27 23:03 UTC (permalink / raw)
To: Deepthi Dharwar; +Cc: linuxppc-dev, linux-pm, linux-kernel, linux-pm
In-Reply-To: <20111117112841.9191.97974.stgit@localhost6.localdomain6>
On Thu, 2011-11-17 at 16:58 +0530, Deepthi Dharwar wrote:
> This patch implements a backhand cpuidle driver for pSeries
> based on pseries_dedicated_idle_loop and pseries_shared_idle_loop
> routines. The driver is built only if CONFIG_CPU_IDLE is set. This
> cpuidle driver uses global registration of idle states and
> not per-cpu.
.../...
> +#define MAX_IDLE_STATE_COUNT 2
> +
> +static int max_cstate = MAX_IDLE_STATE_COUNT - 1;
Why "cstate" ? This isn't an x86 :-)
> +static struct cpuidle_device __percpu *pseries_idle_cpuidle_devices;
Shorter name please. pseries_cpuidle_devs is fine.
> +static struct cpuidle_state *cpuidle_state_table;
> +
> +void update_smt_snooze_delay(int snooze)
> +{
> + struct cpuidle_driver *drv = cpuidle_get_driver();
> + if (drv)
> + drv->states[0].target_residency = snooze;
> +}
> +
> +static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before)
> +{
> +
> + *kt_before = ktime_get_real();
> + *in_purr = mfspr(SPRN_PURR);
> + /*
> + * Indicate to the HV that we are idle. Now would be
> + * a good time to find other work to dispatch.
> + */
> + get_lppaca()->idle = 1;
> + get_lppaca()->donate_dedicated_cpu = 1;
> +}
I notice that you call this on shared processors as well. The old ocde
used to not set donate_dedicated_cpu in that case. I assume that's not a
big deal and that the HV will just ignore it in the shared processor
case but please add a comment after you've verified it.
> +static inline s64 idle_loop_epilog(unsigned long in_purr, ktime_t kt_before)
> +{
> + get_lppaca()->wait_state_cycles += mfspr(SPRN_PURR) - in_purr;
> + get_lppaca()->donate_dedicated_cpu = 0;
> + get_lppaca()->idle = 0;
> +
> + return ktime_to_us(ktime_sub(ktime_get_real(), kt_before));
> +}
> +
> +
> +static int snooze_loop(struct cpuidle_device *dev,
> + struct cpuidle_driver *drv,
> + int index)
> +{
> + unsigned long in_purr;
> + ktime_t kt_before;
> +
> + idle_loop_prolog(&in_purr, &kt_before);
> +
> + local_irq_enable();
> + set_thread_flag(TIF_POLLING_NRFLAG);
> + while (!need_resched()) {
> + ppc64_runlatch_off();
> + HMT_low();
> + HMT_very_low();
> + }
> + HMT_medium();
> + clear_thread_flag(TIF_POLLING_NRFLAG);
> + smp_mb();
> + local_irq_disable();
> +
> + dev->last_residency =
> + (int)idle_loop_epilog(in_purr, kt_before);
> + return index;
> +}
So your snooze loop has no timeout, is that handled by the cpuidle
driver using some kind of timer ? That sounds a lot less efficient than
passing a max delay to the snooze loop to handle getting into a deeper
state after a bit of snoozing rather than interrupting etc...
> +static int dedicated_cede_loop(struct cpuidle_device *dev,
> + struct cpuidle_driver *drv,
> + int index)
> +{
> + unsigned long in_purr;
> + ktime_t kt_before;
> +
> + idle_loop_prolog(&in_purr, &kt_before);
> +
> + ppc64_runlatch_off();
> + HMT_medium();
> + cede_processor();
> +
> + dev->last_residency =
> + (int)idle_loop_epilog(in_purr, kt_before);
> + return index;
> +}
> +
> +static int shared_cede_loop(struct cpuidle_device *dev,
> + struct cpuidle_driver *drv,
> + int index)
> +{
> + unsigned long in_purr;
> + ktime_t kt_before;
> +
> + idle_loop_prolog(&in_purr, &kt_before);
> +
> + /*
> + * Yield the processor to the hypervisor. We return if
> + * an external interrupt occurs (which are driven prior
> + * to returning here) or if a prod occurs from another
> + * processor. When returning here, external interrupts
> + * are enabled.
> + */
> + cede_processor();
> +
> + dev->last_residency =
> + (int)idle_loop_epilog(in_purr, kt_before);
> + return index;
> +}
> +
> +/*
> + * States for dedicated partition case.
> + */
> +static struct cpuidle_state dedicated_states[MAX_IDLE_STATE_COUNT] = {
> + { /* Snooze */
> + .name = "snooze",
> + .desc = "snooze",
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .exit_latency = 0,
> + .target_residency = 0,
> + .enter = &snooze_loop },
> + { /* CEDE */
> + .name = "CEDE",
> + .desc = "CEDE",
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .exit_latency = 1,
> + .target_residency = 10,
> + .enter = &dedicated_cede_loop },
> +};
> +
> +/*
> + * States for shared partition case.
> + */
> +static struct cpuidle_state shared_states[MAX_IDLE_STATE_COUNT] = {
> + { /* Shared Cede */
> + .name = "Shared Cede",
> + .desc = "Shared Cede",
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .exit_latency = 0,
> + .target_residency = 0,
> + .enter = &shared_cede_loop },
> +};
> +
> +int pseries_notify_cpuidle_add_cpu(int cpu)
> +{
> + struct cpuidle_device *dev =
> + per_cpu_ptr(pseries_idle_cpuidle_devices, cpu);
> + if (dev && cpuidle_get_driver()) {
> + cpuidle_disable_device(dev);
> + cpuidle_enable_device(dev);
> + }
> + return 0;
> +}
> +
> +/*
> + * pseries_idle_cpuidle_driver_init()
> + */
> +static int pseries_idle_cpuidle_driver_init(void)
> +{
Drop the "idle", those names are too long.
> + int cstate;
And use something else than 'cstate', we are among civilized people
here ;-)
> + struct cpuidle_driver *drv = &pseries_idle_driver;
> +
> + drv->state_count = 0;
> +
> + for (cstate = 0; cstate < MAX_IDLE_STATE_COUNT; ++cstate) {
> +
> + if (cstate > max_cstate)
> + break;
> +
> + /* is the state not enabled? */
> + if (cpuidle_state_table[cstate].enter == NULL)
> + continue;
> +
> + drv->states[drv->state_count] = /* structure copy */
> + cpuidle_state_table[cstate];
> +
> + if (cpuidle_state_table == dedicated_states)
> + drv->states[drv->state_count].target_residency =
> + __get_cpu_var(smt_snooze_delay);
> +
> + drv->state_count += 1;
> + }
> +
> + return 0;
> +}
> +
> +/* pseries_idle_devices_uninit(void)
> + * unregister cpuidle devices and de-allocate memory
> + */
> +static void pseries_idle_devices_uninit(void)
> +{
> + int i;
> + struct cpuidle_device *dev;
> +
> + for_each_possible_cpu(i) {
> + dev = per_cpu_ptr(pseries_idle_cpuidle_devices, i);
> + cpuidle_unregister_device(dev);
> + }
> +
> + free_percpu(pseries_idle_cpuidle_devices);
> + return;
> +}
> +
> +/* pseries_idle_devices_init()
> + * allocate, initialize and register cpuidle device
> + */
> +static int pseries_idle_devices_init(void)
> +{
> + int i;
> + struct cpuidle_driver *drv = &pseries_idle_driver;
> + struct cpuidle_device *dev;
> +
> + pseries_idle_cpuidle_devices = alloc_percpu(struct cpuidle_device);
> + if (pseries_idle_cpuidle_devices == NULL)
> + return -ENOMEM;
> +
> + for_each_possible_cpu(i) {
> + dev = per_cpu_ptr(pseries_idle_cpuidle_devices, i);
> + dev->state_count = drv->state_count;
> + dev->cpu = i;
> + if (cpuidle_register_device(dev)) {
> + printk(KERN_DEBUG \
> + "cpuidle_register_device %d failed!\n", i);
> + return -EIO;
> + }
> + }
> +
> + return 0;
> +}
> +
> +/*
> + * pseries_idle_probe()
> + * Choose state table for shared versus dedicated partition
> + */
> +static int pseries_idle_probe(void)
> +{
> + if (max_cstate == 0) {
> + printk(KERN_DEBUG "pseries processor idle disabled.\n");
> + return -EPERM;
> + }
> +
> + if (!firmware_has_feature(FW_FEATURE_SPLPAR)) {
> + printk(KERN_DEBUG "Using default idle\n");
> + return -ENODEV;
> + }
Don't even printk here, this will happen on all !pseries machines and
the debug output isn't useful. Also move the check of max-cstate to
after the splpar test.
Overall, I quite like these patches, my comments are all pretty minor,
hopefully the next round should be the one.
Cheers,
Ben.
^ permalink raw reply
* Re: [RFC PATCH v2 1/4] cpuidle: (powerpc) Add cpu_idle_wait() to allow switching of idle routines
From: Benjamin Herrenschmidt @ 2011-11-27 22:48 UTC (permalink / raw)
To: Deepthi Dharwar; +Cc: linuxppc-dev, linux-pm, linux-kernel, linux-pm
In-Reply-To: <20111117112830.9191.1951.stgit@localhost6.localdomain6>
On Thu, 2011-11-17 at 16:58 +0530, Deepthi Dharwar wrote:
> This patch provides cpu_idle_wait() routine for the powerpc
> platform which is required by the cpuidle subsystem. This
> routine is requied to change the idle handler on SMP systems.
> The equivalent routine for x86 is in arch/x86/kernel/process.c
> but the powerpc implementation is different.
>
> Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
> Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
> Signed-off-by: Arun R Bharadwaj <arun.r.bharadwaj@gmail.com>
> ---
No, that patch also adds this idle boot override thing (can you pick a
shorter name for boot_option_idle_override btw ?) which seems unrelated
and without any explanation as to what it's supposed to be about.
Additionally, I'm a bit worried (but maybe we already discussed that a
while back, I don't know) but cpu_idle_wait() has "wait" in the name,
which makes me think it might need to actually -wait- for all cpus to
have come out of the function.
Now your implementation doesn't provide that guarantee. It might be
fine, I don't know, but if it is, you'd better document it well in the
comments surrounding the code, because as it is, all you do is shoot an
interrupt which will cause the target CPU to eventually come out of idle
some time in the future.
Cheers,
Ben.
> arch/powerpc/Kconfig | 4 ++++
> arch/powerpc/include/asm/processor.h | 2 ++
> arch/powerpc/include/asm/system.h | 1 +
> arch/powerpc/kernel/idle.c | 26 ++++++++++++++++++++++++++
> 4 files changed, 33 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index b177caa..87f8604 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -87,6 +87,10 @@ config ARCH_HAS_ILOG2_U64
> bool
> default y if 64BIT
>
> +config ARCH_HAS_CPU_IDLE_WAIT
> + bool
> + default y
> +
> config GENERIC_HWEIGHT
> bool
> default y
> diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
> index eb11a44..811b7e7 100644
> --- a/arch/powerpc/include/asm/processor.h
> +++ b/arch/powerpc/include/asm/processor.h
> @@ -382,6 +382,8 @@ static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
> }
> #endif
>
> +enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
> +
> #endif /* __KERNEL__ */
> #endif /* __ASSEMBLY__ */
> #endif /* _ASM_POWERPC_PROCESSOR_H */
> diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
> index e30a13d..ff66680 100644
> --- a/arch/powerpc/include/asm/system.h
> +++ b/arch/powerpc/include/asm/system.h
> @@ -221,6 +221,7 @@ extern unsigned long klimit;
> extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
>
> extern int powersave_nap; /* set if nap mode can be used in idle loop */
> +void cpu_idle_wait(void);
>
> /*
> * Atomic exchange
> diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
> index 39a2baa..b478c72 100644
> --- a/arch/powerpc/kernel/idle.c
> +++ b/arch/powerpc/kernel/idle.c
> @@ -39,9 +39,13 @@
> #define cpu_should_die() 0
> #endif
>
> +unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
> +EXPORT_SYMBOL(boot_option_idle_override);
> +
> static int __init powersave_off(char *arg)
> {
> ppc_md.power_save = NULL;
> + boot_option_idle_override = IDLE_POWERSAVE_OFF;
> return 0;
> }
> __setup("powersave=off", powersave_off);
> @@ -102,6 +106,28 @@ void cpu_idle(void)
> }
> }
>
> +
> +/*
> + * cpu_idle_wait - Used to ensure that all the CPUs come out of the old
> + * idle loop and start using the new idle loop.
> + * Required while changing idle handler on SMP systems.
> + * Caller must have changed idle handler to the new value before the call.
> + */
> +void cpu_idle_wait(void)
> +{
> + int cpu;
> + smp_mb();
> +
> + /* kick all the CPUs so that they exit out of old idle routine */
> + get_online_cpus();
> + for_each_online_cpu(cpu) {
> + if (cpu != smp_processor_id())
> + smp_send_reschedule(cpu);
> + }
> + put_online_cpus();
> +}
> +EXPORT_SYMBOL_GPL(cpu_idle_wait);
> +
> int powersave_nap;
>
> #ifdef CONFIG_SYSCTL
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] perf events, powerpc: Add POWER7 stalled-cycles-frontend/backend events
From: Benjamin Herrenschmidt @ 2011-11-27 22:40 UTC (permalink / raw)
To: Michael Neuling
Cc: linuxppc-dev, Paul Mackerras, linux-kernel, Anshuman Khandual
In-Reply-To: <4880.1315549581@neuling.org>
On Fri, 2011-09-09 at 16:26 +1000, Michael Neuling wrote:
> I agree, I think they match what Ingo is trying to achieve.
>
> Can you add these descriptions to the patch and resubmit please?
>
> If you can find similar events for power4/5/5+/6 that would be great too
> submit too.
>
> FWIW, the patch compiles and runs for me.
I already put it in my next branch, but feel free to send a followup
patch adding some comments if you think that's worthwhile.
Cheers,
Ben.
^ permalink raw reply
* Re: Enabling MBX in MPC5121 - OGLES kernel modules
From: Robert Schwebel @ 2011-11-27 18:29 UTC (permalink / raw)
To: Einar Már Björgvinsson; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <76E1146DEE728E4E95C1C6D1EEA1DBA96F174F6B@GRBSR0004.marel.net>
Einar,
On Fri, Nov 25, 2011 at 08:20:30AM +0000, Einar Már Björgvinsson wrote:
> Wanted to repeat my previous email about enabling MBX in MPC5121.
>
> Anybody out there who can assist me?
This list is about open source software. The core you are using is from
Imagination Technologies, they do not give out any documentation. This
means that the community on this mailing list cannot help you. Please go
to the Imagination or Freescale support and tell them that you want to
use their graphics core with the mainline kernel. Maybe they can help
you.
rsc
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH-RFC 02/10] lib: add GENERIC_PCI_IOMAP
From: Michael S. Tsirkin @ 2011-11-27 17:12 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Nicolas Pitre, linux-mips, linux-m68k, linux-ia64, linux-sh,
linux-pci, linux, Jesse Barnes, Chen Liqin, Paul Mackerras,
Ralf Baechle, H. Peter Anvin, sparclinux, Guan Xuetao, Lennox Wu,
Jonas Bonn, Jesper Nilsson, Russell King, linux-hexagon,
Helge Deller, x86, James E.J. Bottomley, Ingo Molnar,
Geert Uytterhoeven, Arend van Spriel, Matt Turner, linux-arch,
Lasse Collin, Arnd Bergmann, Lucas De Marchi, microblaze-uclinux,
Michal Simek, Rob Herring, Mikael Starvik, Ivan Kokshaysky,
Franky Lin, Thomas Gleixner, Andrew Morton, linux-arm-kernel,
Richard Henderson, Michael Ellerman, Paul Bolle, Tony Luck,
linux-cris-kernel, linux-parisc, Paul Gortmaker, linux-kernel,
Fenghua Yu, Richard Kuo, Kyle McMartin, Paul Mundt, linux-alpha,
Olof Johansson, Fabio Baltieri, linuxppc-dev, David S. Miller
In-Reply-To: <20111125115455.9d5e18da6e683586d84ed9c8@canb.auug.org.au>
On Fri, Nov 25, 2011 at 11:54:55AM +1100, Stephen Rothwell wrote:
> Hi Michael,
>
> On Thu, 24 Nov 2011 22:17:02 +0200 "Michael S. Tsirkin" <mst@redhat.com> wrote:
> >
> > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> > index 9120887..c8a67345 100644
> > --- a/include/asm-generic/io.h
> > +++ b/include/asm-generic/io.h
> > @@ -19,6 +19,8 @@
> > #include <asm-generic/iomap.h>
> > #endif
> >
> > +#include <asm-generic/pci_iomap.h>
> > +
> > #ifndef mmiowb
> > #define mmiowb() do {} while (0)
> > #endif
> > @@ -283,9 +285,6 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len)
> > #define __io_virt(x) ((void __force *) (x))
> >
> > #ifndef CONFIG_GENERIC_IOMAP
> > -/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
> > -struct pci_dev;
> > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
> > static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
> > {
> > }
>
> Just wondering why you move pci_iomap but not pic_iounmap.
unmap is implemented significantly different between architectures.
> And also if
> pci_iounmap is meant to stay here, then the "struct pci_dev" should
> probably stay as well.
Right. I'll fix that.
> > diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h
> > index 98dcd76..fdcddcb 100644
> > --- a/include/asm-generic/iomap.h
> > +++ b/include/asm-generic/iomap.h
> > @@ -69,16 +69,13 @@ extern void ioport_unmap(void __iomem *);
> > #ifdef CONFIG_PCI
> > /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
> > struct pci_dev;
> > -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
> > extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
>
> Ditto with pci_iounmap.
Answered above :)
> Also the comment above really belongs with pci_iomap.
Right, I'll correct the comment.
> > diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h
> > new file mode 100644
> > index 0000000..e08b3bd
> > --- /dev/null
> > +++ b/include/asm-generic/pci_iomap.h
> > @@ -0,0 +1,26 @@
> > +/* Generic I/O port emulation, based on MN10300 code
> > + *
> > + * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
> > + * Written by David Howells (dhowells@redhat.com)
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public Licence
> > + * as published by the Free Software Foundation; either version
> > + * 2 of the Licence, or (at your option) any later version.
> > + */
> > +#ifndef __ASM_GENERIC_PCI_IOMAP_H
> > +#define __ASM_GENERIC_PCI_IOMAP_H
> > +
> > +#ifdef CONFIG_PCI
> > +/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
> > +struct pci_dev;
>
> You could move this struct declaration above the ifdef and remove the
> duplicate below.
Good point. Will do.
> > +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
> > +#else
> > +struct pci_dev;
> > +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
> > +{
> > + return NULL;
> > +}
> > +#endif
> > +
> > +#endif /* __ASM_GENERIC_IO_H */
> > diff --git a/lib/iomap.c b/lib/iomap.c
> > index 5dbcb4b..ada922a 100644
> > --- a/lib/iomap.c
> > +++ b/lib/iomap.c
> > @@ -242,45 +242,11 @@ EXPORT_SYMBOL(ioport_unmap);
> > #endif /* CONFIG_HAS_IOPORT */
> >
> > #ifdef CONFIG_PCI
> > -/**
> > - * pci_iomap - create a virtual mapping cookie for a PCI BAR
> > - * @dev: PCI device that owns the BAR
> > - * @bar: BAR number
> > - * @maxlen: length of the memory to map
> > - *
> > - * Using this function you will get a __iomem address to your device BAR.
> > - * You can access it using ioread*() and iowrite*(). These functions hide
> > - * the details if this is a MMIO or PIO address space and will just do what
> > - * you expect from them in the correct way.
> > - *
> > - * @maxlen specifies the maximum length to map. If you want to get access to
> > - * the complete BAR without checking for its length first, pass %0 here.
> > - * */
> > -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
> > -{
> > - resource_size_t start = pci_resource_start(dev, bar);
> > - resource_size_t len = pci_resource_len(dev, bar);
> > - unsigned long flags = pci_resource_flags(dev, bar);
> > -
> > - if (!len || !start)
> > - return NULL;
> > - if (maxlen && len > maxlen)
> > - len = maxlen;
> > - if (flags & IORESOURCE_IO)
> > - return ioport_map(start, len);
> > - if (flags & IORESOURCE_MEM) {
> > - if (flags & IORESOURCE_CACHEABLE)
> > - return ioremap(start, len);
> > - return ioremap_nocache(start, len);
> > - }
> > - /* What? */
> > - return NULL;
> > -}
> > -
> > +/* Hide the details if this is a MMIO or PIO address space and just do what
> > + * you expect in the correct way. */
> > void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
> > {
> > IO_COND(addr, /* nothing */, iounmap(addr));
> > }
> > -EXPORT_SYMBOL(pci_iomap);
> > EXPORT_SYMBOL(pci_iounmap);
>
> Ditto with pci_iounmap
Answered above.
> > diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c
> > new file mode 100644
> > index 0000000..40b26cb
> > --- /dev/null
> > +++ b/lib/pci_iomap.c
> > @@ -0,0 +1,48 @@
> > +/*
> > + * Implement the default iomap interfaces
> > + *
> > + * (C) Copyright 2004 Linus Torvalds
> > + */
> > +#include <linux/pci.h>
> > +#include <linux/io.h>
> > +
> > +#include <linux/module.h>
>
> If this is relative to (at least) v3.2-rc1, then you should use export.h
> instead of module.h
I just copied lib/iomap.c
Will fix, thanks for the comments.
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/
^ permalink raw reply
* sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
From: acrux @ 2011-11-27 16:37 UTC (permalink / raw)
To: linuxppc-dev
Acube Sam460ex has SM502 as onboard video.
I got this with any kernel newer than 2.6.38.x thus the framebuffer is lost too:
root@sam4x0:~# diff dmesg-2.6.38.8 dmesg-2.6.39.4
1,2c1,3
< Using PowerPC 44x Platform machine description
< Linux version 2.6.38.8-Sam460ex (root@sam4x0) (gcc version 4.5.3 (CRUX PPC) ) #1 Fri Nov 11 22:07:53 CET 2011
---
> Using Canyonlands machine description
> Initializing cgroup subsys cpu
> Linux version 2.6.39.4-Sam460ex (root@sam4x0) (gcc version 4.5.3 (CRUX PPC) ) #1 Fri Nov 11 19:06:02 CET 2011
17c18
[cut]
161,179c165,167
< sm501 0001:00:06.0: SM501 At f5480000: Version 050100c0, 64 Mb, IRQ 19
< sm501 0001:00:06.0: setting M1XCLK to 144000000
< sm501 0001:00:06.0: setting MCLK to 72000000
< sm501-usb[0] [mem 0xd84040000-0xd8405ffff]
< sm501-usb[1] [mem 0xd83fc0000-0xd83ffffff]
< sm501-usb[2] [irq 19]
< serial8250.10: ttyS2 at MMIO 0xd84030000 (irq = 19) is a ST16654
< serial8250.10: ttyS3 at MMIO 0xd84030020 (irq = 19) is a ST16654
< sm501-fb[0] [mem 0xd84080000-0xd8408ffff]
< sm501-fb[1] [mem 0xd84100000-0xd8414ffff]
< sm501-fb[2] [mem 0xd80000000-0xd83fbffff]
< sm501-fb[3] [irq 19]
< sm501-fb sm501-fb.80: fb sm501fb-crt disabled at start
< Console: switching to colour frame buffer device 100x37
< sm501-fb sm501-fb.80: fb0: sm501fb-crt frame buffer
< sm501-fb sm501-fb.80: fb sm501fb-panel enabled at start
< sm501-fb sm501-fb.80: fb1: sm501fb-panel frame buffer
< of:sata-dwc 4bffd1000.sata: id 0, controller version 1.82
< of:sata-dwc 4bffd1000.sata: DMA initialized
---
> sm501 0001:00:06.0: incorrect device id c0000105
> sata-dwc 4bffd1000.sata: id 0, controller version 1.82
> sata-dwc 4bffd1000.sata: DMA initialized
181,182c169
< ata1: SATA max UDMA/133 irq 31
< Fixed MDIO Bus: probed
---
> ata1: SATA max UDMA/133 irq 34
[...]
btw, i remember that i also receive a kernel panic if MTD support is enabled with any kernel newer than 2.6.36.x
regards,
--nico
--
acrux <acrux_it@libero.it>
^ permalink raw reply
* scsi/ipr failed to initialize >=linux-3.0.9, >=linux-3.1.1
From: acrux @ 2011-11-27 13:37 UTC (permalink / raw)
To: linuxppc-dev
scsi subsystem with ipr driver fails to initialize with every kernel >=3.0.9 and >=3.1.1
Checked on YDL_Powerstation, IBM 9114-275, IBM 9123-710,
[...]
OF stdout device is: /ht/isa@8/serial@3f8
Preparing to boot Linux version 3.0.10 (root@radio) (gcc version 4.5.3 (CRUX PP1
command line: root=/dev/sda5 ro
memory layout at init:
memory_limit : 0000000000000000 (16 MB aligned)
alloc_bottom : 0000000000b28000
alloc_top : 0000000030000000
alloc_top_hi : 0000000400000000
rmo_top : 0000000030000000
ram_top : 0000000400000000
instantiating rtas at 0x000000002fff6000... done
boot cpu hw idx 0
starting cpu hw idx 1... done
starting cpu hw idx 2... done
starting cpu hw idx 3... done
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x0000000000c29000 -> 0x0000000000c29636
Device tree struct 0x0000000000c2a000 -> 0x0000000000c2d000
Calling quiesce...
returning from prom_init
DART table allocated at: c00000007f000000
Using Maple machine description
DART IOMMU initialized for U4 type chipset
bootconsole [udbg0] enabled
CPU maps initialized for 1 thread per core
Starting Linux PPC64 #1 SMP PREEMPT Sat Nov 26 19:26:54 CET 2011
-----------------------------------------------------
ppc64_pft_size = 0x0
physicalMemorySize = 0x380000000
htab_address = 0xc0000003f0000000
htab_hash_mask = 0x1fffff
-----------------------------------------------------
Initializing cgroup subsys cpu
Linux version 3.0.10 (root@radio) (gcc version 4.5.3 (CRUX PPC) ) #1 SMP PREEMP1
*** 0000 : CF000012
*** 0000 : Setup Arch
[boot]0012 Setup Arch
Found U4-PCIE PCI host bridge. Firmware bus number: 240->255
PCI host bridge /pciex ranges:
IO 0x00000000f0000000..0x00000000f03fffff -> 0x0000000000000000
MEM 0x00000000c0000000..0x00000000efffffff -> 0x00000000c0000000
Found U3-HT PCI host bridge. Firmware bus number: 0->239
PCI host bridge /ht (primary) ranges:
IO 0x00000000f4000000..0x00000000f43fffff -> 0x0000000000000000
MEM 0x0000000080000000..0x00000000bfffffff -> 0x0000000080000000
mmio NVRAM, 1024k at 0xff800000 mapped to d00008008220b000
Zone PFN ranges:
DMA 0x00000000 -> 0x00400000
Normal empty
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
0: 0x00000000 -> 0x00080000
0: 0x00100000 -> 0x00400000
*** 0000 : CF000015
*** 0000 : Setup Done
[boot]0015 Setup Done
PERCPU: Embedded 11 pages/cpu @c000000000d00000 s14848 r0 d30208 u262144
Built 1 zonelists in Node order, mobility grouping on. Total pages: 3612672
Policy zone: DMA
Kernel command line: root=/dev/sda5 ro
PID hash table entries: 4096 (order: 3, 32768 bytes)
freeing bootmem node 0
Memory: 14176588k/14680064k available (8176k kernel code, 503476k reserved, 120)
SLUB: Genslabs=15, HWalign=128, Order=0-3, MinObjects=0, CPUs=4, Nodes=256
Preemptible hierarchical RCU implementation.
NR_IRQS:512 nr_irqs:512 16
mpic: Setting up MPIC " MPIC " version 1.2 at f8040000, max 4 CPUs
mpic: ISU size: 124, shift: 7, mask: 7f
mpic: Initializing for 124 sources
mpic: Setting up HT PICs workarounds for U3/U4
mpic: - HT:07.0 [0xf0] vendor 1022 device 7460 has 24 irqs
Maple: Found RTC at IO 0x1070
clocksource: timebase mult[1175bfb2] shift[22] registered
Console: colour dummy device 80x25
pid_max: default: 32768 minimum: 301
Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes)
Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes)
Mount-cache hash table entries: 256
mpic: requesting IPIs...
PPC970/FX/MP performance monitor hardware support registered
Brought up 4 CPUs
devtmpfs: initialized
NET: Registered protocol family 16
PCI: Probing PCI hardware
IOMMU table initialized, virtual merging enabled
pci 0000:f0:0b.0: PCI bridge to [bus f1-f1]
pci 0001:00:01.0: PCI bridge to [bus 01-01]
pci 0001:00:02.0: PCI bridge to [bus 02-02]
pci 0001:00:03.0: PCI bridge to [bus 03-03]
pci 0001:00:04.0: PCI bridge to [bus 04-04]
pci 0001:00:05.0: PCI bridge to [bus 05-05]
pci 0001:00:06.0: PCI bridge to [bus 06-06]
pci 0001:00:07.0: PCI bridge to [bus 07-07]
bio: create slab <bio-0> at 0
vgaarb: device added: PCI:0000:f1:00.0,decodes=io+mem,owns=none,locks=none
vgaarb: loaded
vgaarb: bridge control possible 0000:f1:00.0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Version 1.0.24.
Bluetooth: Core ver 2.16
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource timebase
Switched to NOHz mode on CPU #3
NET: Registered protocol family 2
Switched to NOHz mode on CPU #2
Switched to NOHz mode on CPU #1
IP route cache hash table entries: 524288 (order: 10, 4194304 bytes)
Switched to NOHz mode on CPU #0
TCP established hash table entries: 524288 (order: 11, 8388608 bytes)
TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
TCP: Hash tables configured (established 524288 bind 65536)
TCP reno registered
UDP hash table entries: 8192 (order: 7, 524288 bytes)
UDP-Lite hash table entries: 8192 (order: 7, 524288 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
pci 0001:00:03.0: Found enabled HT MSI Mapping
pci 0001:00:04.0: Found enabled HT MSI Mapping
pci 0001:00:05.0: Found enabled HT MSI Mapping
pci 0001:00:06.0: Found enabled HT MSI Mapping
pci 0001:01:01.0: Quirk disabled MSI
HugeTLB registered 16 MB page size, pre-allocated 0 pages
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFS: nTxBlock = 8192, nTxLock = 65536
SGI XFS with ACLs, security attributes, large block/inode numbers, no debug enad
Btrfs loaded
msgmni has been set to 27688
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at I/O 0x4113f8 (irq = 68) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
serial8250.0: ttyS1 at I/O 0x4112f8 (irq = 67) is a 16550A
serial 0001:07:02.0: enabling device (0140 -> 0142)
0001:07:02.0: ttyS2 at MMIO 0xb8202000 (irq = 17) is a U6_16550A
0001:07:02.0: ttyS3 at MMIO 0xb8202200 (irq = 17) is a U6_16550A
ipmi message handler version 39.2
ipmi device interface
IPMI System Interface driver.
ipmi_si: Unable to find any System Interface(s)
IPMI Watchdog: driver initialized
Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
brd: module loaded
loop: module loaded
nbd: registered device at major 43
ipr: IBM Power RAID SCSI Device Driver version: 2.5.2 (April 27, 2011)
ipr 0001:01:01.0: Found IOA with IRQ: 18
ipr 0001:01:01.0: Using 32-bit DMA via iommu
ipr 0001:01:01.0: Starting IOA initialization sequence.
ipr 0001:01:01.0: Adapter firmware version: 01200018
ipr 0001:01:01.0: IOA initialized.
scsi0 : IBM 572C Storage Adapter
scsi 0:0:0:0: Direct-Access IBM-ESXS ST373455SS BA23 PQ: 0 ANSI: 5
------------[ cut here ]------------
WARNING: at drivers/scsi/scsi_lib.c:1702
Modules linked in:
NIP: c000000000441db4 LR: c000000000441d9c CTR: c00000000044504c
REGS: c0000003ec8b2ee0 TRAP: 0700 Not tainted (3.0.10)
MSR: 9000000000029032 <EE,ME,CE,IR,DR> CR: 48000024 XER: 200fffff
TASK = c0000003ec8a8000[1] 'swapper' THREAD: c0000003ec8b0000 CPU: 1
GPR00: 0000000000000001 c0000003ec8b3160 c00000000091c8c8 c0000003ea12f940
GPR04: c0000000008d4668 0000000000000000 c0000003ea143740 c0000000007fba80
GPR08: 0000000000000bd1 c0000000007fba88 0000000000548000 0000000000548000
GPR12: 0000000048000028 c00000000ffff280 0000000000000000 0000000000180000
GPR16: c0000003ec8b37a0 0000000000000090 c0000003ea198d88 0000000000000074
GPR20: 0000000000000000 c0000003ea198000 0000000000000000 0000000000000004
GPR24: c0000003ec8b3460 c0000003ea194400 0000000000000000 c0000003ea194428
GPR28: c0000003ea161940 fffffffffffffffa c00000000087e5c0 c0000003ea12f940
NIP [c000000000441db4] .scsi_free_queue+0x20/0x7c
LR [c000000000441d9c] .scsi_free_queue+0x8/0x7c
Call Trace:
[c0000003ec8b3160] [c00000000087e5c0] 0xc00000000087e5c0 (unreliable)
[c0000003ec8b31f0] [c0000000004427e8] .scsi_alloc_sdev+0x240/0x27c
[c0000003ec8b3290] [c000000000442ba0] .scsi_probe_and_add_lun+0xf8/0x960
[c0000003ec8b33e0] [c000000000443678] .__scsi_scan_target+0xd8/0x59c
[c0000003ec8b3520] [c000000000443ba0] .scsi_scan_channel+0x64/0xac
[c0000003ec8b35d0] [c000000000443f08] .scsi_scan_host_selected+0xd4/0x124
[c0000003ec8b3680] [c0000000004443a4] .scsi_scan_host+0x1d0/0x21c
[c0000003ec8b3720] [c000000000647058] .ipr_probe+0x13a8/0x1464
[c0000003ec8b3850] [c0000000003b3ca4] .local_pci_probe+0x70/0xd4
[c0000003ec8b38e0] [c0000000003b418c] .pci_device_probe+0xc8/0xf8
[c0000003ec8b3990] [c0000000004290c8] .driver_probe_device+0xf0/0x1ac
[c0000003ec8b3a30] [c00000000042920c] .__driver_attach+0x88/0xb8
[c0000003ec8b3ac0] [c000000000428020] .bus_for_each_dev+0x70/0xa8
[c0000003ec8b3b70] [c000000000428cd8] .driver_attach+0x24/0x30
[c0000003ec8b3bf0] [c000000000428828] .bus_add_driver+0xc0/0x264
[c0000003ec8b3c90] [c000000000429680] .driver_register+0xb8/0x150
[c0000003ec8b3d30] [c0000000003b4428] .__pci_register_driver+0x4c/0xdc
[c0000003ec8b3dd0] [c0000000007cef68] .ipr_init+0x44/0x50
[c0000003ec8b3e50] [c00000000000a7e4] .do_one_initcall+0xc0/0x190
[c0000003ec8b3f00] [c0000000007ac910] .kernel_init+0xb0/0x14c
[c0000003ec8b3f90] [c00000000001859c] .kernel_thread+0x54/0x70
Instruction dump:
60000000 38210080 7fe3fb78 4bbee468 7c0802a6 4bbee3f9 f821ff71 7c7f1b78
e80302c8 7c000074 7800d182 68000001 <0b000000> e86302e8 481f92a5 60000000
---[ end trace 6a6e1c0c73955051 ]---
------------[ cut here ]------------
WARNING: at drivers/scsi/scsi_lib.c:1702
Modules linked in:
NIP: c000000000441db4 LR: c000000000441d9c CTR: c00000000044504c
REGS: c0000003ec8b2ee0 TRAP: 0700 Tainted: G W (3.0.10)
MSR: 9000000000029032 <EE,ME,CE,IR,DR> CR: 48000024 XER: 200fffff
TASK = c0000003ec8a8000[1] 'swapper' THREAD: c0000003ec8b0000 CPU: 1
GPR00: 0000000000000001 c0000003ec8b3160 c00000000091c8c8 c0000003ea12f940
GPR04: c0000000008d4668 0000000000000000 c0000003ea143740 c0000000007fba80
GPR08: 0000000000000be1 c0000000007fba88 0000000000548000 0000000000548000
GPR12: 0000000048000028 c00000000ffff280 0000000000000000 0000000000180000
GPR16: c0000003ec8b37a0 0000000000000090 c0000003ea198d88 0000000000000074
GPR20: 0000000000000000 c0000003ea198000 0000000000000000 0000000000000004
GPR24: c0000003ec8b3460 c0000003ea194400 0000000000000000 c0000003ea194428
GPR28: c0000003ea161940 fffffffffffffffa c00000000087e5c0 c0000003ea12f940
NIP [c000000000441db4] .scsi_free_queue+0x20/0x7c
LR [c000000000441d9c] .scsi_free_queue+0x8/0x7c
Call Trace:
[c0000003ec8b3160] [c00000000087e5c0] 0xc00000000087e5c0 (unreliable)
[c0000003ec8b31f0] [c0000000004427e8] .scsi_alloc_sdev+0x240/0x27c
[c0000003ec8b3290] [c000000000442ba0] .scsi_probe_and_add_lun+0xf8/0x960
[c0000003ec8b33e0] [c000000000443678] .__scsi_scan_target+0xd8/0x59c
[c0000003ec8b3520] [c000000000443ba0] .scsi_scan_channel+0x64/0xac
[c0000003ec8b35d0] [c000000000443f08] .scsi_scan_host_selected+0xd4/0x124
[c0000003ec8b3680] [c0000000004443a4] .scsi_scan_host+0x1d0/0x21c
[c0000003ec8b3720] [c000000000647058] .ipr_probe+0x13a8/0x1464
[c0000003ec8b3850] [c0000000003b3ca4] .local_pci_probe+0x70/0xd4
[c0000003ec8b38e0] [c0000000003b418c] .pci_device_probe+0xc8/0xf8
[c0000003ec8b3990] [c0000000004290c8] .driver_probe_device+0xf0/0x1ac
[c0000003ec8b3a30] [c00000000042920c] .__driver_attach+0x88/0xb8
[c0000003ec8b3ac0] [c000000000428020] .bus_for_each_dev+0x70/0xa8
[c0000003ec8b3b70] [c000000000428cd8] .driver_attach+0x24/0x30
[c0000003ec8b3bf0] [c000000000428828] .bus_add_driver+0xc0/0x264
[c0000003ec8b3c90] [c000000000429680] .driver_register+0xb8/0x150
[c0000003ec8b3d30] [c0000000003b4428] .__pci_register_driver+0x4c/0xdc
[c0000003ec8b3dd0] [c0000000007cef68] .ipr_init+0x44/0x50
[c0000003ec8b3e50] [c00000000000a7e4] .do_one_initcall+0xc0/0x190
[c0000003ec8b3f00] [c0000000007ac910] .kernel_init+0xb0/0x14c
[c0000003ec8b3f90] [c00000000001859c] .kernel_thread+0x54/0x70
Instruction dump:
60000000 38210080 7fe3fb78 4bbee468 7c0802a6 4bbee3f9 f821ff71 7c7f1b78
e80302c8 7c000074 7800d182 68000001 <0b000000> e86302e8 481f92a5 60000000
---[ end trace 6a6e1c0c73955052 ]---
------------[ cut here ]------------
WARNING: at drivers/scsi/scsi_lib.c:1702
Modules linked in:
NIP: c000000000441db4 LR: c000000000441d9c CTR: c00000000044504c
REGS: c0000003ec8b2ee0 TRAP: 0700 Tainted: G W (3.0.10)
MSR: 9000000000029032 <EE,ME,CE,IR,DR> CR: 48000024 XER: 200fffff
TASK = c0000003ec8a8000[1] 'swapper' THREAD: c0000003ec8b0000 CPU: 1
GPR00: 0000000000000001 c0000003ec8b3160 c00000000091c8c8 c0000003ea12f940
GPR04: c0000000008d4668 0000000000000000 c0000003ea143740 c0000000007fba80
GPR08: 0000000000000bf1 c0000000007fba88 0000000000548000 0000000000548000
GPR12: 0000000048000028 c00000000ffff280 0000000000000000 0000000000180000
GPR16: c0000003ec8b37a0 0000000000000090 c0000003ea198d88 0000000000000074
GPR20: 0000000000000000 c0000003ea198000 0000000000000000 0000000000000004
GPR24: c0000003ec8b3460 c0000003ea194400 0000000000000000 c0000003ea194428
GPR28: c0000003ea161940 fffffffffffffffa c00000000087e5c0 c0000003ea12f940
NIP [c000000000441db4] .scsi_free_queue+0x20/0x7c
LR [c000000000441d9c] .scsi_free_queue+0x8/0x7c
Call Trace:
[c0000003ec8b3160] [c00000000087e5c0] 0xc00000000087e5c0 (unreliable)
[c0000003ec8b31f0] [c0000000004427e8] .scsi_alloc_sdev+0x240/0x27c
[c0000003ec8b3290] [c000000000442ba0] .scsi_probe_and_add_lun+0xf8/0x960
[c0000003ec8b33e0] [c000000000443678] .__scsi_scan_target+0xd8/0x59c
[c0000003ec8b3520] [c000000000443ba0] .scsi_scan_channel+0x64/0xac
[c0000003ec8b35d0] [c000000000443f08] .scsi_scan_host_selected+0xd4/0x124
[c0000003ec8b3680] [c0000000004443a4] .scsi_scan_host+0x1d0/0x21c
[c0000003ec8b3720] [c000000000647058] .ipr_probe+0x13a8/0x1464
[c0000003ec8b3850] [c0000000003b3ca4] .local_pci_probe+0x70/0xd4
[c0000003ec8b38e0] [c0000000003b418c] .pci_device_probe+0xc8/0xf8
[c0000003ec8b3990] [c0000000004290c8] .driver_probe_device+0xf0/0x1ac
[c0000003ec8b3a30] [c00000000042920c] .__driver_attach+0x88/0xb8
[c0000003ec8b3ac0] [c000000000428020] .bus_for_each_dev+0x70/0xa8
[c0000003ec8b3b70] [c000000000428cd8] .driver_attach+0x24/0x30
[c0000003ec8b3bf0] [c000000000428828] .bus_add_driver+0xc0/0x264
[c0000003ec8b3c90] [c000000000429680] .driver_register+0xb8/0x150
[c0000003ec8b3d30] [c0000000003b4428] .__pci_register_driver+0x4c/0xdc
[c0000003ec8b3dd0] [c0000000007cef68] .ipr_init+0x44/0x50
[c0000003ec8b3e50] [c00000000000a7e4] .do_one_initcall+0xc0/0x190
[c0000003ec8b3f00] [c0000000007ac910] .kernel_init+0xb0/0x14c
[c0000003ec8b3f90] [c00000000001859c] .kernel_thread+0x54/0x70
Instruction dump:
60000000 38210080 7fe3fb78 4bbee468 7c0802a6 4bbee3f9 f821ff71 7c7f1b78
e80302c8 7c000074 7800d182 68000001 <0b000000> e86302e8 481f92a5 60000000
---[ end trace 6a6e1c0c73955053 ]---
------------[ cut here ]------------
[...]
regards,
--nico
--
acrux <acrux_it@libero.it>
^ permalink raw reply
* [PATCH 61/62] highmem: kill all __kmap_atomic()
From: Cong Wang @ 2011-11-27 5:27 UTC (permalink / raw)
To: linux-kernel
Cc: Nicolas Pitre, linux-mips, Cong Wang, David Howells,
Paul Gortmaker, James Bottomley, Paul Mackerras, H. Peter Anvin,
sparclinux, Christoph Lameter, linux-am33-list, Russell King,
Helge Deller, x86, James E.J. Bottomley, Ingo Molnar,
Chris Metcalf, Thomas Gleixner, linux-arm-kernel, linux-parisc,
Ralf Baechle, Kyle McMartin, Tejun Heo, akpm, Koichi Yasutake,
linuxppc-dev, David S. Miller
In-Reply-To: <1322371662-26166-1-git-send-email-amwang@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
arch/arm/mm/highmem.c | 4 ++--
arch/frv/include/asm/highmem.h | 2 +-
arch/frv/mm/highmem.c | 4 ++--
arch/mips/include/asm/highmem.h | 2 +-
arch/mips/mm/highmem.c | 4 ++--
arch/mn10300/include/asm/highmem.h | 2 +-
arch/parisc/include/asm/cacheflush.h | 2 +-
arch/powerpc/include/asm/highmem.h | 2 +-
arch/sparc/include/asm/highmem.h | 2 +-
arch/sparc/mm/highmem.c | 4 ++--
arch/tile/include/asm/highmem.h | 2 +-
arch/tile/mm/highmem.c | 4 ++--
arch/x86/include/asm/highmem.h | 2 +-
arch/x86/mm/highmem_32.c | 4 ++--
include/linux/highmem.h | 11 +++--------
15 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index 807c057..5a21505 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -36,7 +36,7 @@ void kunmap(struct page *page)
}
EXPORT_SYMBOL(kunmap);
-void *__kmap_atomic(struct page *page)
+void *kmap_atomic(struct page *page)
{
unsigned int idx;
unsigned long vaddr;
@@ -81,7 +81,7 @@ void *__kmap_atomic(struct page *page)
return (void *)vaddr;
}
-EXPORT_SYMBOL(__kmap_atomic);
+EXPORT_SYMBOL(kmap_atomic);
void __kunmap_atomic(void *kvaddr)
{
diff --git a/arch/frv/include/asm/highmem.h b/arch/frv/include/asm/highmem.h
index a8d6565..716956a 100644
--- a/arch/frv/include/asm/highmem.h
+++ b/arch/frv/include/asm/highmem.h
@@ -157,7 +157,7 @@ static inline void kunmap_atomic_primary(void *kvaddr, enum km_type type)
pagefault_enable();
}
-void *__kmap_atomic(struct page *page);
+void *kmap_atomic(struct page *page);
void __kunmap_atomic(void *kvaddr);
#endif /* !__ASSEMBLY__ */
diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c
index fd7fcd4..31902c9 100644
--- a/arch/frv/mm/highmem.c
+++ b/arch/frv/mm/highmem.c
@@ -37,7 +37,7 @@ struct page *kmap_atomic_to_page(void *ptr)
return virt_to_page(ptr);
}
-void *__kmap_atomic(struct page *page)
+void *kmap_atomic(struct page *page)
{
unsigned long paddr;
int type;
@@ -64,7 +64,7 @@ void *__kmap_atomic(struct page *page)
return NULL;
}
}
-EXPORT_SYMBOL(__kmap_atomic);
+EXPORT_SYMBOL(kmap_atomic);
void __kunmap_atomic(void *kvaddr)
{
diff --git a/arch/mips/include/asm/highmem.h b/arch/mips/include/asm/highmem.h
index 77e6440..2d91888 100644
--- a/arch/mips/include/asm/highmem.h
+++ b/arch/mips/include/asm/highmem.h
@@ -47,7 +47,7 @@ extern void kunmap_high(struct page *page);
extern void *kmap(struct page *page);
extern void kunmap(struct page *page);
-extern void *__kmap_atomic(struct page *page);
+extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern void *kmap_atomic_pfn(unsigned long pfn);
extern struct page *kmap_atomic_to_page(void *ptr);
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 3634c7e..aff5705 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -41,7 +41,7 @@ EXPORT_SYMBOL(kunmap);
* kmaps are appropriate for short, tight code paths only.
*/
-void *__kmap_atomic(struct page *page)
+void *kmap_atomic(struct page *page)
{
unsigned long vaddr;
int idx, type;
@@ -62,7 +62,7 @@ void *__kmap_atomic(struct page *page)
return (void*) vaddr;
}
-EXPORT_SYMBOL(__kmap_atomic);
+EXPORT_SYMBOL(kmap_atomic);
void __kunmap_atomic(void *kvaddr)
{
diff --git a/arch/mn10300/include/asm/highmem.h b/arch/mn10300/include/asm/highmem.h
index bfe2d88..7c137cd 100644
--- a/arch/mn10300/include/asm/highmem.h
+++ b/arch/mn10300/include/asm/highmem.h
@@ -70,7 +70,7 @@ static inline void kunmap(struct page *page)
* be used in IRQ contexts, so in some (very limited) cases we need
* it.
*/
-static inline unsigned long __kmap_atomic(struct page *page)
+static inline unsigned long kmap_atomic(struct page *page)
{
unsigned long vaddr;
int idx, type;
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index da601dd..9f21ab0 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -140,7 +140,7 @@ static inline void *kmap(struct page *page)
#define kunmap(page) kunmap_parisc(page_address(page))
-static inline void *__kmap_atomic(struct page *page)
+static inline void *kmap_atomic(struct page *page)
{
pagefault_disable();
return page_address(page);
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index dbc2640..caaf6e0 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -79,7 +79,7 @@ static inline void kunmap(struct page *page)
kunmap_high(page);
}
-static inline void *__kmap_atomic(struct page *page)
+static inline void *kmap_atomic(struct page *page)
{
return kmap_atomic_prot(page, kmap_prot);
}
diff --git a/arch/sparc/include/asm/highmem.h b/arch/sparc/include/asm/highmem.h
index 3d7afbb..3b6e00d 100644
--- a/arch/sparc/include/asm/highmem.h
+++ b/arch/sparc/include/asm/highmem.h
@@ -70,7 +70,7 @@ static inline void kunmap(struct page *page)
kunmap_high(page);
}
-extern void *__kmap_atomic(struct page *page);
+extern void *kmap_atomic(struct page *page);
extern void __kunmap_atomic(void *kvaddr);
extern struct page *kmap_atomic_to_page(void *vaddr);
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c
index 77140a0..055c66c 100644
--- a/arch/sparc/mm/highmem.c
+++ b/arch/sparc/mm/highmem.c
@@ -30,7 +30,7 @@
#include <asm/tlbflush.h>
#include <asm/fixmap.h>
-void *__kmap_atomic(struct page *page)
+void *kmap_atomic(struct page *page)
{
unsigned long vaddr;
long idx, type;
@@ -64,7 +64,7 @@ void *__kmap_atomic(struct page *page)
return (void*) vaddr;
}
-EXPORT_SYMBOL(__kmap_atomic);
+EXPORT_SYMBOL(kmap_atomic);
void __kunmap_atomic(void *kvaddr)
{
diff --git a/arch/tile/include/asm/highmem.h b/arch/tile/include/asm/highmem.h
index b2a6c5d..fc8429a 100644
--- a/arch/tile/include/asm/highmem.h
+++ b/arch/tile/include/asm/highmem.h
@@ -59,7 +59,7 @@ void *kmap_fix_kpte(struct page *page, int finished);
/* This macro is used only in map_new_virtual() to map "page". */
#define kmap_prot page_to_kpgprot(page)
-void *__kmap_atomic(struct page *page);
+void *kmap_atomic(struct page *page);
void __kunmap_atomic(void *kvaddr);
void *kmap_atomic_pfn(unsigned long pfn);
void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
diff --git a/arch/tile/mm/highmem.c b/arch/tile/mm/highmem.c
index 31dbbd9..ef8e5a6 100644
--- a/arch/tile/mm/highmem.c
+++ b/arch/tile/mm/highmem.c
@@ -224,12 +224,12 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
}
EXPORT_SYMBOL(kmap_atomic_prot);
-void *__kmap_atomic(struct page *page)
+void *kmap_atomic(struct page *page)
{
/* PAGE_NONE is a magic value that tells us to check immutability. */
return kmap_atomic_prot(page, PAGE_NONE);
}
-EXPORT_SYMBOL(__kmap_atomic);
+EXPORT_SYMBOL(kmap_atomic);
void __kunmap_atomic(void *kvaddr)
{
diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h
index 3bd0402..302a323 100644
--- a/arch/x86/include/asm/highmem.h
+++ b/arch/x86/include/asm/highmem.h
@@ -61,7 +61,7 @@ void *kmap(struct page *page);
void kunmap(struct page *page);
void *kmap_atomic_prot(struct page *page, pgprot_t prot);
-void *__kmap_atomic(struct page *page);
+void *kmap_atomic(struct page *page);
void __kunmap_atomic(void *kvaddr);
void *kmap_atomic_pfn(unsigned long pfn);
void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index b499626..9f85499 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -50,11 +50,11 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
}
EXPORT_SYMBOL(kmap_atomic_prot);
-void *__kmap_atomic(struct page *page)
+void *kmap_atomic(struct page *page)
{
return kmap_atomic_prot(page, kmap_prot);
}
-EXPORT_SYMBOL(__kmap_atomic);
+EXPORT_SYMBOL(kmap_atomic);
/*
* This is the same as kmap_atomic() but can map memory that doesn't
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 42ac049..9c1b442 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -55,12 +55,12 @@ static inline void kunmap(struct page *page)
{
}
-static inline void *__kmap_atomic(struct page *page)
+static inline void *kmap_atomic(struct page *page)
{
pagefault_disable();
return page_address(page);
}
-#define kmap_atomic_prot(page, prot) __kmap_atomic(page)
+#define kmap_atomic_prot(page, prot) kmap_atomic(page)
static inline void __kunmap_atomic(void *addr)
{
@@ -121,15 +121,10 @@ static inline void kmap_atomic_idx_pop(void)
#define NARG_(_2, _1, n, ...) n
#define NARG(...) NARG_(__VA_ARGS__, 2, 1, :)
-static inline void *kmap_atomic(struct page *page)
-{
- return __kmap_atomic(page);
-}
-
static inline void __deprecated *kmap_atomic_deprecated(struct page *page,
enum km_type km)
{
- return __kmap_atomic(page);
+ return kmap_atomic(page);
}
#define kmap_atomic1(...) kmap_atomic(__VA_ARGS__)
--
1.7.4.4
^ permalink raw reply related
* [PATCH 05/62] powerpc: remove the second argument of k[un]map_atomic()
From: Cong Wang @ 2011-11-27 5:26 UTC (permalink / raw)
To: linux-kernel
Cc: Andrea Arcangeli, Dave Carroll, Cong Wang, Marcelo Tosatti,
Alexander Graf, kvm-ppc, Paul Gortmaker, Paul Mackerras,
Avi Kivity, kvm, akpm, linuxppc-dev, Anton Blanchard,
David Gibson
In-Reply-To: <1322371662-26166-1-git-send-email-amwang@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
arch/powerpc/kvm/book3s_pr.c | 4 ++--
arch/powerpc/mm/dma-noncoherent.c | 5 ++---
arch/powerpc/mm/hugetlbpage.c | 4 ++--
arch/powerpc/mm/mem.c | 4 ++--
4 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 3c791e1..fbd4103 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -227,14 +227,14 @@ static void kvmppc_patch_dcbz(struct kvm_vcpu *vcpu, struct kvmppc_pte *pte)
hpage_offset /= 4;
get_page(hpage);
- page = kmap_atomic(hpage, KM_USER0);
+ page = kmap_atomic(hpage);
/* patch dcbz into reserved instruction, so we trap */
for (i=hpage_offset; i < hpage_offset + (HW_PAGE_SIZE / 4); i++)
if ((page[i] & 0xff0007ff) == INS_DCBZ)
page[i] &= 0xfffffff7;
- kunmap_atomic(page, KM_USER0);
+ kunmap_atomic(page);
put_page(hpage);
}
diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c
index 329be36..6747eec 100644
--- a/arch/powerpc/mm/dma-noncoherent.c
+++ b/arch/powerpc/mm/dma-noncoherent.c
@@ -365,12 +365,11 @@ static inline void __dma_sync_page_highmem(struct page *page,
local_irq_save(flags);
do {
- start = (unsigned long)kmap_atomic(page + seg_nr,
- KM_PPC_SYNC_PAGE) + seg_offset;
+ start = (unsigned long)kmap_atomic(page + seg_nr) + seg_offset;
/* Sync this buffer segment */
__dma_sync((void *)start, seg_size, direction);
- kunmap_atomic((void *)start, KM_PPC_SYNC_PAGE);
+ kunmap_atomic((void *)start);
seg_nr++;
/* Calculate next buffer segment size */
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 8558b57..85d3592 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -880,9 +880,9 @@ void flush_dcache_icache_hugepage(struct page *page)
if (!PageHighMem(page)) {
__flush_dcache_icache(page_address(page+i));
} else {
- start = kmap_atomic(page+i, KM_PPC_SYNC_ICACHE);
+ start = kmap_atomic(page+i);
__flush_dcache_icache(start);
- kunmap_atomic(start, KM_PPC_SYNC_ICACHE);
+ kunmap_atomic(start);
}
}
}
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 2dd6bdd..edb8b3a 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -457,9 +457,9 @@ void flush_dcache_icache_page(struct page *page)
#endif
#ifdef CONFIG_BOOKE
{
- void *start = kmap_atomic(page, KM_PPC_SYNC_ICACHE);
+ void *start = kmap_atomic(page);
__flush_dcache_icache(start);
- kunmap_atomic(start, KM_PPC_SYNC_ICACHE);
+ kunmap_atomic(start);
}
#elif defined(CONFIG_8xx) || defined(CONFIG_PPC64)
/* On 8xx there is no need to kmap since highmem is not supported */
--
1.7.4.4
^ permalink raw reply related
* Re: [RFC PATCH v5 1/9] fadump: Add documentation for firmware-assisted dump.
From: Mahesh J. Salgaonkar @ 2011-11-25 13:30 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linuxppc-dev, kexec, linux-kernel
In-Reply-To: <20111124223410.GB19828@bloggs.ozlabs.ibm.com>
On 11/25/2011 04:04 AM, Paul Mackerras wrote:
> On Tue, Nov 15, 2011 at 08:43:34PM +0530, Mahesh J Salgaonkar wrote:
>> From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
>>
>> Documentation for firmware-assisted dump. This document is based on the
>> original documentation written for phyp assisted dump by Linas Vepstas
>> and Manish Ahuja, with few changes to reflect the current implementation.
>>
>> Change in v3:
>> - Modified the documentation to reflect introdunction of fadump_registered
>> sysfs file and few minor changes.
>>
>> Change in v2:
>> - Modified the documentation to reflect the change of fadump_region
>> file under debugfs filesystem.
>
> In general we don't want the changes between successive versions in
> the patch description; this information should go below the "---"
> line. The patch description should describe how the patch is now and
> give any information that will be useful to someone looking at the
> resulting git commit later on, but it doesn't need to tell us about
> previous versions of the patch that will never appear in the git
> history.
Sure will do that.
>
>> +-- Once the dump is copied out, the memory that held the dump
>> + is immediately available to the running kernel. A further
>> + reboot isn't required.
>
> I have a general worry about the system making allocations that are
> intended to be node-local while it is running with restricted memory
> (i.e. after the crash and reboot and before the dump has been written
> out and the dump memory freed). Those allocations will probably all
> come from one node and thus won't necessarily be on the desired node.
> So, for very large systems with significant NUMA characteristics, it
> may be desirable (though not required) to reboot after taking the
> dump.
I have been working on trying to integrate FADUMP with the kdump
infrastructure on distros, which will modify the existing kernel initrd
to capture the vmcore and release the memory at the very early stage
before the switch_root.
However, by default FADUMP will also reboot after capturing vmcore
unless user specifies 'noreboot' option through kdump configuration file.
>
> What happens about the NUMA information in the kernel -- all the
> memory sections, etc.? Do they get set up as normal even though the
> second kernel is booting with only a small amount of memory initially?
>
In FADUMP case, the booting of second kernel after crash is equivalent
to normal kernel bootup and it boots with the knowledge of entire system
RAM with NUMA information. The memblock structure does contain map for
entire system RAM. We just reserve the memory above the bootmem at the
very early stage in the second kernel, so that it remains untouched.
Thanks,
-Mahesh.
^ permalink raw reply
* Re: [PATCH] powerpc/40x: Add APM8018X SOC support
From: Arnd Bergmann @ 2011-11-25 12:53 UTC (permalink / raw)
To: Tanmay Inamdar; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <CACoXjcnfCM8Z5qFfrHtxsXkpf492LVbkDA3X=a9dRv9Lcv7Asw@mail.gmail.com>
On Friday 25 November 2011, Tanmay Inamdar wrote:
> > >
> > > +#if defined(CONFIG_APM8018X)
> > > +/* CPR */
> > > +#define DCRN_CPR0_CONFIG_ADDR 0xa
> > > +#define DCRN_CPR1_CONFIG_DATA 0xb
> > > +/* AHB */
> > > +#define DCRN_SDR1_CONFIG_ADDR 0xc
> > > +#define DCRN_SDR1_CONFIG_DATA 0xd
> > > +#else
> > > /* CPRs (440GX and 440SP/440SPe) */
> > > #define DCRN_CPR0_CONFIG_ADDR 0xc
> > > #define DCRN_CPR0_CONFIG_DATA 0xd
> > > +#endif /* CONFIG_APM8018X */
> >
> > same comment as above.
> >
>
> Some existing drivers use these macros. If I change the names, I will have
> to update the
> driver code.
Not so many apparently:
$ git grep DCRN_CPR._CONFIG
arch/powerpc/include/asm/dcr-regs.h:#define DCRN_CPR0_CONFIG_ADDR 0xc
arch/powerpc/include/asm/dcr-regs.h:#define DCRN_CPR0_CONFIG_DATA 0xd
arch/powerpc/kvm/44x_emulate.c: case DCRN_CPR0_CONFIG_ADDR:
arch/powerpc/kvm/44x_emulate.c: case DCRN_CPR0_CONFIG_DATA:
arch/powerpc/kvm/44x_emulate.c: mtdcr(DCRN_CPR0_CONFIG_ADDR,
arch/powerpc/kvm/44x_emulate.c: mfdcr(DCRN_CPR0_CONFIG_DATA));
arch/powerpc/kvm/44x_emulate.c: case DCRN_CPR0_CONFIG_ADDR:
Don't worry about out of tree drivers. If you want to be nice to the authors,
rename the macros so that the drivers break in an obvious way rather than
silently.
Note that any drivers relying on these as a constant are already broken
as soon as you try to build a kernel with both APM8018X and 440 enabled,
so you absolutely have to change the device drivers to work with those
kernels.
> > > diff --git a/arch/powerpc/kernel/cputable.c
> > b/arch/powerpc/kernel/cputable.c
> > > index edae5bb..e5c51a6 100644
> > > --- a/arch/powerpc/kernel/cputable.c
> > > +++ b/arch/powerpc/kernel/cputable.c
> > > @@ -1505,6 +1505,58 @@ static struct cpu_spec __initdata cpu_specs[] = {
> > > .machine_check = machine_check_4xx,
> > > .platform = "ppc405",
> > > },
> > > + { /* APM80186-SK */
> > > + .pvr_mask = 0xffffffff,
> > > + .pvr_value = 0x7ff11432,
> >
> > If you mask out the lower bits, you only need a single entry instead of
> > four identical ones.
> >
>
> You are right. But each PVR represent different version of SOC. If I create
> single
> entry, then I will have to give generic cpu_name which I don't want.
Isn't the common name for these always "APM80186"? If you don't need to tell
the difference between them for the purposes of cpu_spec, then don't do
it here.
Arnd
^ permalink raw reply
* Re: [PATCH] powerpc/40x: Add APM8018X SOC support
From: Tanmay Inamdar @ 2011-11-25 12:22 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <24399FB8-956E-4C5A-B153-F77196602062@kernel.crashing.org>
Hello,
Please see inline comment.
Regards,
Tanmay
On Wed, Nov 23, 2011 at 9:46 PM, Kumar Gala <galak@kernel.crashing.org> wro=
te:
>
> On Nov 23, 2011, at 3:44 AM, Tanmay Inamdar wrote:
>
> > arch/powerpc/kernel/udbg_16550.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 22 +
>
> Would be probably good to split this change into its own patch.
Sure. I will do it.
>
> - k
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, =
is for the sole use of the intended recipient(s) and contains information=
=A0
that is confidential and proprietary to AppliedMicro Corporation or its s=
ubsidiaries. =
It is to be used solely for the purpose of furthering the parties' busine=
ss relationship. =
All unauthorized review, use, disclosure or distribution is prohibited. =
If you are not the intended recipient, please contact the sender by reply=
e-mail =
and destroy all copies of the original message.
=0D
^ permalink raw reply
* Re: [PATCH] powerpc/40x: Add APM8018X SOC support
From: Tanmay Inamdar @ 2011-11-25 12:19 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <201111231415.51985.arnd@arndb.de>
[-- Attachment #1: Type: text/plain, Size: 5743 bytes --]
Hello Arnd,
Thanks for the comments. Please see inline replies.
Regards,
Tanmay
On Wed, Nov 23, 2011 at 7:45 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 23 November 2011, Tanmay Inamdar wrote:
> > The AppliedMicro APM8018X embedded processor targets embedded
> applications that
> > require low power and a small footprint. It features a PowerPC 405
> processor
> > core built in a 65nm low-power CMOS process with a five-stage pipeline
> executing
> > up to one instruction per cycle. The family has 128-kbytes of on-chip
> memory,
> > a 128-bit local bus and on-chip DDR2 SDRAM controller with 16-bit
> interface.
>
> Hi Tanmay,
>
> > +#if defined(CONFIG_APM8018X)
> > +#define DCRN_CPR0_ADDR 0xa
> > +#define DCRN_CPR0_DATA 0xb
> > +#else
> > /* 440EP Clock/Power-on Reset regs */
> > #define DCRN_CPR0_ADDR 0xc
> > #define DCRN_CPR0_DATA 0xd
> > +#endif /* CONFIG_APM8018X */
>
> This prevents you from building one kernel that runs on both APM8018X and
> others. Better define a new constant name for the new registers and select
> the right one at run-time.
>
> > diff --git a/arch/powerpc/boot/dts/klondike.dts
> b/arch/powerpc/boot/dts/klondike.dts
> > new file mode 100644
> > index 0000000..9372a52
> > --- /dev/null
> > +++ b/arch/powerpc/boot/dts/klondike.dts
> > @@ -0,0 +1,668 @@
> > +/*
> > + * Device Tree Source for AMCC Klondike (405)
> > + *
>
> The device tree file for the most part describes the chip, but partly also
> the board. Have you considered splitting the soc parts into a .dtsi file
> and moving all the configuration into a separate file?
>
Thanks for suggesting this. I will consider using .dtsi now.
>
>
> > diff --git a/arch/powerpc/configs/40x/klondike_defconfig
> b/arch/powerpc/configs/40x/klondike_defconfig
> > new file mode 100644
> > index 0000000..840f438
> > --- /dev/null
> > +++ b/arch/powerpc/configs/40x/klondike_defconfig
> > @@ -0,0 +1,1353 @@
> > +#
> > +# Automatically generated file; DO NOT EDIT.
> > +# Linux/powerpc 3.2.0-rc2 Kernel Configuration
> > +#
> > +# CONFIG_PPC64 is not set
> > +
>
> Please use 'make savedefconfig' to create a minimal defconfig file instead
> of listing
> the full configuration here.
>
Yes.
>
> > diff --git a/arch/powerpc/include/asm/dcr-regs.h
> b/arch/powerpc/include/asm/dcr-regs.h
> > index 380274d..c900cfd 100644
> > --- a/arch/powerpc/include/asm/dcr-regs.h
> > +++ b/arch/powerpc/include/asm/dcr-regs.h
> > @@ -24,9 +24,18 @@
> > * of the driver main register set
> > */
> >
> > +#if defined(CONFIG_APM8018X)
> > +/* CPR */
> > +#define DCRN_CPR0_CONFIG_ADDR 0xa
> > +#define DCRN_CPR1_CONFIG_DATA 0xb
> > +/* AHB */
> > +#define DCRN_SDR1_CONFIG_ADDR 0xc
> > +#define DCRN_SDR1_CONFIG_DATA 0xd
> > +#else
> > /* CPRs (440GX and 440SP/440SPe) */
> > #define DCRN_CPR0_CONFIG_ADDR 0xc
> > #define DCRN_CPR0_CONFIG_DATA 0xd
> > +#endif /* CONFIG_APM8018X */
>
> same comment as above.
>
Some existing drivers use these macros. If I change the names, I will have
to update the
driver code.
>
> > diff --git a/arch/powerpc/kernel/cputable.c
> b/arch/powerpc/kernel/cputable.c
> > index edae5bb..e5c51a6 100644
> > --- a/arch/powerpc/kernel/cputable.c
> > +++ b/arch/powerpc/kernel/cputable.c
> > @@ -1505,6 +1505,58 @@ static struct cpu_spec __initdata cpu_specs[] = {
> > .machine_check = machine_check_4xx,
> > .platform = "ppc405",
> > },
> > + { /* APM80186-SK */
> > + .pvr_mask = 0xffffffff,
> > + .pvr_value = 0x7ff11432,
>
> If you mask out the lower bits, you only need a single entry instead of
> four identical ones.
>
You are right. But each PVR represent different version of SOC. If I create
single
entry, then I will have to give generic cpu_name which I don't want.
>
> > --- a/arch/powerpc/kernel/udbg_16550.c
> > +++ b/arch/powerpc/kernel/udbg_16550.c
> > @@ -18,6 +18,19 @@ extern void real_writeb(u8 data, volatile u8 __iomem
> *addr);
> > extern u8 real_205_readb(volatile u8 __iomem *addr);
> > extern void real_205_writeb(u8 data, volatile u8 __iomem *addr);
> >
> > +#ifdef CONFIG_UART_16550_WORD_ADDRESSABLE
> > +struct NS16550 {
> > + /* this struct must be packed */
> > + unsigned char rbr; /* 0 */ u8 s0[3];
> > + unsigned char ier; /* 1 */ u8 s1[3];
> > + unsigned char fcr; /* 2 */ u8 s2[3];
> > + unsigned char lcr; /* 3 */ u8 s3[3];
> > + unsigned char mcr; /* 4 */ u8 s4[3];
> > + unsigned char lsr; /* 5 */ u8 s5[3];
> > + unsigned char msr; /* 6 */ u8 s6[3];
> > + unsigned char scr; /* 7 */ u8 s7[3];
> > +};
> > +#else
> > struct NS16550 {
> > /* this struct must be packed */
> > unsigned char rbr; /* 0 */
> > @@ -29,6 +42,7 @@ struct NS16550 {
> > unsigned char msr; /* 6 */
> > unsigned char scr; /* 7 */
> > };
> > +#endif /* CONFIG_UART_16550_WORD_ADDRESSABLE */
> >
>
> Same things as with the register definitions. Please make this
> run-time selectable to allow build-time configurations that
> support both layouts.
>
Yes. I will try to find better solution.
>
> Arnd
>
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and contains information
that is confidential and proprietary to AppliedMicro Corporation or its subsidiaries.
It is to be used solely for the purpose of furthering the parties' business relationship.
All unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply e-mail
and destroy all copies of the original message.
[-- Attachment #2: Type: text/html, Size: 7599 bytes --]
^ permalink raw reply
* [PATCH net-next v2 4/4] powerpc: tqm8548/tqm8xx: add and update CAN device nodes
From: Wolfgang Grandegger @ 2011-11-25 9:43 UTC (permalink / raw)
To: netdev
Cc: Stanislav Yelenskiy, devicetree-discuss, linux-can, linuxppc-dev,
IreneV, socketcan-users
In-Reply-To: <1322214204-1121-1-git-send-email-wg@grandegger.com>
This patch enables or updates support for the CC770 and AN82527
CAN controller on the TQM8548 and TQM8xx boards.
CC: devicetree-discuss@lists.ozlabs.org
CC: linuxppc-dev@ozlabs.org
CC: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
arch/powerpc/boot/dts/tqm8548-bigflash.dts | 19 ++++++++++++++-----
arch/powerpc/boot/dts/tqm8548.dts | 19 ++++++++++++++-----
arch/powerpc/boot/dts/tqm8xx.dts | 25 +++++++++++++++++++++++++
3 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/boot/dts/tqm8548-bigflash.dts b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
index 9452c3c..d918752 100644
--- a/arch/powerpc/boot/dts/tqm8548-bigflash.dts
+++ b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
@@ -352,7 +352,7 @@
ranges = <
0 0x0 0xfc000000 0x04000000 // NOR FLASH bank 1
1 0x0 0xf8000000 0x08000000 // NOR FLASH bank 0
- 2 0x0 0xa3000000 0x00008000 // CAN (2 x i82527)
+ 2 0x0 0xa3000000 0x00008000 // CAN (2 x CC770)
3 0x0 0xa3010000 0x00008000 // NAND FLASH
>;
@@ -393,18 +393,27 @@
};
/* Note: CAN support needs be enabled in U-Boot */
- can0@2,0 {
- compatible = "intel,82527"; // Bosch CC770
+ can@2,0 {
+ compatible = "bosch,cc770"; // Bosch CC770
reg = <2 0x0 0x100>;
interrupts = <4 1>;
interrupt-parent = <&mpic>;
+ bosch,external-clock-frequency = <16000000>;
+ bosch,disconnect-rx1-input;
+ bosch,disconnect-tx1-output;
+ bosch,iso-low-speed-mux;
+ bosch,clock-out-frequency = <16000000>;
};
- can1@2,100 {
- compatible = "intel,82527"; // Bosch CC770
+ can@2,100 {
+ compatible = "bosch,cc770"; // Bosch CC770
reg = <2 0x100 0x100>;
interrupts = <4 1>;
interrupt-parent = <&mpic>;
+ bosch,external-clock-frequency = <16000000>;
+ bosch,disconnect-rx1-input;
+ bosch,disconnect-tx1-output;
+ bosch,iso-low-speed-mux;
};
/* Note: NAND support needs to be enabled in U-Boot */
diff --git a/arch/powerpc/boot/dts/tqm8548.dts b/arch/powerpc/boot/dts/tqm8548.dts
index 619776f..988d887 100644
--- a/arch/powerpc/boot/dts/tqm8548.dts
+++ b/arch/powerpc/boot/dts/tqm8548.dts
@@ -352,7 +352,7 @@
ranges = <
0 0x0 0xfc000000 0x04000000 // NOR FLASH bank 1
1 0x0 0xf8000000 0x08000000 // NOR FLASH bank 0
- 2 0x0 0xe3000000 0x00008000 // CAN (2 x i82527)
+ 2 0x0 0xe3000000 0x00008000 // CAN (2 x CC770)
3 0x0 0xe3010000 0x00008000 // NAND FLASH
>;
@@ -393,18 +393,27 @@
};
/* Note: CAN support needs be enabled in U-Boot */
- can0@2,0 {
- compatible = "intel,82527"; // Bosch CC770
+ can@2,0 {
+ compatible = "bosch,cc770"; // Bosch CC770
reg = <2 0x0 0x100>;
interrupts = <4 1>;
interrupt-parent = <&mpic>;
+ bosch,external-clock-frequency = <16000000>;
+ bosch,disconnect-rx1-input;
+ bosch,disconnect-tx1-output;
+ bosch,iso-low-speed-mux;
+ bosch,clock-out-frequency = <16000000>;
};
- can1@2,100 {
- compatible = "intel,82527"; // Bosch CC770
+ can@2,100 {
+ compatible = "bosch,cc770"; // Bosch CC770
reg = <2 0x100 0x100>;
interrupts = <4 1>;
interrupt-parent = <&mpic>;
+ bosch,external-clock-frequency = <16000000>;
+ bosch,disconnect-rx1-input;
+ bosch,disconnect-tx1-output;
+ bosch,iso-low-speed-mux;
};
/* Note: NAND support needs to be enabled in U-Boot */
diff --git a/arch/powerpc/boot/dts/tqm8xx.dts b/arch/powerpc/boot/dts/tqm8xx.dts
index f6da7ec..c3dba25 100644
--- a/arch/powerpc/boot/dts/tqm8xx.dts
+++ b/arch/powerpc/boot/dts/tqm8xx.dts
@@ -57,6 +57,7 @@
ranges = <
0x0 0x0 0x40000000 0x800000
+ 0x3 0x0 0xc0000000 0x200
>;
flash@0,0 {
@@ -67,6 +68,30 @@
bank-width = <4>;
device-width = <2>;
};
+
+ /* Note: CAN support needs be enabled in U-Boot */
+ can@3,0 {
+ compatible = "intc,82527";
+ reg = <3 0x0 0x80>;
+ interrupts = <8 1>;
+ interrupt-parent = <&PIC>;
+ bosch,external-clock-frequency = <16000000>;
+ bosch,disconnect-rx1-input;
+ bosch,disconnect-tx1-output;
+ bosch,iso-low-speed-mux;
+ bosch,clock-out-frequency = <16000000>;
+ };
+
+ can@3,100 {
+ compatible = "intc,82527";
+ reg = <3 0x100 0x80>;
+ interrupts = <8 1>;
+ interrupt-parent = <&PIC>;
+ bosch,external-clock-frequency = <16000000>;
+ bosch,disconnect-rx1-input;
+ bosch,disconnect-tx1-output;
+ bosch,iso-low-speed-mux;
+ };
};
soc@fff00000 {
--
1.7.4.1
^ permalink raw reply related
* [PATCH net-next v2 3/4] can: cc770: add platform bus driver for the CC770 and AN82527
From: Wolfgang Grandegger @ 2011-11-25 9:43 UTC (permalink / raw)
To: netdev
Cc: Stanislav Yelenskiy, Devicetree-discuss, linux-can, linuxppc-dev,
IreneV, socketcan-users
In-Reply-To: <1322214204-1121-1-git-send-email-wg@grandegger.com>
This driver works with both, static platform data and device tree
bindings. It has been tested on a TQM855L board with two AN82527
CAN controllers on the local bus.
CC: Devicetree-discuss@lists.ozlabs.org
CC: linuxppc-dev@ozlabs.org
CC: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
.../devicetree/bindings/net/can/cc770.txt | 56 ++++
drivers/net/can/cc770/Kconfig | 7 +
drivers/net/can/cc770/Makefile | 1 +
drivers/net/can/cc770/cc770_platform.c | 289 ++++++++++++++++++++
4 files changed, 353 insertions(+), 0 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/can/cc770.txt
create mode 100644 drivers/net/can/cc770/cc770_platform.c
diff --git a/Documentation/devicetree/bindings/net/can/cc770.txt b/Documentation/devicetree/bindings/net/can/cc770.txt
new file mode 100644
index 0000000..01e282d
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/cc770.txt
@@ -0,0 +1,56 @@
+Memory mapped Bosch CC770 and Intel AN82527 CAN controller
+
+Note: The CC770 is a CAN controller from Bosch, which is 100%
+compatible with the old AN82527 from Intel, but with "bugs" being fixed.
+
+Required properties:
+
+- compatible : should be "bosch,cc770" for the CC770 and "intc,82527"
+ for the AN82527.
+
+- reg : should specify the chip select, address offset and size required
+ to map the registers of the controller. The size is usually 0x80.
+
+- interrupts : property with a value describing the interrupt source
+ (number and sensitivity) required for the controller.
+
+Optional properties:
+
+- bosch,external-clock-frequency : frequency of the external oscillator
+ clock in Hz. Note that the internal clock frequency used by the
+ controller is half of that value. If not specified, a default
+ value of 16000000 (16 MHz) is used.
+
+- bosch,clock-out-frequency : slock frequency in Hz on the CLKOUT pin.
+ If not specified or if the specified value is 0, the CLKOUT pin
+ will be disabled.
+
+- bosch,slew-rate : slew rate of the CLKOUT signal. If not specified,
+ a resonable value will be calculated.
+
+- bosch,disconnect-rx0-input : see data sheet.
+
+- bosch,disconnect-rx1-input : see data sheet.
+
+- bosch,disconnect-tx1-output : see data sheet.
+
+- bosch,polarity-dominant : see data sheet.
+
+- bosch,divide-memory-clock : see data sheet.
+
+- bosch,iso-low-speed-mux : see data sheet.
+
+For further information, please have a look to the CC770 or AN82527.
+
+Examples:
+
+can@3,100 {
+ compatible = "bosch,cc770";
+ reg = <3 0x100 0x80>;
+ interrupts = <2 0>;
+ interrupt-parent = <&mpic>;
+ bosch,external-clock-frequency = <16000000>;
+};
+
+
+
diff --git a/drivers/net/can/cc770/Kconfig b/drivers/net/can/cc770/Kconfig
index 28e4d48..22c07a8 100644
--- a/drivers/net/can/cc770/Kconfig
+++ b/drivers/net/can/cc770/Kconfig
@@ -11,4 +11,11 @@ config CAN_CC770_ISA
connected to the ISA bus using I/O port, memory mapped or
indirect access.
+config CAN_CC770_PLATFORM
+ tristate "Generic Platform Bus based CC770 driver"
+ ---help---
+ This driver adds support for the CC770 and AN82527 chips
+ connected to the "platform bus" (Linux abstraction for directly
+ to the processor attached devices).
+
endif
diff --git a/drivers/net/can/cc770/Makefile b/drivers/net/can/cc770/Makefile
index 872ecff..9fb8321 100644
--- a/drivers/net/can/cc770/Makefile
+++ b/drivers/net/can/cc770/Makefile
@@ -4,5 +4,6 @@
obj-$(CONFIG_CAN_CC770) += cc770.o
obj-$(CONFIG_CAN_CC770_ISA) += cc770_isa.o
+obj-$(CONFIG_CAN_CC770_PLATFORM) += cc770_platform.o
ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
new file mode 100644
index 0000000..a33f91d
--- /dev/null
+++ b/drivers/net/can/cc770/cc770_platform.c
@@ -0,0 +1,289 @@
+/*
+ * Driver for CC770 and AN82527 CAN controllers on the platform bus
+ *
+ * Copyright (C) 2009, 2011 Wolfgang Grandegger <wg@grandegger.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the version 2 of the GNU General Public License
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * If platform data are used you should have similar definitions
+ * in your board-specific code:
+ *
+ * static struct cc770_platform_data myboard_cc770_pdata = {
+ * .osc_freq = 16000000,
+ * .cir = 0x41,
+ * .cor = 0x20,
+ * .bcr = 0x40,
+ * };
+ *
+ * Please see include/linux/can/platform/cc770.h for description of
+ * above fields.
+ *
+ * If the device tree is used, you need a CAN node definition in your
+ * DTS file similar to:
+ *
+ * can@3,100 {
+ * compatible = "bosch,cc770";
+ * reg = <3 0x100 0x80>;
+ * interrupts = <2 0>;
+ * interrupt-parent = <&mpic>;
+ * bosch,external-clock-frequency = <16000000>;
+ * };
+ *
+ * See "Documentation/devicetree/bindings/net/can/cc770.txt" for further
+ * information.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/netdevice.h>
+#include <linux/delay.h>
+#include <linux/can.h>
+#include <linux/can/dev.h>
+#include <linux/can/platform/cc770.h>
+
+#include <linux/of_platform.h>
+
+#include "cc770.h"
+
+#define DRV_NAME "cc770_platform"
+
+MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
+MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the platform bus");
+MODULE_LICENSE("GPL v2");
+
+#define CC770_PLATFORM_CAN_CLOCK 16000000
+
+static u8 cc770_platform_read_reg(const struct cc770_priv *priv, int reg)
+{
+ return in_8(priv->reg_base + reg);
+}
+
+static void cc770_platform_write_reg(const struct cc770_priv *priv, int reg,
+ u8 val)
+{
+ out_8(priv->reg_base + reg, val);
+}
+
+static int __devinit cc770_get_of_node_data(struct platform_device *pdev,
+ struct cc770_priv *priv)
+{
+ struct device_node *np = pdev->dev.of_node;
+ const u32 *prop;
+ int prop_size;
+ u32 clkext;
+
+ prop = of_get_property(np, "bosch,external-clock-frequency",
+ &prop_size);
+ if (prop && (prop_size == sizeof(u32)))
+ clkext = *prop;
+ else
+ clkext = CC770_PLATFORM_CAN_CLOCK; /* default */
+ priv->can.clock.freq = clkext;
+
+ /* The system clock may not exceed 10 MHz */
+ if (priv->can.clock.freq > 10000000) {
+ priv->cpu_interface |= CPUIF_DSC;
+ priv->can.clock.freq /= 2;
+ }
+
+ /* The memory clock may not exceed 8 MHz */
+ if (priv->can.clock.freq > 8000000)
+ priv->cpu_interface |= CPUIF_DMC;
+
+ if (of_get_property(np, "bosch,divide-memory-clock", NULL))
+ priv->cpu_interface |= CPUIF_DMC;
+ if (of_get_property(np, "bosch,iso-low-speed-mux", NULL))
+ priv->cpu_interface |= CPUIF_MUX;
+
+ if (!of_get_property(np, "bosch,no-comperator-bypass", NULL))
+ priv->bus_config |= BUSCFG_CBY;
+ if (of_get_property(np, "bosch,disconnect-rx0-input", NULL))
+ priv->bus_config |= BUSCFG_DR0;
+ if (of_get_property(np, "bosch,disconnect-rx1-input", NULL))
+ priv->bus_config |= BUSCFG_DR1;
+ if (of_get_property(np, "bosch,disconnect-tx1-output", NULL))
+ priv->bus_config |= BUSCFG_DT1;
+ if (of_get_property(np, "bosch,polarity-dominant", NULL))
+ priv->bus_config |= BUSCFG_POL;
+
+ prop = of_get_property(np, "bosch,clock-out-frequency", &prop_size);
+ if (prop && (prop_size == sizeof(u32)) && *prop > 0) {
+ u32 cdv = clkext / *prop;
+ int slew;
+
+ if (cdv > 0 && cdv < 16) {
+ priv->cpu_interface |= CPUIF_CEN;
+ priv->clkout |= (cdv - 1) & CLKOUT_CD_MASK;
+
+ prop = of_get_property(np, "bosch,slew-rate",
+ &prop_size);
+ if (prop && (prop_size == sizeof(u32))) {
+ slew = *prop;
+ } else {
+ /* Determine default slew rate */
+ slew = (CLKOUT_SL_MASK >>
+ CLKOUT_SL_SHIFT) -
+ ((cdv * clkext - 1) / 8000000);
+ if (slew < 0)
+ slew = 0;
+ }
+ priv->clkout |= (slew << CLKOUT_SL_SHIFT) &
+ CLKOUT_SL_MASK;
+ } else {
+ dev_dbg(&pdev->dev, "invalid clock-out-frequency\n");
+ }
+ }
+
+ return 0;
+}
+
+static int __devinit cc770_get_platform_data(struct platform_device *pdev,
+ struct cc770_priv *priv)
+{
+
+ struct cc770_platform_data *pdata = pdev->dev.platform_data;
+
+ priv->can.clock.freq = pdata->osc_freq;
+ if (priv->cpu_interface | CPUIF_DSC)
+ priv->can.clock.freq /= 2;
+ priv->clkout = pdata->cor;
+ priv->bus_config = pdata->bcr;
+ priv->cpu_interface = pdata->cir;
+
+ return 0;
+}
+
+static int __devinit cc770_platform_probe(struct platform_device *pdev)
+{
+ struct net_device *dev;
+ struct cc770_priv *priv;
+ struct resource *mem;
+ resource_size_t mem_size;
+ void __iomem *base;
+ int err, irq;
+
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ irq = platform_get_irq(pdev, 0);
+ if (!mem || irq <= 0)
+ return -ENODEV;
+
+ mem_size = resource_size(mem);
+ if (!request_mem_region(mem->start, mem_size, pdev->name))
+ return -EBUSY;
+
+ base = ioremap(mem->start, mem_size);
+ if (!base) {
+ err = -ENOMEM;
+ goto exit_release_mem;
+ }
+
+ dev = alloc_cc770dev(0);
+ if (!dev) {
+ err = -ENOMEM;
+ goto exit_unmap_mem;
+ }
+
+ dev->irq = irq;
+ priv = netdev_priv(dev);
+ priv->read_reg = cc770_platform_read_reg;
+ priv->write_reg = cc770_platform_write_reg;
+ priv->irq_flags = IRQF_SHARED;
+ priv->reg_base = base;
+
+ if (pdev->dev.of_node)
+ err = cc770_get_of_node_data(pdev, priv);
+ else if (pdev->dev.platform_data)
+ err = cc770_get_platform_data(pdev, priv);
+ else
+ err = -ENODEV;
+ if (err)
+ goto exit_free_cc770;
+
+ dev_dbg(&pdev->dev,
+ "reg_base=0x%p irq=%d clock=%d cpu_interface=0x%02x "
+ "bus_config=0x%02x clkout=0x%02x\n",
+ priv->reg_base, dev->irq, priv->can.clock.freq,
+ priv->cpu_interface, priv->bus_config, priv->clkout);
+
+ dev_set_drvdata(&pdev->dev, dev);
+ SET_NETDEV_DEV(dev, &pdev->dev);
+
+ err = register_cc770dev(dev);
+ if (err) {
+ dev_err(&pdev->dev,
+ "couldn't register CC700 device (err=%d)\n", err);
+ goto exit_free_cc770;
+ }
+
+ return 0;
+
+exit_free_cc770:
+ free_cc770dev(dev);
+exit_unmap_mem:
+ iounmap(base);
+exit_release_mem:
+ release_mem_region(mem->start, mem_size);
+
+ return err;
+}
+
+static int __devexit cc770_platform_remove(struct platform_device *pdev)
+{
+ struct net_device *dev = dev_get_drvdata(&pdev->dev);
+ struct cc770_priv *priv = netdev_priv(dev);
+ struct resource *mem;
+
+ unregister_cc770dev(dev);
+ iounmap(priv->reg_base);
+ free_cc770dev(dev);
+
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (mem)
+ release_mem_region(mem->start, resource_size(mem));
+ else
+ dev_err(&pdev->dev, "couldn't release mem region");
+
+ return 0;
+}
+
+static struct of_device_id __devinitdata cc770_platform_table[] = {
+ {.compatible = "bosch,cc770"}, /* CC770 from Bosch */
+ {.compatible = "intc,82527"}, /* AN82527 from Intel CP */
+ {},
+};
+
+static struct platform_driver cc770_platform_driver = {
+ .driver = {
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = cc770_platform_table,
+ },
+ .probe = cc770_platform_probe,
+ .remove = __devexit_p(cc770_platform_remove),
+};
+
+static int __init cc770_platform_init(void)
+{
+ return platform_driver_register(&cc770_platform_driver);
+}
+module_init(cc770_platform_init);
+
+static void __exit cc770_platform_exit(void)
+{
+ platform_driver_unregister(&cc770_platform_driver);
+}
+module_exit(cc770_platform_exit);
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH-RFC 01/10] lib: move GENERIC_IOMAP to lib/Kconfig
From: Jesper Nilsson @ 2011-11-25 8:41 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Nicolas Pitre, linux-mips@linux-mips.org,
linux-m68k@vger.kernel.org, linux-ia64@vger.kernel.org,
linux-sh@vger.kernel.org, linux@openrisc.net,
linux-pci@vger.kernel.org, Jesse Barnes, Chen Liqin,
Paul Mackerras, H. Peter Anvin, sparclinux@vger.kernel.org,
Guan Xuetao, Lennox Wu, Jonas Bonn, Russell King,
linux-hexagon@vger.kernel.org, Helge Deller, x86@kernel.org,
James E.J. Bottomley, Ingo Molnar, Geert Uytterhoeven,
linux-arch@vger.kernel.org, Arend van Spriel, Matt Turner,
Fenghua Yu, Lasse Collin, Arnd Bergmann, Lucas De Marchi,
microblaze-uclinux@itee.uq.edu.au, Paul Bolle, Rob Herring,
Mikael Starvik, Ivan Kokshaysky, Franky Lin, Thomas Gleixner,
Fabio Baltieri, linux-arm-kernel@lists.infradead.org,
Richard Henderson, Michael Ellerman, Michal Simek, Tony Luck,
linux-parisc@vger.kernel.org, linux-cris-kernel, Paul Gortmaker,
linux-kernel@vger.kernel.org, Ralf Baechle, Richard Kuo,
Kyle McMartin, Paul Mundt, linux-alpha@vger.kernel.org,
Olof Johansson, Andrew Morton, linuxppc-dev@lists.ozlabs.org,
David S. Miller
In-Reply-To: <5aed7b7e1dbc8a50ebd6986245df8054fd05b7cd.1322163031.git.mst@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
On Thu, Nov 24, 2011 at 09:15:42PM +0100, Michael S. Tsirkin wrote:
> define GENERIC_IOMAP in a central location
> instead of all architectures. This will be helpful
> for the follow-up patch which makes it select
> other configs. Code is also a bit shorter this way.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
For the CRIS part:
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* RE: Enabling MBX in MPC5121 - OGLES kernel modules
From: Einar Már Björgvinsson @ 2011-11-25 8:20 UTC (permalink / raw)
To: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <76E1146DEE728E4E95C1C6D1EEA1DBA96F174768@GRBSR0004.marel.net>
[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]
Hi
Wanted to repeat my previous email about enabling MBX in MPC5121.
Anybody out there who can assist me ?
regards
Einar
________________________________
From: Einar Már Björgvinsson
Sent: Tuesday, November 22, 2011 7:15 PM
To: linuxppc-dev@lists.ozlabs.org
Subject: Enabling MBX in MPC5121 - OGLES kernel modules
Hi
I've been working on enabling the PowerVR GPU core in MPC5121 chip. I've been following the documentation from here:
http://www.datasheetarchive.com/indexdl/Datasheet-076/DSAE0026055.pdf
This documentation was released in a bundle with MBX libraries and MBX kernel patches. Also have I downloaded the OGLES SDK from Imgtech where I've successfully built some demos for MPC5121.
The last piece of the puzzle is to have the right kernel modules. There are some kernel modules provided in the documentation bundle but they are build against older kernel version (2.6.24) but I'm am using kernel version 2.6.33 with RT 29.
What I'm hoping is that somebody have the source code for the following kernel modules:
- pvr.ko
- clcdc.ko
- swcamera.ko
- dgbdrv.ko
Hope somebody out there can assist
Regards
Einar M. Bjorgvinsson
Embedded Software Engineer
Marel ehf
Iceland
[-- Attachment #2: Type: text/html, Size: 2269 bytes --]
^ permalink raw reply
* Re: oprofile callgraph support missing for common cpus
From: Juntang Fu(David) @ 2011-11-25 5:58 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, oprofile-list, Fleming, Andy
In-Reply-To: <1322198672.32635.24.camel@pasglop>
On 11/25/2011 01:24 PM, Benjamin Herrenschmidt wrote:
> On Fri, 2011-11-18 at 09:22 +0100, Joakim Tjernlund wrote:
>
>> I forgot to ask, oprofile mentions setting -no-omit-framepointer to get
>> correct backtrace but I cannot turn on frame pointers for the ppc kernel.
>> Isn't frame pointers needed for pcc? what about user space?
> PowerPC always has frame pointers, ignore that :-)
Recently I have met a similar problem on frame pointer but at arm_v7
variant in back tracing
support for Oprofile, could you help me see it? thanks in advance:
in my case, I have enabled Oprofile support in my arm_v7 thumb2 target,
in the created binary image
including kernel image and rootfs, seems that frame pointer is not
enabled for arm thumb2, So I have met
the following problems in back trace:
I can get the right stack traces for kernel stack, but for user stack, the
stack length is always one depth, why?
Is this a known deficiency in supporting arm thumb2 for Oprofile stack
trace?
Thanks.
B.R.
--David
> Cheers,
> Ben.
>
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oprofile-list
^ permalink raw reply
* [PATCH] powerpc: Atomically output each stack frame line in show_stack
From: Anton Blanchard @ 2011-11-25 5:47 UTC (permalink / raw)
To: benh, paulus, miltonm; +Cc: linuxppc-dev
From: Milton Miller <miltonm@bga.com>
show_stack uses up to 4 printks per line and other CPUs using printk
can corrupt the output. This patch calls printk once per stack frame
line to produce more readable output.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-build/arch/powerpc/kernel/process.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/process.c 2011-11-25
16:44:06.548045629 +1100 +++
linux-build/arch/powerpc/kernel/process.c 2011-11-25
16:44:07.944070260 +1100 @@ -1147,7 +1147,7 @@ void show_stack(struct
task_struct *tsk, { unsigned long sp, ip, lr, newsp;
int count = 0;
- int firstframe = 1;
+ char *firstframe = " (unreliable)";
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
int curr_frame = current->curr_ret_stack;
extern void return_to_handler(void);
@@ -1180,20 +1180,20 @@ void show_stack(struct task_struct *tsk,
stack = (unsigned long *) sp;
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
- if (!firstframe || ip != lr) {
- printk("["REG"] ["REG"] %pS", sp, ip, (void
*)ip);
+ if (!firstframe[0] || ip != lr) {
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
if ((ip == rth || ip == mrth) && curr_frame >=
0) {
- printk(" (%pS)",
- (void
*)current->ret_stack[curr_frame].ret);
+ printk("["REG"] ["REG"] %pS
(%pS)%s\n", sp, ip,
+ (void *)ip, (void *)
+
current->ret_stack[curr_frame].ret,
+ firstframe);
curr_frame--;
- }
+ } else
#endif
- if (firstframe)
- printk(" (unreliable)");
- printk("\n");
+ printk("["REG"] ["REG"] %pS%s\n", sp,
ip,
+ (void *)ip, firstframe);
}
- firstframe = 0;
+ firstframe = "";
/*
* See if this is an exception frame.
@@ -1206,7 +1206,7 @@ void show_stack(struct task_struct *tsk,
lr = regs->link;
printk("--- Exception: %lx at %pS\n LR =
%pS\n", regs->trap, (void *)regs->nip, (void *)lr);
- firstframe = 1;
+ firstframe = " (unreliable)";
}
sp = newsp;
^ permalink raw reply
* [PATCH] powerpc: Harden xics hypervisor backend
From: Anton Blanchard @ 2011-11-25 5:39 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
During kdump stress testing I sometimes see the kdump kernel panic
with:
Interrupt 0x306 (real) is invalid, disabling it.
Kernel panic - not syncing: bad return code EOI - rc = -4, value=ff000306
Instead of panicing print the error message, dump the stack the first
time it happens and continue on. Add some more information to the
debug messages as well.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-build/arch/powerpc/sysdev/xics/icp-hv.c
===================================================================
--- linux-build.orig/arch/powerpc/sysdev/xics/icp-hv.c 2011-11-25 14:01:50.756984686 +1100
+++ linux-build/arch/powerpc/sysdev/xics/icp-hv.c 2011-11-25 14:13:22.389244117 +1100
@@ -27,33 +27,49 @@ static inline unsigned int icp_hv_get_xi
{
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
long rc;
+ unsigned int ret = XICS_IRQ_SPURIOUS;
rc = plpar_hcall(H_XIRR, retbuf, cppr);
- if (rc != H_SUCCESS)
- panic(" bad return code xirr - rc = %lx\n", rc);
- return (unsigned int)retbuf[0];
+ if (rc == H_SUCCESS) {
+ ret = (unsigned int)retbuf[0];
+ } else {
+ pr_err("%s: bad return code xirr cppr=0x%x returned %ld\n",
+ __func__, cppr, rc);
+ WARN_ON_ONCE(1);
+ }
+
+ return ret;
}
static inline void icp_hv_set_xirr(unsigned int value)
{
long rc = plpar_hcall_norets(H_EOI, value);
- if (rc != H_SUCCESS)
- panic("bad return code EOI - rc = %ld, value=%x\n", rc, value);
+ if (rc != H_SUCCESS) {
+ pr_err("%s: bad return code eoi xirr=0x%x returned %ld\n",
+ __func__, value, rc);
+ WARN_ON_ONCE(1);
+ }
}
static inline void icp_hv_set_cppr(u8 value)
{
long rc = plpar_hcall_norets(H_CPPR, value);
- if (rc != H_SUCCESS)
- panic("bad return code cppr - rc = %lx\n", rc);
+ if (rc != H_SUCCESS) {
+ pr_err("%s: bad return code cppr cppr=0x%x returned %ld\n",
+ __func__, value, rc);
+ WARN_ON_ONCE(1);
+ }
}
static inline void icp_hv_set_qirr(int n_cpu , u8 value)
{
- long rc = plpar_hcall_norets(H_IPI, get_hard_smp_processor_id(n_cpu),
- value);
- if (rc != H_SUCCESS)
- panic("bad return code qirr - rc = %lx\n", rc);
+ int hw_cpu = get_hard_smp_processor_id(n_cpu);
+ long rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
+ if (rc != H_SUCCESS) {
+ pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x "
+ "returned %ld\n", __func__, n_cpu, hw_cpu, value, rc);
+ WARN_ON_ONCE(1);
+ }
}
static void icp_hv_eoi(struct irq_data *d)
^ 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