* [PATCH] powerpc/drivers: use linux/of_device.h instead of asm/of_device.h
From: Stephen Rothwell @ 2008-08-11 7:04 UTC (permalink / raw)
To: Paul Mackerras, Benjamin Herrenschmidt
Cc: alsa-devel, Stelian Pop, Hanselmann, Michael, lm-sensors,
linuxppc-dev, Delvare, Johannes Berg, Jean
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/hwmon/ams/ams.h | 2 +-
sound/aoa/soundbus/soundbus.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
These are the last two users of asm/of_device.h. If everyone is happy,
we can put this through the powerpc tree. I have build tested for
ppc64_defconfig and ppc6xx_defconfig (which uses the relevant drivers).
After this we can remove the include of linux/of_device.h from
asm/of_device.h
diff --git a/drivers/hwmon/ams/ams.h b/drivers/hwmon/ams/ams.h
index a6221e5..221ef69 100644
--- a/drivers/hwmon/ams/ams.h
+++ b/drivers/hwmon/ams/ams.h
@@ -4,7 +4,7 @@
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/types.h>
-#include <asm/of_device.h>
+#include <linux/of_device.h>
enum ams_irq {
AMS_IRQ_FREEFALL = 0x01,
diff --git a/sound/aoa/soundbus/soundbus.h b/sound/aoa/soundbus/soundbus.h
index 622cd37..a0f223c 100644
--- a/sound/aoa/soundbus/soundbus.h
+++ b/sound/aoa/soundbus/soundbus.h
@@ -8,7 +8,7 @@
#ifndef __SOUNDBUS_H
#define __SOUNDBUS_H
-#include <asm/of_device.h>
+#include <linux/of_device.h>
#include <sound/pcm.h>
#include <linux/list.h>
--
1.5.6.3
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* Re: [Cbe-oss-dev] please pull cell merge branch
From: Arnd Bergmann @ 2008-08-11 7:18 UTC (permalink / raw)
To: cbe-oss-dev
Cc: Robert Richter, linux-kernel, linuxppc-dev, oprofile-list,
Paul Mackerras, cel
In-Reply-To: <18591.30474.127939.243247@cargo.ozlabs.ibm.com>
On Monday 11 August 2008, Paul Mackerras wrote:
> Arnd Bergmann writes:
> > I've fixed one last bug in Carl's update for cell-oprofile (int flags
> > instead of unsigned long flags) and made sure the comments fit the
> > usual style. This fixes a long-standing bug that prevented us from
> > using oprofile on SPUs in many real-world scenarios.=20
>
> Since you're touching generic oprofile code here, do you have an ack=20
> from the oprofile maintainer? =A0Or is the oprofile maintainer listed in
> MAINTAINERS (Robert Richter) no longer active or something?
>=20
Sorry about that. I had assumed that at the very least Carl had had
the oprofile list on Cc and that people there just didn't care.
Robert has just recently taken over maintainership for oprofile,
so I assume that he is indeed active and interested in the patches.
I'll send them out again for his review on oprofile-list.
Arnd <><
^ permalink raw reply
* powerpc/cell/oprofile: fix mutex locking for spu-oprofile
From: Arnd Bergmann @ 2008-08-11 7:25 UTC (permalink / raw)
To: linuxppc-dev
Cc: Robert Richter, linux-kernel, Paul Mackerras, oprofile-list, cel,
cbe-oss-dev
In-Reply-To: <200808110918.57293.arnd@arndb.de>
From: Carl Love <cel@us.ibm.com>
The issue is the SPU code is not holding the kernel mutex lock while
adding samples to the kernel buffer.
This patch creates per SPU buffers to hold the data. Data
is added to the buffers from in interrupt context. The data
is periodically pushed to the kernel buffer via a new Oprofile
function oprofile_put_buff(). The oprofile_put_buff() function
is called via a work queue enabling the funtion to acquire the
mutex lock.
The existing user controls for adjusting the per CPU buffer
size is used to control the size of the per SPU buffers.
Similarly, overflows of the SPU buffers are reported by
incrementing the per CPU buffer stats. This eliminates the
need to have architecture specific controls for the per SPU
buffers which is not acceptable to the OProfile user tool
maintainer.
The export of the oprofile add_event_entry() is removed as it
is no longer needed given this patch.
Note, this patch has not addressed the issue of indexing arrays
by the spu number. This still needs to be fixed as the spu
numbering is not guarenteed to be 0 to max_num_spus-1.
Signed-off-by: Carl Love <carll@us.ibm.com>
Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/oprofile/cell/pr_util.h | 13 ++
arch/powerpc/oprofile/cell/spu_profiler.c | 4 +-
arch/powerpc/oprofile/cell/spu_task_sync.c | 236 +++++++++++++++++++++++++---
drivers/oprofile/buffer_sync.c | 24 +++
drivers/oprofile/cpu_buffer.c | 15 ++-
drivers/oprofile/event_buffer.h | 7 +
include/linux/oprofile.h | 16 +-
7 files changed, 279 insertions(+), 36 deletions(-)
diff --git a/arch/powerpc/oprofile/cell/pr_util.h b/arch/powerpc/oprofile/cell/pr_util.h
index 22e4e8d..628009c 100644
--- a/arch/powerpc/oprofile/cell/pr_util.h
+++ b/arch/powerpc/oprofile/cell/pr_util.h
@@ -24,6 +24,11 @@
#define SKIP_GENERIC_SYNC 0
#define SYNC_START_ERROR -1
#define DO_GENERIC_SYNC 1
+#define SPUS_PER_NODE 8
+#define DEFAULT_TIMER_EXPIRE (HZ / 10)
+
+extern struct delayed_work spu_work;
+extern int spu_prof_running;
struct spu_overlay_info { /* map of sections within an SPU overlay */
unsigned int vma; /* SPU virtual memory address from elf */
@@ -62,6 +67,14 @@ struct vma_to_fileoffset_map { /* map of sections within an SPU program */
};
+struct spu_buffer {
+ int last_guard_val;
+ int ctx_sw_seen;
+ unsigned long *buff;
+ unsigned int head, tail;
+};
+
+
/* The three functions below are for maintaining and accessing
* the vma-to-fileoffset map.
*/
diff --git a/arch/powerpc/oprofile/cell/spu_profiler.c b/arch/powerpc/oprofile/cell/spu_profiler.c
index 380d7e2..6edaebd 100644
--- a/arch/powerpc/oprofile/cell/spu_profiler.c
+++ b/arch/powerpc/oprofile/cell/spu_profiler.c
@@ -23,12 +23,11 @@
static u32 *samples;
-static int spu_prof_running;
+int spu_prof_running;
static unsigned int profiling_interval;
#define NUM_SPU_BITS_TRBUF 16
#define SPUS_PER_TB_ENTRY 4
-#define SPUS_PER_NODE 8
#define SPU_PC_MASK 0xFFFF
@@ -208,6 +207,7 @@ int start_spu_profiling(unsigned int cycles_reset)
spu_prof_running = 1;
hrtimer_start(&timer, kt, HRTIMER_MODE_REL);
+ schedule_delayed_work(&spu_work, DEFAULT_TIMER_EXPIRE);
return 0;
}
diff --git a/arch/powerpc/oprofile/cell/spu_task_sync.c b/arch/powerpc/oprofile/cell/spu_task_sync.c
index 2a9b4a0..2949126 100644
--- a/arch/powerpc/oprofile/cell/spu_task_sync.c
+++ b/arch/powerpc/oprofile/cell/spu_task_sync.c
@@ -35,7 +35,102 @@ static DEFINE_SPINLOCK(buffer_lock);
static DEFINE_SPINLOCK(cache_lock);
static int num_spu_nodes;
int spu_prof_num_nodes;
-int last_guard_val[MAX_NUMNODES * 8];
+
+struct spu_buffer spu_buff[MAX_NUMNODES * SPUS_PER_NODE];
+struct delayed_work spu_work;
+static unsigned max_spu_buff;
+
+static void spu_buff_add(unsigned long int value, int spu)
+{
+ /* spu buff is a circular buffer. Add entries to the
+ * head. Head is the index to store the next value.
+ * The buffer is full when there is one available entry
+ * in the queue, i.e. head and tail can't be equal.
+ * That way we can tell the difference between the
+ * buffer being full versus empty.
+ *
+ * ASSUPTION: the buffer_lock is held when this function
+ * is called to lock the buffer, head and tail.
+ */
+ int full = 1;
+
+ if (spu_buff[spu].head >= spu_buff[spu].tail) {
+ if ((spu_buff[spu].head - spu_buff[spu].tail)
+ < (max_spu_buff - 1))
+ full = 0;
+
+ } else if (spu_buff[spu].tail > spu_buff[spu].head) {
+ if ((spu_buff[spu].tail - spu_buff[spu].head)
+ > 1)
+ full = 0;
+ }
+
+ if (!full) {
+ spu_buff[spu].buff[spu_buff[spu].head] = value;
+ spu_buff[spu].head++;
+
+ if (spu_buff[spu].head >= max_spu_buff)
+ spu_buff[spu].head = 0;
+ } else {
+ /* From the user's perspective make the SPU buffer
+ * size management/overflow look like we are using
+ * per cpu buffers. The user uses the same
+ * per cpu parameter to adjust the SPU buffer size.
+ * Increment the sample_lost_overflow to inform
+ * the user the buffer size needs to be increased.
+ */
+ oprofile_cpu_buffer_inc_smpl_lost();
+ }
+}
+
+/* This function copies the per SPU buffers to the
+ * OProfile kernel buffer.
+ */
+void sync_spu_buff(void)
+{
+ int spu;
+ unsigned long flags;
+ int curr_head;
+
+ for (spu = 0; spu < num_spu_nodes; spu++) {
+ /* In case there was an issue and the buffer didn't
+ * get created skip it.
+ */
+ if (spu_buff[spu].buff == NULL)
+ continue;
+
+ /* Hold the lock to make sure the head/tail
+ * doesn't change while spu_buff_add() is
+ * deciding if the buffer is full or not.
+ * Being a little paranoid.
+ */
+ spin_lock_irqsave(&buffer_lock, flags);
+ curr_head = spu_buff[spu].head;
+ spin_unlock_irqrestore(&buffer_lock, flags);
+
+ /* Transfer the current contents to the kernel buffer.
+ * data can still be added to the head of the buffer.
+ */
+ oprofile_put_buff(spu_buff[spu].buff,
+ spu_buff[spu].tail,
+ curr_head, max_spu_buff);
+
+ spin_lock_irqsave(&buffer_lock, flags);
+ spu_buff[spu].tail = curr_head;
+ spin_unlock_irqrestore(&buffer_lock, flags);
+ }
+
+}
+
+static void wq_sync_spu_buff(struct work_struct *work)
+{
+ /* move data from spu buffers to kernel buffer */
+ sync_spu_buff();
+
+ /* only reschedule if profiling is not done */
+ if (spu_prof_running)
+ schedule_delayed_work(&spu_work, DEFAULT_TIMER_EXPIRE);
+}
/* Container for caching information about an active SPU task. */
struct cached_info {
@@ -305,14 +400,21 @@ static int process_context_switch(struct spu *spu, unsigned long objectId)
/* Record context info in event buffer */
spin_lock_irqsave(&buffer_lock, flags);
- add_event_entry(ESCAPE_CODE);
- add_event_entry(SPU_CTX_SWITCH_CODE);
- add_event_entry(spu->number);
- add_event_entry(spu->pid);
- add_event_entry(spu->tgid);
- add_event_entry(app_dcookie);
- add_event_entry(spu_cookie);
- add_event_entry(offset);
+ spu_buff_add(ESCAPE_CODE, spu->number);
+ spu_buff_add(SPU_CTX_SWITCH_CODE, spu->number);
+ spu_buff_add(spu->number, spu->number);
+ spu_buff_add(spu->pid, spu->number);
+ spu_buff_add(spu->tgid, spu->number);
+ spu_buff_add(app_dcookie, spu->number);
+ spu_buff_add(spu_cookie, spu->number);
+ spu_buff_add(offset, spu->number);
+
+ /* Set flag to indicate SPU PC data can now be written out. If
+ * the SPU program counter data is seen before an SPU context
+ * record is seen, the postprocessing will fail.
+ */
+ spu_buff[spu->number].ctx_sw_seen = 1;
+
spin_unlock_irqrestore(&buffer_lock, flags);
smp_wmb(); /* insure spu event buffer updates are written */
/* don't want entries intermingled... */
@@ -360,6 +462,47 @@ static int number_of_online_nodes(void)
return nodes;
}
+static int oprofile_spu_buff_create(void)
+{
+ int spu;
+
+ max_spu_buff = oprofile_get_cpu_buffer_size();
+
+ for (spu = 0; spu < num_spu_nodes; spu++) {
+ /* create circular buffers to store the data in.
+ * use locks to manage accessing the buffers
+ */
+ spu_buff[spu].head = 0;
+ spu_buff[spu].tail = 0;
+
+ /*
+ * Create a buffer for each SPU. Can't reliably
+ * create a single buffer for all spus due to not
+ * enough contiguous kernel memory.
+ */
+
+ spu_buff[spu].buff = kzalloc((max_spu_buff
+ * sizeof(unsigned long)),
+ GFP_KERNEL);
+
+ if (!spu_buff[spu].buff) {
+ printk(KERN_ERR "SPU_PROF: "
+ "%s, line %d: oprofile_spu_buff_create "
+ "failed to allocate spu buffer %d.\n",
+ __func__, __LINE__, spu);
+
+ /* release the spu buffers that have been allocated */
+ while (spu >= 0) {
+ kfree(spu_buff[spu].buff);
+ spu_buff[spu].buff = 0;
+ spu--;
+ }
+ return -ENOMEM;
+ }
+ }
+ return 0;
+}
+
/* The main purpose of this function is to synchronize
* OProfile with SPUFS by registering to be notified of
* SPU task switches.
@@ -372,20 +515,35 @@ static int number_of_online_nodes(void)
*/
int spu_sync_start(void)
{
- int k;
+ int spu;
int ret = SKIP_GENERIC_SYNC;
int register_ret;
unsigned long flags = 0;
spu_prof_num_nodes = number_of_online_nodes();
num_spu_nodes = spu_prof_num_nodes * 8;
+ INIT_DELAYED_WORK(&spu_work, wq_sync_spu_buff);
+
+ /* create buffer for storing the SPU data to put in
+ * the kernel buffer.
+ */
+ ret = oprofile_spu_buff_create();
+ if (ret)
+ goto out;
spin_lock_irqsave(&buffer_lock, flags);
- add_event_entry(ESCAPE_CODE);
- add_event_entry(SPU_PROFILING_CODE);
- add_event_entry(num_spu_nodes);
+ for (spu = 0; spu < num_spu_nodes; spu++) {
+ spu_buff_add(ESCAPE_CODE, spu);
+ spu_buff_add(SPU_PROFILING_CODE, spu);
+ spu_buff_add(num_spu_nodes, spu);
+ }
spin_unlock_irqrestore(&buffer_lock, flags);
+ for (spu = 0; spu < num_spu_nodes; spu++) {
+ spu_buff[spu].ctx_sw_seen = 0;
+ spu_buff[spu].last_guard_val = 0;
+ }
+
/* Register for SPU events */
register_ret = spu_switch_event_register(&spu_active);
if (register_ret) {
@@ -393,8 +551,6 @@ int spu_sync_start(void)
goto out;
}
- for (k = 0; k < (MAX_NUMNODES * 8); k++)
- last_guard_val[k] = 0;
pr_debug("spu_sync_start -- running.\n");
out:
return ret;
@@ -446,13 +602,20 @@ void spu_sync_buffer(int spu_num, unsigned int *samples,
* use. We need to discard samples taken during the time
* period which an overlay occurs (i.e., guard value changes).
*/
- if (grd_val && grd_val != last_guard_val[spu_num]) {
- last_guard_val[spu_num] = grd_val;
+ if (grd_val && grd_val != spu_buff[spu_num].last_guard_val) {
+ spu_buff[spu_num].last_guard_val = grd_val;
/* Drop the rest of the samples. */
break;
}
- add_event_entry(file_offset | spu_num_shifted);
+ /* We must ensure that the SPU context switch has been written
+ * out before samples for the SPU. Otherwise, the SPU context
+ * information is not available and the postprocessing of the
+ * SPU PC will fail with no available anonymous map information.
+ */
+ if (spu_buff[spu_num].ctx_sw_seen)
+ spu_buff_add((file_offset | spu_num_shifted),
+ spu_num);
}
spin_unlock(&buffer_lock);
out:
@@ -463,20 +626,41 @@ out:
int spu_sync_stop(void)
{
unsigned long flags = 0;
- int ret = spu_switch_event_unregister(&spu_active);
- if (ret) {
+ int ret;
+ int k;
+
+ ret = spu_switch_event_unregister(&spu_active);
+
+ if (ret)
printk(KERN_ERR "SPU_PROF: "
- "%s, line %d: spu_switch_event_unregister returned %d\n",
- __func__, __LINE__, ret);
- goto out;
- }
+ "%s, line %d: spu_switch_event_unregister " \
+ "returned %d\n",
+ __func__, __LINE__, ret);
+
+ /* flush any remaining data in the per SPU buffers */
+ sync_spu_buff();
spin_lock_irqsave(&cache_lock, flags);
ret = release_cached_info(RELEASE_ALL);
spin_unlock_irqrestore(&cache_lock, flags);
-out:
+
+ /* remove scheduled work queue item rather then waiting
+ * for every queued entry to execute. Then flush pending
+ * system wide buffer to event buffer.
+ */
+ cancel_delayed_work(&spu_work);
+
+ for (k = 0; k < num_spu_nodes; k++) {
+ spu_buff[k].ctx_sw_seen = 0;
+
+ /*
+ * spu_sys_buff will be null if there was a problem
+ * allocating the buffer. Only delete if it exists.
+ */
+ kfree(spu_buff[k].buff);
+ spu_buff[k].buff = 0;
+ }
pr_debug("spu_sync_stop -- done.\n");
return ret;
}
-
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 9304c45..4a70180 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -551,3 +551,27 @@ void sync_buffer(int cpu)
mutex_unlock(&buffer_mutex);
}
+
+/* The function can be used to add a buffer worth of data directly to
+ * the kernel buffer. The buffer is assumed to be a circular buffer.
+ * Take the entries from index start and end at index end, wrapping
+ * at max_entries.
+ */
+void oprofile_put_buff(unsigned long *buf, unsigned int start,
+ unsigned int stop, unsigned int max)
+{
+ int i;
+
+ i = start;
+
+ mutex_lock(&buffer_mutex);
+ while (i != stop) {
+ add_event_entry(buf[i++]);
+
+ if (i >= max)
+ i = 0;
+ }
+
+ mutex_unlock(&buffer_mutex);
+}
+
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index 2450b3a..b8601dc 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -37,11 +37,24 @@ static int work_enabled;
void free_cpu_buffers(void)
{
int i;
-
+
for_each_online_cpu(i)
vfree(per_cpu(cpu_buffer, i).buffer);
}
+unsigned long oprofile_get_cpu_buffer_size(void)
+{
+ return fs_cpu_buffer_size;
+}
+
+void oprofile_cpu_buffer_inc_smpl_lost(void)
+{
+ struct oprofile_cpu_buffer *cpu_buf
+ = &__get_cpu_var(cpu_buffer);
+
+ cpu_buf->sample_lost_overflow++;
+}
+
int alloc_cpu_buffers(void)
{
int i;
diff --git a/drivers/oprofile/event_buffer.h b/drivers/oprofile/event_buffer.h
index 5076ed1..84bf324 100644
--- a/drivers/oprofile/event_buffer.h
+++ b/drivers/oprofile/event_buffer.h
@@ -17,6 +17,13 @@ int alloc_event_buffer(void);
void free_event_buffer(void);
+/**
+ * Add data to the event buffer.
+ * The data passed is free-form, but typically consists of
+ * file offsets, dcookies, context information, and ESCAPE codes.
+ */
+void add_event_entry(unsigned long data);
+
/* wake up the process sleeping on the event file */
void wake_up_buffer_waiter(void);
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 041bb31..1ef7fce 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -84,13 +84,6 @@ int oprofile_arch_init(struct oprofile_operations * ops);
void oprofile_arch_exit(void);
/**
- * Add data to the event buffer.
- * The data passed is free-form, but typically consists of
- * file offsets, dcookies, context information, and ESCAPE codes.
- */
-void add_event_entry(unsigned long data);
-
-/**
* Add a sample. This may be called from any context. Pass
* smp_processor_id() as cpu.
*/
@@ -160,5 +153,14 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, siz
/** lock for read/write safety */
extern spinlock_t oprofilefs_lock;
+
+/**
+ * Add the contents of a circular buffer to the event buffer.
+ */
+void oprofile_put_buff(unsigned long *buf, unsigned int start,
+ unsigned int stop, unsigned int max);
+
+unsigned long oprofile_get_cpu_buffer_size(void);
+void oprofile_cpu_buffer_inc_smpl_lost(void);
#endif /* OPROFILE_H */
--
1.5.4.3
^ permalink raw reply related
* Re: [PATCH] powerpc/drivers: use linux/of_device.h instead of asm/of_device.h
From: Jean Delvare @ 2008-08-11 7:25 UTC (permalink / raw)
To: Stephen Rothwell
Cc: alsa-devel, linuxppc-dev, Michael Hanselmann, lm-sensors,
Stelian Pop, Paul Mackerras, Johannes Berg
In-Reply-To: <20080811170432.f747ab5e.sfr@canb.auug.org.au>
On Mon, 11 Aug 2008 17:04:32 +1000, Stephen Rothwell wrote:
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> drivers/hwmon/ams/ams.h | 2 +-
> sound/aoa/soundbus/soundbus.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> These are the last two users of asm/of_device.h. If everyone is happy,
> we can put this through the powerpc tree. I have build tested for
> ppc64_defconfig and ppc6xx_defconfig (which uses the relevant drivers).
>
> After this we can remove the include of linux/of_device.h from
> asm/of_device.h
>
> diff --git a/drivers/hwmon/ams/ams.h b/drivers/hwmon/ams/ams.h
> index a6221e5..221ef69 100644
> --- a/drivers/hwmon/ams/ams.h
> +++ b/drivers/hwmon/ams/ams.h
> @@ -4,7 +4,7 @@
> #include <linux/mutex.h>
> #include <linux/spinlock.h>
> #include <linux/types.h>
> -#include <asm/of_device.h>
> +#include <linux/of_device.h>
>
> enum ams_irq {
> AMS_IRQ_FREEFALL = 0x01,
> diff --git a/sound/aoa/soundbus/soundbus.h b/sound/aoa/soundbus/soundbus.h
> index 622cd37..a0f223c 100644
> --- a/sound/aoa/soundbus/soundbus.h
> +++ b/sound/aoa/soundbus/soundbus.h
> @@ -8,7 +8,7 @@
> #ifndef __SOUNDBUS_H
> #define __SOUNDBUS_H
>
> -#include <asm/of_device.h>
> +#include <linux/of_device.h>
> #include <sound/pcm.h>
> #include <linux/list.h>
>
No objection from me, go ahead.
--
Jean Delvare
^ permalink raw reply
* powerpc/cell/oprofile: avoid double free of profile buffer
From: Arnd Bergmann @ 2008-08-11 7:25 UTC (permalink / raw)
To: linuxppc-dev
Cc: Robert Richter, linux-kernel, Paul Mackerras, oprofile-list, cel,
cbe-oss-dev
In-Reply-To: <200808110918.57293.arnd@arndb.de>
From: Carl Love <cel@us.ibm.com>
If an error occurs on opcontrol start, the event and per cpu buffers
are released. If later opcontrol shutdown is called then the free
function will be called again to free buffers that no longer
exist. This results in a kernel oops. The following changes
prevent the call to delete buffers that don't exist.
Signed-off-by: Carl Love <carll@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/oprofile/cpu_buffer.c | 4 +++-
drivers/oprofile/event_buffer.c | 2 ++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index b8601dc..366b5d2 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -38,8 +38,10 @@ void free_cpu_buffers(void)
{
int i;
- for_each_online_cpu(i)
+ for_each_online_cpu(i) {
vfree(per_cpu(cpu_buffer, i).buffer);
+ per_cpu(cpu_buffer, i).buffer = NULL;
+ }
}
unsigned long oprofile_get_cpu_buffer_size(void)
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c
index e7fbac5..8d692a5 100644
--- a/drivers/oprofile/event_buffer.c
+++ b/drivers/oprofile/event_buffer.c
@@ -93,6 +93,8 @@ out:
void free_event_buffer(void)
{
vfree(event_buffer);
+
+ event_buffer = NULL;
}
--
1.5.4.3
^ permalink raw reply related
* Re: [alsa-devel] [PATCH] powerpc/drivers: use linux/of_device.h instead of asm/of_device.h
From: Takashi Iwai @ 2008-08-11 7:29 UTC (permalink / raw)
To: Stephen Rothwell
Cc: alsa-devel, Jean, linuxppc-dev, Michael, Hanselmann, lm-sensors,
Stelian Pop, Paul Mackerras, Delvare, Johannes Berg
In-Reply-To: <20080811170432.f747ab5e.sfr@canb.auug.org.au>
At Mon, 11 Aug 2008 17:04:32 +1000,
Stephen Rothwell wrote:
>
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> drivers/hwmon/ams/ams.h | 2 +-
> sound/aoa/soundbus/soundbus.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> These are the last two users of asm/of_device.h. If everyone is happy,
> we can put this through the powerpc tree. I have build tested for
> ppc64_defconfig and ppc6xx_defconfig (which uses the relevant drivers).
>
> After this we can remove the include of linux/of_device.h from
> asm/of_device.h
Looks good to me.
Acked-by: Takashi Iwai <tiwai@suse.de>
thanks,
Takashi
> diff --git a/drivers/hwmon/ams/ams.h b/drivers/hwmon/ams/ams.h
> index a6221e5..221ef69 100644
> --- a/drivers/hwmon/ams/ams.h
> +++ b/drivers/hwmon/ams/ams.h
> @@ -4,7 +4,7 @@
> #include <linux/mutex.h>
> #include <linux/spinlock.h>
> #include <linux/types.h>
> -#include <asm/of_device.h>
> +#include <linux/of_device.h>
>
> enum ams_irq {
> AMS_IRQ_FREEFALL = 0x01,
> diff --git a/sound/aoa/soundbus/soundbus.h b/sound/aoa/soundbus/soundbus.h
> index 622cd37..a0f223c 100644
> --- a/sound/aoa/soundbus/soundbus.h
> +++ b/sound/aoa/soundbus/soundbus.h
> @@ -8,7 +8,7 @@
> #ifndef __SOUNDBUS_H
> #define __SOUNDBUS_H
>
> -#include <asm/of_device.h>
> +#include <linux/of_device.h>
> #include <sound/pcm.h>
> #include <linux/list.h>
>
> --
> 1.5.6.3
>
> --
> Cheers,
> Stephen Rothwell sfr@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply
* Re: [RFC] [PATCH 0/5 V2] Huge page backed user-space stacks
From: Mel Gorman @ 2008-08-11 8:04 UTC (permalink / raw)
To: Dave Hansen
Cc: linux-mm, libhugetlbfs-devel, linux-kernel, linuxppc-dev, abh,
ebmunson, Andrew Morton
In-Reply-To: <1218130190.10907.188.camel@nimitz>
On (07/08/08 10:29), Dave Hansen didst pronounce:
> On Thu, 2008-08-07 at 17:06 +0100, Mel Gorman wrote:
> > On (06/08/08 12:50), Dave Hansen didst pronounce:
> > > The main thing this set of patches does that I care about is take an
> > > anonymous VMA and replace it with a hugetlb VMA. It does this on a
> > > special cue, but does it nonetheless.
> >
> > This is not actually a new thing. For a long time now, it has been possible to
> > back malloc() with hugepages at a userspace level using the morecore glibc
> > hook. That is replacing anonymous memory with a file-backed VMA. It happens
> > in a different place but it's just as deliberate as backing stack and the
> > end result is very similar. As the file is ram-based, it doesn't have the
> > same types of consequences like dirty page syncing that you'd ordinarily
> > watch for when moving from anonymous to file-backed memory.
>
> Yes, it has already been done in userspace. That's fine. It isn't
> adding any complexity to the kernel. This is adding behavior that the
> kernel has to support as well as complexity.
>
The complexity is minimal and the progression logical.
hugetlb_file_setup() is the API shmem was using to create a file on an
internal mount suitable for MAP_SHARED. This patchset adds support for
MAP_PRIVATE and the additional complexity is a lot less than supporting
direct pagetable inserts.
> > > This patch has crossed a line in that it is really the first
> > > *replacement* of a normal VMA with a hugetlb VMA instead of the creation
> > > of the VMAs at the user's request.
> >
> > We crossed that line with morecore, it's back there somewhere. We're just
> > doing in kernel this time because backing stacks with hugepages in userspace
> > turned out to be a hairy endevour.
> >
> > Properly supporting anonymous hugepages would either require larger
> > changes to the core or reimplementing yet more of mm/ in mm/hugetlb.c.
> > Neither is a particularly appealing approach, nor is it likely to be a
> > very popular one.
>
> I agree. It is always much harder to write code that can work
> generically??? (and get it accepted) than just write the smallest possible
> hack and stick it in fs/exec.c.
>
> Could this patch at least get fixed up to look like it could be used
> more generically? Some code to look up and replace anonymous VMAs with
> hugetlb-backed ones???
Ok, this latter point can be looked into at least although the
underlying principal may still be using hugetlb_file_setup() rather than
direct pagetable insertions.
> > > Because of the limitations like its inability to grow the VMA, I can't
> > > imagine that this would be a generic mechanism that we can use
> > > elsewhere.
> >
> > What other than a stack even cares about VM_GROWSDOWN working? Besides,
> > VM_GROWSDOWN could be supported in a hugetlbfs file by mapping the end of
> > the file and moving the offset backwards (yeah ok, it ain't the prettiest
> > but it's less churn than introducing significantly different codepaths). It's
> > just not something that needs to be supported at first cut.
> >
> > brk() if you wanted to back hugepages with it conceivably needs a resizing
> > VMA but in that case it's growing up in which case just extend the end of
> > the VMA and increase the size of the file.
>
> I'm more worried about a small huge page size (say 64k) and not being
> able to merge the VMAs. I guess it could start in the *middle* of a
> file and map both directions.
>
> I guess you could always just have a single (very sparse) hugetlb file
> per mm to do all of this 'anonymous' hugetlb memory memory stuff, and
> just map its offsets 1:1 on to the process's virtual address space.
> That would make sure you could always merge VMAs, no matter how they
> grew together.
>
That's an interesting idea. It isn't as straight-forward as it sounds
due to reservation tracking but at the face of it, I can't see why it
couldn't be made work.
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
^ permalink raw reply
* [git pull] Please pull powerpc.git merge branch
From: Paul Mackerras @ 2008-08-11 11:14 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, akpm, linux-kernel
Linus,
Please pull from the 'merge' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge
There are some assorted powerpc bugfixes and defconfig updates, plus a
patch to Documentation/feature-removal-schedule.txt from Robert
P. J. Day that removes the section on removing arch/ppc, since that is
done, plus one from me removing include/linux/harrier_defs.h, since it
was only used by code in arch/ppc which is now gone.
Thanks,
Paul.
Documentation/feature-removal-schedule.txt | 13 -
arch/powerpc/boot/dts/warp.dts | 22 +
arch/powerpc/configs/40x/ep405_defconfig | 207 +++++++++----
arch/powerpc/configs/40x/kilauea_defconfig | 196 +++++++++----
arch/powerpc/configs/40x/makalu_defconfig | 196 +++++++++----
arch/powerpc/configs/40x/walnut_defconfig | 203 +++++++++----
arch/powerpc/configs/44x/bamboo_defconfig | 206 +++++++++----
arch/powerpc/configs/44x/canyonlands_defconfig | 116 +++++--
arch/powerpc/configs/44x/ebony_defconfig | 207 +++++++++----
arch/powerpc/configs/44x/katmai_defconfig | 259 ++++++++++++-----
arch/powerpc/configs/44x/rainier_defconfig | 207 +++++++++----
arch/powerpc/configs/44x/sam440ep_defconfig | 109 +++++--
arch/powerpc/configs/44x/sequoia_defconfig | 207 +++++++++----
arch/powerpc/configs/44x/taishan_defconfig | 208 +++++++++----
arch/powerpc/configs/44x/virtex5_defconfig | 100 +++++-
arch/powerpc/configs/44x/warp_defconfig | 232 ++++++++++-----
arch/powerpc/configs/ppc40x_defconfig | 374 ++++++++++++++++++++----
arch/powerpc/configs/ppc44x_defconfig | 375 ++++++++++++++++++++++--
arch/powerpc/include/asm/mmu-hash64.h | 2
arch/powerpc/kernel/pci-common.c | 17 +
arch/powerpc/kernel/rtas.c | 5
arch/powerpc/mm/hash_utils_64.c | 63 ++--
arch/powerpc/mm/init_64.c | 9 -
arch/powerpc/platforms/44x/warp-nand.c | 2
arch/powerpc/platforms/44x/warp.c | 25 +-
include/linux/harrier_defs.h | 212 --------------
26 files changed, 2598 insertions(+), 1174 deletions(-)
delete mode 100644 include/linux/harrier_defs.h
Benjamin Herrenschmidt (2):
powerpc/pci: Don't keep ISA memory hole resources in the tree
powerpc/mm: Fix attribute confusion with htab_bolt_mapping()
Josh Boyer (1):
powerpc/4xx: Update defconfig files for 2.6.27-rc1
Junio C Hamano (1):
powerpc: Do not ignore arch/powerpc/include
Nathan Fontenot (1):
powerpc: Zero fill the return values of rtas argument buffer
Paul Mackerras (1):
powerpc: Remove include/linux/harrier_defs.h
Robert P. J. Day (1):
powerpc: Delete completed "ppc removal" task from feature removal file
Sean MacLennan (3):
powerpc/4xx: Cleanup Warp for i2c driver changes.
powerpc/44x: Warp DTS changes for board updates
powerpc/44x: Incorrect NOR offset in Warp DTS
Valentine Barshak (1):
powerpc/44x: Adjust warp-nand resource end address
^ permalink raw reply
* Re: Device tree question
From: Steven A. Falco @ 2008-08-11 14:05 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <1218267682.24157.366.camel@pasglop>
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
Benjamin Herrenschmidt wrote:
> On Thu, 2008-08-07 at 15:56 -0400, Steven A. Falco wrote:
>
>> I have added a compact flash to the external bus of a Sequoia
>> (PPC440EPx) evaluation board. It is wired to CS1, and U-boot is set to
>> configure CS1 to be at address 0xc1000000. U-boot can access the
>> device, and reports the correct partition table, etc. so I believe the
>> hardware is ok.
>>
>> I've created a device-tree entry under the EBC0 section of the
>> sequoia.dts file:
>>
>> pata@1,0 {
>> compatible = "harris,hydra_temp-pata", "ata-generic";
>> bank-width = <2>;
>> reg = <1 0 20 1 80 20>;
>> reg-shift = <4>;
>> pio-mode = <4>;
>> interrupts = <27 4>;
>> interrupt-parent = <&UIC0>;
>> };
>> };
>>
>> This seems to be correct, because if I turn on debug in prom_parse, I
>> see a translation that looks reasonable:
>>
>
> Did you check that the resulting physical address was indeed where you
> device is supposed to be addressed ?
>
> Ben
>
They were wrong - I misinterpreted the reg-shift to be like the "stride"
used by u-boot. But u-boot uses it as a multiplier, and reg-shift is
truly a shift. So, I changed the shift to "2", and now the addresses
are correct. I'm still having problems, but I'll start a new thread,
because the new problem concerns interrupts.
Thanks,
Steve
[-- Attachment #2: Type: text/html, Size: 1911 bytes --]
^ permalink raw reply
* [RFC 1/3] add support for exporting symbols from .S files
From: Arnd Bergmann @ 2008-08-11 14:18 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, Matthew Wilcox, Rusty Russell, linuxppc-dev, Al Viro,
David Woodhouse
In-Reply-To: <200808111606.44103.arnd@arndb.de>
This makes it possible to export symbols from assembly files, instead
of having to export them through an extra ksyms.c file.
I found this nicer to implement using a gas macro than a cpp macro.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -1,5 +1,7 @@
#ifndef _LINUX_MODULE_H
#define _LINUX_MODULE_H
+
+#ifndef __ASSEMBLY__
/*
* Dynamic loading of modules into the kernel.
*
@@ -605,4 +607,54 @@ static inline void module_remove_modinfo_attrs(struct module *mod)
#define __MODULE_STRING(x) __stringify(x)
+#else /* __ASSEMBLY__ */
+#include <asm/types.h>
+
+#ifdef CONFIG_MODULES
+.macro __EXPORT_SYMBOL sym section symtab strtab
+ .section \section,"a",@progbits
+ .type \symtab, @object
+ .ifeq BITS_PER_LONG-32
+ .align 3
+\symtab:
+ .long \sym
+ .long \strtab
+ .else
+ .align 4
+\symtab:
+ .quad \sym
+ .quad \strtab
+ .endif
+ .size \symtab,.-\symtab
+ .previous
+
+ .section __ksymtab_strings,"a",@progbits
+ .type \strtab, @object
+\strtab:
+ .string "\sym"
+ .size \strtab,.-\strtab
+ .previous
+ .endm
+
+#define EXPORT_SYMBOL(sym) \
+ __EXPORT_SYMBOL sym,__ksymtab,__ksymtab_ ## sym,__kstrtab_ ## sym
+#define EXPORT_SYMBOL_GPL(sym) \
+ __EXPORT_SYMBOL sym,__ksymtab_gpl,__ksymtab_ ## sym,__kstrtab_ ## sym
+#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
+ __EXPORT_SYMBOL sym,__ksymtab_gpl_future,__ksymtab_ ## sym,__kstrtab_ ## sym
+#define EXPORT_UNUSED_SYMBOL(sym) \
+ __EXPORT_SYMBOL sym,__ksymtab_unused,__ksymtab_ ## sym,__kstrtab_ ## sym
+#define EXPORT_UNUSED_SYMBOL_GPL(sym) \
+ __EXPORT_SYMBOL sym,__ksymtab_unused_gpl,__ksymtab_ ## sym,__kstrtab_ ## sym
+
+#else /* CONFIG_MODULES... */
+#define EXPORT_SYMBOL(sym)
+#define EXPORT_SYMBOL_GPL(sym)
+#define EXPORT_SYMBOL_GPL_FUTURE(sym)
+#define EXPORT_UNUSED_SYMBOL(sym)
+#define EXPORT_UNUSED_SYMBOL_GPL(sym)
+#endif /* !CONFIG_MODULES... */
+
+#endif /* __ASSEMBLY__ */
+
#endif /* _LINUX_MODULE_H */
^ permalink raw reply
* [RFC 3/3] powerpc: remove ppc_ksyms.c
From: Arnd Bergmann @ 2008-08-11 14:25 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, Matthew Wilcox, Rusty Russell, linuxppc-dev, Al Viro,
David Woodhouse
In-Reply-To: <200808111606.44103.arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/kernel/Makefile | 1 -
arch/powerpc/kernel/ppc_ksyms.c | 193 ---------------------------------------
2 files changed, 0 insertions(+), 194 deletions(-)
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 64f5948..a0cd670 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -74,7 +74,6 @@ obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
obj-$(CONFIG_PPC64) += dma_64.o iommu.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
-obj-$(CONFIG_MODULES) += ppc_ksyms.o
obj-$(CONFIG_BOOTX_TEXT) += btext.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_KPROBES) += kprobes.o
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index e1ea4fe..e69de29 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -1,193 +0,0 @@
-#include <linux/module.h>
-#include <linux/threads.h>
-#include <linux/smp.h>
-#include <linux/sched.h>
-#include <linux/elfcore.h>
-#include <linux/string.h>
-#include <linux/interrupt.h>
-#include <linux/screen_info.h>
-#include <linux/vt_kern.h>
-#include <linux/nvram.h>
-#include <linux/irq.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/bitops.h>
-
-#include <asm/page.h>
-#include <asm/processor.h>
-#include <asm/cacheflush.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/atomic.h>
-#include <asm/checksum.h>
-#include <asm/pgtable.h>
-#include <asm/tlbflush.h>
-#include <linux/adb.h>
-#include <linux/cuda.h>
-#include <linux/pmu.h>
-#include <asm/prom.h>
-#include <asm/system.h>
-#include <asm/pci-bridge.h>
-#include <asm/irq.h>
-#include <asm/pmac_feature.h>
-#include <asm/dma.h>
-#include <asm/machdep.h>
-#include <asm/hw_irq.h>
-#include <asm/nvram.h>
-#include <asm/mmu_context.h>
-#include <asm/backlight.h>
-#include <asm/time.h>
-#include <asm/cputable.h>
-#include <asm/btext.h>
-#include <asm/div64.h>
-#include <asm/signal.h>
-#include <asm/dcr.h>
-#include <asm/ftrace.h>
-
-#ifdef CONFIG_PPC32
-extern void transfer_to_handler(void);
-extern void do_IRQ(struct pt_regs *regs);
-extern void machine_check_exception(struct pt_regs *regs);
-extern void alignment_exception(struct pt_regs *regs);
-extern void program_check_exception(struct pt_regs *regs);
-extern void single_step_exception(struct pt_regs *regs);
-extern int sys_sigreturn(struct pt_regs *regs);
-
-EXPORT_SYMBOL(clear_pages);
-EXPORT_SYMBOL(copy_page);
-EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
-EXPORT_SYMBOL(DMA_MODE_READ);
-EXPORT_SYMBOL(DMA_MODE_WRITE);
-
-EXPORT_SYMBOL(transfer_to_handler);
-EXPORT_SYMBOL(do_IRQ);
-EXPORT_SYMBOL(machine_check_exception);
-EXPORT_SYMBOL(alignment_exception);
-EXPORT_SYMBOL(program_check_exception);
-EXPORT_SYMBOL(single_step_exception);
-EXPORT_SYMBOL(sys_sigreturn);
-#endif
-
-#ifdef CONFIG_FTRACE
-EXPORT_SYMBOL(_mcount);
-#endif
-
-EXPORT_SYMBOL(strcpy);
-EXPORT_SYMBOL(strncpy);
-EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
-
-EXPORT_SYMBOL(csum_partial);
-EXPORT_SYMBOL(csum_partial_copy_generic);
-EXPORT_SYMBOL(ip_fast_csum);
-EXPORT_SYMBOL(csum_tcpudp_magic);
-
-EXPORT_SYMBOL(__copy_tofrom_user);
-EXPORT_SYMBOL(__clear_user);
-EXPORT_SYMBOL(__strncpy_from_user);
-EXPORT_SYMBOL(__strnlen_user);
-#ifdef CONFIG_PPC64
-EXPORT_SYMBOL(copy_4K_page);
-#endif
-
-#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
-EXPORT_SYMBOL(isa_io_base);
-EXPORT_SYMBOL(isa_mem_base);
-EXPORT_SYMBOL(pci_dram_offset);
-EXPORT_SYMBOL(pci_alloc_consistent);
-EXPORT_SYMBOL(pci_free_consistent);
-#endif /* CONFIG_PCI */
-
-EXPORT_SYMBOL(start_thread);
-EXPORT_SYMBOL(kernel_thread);
-
-EXPORT_SYMBOL(giveup_fpu);
-#ifdef CONFIG_ALTIVEC
-EXPORT_SYMBOL(giveup_altivec);
-#endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_VSX
-EXPORT_SYMBOL(giveup_vsx);
-#endif /* CONFIG_VSX */
-#ifdef CONFIG_SPE
-EXPORT_SYMBOL(giveup_spe);
-#endif /* CONFIG_SPE */
-
-#ifndef CONFIG_PPC64
-EXPORT_SYMBOL(flush_instruction_cache);
-EXPORT_SYMBOL(flush_tlb_kernel_range);
-EXPORT_SYMBOL(flush_tlb_page);
-EXPORT_SYMBOL(_tlbie);
-#endif
-EXPORT_SYMBOL(__flush_icache_range);
-EXPORT_SYMBOL(flush_dcache_range);
-
-#ifdef CONFIG_SMP
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(smp_hw_index);
-#endif
-#endif
-
-#ifdef CONFIG_ADB
-EXPORT_SYMBOL(adb_request);
-EXPORT_SYMBOL(adb_register);
-EXPORT_SYMBOL(adb_unregister);
-EXPORT_SYMBOL(adb_poll);
-EXPORT_SYMBOL(adb_try_handler_change);
-#endif /* CONFIG_ADB */
-#ifdef CONFIG_ADB_CUDA
-EXPORT_SYMBOL(cuda_request);
-EXPORT_SYMBOL(cuda_poll);
-#endif /* CONFIG_ADB_CUDA */
-EXPORT_SYMBOL(to_tm);
-
-#ifdef CONFIG_PPC32
-long long __ashrdi3(long long, int);
-long long __ashldi3(long long, int);
-long long __lshrdi3(long long, int);
-EXPORT_SYMBOL(__ashrdi3);
-EXPORT_SYMBOL(__ashldi3);
-EXPORT_SYMBOL(__lshrdi3);
-int __ucmpdi2(unsigned long long, unsigned long long);
-EXPORT_SYMBOL(__ucmpdi2);
-#endif
-
-EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memchr);
-
-#if defined(CONFIG_FB_VGA16_MODULE)
-EXPORT_SYMBOL(screen_info);
-#endif
-
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(timer_interrupt);
-EXPORT_SYMBOL(irq_desc);
-EXPORT_SYMBOL(tb_ticks_per_jiffy);
-EXPORT_SYMBOL(cacheable_memcpy);
-#endif
-
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(next_mmu_context);
-EXPORT_SYMBOL(set_context);
-#endif
-
-#ifdef CONFIG_PPC_STD_MMU_32
-extern long mol_trampoline;
-EXPORT_SYMBOL(mol_trampoline); /* For MOL */
-EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
-#ifdef CONFIG_SMP
-extern int mmu_hash_lock;
-EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
-#endif /* CONFIG_SMP */
-extern long *intercept_table;
-EXPORT_SYMBOL(intercept_table);
-#endif /* CONFIG_PPC_STD_MMU_32 */
-#ifdef CONFIG_PPC_DCR_NATIVE
-EXPORT_SYMBOL(__mtdcr);
-EXPORT_SYMBOL(__mfdcr);
-#endif
-EXPORT_SYMBOL(empty_zero_page);
^ permalink raw reply related
* [RFC 2/3] powerpc: export all symbols from the definition file
From: Arnd Bergmann @ 2008-08-11 14:17 UTC (permalink / raw)
To: linux-kernel
Cc: linux-arch, Matthew Wilcox, Rusty Russell, linuxppc-dev, Al Viro,
David Woodhouse
In-Reply-To: <200808111606.44103.arnd@arndb.de>
It's now possible to export symbols from .S files, so move all
exports out of the ppc_ksyms.c file to the definition of the
symbols.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/kernel/entry_32.S | 3 +++
arch/powerpc/kernel/entry_64.S | 2 ++
arch/powerpc/kernel/fpu.S | 2 ++
arch/powerpc/kernel/head_32.S | 6 ++++++
arch/powerpc/kernel/head_40x.S | 4 ++++
arch/powerpc/kernel/head_44x.S | 5 +++++
arch/powerpc/kernel/head_64.S | 2 ++
arch/powerpc/kernel/head_8xx.S | 4 ++++
arch/powerpc/kernel/head_fsl_booke.S | 6 ++++++
arch/powerpc/kernel/irq.c | 4 +++-
arch/powerpc/kernel/misc_32.S | 12 ++++++++++++
arch/powerpc/kernel/misc_64.S | 5 +++++
arch/powerpc/kernel/pci-common.c | 2 ++
arch/powerpc/kernel/pci_32.c | 3 +++
arch/powerpc/kernel/process.c | 2 ++
arch/powerpc/kernel/setup-common.c | 1 +
arch/powerpc/kernel/setup_32.c | 5 +++++
arch/powerpc/kernel/signal_32.c | 2 ++
arch/powerpc/kernel/smp.c | 2 ++
arch/powerpc/kernel/time.c | 3 +++
arch/powerpc/kernel/traps.c | 4 ++++
arch/powerpc/lib/checksum_32.S | 6 ++++++
arch/powerpc/lib/checksum_64.S | 5 +++++
arch/powerpc/lib/copy_32.S | 7 +++++++
arch/powerpc/lib/copypage_64.S | 3 +++
arch/powerpc/lib/copyuser_64.S | 3 +++
arch/powerpc/lib/mem_64.S | 3 +++
arch/powerpc/lib/memcpy_64.S | 3 +++
arch/powerpc/lib/string.S | 12 ++++++++++++
arch/powerpc/mm/hash_low_32.S | 4 ++++
arch/powerpc/mm/mmu_context_32.c | 2 ++
arch/powerpc/mm/tlb_32.c | 3 +++
arch/powerpc/sysdev/dcr-low.S | 3 +++
drivers/macintosh/adb.c | 5 +++++
drivers/macintosh/via-cuda.c | 3 +++
35 files changed, 140 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 1cbbf70..7716264 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -22,6 +22,7 @@
#include <linux/errno.h>
#include <linux/sys.h>
#include <linux/threads.h>
+#include <linux/module.h>
#include <asm/reg.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -209,6 +210,7 @@ transfer_to_handler_cont:
lwz r12,_LINK(r11) /* and return to address in LR */
b fast_exception_return
#endif
+EXPORT_SYMBOL(transfer_to_handler)
/*
* On kernel stack overflow, load up an initial stack pointer
@@ -1196,6 +1198,7 @@ mcount_call:
lwz r10,40(r1)
addi r1, r1, 48
bctr
+EXPORT_SYMBOL(_mcount)
_GLOBAL(ftrace_caller)
/* Based off of objdump optput from glibc */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 2d802e9..fa65272 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -18,6 +18,7 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <linux/errno.h>
#include <asm/unistd.h>
#include <asm/processor.h>
@@ -898,6 +899,7 @@ mcount_call:
mtlr r0
addi r1, r1, 112
blr
+EXPORT_SYMBOL(_mcount)
_GLOBAL(ftrace_caller)
/* Taken from output of objdump from lib64/glibc */
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
index a088c06..6e137b4 100644
--- a/arch/powerpc/kernel/fpu.S
+++ b/arch/powerpc/kernel/fpu.S
@@ -14,6 +14,7 @@
*
*/
+#include <linux/module.h>
#include <asm/reg.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -154,6 +155,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
PPC_STL r5,ADDROFF(last_task_used_math)(r4)
#endif /* CONFIG_SMP */
blr
+EXPORT_SYMBOL(giveup_fpu)
/*
* These are used in the alignment trap handler when emulating
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 99ee2f0..d6c8a03 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -21,6 +21,7 @@
*
*/
+#include <linux/module.h>
#include <asm/reg.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -690,6 +691,7 @@ DataStoreTLBMiss:
.globl mol_trampoline
.set mol_trampoline, i0x2f00
+EXPORT_SYMBOL(mol_trampoline)
. = 0x3000
@@ -801,6 +803,7 @@ giveup_altivec:
#endif /* CONFIG_SMP */
blr
#endif /* CONFIG_ALTIVEC */
+EXPORT_SYMBOL(giveup_altivec)
/*
* This code is jumped to from the startup code to copy
@@ -1092,6 +1095,7 @@ _ENTRY(set_context)
sync
isync
blr
+EXPORT_SYMBOL(set_context)
/*
* An undocumented "feature" of 604e requires that the v bit
@@ -1294,6 +1298,7 @@ sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
+EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir
swapper_pg_dir:
@@ -1307,6 +1312,7 @@ intercept_table:
.long 0, 0, 0, 0, 0, 0, 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
+EXPORT_SYMBOL(intercept_table)
/* Room for two PTE pointers, usually the kernel and current user pointers
* to their respective root page table.
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 56d8e5d..717de09 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -31,6 +31,7 @@
*
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -822,6 +823,7 @@ finish_tlb_load:
*/
_ENTRY(giveup_fpu)
blr
+EXPORT_SYMBOL(giveup_fpu)
/* This is where the main kernel code starts.
*/
@@ -987,6 +989,7 @@ _GLOBAL(set_context)
isync /* Need an isync to flush shadow */
/* TLBs after changing PID */
blr
+EXPORT_SYMBOL(set_context)
/* We put a few things here that have to be page-aligned. This stuff
* goes at the beginning of the data segment, which is page-aligned.
@@ -998,6 +1001,7 @@ sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
+EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir
swapper_pg_dir:
.space PGD_TABLE_SIZE
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index f3a1ea9..703a70c 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -28,6 +28,7 @@
* option) any later version.
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -604,6 +605,7 @@ _GLOBAL(__fixup_440A_mcheck)
*/
_GLOBAL(giveup_altivec)
blr
+EXPORT_SYMBOL(giveup_altivec)
/*
* extern void giveup_fpu(struct task_struct *prev)
@@ -613,6 +615,7 @@ _GLOBAL(giveup_altivec)
#ifndef CONFIG_PPC_FPU
_GLOBAL(giveup_fpu)
blr
+EXPORT_SYMBOL(giveup_fpu)
#endif
_GLOBAL(set_context)
@@ -628,6 +631,7 @@ _GLOBAL(set_context)
mtspr SPRN_PID,r3
isync /* Force context change */
blr
+EXPORT_SYMBOL(set_context)
/*
* We put a few things here that have to be page-aligned. This stuff
@@ -640,6 +644,7 @@ sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
+EXPORT_SYMBOL(empty_zero_page)
/*
* To support >32-bit physical addresses, we use an 8KB pgdir.
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index cc8fb47..d807daa 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -21,6 +21,7 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <linux/threads.h>
#include <asm/reg.h>
#include <asm/page.h>
@@ -1653,6 +1654,7 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
.globl empty_zero_page
empty_zero_page:
.space PAGE_SIZE
+EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir
swapper_pg_dir:
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 3c9452d..c3ef451 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -19,6 +19,7 @@
*
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -590,6 +591,7 @@ DataTLBError:
.globl giveup_fpu
giveup_fpu:
blr
+EXPORT_SYMBOL(giveup_fpu)
/*
* This is where the main kernel code starts.
@@ -831,6 +833,7 @@ _GLOBAL(set_context)
#endif
SYNC
blr
+EXPORT_SYMBOL(set_context)
#ifdef CONFIG_8xx_CPU6
/* It's here because it is unique to the 8xx.
@@ -861,6 +864,7 @@ sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
+EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir
swapper_pg_dir:
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 3cb52fa..7e579fc 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -30,6 +30,7 @@
* option) any later version.
*/
+#include <linux/module.h>
#include <linux/threads.h>
#include <asm/processor.h>
#include <asm/page.h>
@@ -902,6 +903,7 @@ _GLOBAL(loadcam_entry)
*/
_GLOBAL(giveup_altivec)
blr
+EXPORT_SYMBOL(giveup_altivec)
#ifdef CONFIG_SPE
/*
@@ -938,6 +940,7 @@ _GLOBAL(giveup_spe)
#endif /* !CONFIG_SMP */
blr
#endif /* CONFIG_SPE */
+EXPORT_SYMBOL(giveup_spe)
/*
* extern void giveup_fpu(struct task_struct *prev)
@@ -947,6 +950,7 @@ _GLOBAL(giveup_spe)
#ifndef CONFIG_PPC_FPU
_GLOBAL(giveup_fpu)
blr
+EXPORT_SYMBOL(giveup_fpu)
#endif
/*
@@ -980,6 +984,7 @@ _GLOBAL(set_context)
mtspr SPRN_PID,r3
isync /* Force context change */
blr
+EXPORT_SYMBOL(set_context)
_GLOBAL(flush_dcache_L1)
mfspr r3,SPRN_L1CFG0
@@ -1038,6 +1043,7 @@ sdata:
.globl empty_zero_page
empty_zero_page:
.space 4096
+EXPORT_SYMBOL(empty_zero_page)
.globl swapper_pg_dir
swapper_pg_dir:
.space PGD_TABLE_SIZE
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index d972dec..e6a9af6 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -83,9 +83,10 @@ extern int tau_interrupts(int);
#endif
#endif /* CONFIG_PPC32 */
-#ifdef CONFIG_PPC64
EXPORT_SYMBOL(irq_desc);
+#ifdef CONFIG_PPC64
+
int distribute_irqs = 1;
static inline notrace unsigned long get_hard_enabled(void)
@@ -334,6 +335,7 @@ void do_IRQ(struct pt_regs *regs)
}
#endif
}
+EXPORT_SYMBOL(do_IRQ);
void __init init_IRQ(void)
{
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 6321ae3..d8c8b82 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -16,6 +16,7 @@
*
*/
+#include <linux/module.h>
#include <linux/sys.h>
#include <asm/unistd.h>
#include <asm/errno.h>
@@ -435,6 +436,7 @@ _GLOBAL(_tlbie)
#endif /* CONFIG_SMP */
#endif /* ! CONFIG_40x */
blr
+EXPORT_SYMBOL(_tlbie)
/*
* Flush instruction cache.
@@ -481,6 +483,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_UNIFIED_ID_CACHE)
#endif /* CONFIG_8xx/4xx */
isync
blr
+EXPORT_SYMBOL(flush_instruction_cache)
/*
* Write any modified data cache blocks out to memory
@@ -512,6 +515,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
sync /* additional sync needed on g4 */
isync
blr
+EXPORT_SYMBOL(__flush_icache_range)
/*
* Write any modified data cache blocks out to memory.
* Does not invalidate the corresponding cache lines (especially for
@@ -554,6 +558,7 @@ _GLOBAL(flush_dcache_range)
bdnz 1b
sync /* wait for dcbst's to get to ram */
blr
+EXPORT_SYMBOL(flush_dcache_range)
/*
* Like above, but invalidate the D-cache. This is used by the 8xx
@@ -670,6 +675,7 @@ _GLOBAL(clear_pages)
addi r3,r3,L1_CACHE_BYTES
bdnz 1b
blr
+EXPORT_SYMBOL(clear_pages)
/*
* Copy a whole page. We use the dcbz instruction on the destination
@@ -741,6 +747,7 @@ _GLOBAL(copy_page)
li r11,4
b 2b
#endif /* CONFIG_8xx */
+EXPORT_SYMBOL(copy_page)
/*
* void atomic_clear_mask(atomic_t mask, atomic_t *addr)
@@ -787,6 +794,7 @@ _GLOBAL(__ashrdi3)
sraw r3,r3,r5 # MSW = MSW >> count
or r4,r4,r7 # LSW |= t2
blr
+EXPORT_SYMBOL(__ashrdi3)
_GLOBAL(__ashldi3)
subfic r6,r5,32
@@ -798,6 +806,7 @@ _GLOBAL(__ashldi3)
slw r4,r4,r5 # LSW = LSW << count
or r3,r3,r7 # MSW |= t2
blr
+EXPORT_SYMBOL(__ashldi3)
_GLOBAL(__lshrdi3)
subfic r6,r5,32
@@ -809,6 +818,7 @@ _GLOBAL(__lshrdi3)
srw r3,r3,r5 # MSW = MSW >> count
or r4,r4,r7 # LSW |= t2
blr
+EXPORT_SYMBOL(__lshrdi3)
/*
* 64-bit comparison: __ucmpdi2(u64 a, u64 b)
@@ -824,6 +834,7 @@ _GLOBAL(__ucmpdi2)
bltlr
li r3,2
blr
+EXPORT_SYMBOL(__ucmpdi2);
_GLOBAL(abs)
srawi r4,r3,31
@@ -861,6 +872,7 @@ _GLOBAL(kernel_thread)
lwz r31,12(r1)
addi r1,r1,16
blr
+EXPORT_SYMBOL(kernel_thread)
/*
* This routine is just here to keep GCC happy - sigh...
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index 4dd70cf..b1d05c0 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -14,6 +14,7 @@
*
*/
+#include <linux/module.h>
#include <linux/sys.h>
#include <asm/unistd.h>
#include <asm/errno.h>
@@ -108,6 +109,7 @@ _KPROBE(__flush_icache_range)
isync
blr
.previous .text
+EXPORT_SYMBOL(__flush_icache_range)
/*
* Like above, but only do the D-cache.
*
@@ -137,6 +139,7 @@ _GLOBAL(flush_dcache_range)
bdnz 0b
sync
blr
+EXPORT_SYMBOL(flush_dcache_range)
/*
* Like above, but works on non-mapped physical addresses.
@@ -442,6 +445,7 @@ _GLOBAL(kernel_thread)
ld r29,-24(r1)
ld r30,-16(r1)
blr
+EXPORT_SYMBOL(kernel_thread)
/*
* disable_kernel_fp()
@@ -503,6 +507,7 @@ _GLOBAL(giveup_altivec)
std r5,0(r4)
#endif /* CONFIG_SMP */
blr
+EXPORT_SYMBOL(giveup_altivec)
#endif /* CONFIG_ALTIVEC */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 224e9a1..3e7b258 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -23,6 +23,7 @@
#include <linux/string.h>
#include <linux/init.h>
#include <linux/bootmem.h>
+#include <linux/module.h>
#include <linux/mm.h>
#include <linux/list.h>
#include <linux/syscalls.h>
@@ -52,6 +53,7 @@ static int global_phb_number; /* Global phb counter */
/* ISA Memory physical address */
resource_size_t isa_mem_base;
+EXPORT_SYMBOL(isa_mem_base);
/* Default PCI flags is 0 */
unsigned int ppc_pci_flags;
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 88db4ff..329acae 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -3,6 +3,7 @@
*/
#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/string.h>
@@ -33,7 +34,9 @@
#endif
unsigned long isa_io_base = 0;
+EXPORT_SYMBOL(isa_io_base);
unsigned long pci_dram_offset = 0;
+EXPORT_SYMBOL(pci_dram_offset);
int pcibios_assign_bus_offset = 1;
void pcibios_make_OF_bus_map(void);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 957bded..c832697 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -167,6 +167,7 @@ void giveup_vsx(struct task_struct *tsk)
giveup_altivec(tsk);
__giveup_vsx(tsk);
}
+EXPORT_SYMBOL(giveup_vsx);
void flush_vsx_to_thread(struct task_struct *tsk)
{
@@ -760,6 +761,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
current->thread.used_spe = 0;
#endif /* CONFIG_SPE */
}
+EXPORT_SYMBOL(start_thread);
#define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \
| PR_FP_EXC_RES | PR_FP_EXC_INV)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 9cc5a52..174614d 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -91,6 +91,7 @@ struct screen_info screen_info = {
.orig_video_isVGA = 1,
.orig_video_points = 16
};
+EXPORT_SYMBOL(screen_info);
#ifdef __DO_IRQ_CANON
/* XXX should go elsewhere eventually */
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 066e65c..f871152 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -50,8 +50,13 @@ EXPORT_SYMBOL_GPL(boot_cpuid);
int boot_cpuid_phys;
unsigned long ISA_DMA_THRESHOLD;
+EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
+
unsigned int DMA_MODE_READ;
+EXPORT_SYMBOL(DMA_MODE_READ);
+
unsigned int DMA_MODE_WRITE;
+EXPORT_SYMBOL(DMA_MODE_WRITE);
int have_of = 1;
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 3e80aa3..ca17314 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -25,6 +25,7 @@
#include <linux/errno.h>
#include <linux/elf.h>
#include <linux/ptrace.h>
+#include <linux/module.h>
#ifdef CONFIG_PPC64
#include <linux/syscalls.h>
#include <linux/compat.h>
@@ -1288,3 +1289,4 @@ badframe:
force_sig(SIGSEGV, current);
return 0;
}
+EXPORT_SYMBOL(sys_sigreturn);
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 5337ca7..65f4c3a 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -58,6 +58,8 @@
#endif
int smp_hw_index[NR_CPUS];
+EXPORT_SYMBOL(smp_hw_index);
+
struct thread_info *secondary_ti;
cpumask_t cpu_possible_map = CPU_MASK_NONE;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index e2ee66b..fc4646d 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -142,6 +142,7 @@ static void __init clocksource_init(void);
#endif
unsigned long tb_ticks_per_jiffy;
+EXPORT_SYMBOL(tb_ticks_per_jiffy);
unsigned long tb_ticks_per_usec = 100; /* sane default */
EXPORT_SYMBOL(tb_ticks_per_usec);
unsigned long tb_ticks_per_sec;
@@ -612,6 +613,7 @@ void timer_interrupt(struct pt_regs * regs)
irq_exit();
set_irq_regs(old_regs);
}
+EXPORT_SYMBOL(timer_interrupt);
void wakeup_decrementer(void)
{
@@ -1091,6 +1093,7 @@ void to_tm(int tim, struct rtc_time * tm)
*/
GregorianDay(tm);
}
+EXPORT_SYMBOL(to_tm);
/* Auxiliary function to compute scaling factors */
/* Actually the choice of a timebase running at 1/4 the of the bus
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 81ccb8d..8d9c77a 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -533,6 +533,7 @@ void machine_check_exception(struct pt_regs *regs)
if (!(regs->msr & MSR_RI))
panic("Unrecoverable Machine check");
}
+EXPORT_SYMBOL(machine_check_exception);
void SMIException(struct pt_regs *regs)
{
@@ -574,6 +575,7 @@ void __kprobes single_step_exception(struct pt_regs *regs)
_exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
}
+EXPORT_SYMBOL(single_step_exception);
/*
* After we have successfully emulated an instruction, we have to
@@ -893,6 +895,7 @@ void __kprobes program_check_exception(struct pt_regs *regs)
else
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
}
+EXPORT_SYMBOL(program_check_exception);
void alignment_exception(struct pt_regs *regs)
{
@@ -921,6 +924,7 @@ void alignment_exception(struct pt_regs *regs)
else
bad_page_fault(regs, regs->dar, sig);
}
+EXPORT_SYMBOL(alignment_exception);
void StackOverflow(struct pt_regs *regs)
{
diff --git a/arch/powerpc/lib/checksum_32.S b/arch/powerpc/lib/checksum_32.S
index 7874e8a..194d9bb 100644
--- a/arch/powerpc/lib/checksum_32.S
+++ b/arch/powerpc/lib/checksum_32.S
@@ -12,6 +12,7 @@
* Severely hacked about by Paul Mackerras (paulus@cs.anu.edu.au).
*/
+#include <linux/module.h>
#include <linux/sys.h>
#include <asm/processor.h>
#include <asm/errno.h>
@@ -39,6 +40,7 @@ _GLOBAL(ip_fast_csum)
not r3,r3
srwi r3,r3,16
blr
+EXPORT_SYMBOL(ip_fast_csum)
/*
* Compute checksum of TCP or UDP pseudo-header:
@@ -55,6 +57,7 @@ _GLOBAL(csum_tcpudp_magic)
not r3,r3
srwi r3,r3,16
blr
+EXPORT_SYMBOL(csum_tcpudp_magic)
/*
* computes the checksum of a memory block at buff, length len,
@@ -93,6 +96,7 @@ _GLOBAL(csum_partial)
adde r0,r0,r5
5: addze r3,r0 /* add in final carry */
blr
+EXPORT_SYMBOL(csum_partial)
/*
* Computes the checksum of a memory block at src, length len,
@@ -203,6 +207,8 @@ dst_error:
1: addze r3,r0
blr
+EXPORT_SYMBOL(csum_partial_copy_generic)
+
.section __ex_table,"a"
.long 81b,src_error_1
.long 91b,dst_error
diff --git a/arch/powerpc/lib/checksum_64.S b/arch/powerpc/lib/checksum_64.S
index ef96c6c..c6a7b67 100644
--- a/arch/powerpc/lib/checksum_64.S
+++ b/arch/powerpc/lib/checksum_64.S
@@ -12,6 +12,7 @@
* Severely hacked about by Paul Mackerras (paulus@cs.anu.edu.au).
*/
+#include <linux/module.h>
#include <linux/sys.h>
#include <asm/processor.h>
#include <asm/errno.h>
@@ -43,6 +44,7 @@ _GLOBAL(ip_fast_csum)
not r3,r3
srwi r3,r3,16
blr
+EXPORT_SYMBOL(ip_fast_csum)
/*
* Compute checksum of TCP or UDP pseudo-header:
@@ -64,6 +66,7 @@ _GLOBAL(csum_tcpudp_magic)
not r3,r3
srwi r3,r3,16
blr
+EXPORT_SYMBOL(csum_tcpudp_magic)
/*
* Computes the checksum of a memory block at buff, length len,
@@ -114,6 +117,7 @@ _GLOBAL(csum_partial)
add r3,r4,r5
srdi r3,r3,32
blr
+EXPORT_SYMBOL(csum_partial)
/*
* Computes the checksum of a memory block at src, length len,
@@ -169,6 +173,7 @@ _GLOBAL(csum_partial_copy_generic)
add r3,r4,r3
srdi r3,r3,32
blr
+EXPORT_SYMBOL(csum_partial_copy_generic)
/* These shouldn't go in the fixup section, since that would
cause the ex_table addresses to get out of order. */
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S
index c657de5..aa3645d 100644
--- a/arch/powerpc/lib/copy_32.S
+++ b/arch/powerpc/lib/copy_32.S
@@ -8,6 +8,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/cache.h>
#include <asm/errno.h>
@@ -154,6 +155,7 @@ _GLOBAL(memset)
8: stbu r4,1(r6)
bdnz 8b
blr
+EXPORT_SYMBOL(memset)
/*
* This version uses dcbz on the complete cache lines in the
@@ -235,6 +237,7 @@ _GLOBAL(cacheable_memcpy)
addi r6,r6,1
bdnz 40b
65: blr
+EXPORT_SYMBOL(cacheable_memcpy)
_GLOBAL(memmove)
cmplw 0,r3,r4
@@ -281,6 +284,8 @@ _GLOBAL(memcpy)
beq 2b
mtctr r7
b 1b
+EXPORT_SYMBOL(memmove)
+EXPORT_SYMBOL(memcpy)
_GLOBAL(backwards_memcpy)
rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
@@ -540,3 +545,5 @@ _GLOBAL(__copy_tofrom_user)
.long 112b,120b
.long 114b,120b
.text
+
+EXPORT_SYMBOL(__copy_tofrom_user)
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index f9837f4..e81ffa2 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -6,6 +6,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/ppc_asm.h>
@@ -117,3 +118,5 @@ _GLOBAL(copy_4K_page)
ld r30,-16(1)
ld r31,-8(1)
blr
+
+EXPORT_SYMBOL(copy_4K_page)
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S
index 25ec537..2342fd6 100644
--- a/arch/powerpc/lib/copyuser_64.S
+++ b/arch/powerpc/lib/copyuser_64.S
@@ -6,6 +6,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/ppc_asm.h>
@@ -572,3 +573,5 @@ _GLOBAL(__copy_tofrom_user)
.llong 89b,100b
.llong 90b,100b
.llong 91b,100b
+
+EXPORT_SYMBOL(__copy_tofrom_user)
diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S
index 11ce045..2a18d58 100644
--- a/arch/powerpc/lib/mem_64.S
+++ b/arch/powerpc/lib/mem_64.S
@@ -8,6 +8,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/errno.h>
#include <asm/ppc_asm.h>
@@ -76,11 +77,13 @@ _GLOBAL(memset)
10: bflr 31
stb r4,0(r6)
blr
+EXPORT_SYMBOL(memset)
_GLOBAL(memmove)
cmplw 0,r3,r4
bgt .backwards_memcpy
b .memcpy
+EXPORT_SYMBOL(memmove)
_GLOBAL(backwards_memcpy)
rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S
index 3f13112..839945b 100644
--- a/arch/powerpc/lib/memcpy_64.S
+++ b/arch/powerpc/lib/memcpy_64.S
@@ -6,6 +6,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/ppc_asm.h>
@@ -171,3 +172,5 @@ _GLOBAL(memcpy)
stb r0,0(r3)
4: ld r3,48(r1) /* return dest pointer */
blr
+
+EXPORT_SYMBOL(memcpy)
diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S
index 64e2e49..929100a 100644
--- a/arch/powerpc/lib/string.S
+++ b/arch/powerpc/lib/string.S
@@ -8,6 +8,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/module.h>
#include <asm/processor.h>
#include <asm/errno.h>
#include <asm/ppc_asm.h>
@@ -24,6 +25,7 @@ _GLOBAL(strcpy)
stbu r0,1(r5)
bne 1b
blr
+EXPORT_SYMBOL(strcpy)
/* This clears out any unused part of the destination buffer,
just as the libc version does. -- paulus */
@@ -44,6 +46,7 @@ _GLOBAL(strncpy)
2: stbu r0,1(r6) /* clear it out if so */
bdnz 2b
blr
+EXPORT_SYMBOL(strncpy)
_GLOBAL(strcat)
addi r5,r3,-1
@@ -57,6 +60,7 @@ _GLOBAL(strcat)
stbu r0,1(r5)
bne 1b
blr
+EXPORT_SYMBOL(strcat)
_GLOBAL(strcmp)
addi r5,r3,-1
@@ -68,6 +72,7 @@ _GLOBAL(strcmp)
beqlr 1
beq 1b
blr
+EXPORT_SYMBOL(strcmp)
_GLOBAL(strncmp)
PPC_LCMPI r5,0
@@ -82,6 +87,7 @@ _GLOBAL(strncmp)
beqlr 1
bdnzt eq,1b
blr
+EXPORT_SYMBOL(strncmp)
_GLOBAL(strlen)
addi r4,r3,-1
@@ -90,6 +96,7 @@ _GLOBAL(strlen)
bne 1b
subf r3,r3,r4
blr
+EXPORT_SYMBOL(strlen)
_GLOBAL(memcmp)
cmpwi 0,r5,0
@@ -104,6 +111,7 @@ _GLOBAL(memcmp)
blr
2: li r3,0
blr
+EXPORT_SYMBOL(memcmp)
_GLOBAL(memchr)
cmpwi 0,r5,0
@@ -116,6 +124,7 @@ _GLOBAL(memchr)
beqlr
2: li r3,0
blr
+EXPORT_SYMBOL(memchr)
_GLOBAL(__clear_user)
addi r6,r3,-4
@@ -158,6 +167,7 @@ _GLOBAL(__clear_user)
PPC_LONG 1b,91b
PPC_LONG 8b,92b
.text
+EXPORT_SYMBOL(__clear_user)
_GLOBAL(__strncpy_from_user)
addi r6,r3,-1
@@ -179,6 +189,7 @@ _GLOBAL(__strncpy_from_user)
.section __ex_table,"a"
PPC_LONG 1b,99b
.text
+EXPORT_SYMBOL(__strncpy_from_user)
/* r3 = str, r4 = len (> 0), r5 = top (highest addr) */
_GLOBAL(__strnlen_user)
@@ -203,3 +214,4 @@ _GLOBAL(__strnlen_user)
.section __ex_table,"a"
PPC_LONG 1b,99b
+EXPORT_SYMBOL(__strnlen_user)
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
index b9ba7d9..ac9bef1 100644
--- a/arch/powerpc/mm/hash_low_32.S
+++ b/arch/powerpc/mm/hash_low_32.S
@@ -19,6 +19,7 @@
*
*/
+#include <linux/module.h>
#include <asm/reg.h>
#include <asm/page.h>
#include <asm/pgtable.h>
@@ -33,6 +34,7 @@
.globl mmu_hash_lock
mmu_hash_lock:
.space 4
+EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
#endif /* CONFIG_SMP */
/*
@@ -609,3 +611,5 @@ _GLOBAL(flush_hash_patch_B)
SYNC_601
isync
blr
+
+EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
diff --git a/arch/powerpc/mm/mmu_context_32.c b/arch/powerpc/mm/mmu_context_32.c
index cc32ba4..b990cc4 100644
--- a/arch/powerpc/mm/mmu_context_32.c
+++ b/arch/powerpc/mm/mmu_context_32.c
@@ -23,12 +23,14 @@
*/
#include <linux/mm.h>
+#include <linux/module.h>
#include <linux/init.h>
#include <asm/mmu_context.h>
#include <asm/tlbflush.h>
unsigned long next_mmu_context;
+EXPORT_SYMBOL(next_mmu_context);
unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
#ifdef FEW_CONTEXTS
atomic_t nr_free_contexts;
diff --git a/arch/powerpc/mm/tlb_32.c b/arch/powerpc/mm/tlb_32.c
index eb4b512..2523d71 100644
--- a/arch/powerpc/mm/tlb_32.c
+++ b/arch/powerpc/mm/tlb_32.c
@@ -24,6 +24,7 @@
#include <linux/kernel.h>
#include <linux/mm.h>
+#include <linux/module.h>
#include <linux/init.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
@@ -136,6 +137,7 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
flush_range(&init_mm, start, end);
FINISH_FLUSH;
}
+EXPORT_SYMBOL(flush_tlb_kernel_range);
/*
* Flush all the (user) entries for the address space described by mm.
@@ -175,6 +177,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1);
FINISH_FLUSH;
}
+EXPORT_SYMBOL(flush_tlb_page);
/*
* For each address in the range, find the pte for the address
diff --git a/arch/powerpc/sysdev/dcr-low.S b/arch/powerpc/sysdev/dcr-low.S
index 2078f39..27bc06c 100644
--- a/arch/powerpc/sysdev/dcr-low.S
+++ b/arch/powerpc/sysdev/dcr-low.S
@@ -9,6 +9,7 @@
* option) any later version.
*/
+#include <linux/module.h>
#include <asm/ppc_asm.h>
#include <asm/processor.h>
@@ -22,9 +23,11 @@
_GLOBAL(__mfdcr)
DCR_ACCESS_PROLOG(__mfdcr_table)
+EXPORT_SYMBOL(__mfdcr);
_GLOBAL(__mtdcr)
DCR_ACCESS_PROLOG(__mtdcr_table)
+EXPORT_SYMBOL(__mtdcr);
__mfdcr_table:
mfdcr r3,0; blr
iff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index cae5248..b915cc4 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -390,6 +390,7 @@ adb_poll(void)
return;
adb_controller->poll();
}
+EXPORT_SYMBOL(adb_poll);
static void adb_sync_req_done(struct adb_request *req)
{
@@ -439,6 +440,7 @@ adb_request(struct adb_request *req, void (*done)(struct adb_request *),
return rc;
}
+EXPORT_SYMBOL(adb_request);
/* Ultimately this should return the number of devices with
the given default id.
@@ -474,6 +476,7 @@ adb_register(int default_id, int handler_id, struct adb_ids *ids,
mutex_unlock(&adb_handler_mutex);
return ids->nids;
}
+EXPORT_SYMBOL(adb_register);
int
adb_unregister(int index)
@@ -495,6 +498,7 @@ adb_unregister(int index)
mutex_unlock(&adb_handler_mutex);
return ret;
}
+EXPORT_SYMBOL(adb_unregister);
void
adb_input(unsigned char *buf, int nb, int autopoll)
@@ -561,6 +565,7 @@ adb_try_handler_change(int address, int new_id)
mutex_unlock(&adb_handler_mutex);
return ret;
}
+EXPORT_SYMBOL(adb_try_handler_change);
int
adb_get_infos(int address, int *original_address, int *handler_id)
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index 741a93a..91dd6bf 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -10,6 +10,7 @@
*/
#include <stdarg.h>
#include <linux/types.h>
+#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/delay.h>
@@ -375,6 +376,7 @@ cuda_request(struct adb_request *req, void (*done)(struct adb_request *),
req->reply_expected = 1;
return cuda_write(req);
}
+EXPORT_SYMBOL(cuda_request);
static int
cuda_write(struct adb_request *req)
@@ -435,6 +437,7 @@ cuda_poll(void)
cuda_interrupt(0, NULL);
enable_irq(cuda_irq);
}
+EXPORT_SYMBOL(cuda_poll);
static irqreturn_t
cuda_interrupt(int irq, void *arg)
^ permalink raw reply related
* Possible bug in IRQ handling in pata_of_platform / pata_platform
From: Steven A. Falco @ 2008-08-11 14:48 UTC (permalink / raw)
To: linuxppc-dev
I think there is a bug in the communications between pata_of_platform
and pata_platform. I will refer to the master branch of the DENX git
tree, which is roughly v2.6.26.1 at this time. I am using a Sequoia
board with a PPC440EPx.
In pata_of_platform, we have:
ret = of_irq_to_resource(dn, 0, &irq_res);
if (ret == NO_IRQ)
irq_res.start = irq_res.end = -1;
so if there is no interrupt defined, then start and end are -1.
However, __pata_platform_probe has:
if (irq_res && irq_res->start > 0) {
irq = irq_res->start;
irq_flags = irq_res->flags;
}
You might think that the (irq_res->start > 0) test will fail, as it
should in this no-irq case. But, start is a u64, so the -1 actually
looks like a large positive number in the comparison. So,
__pata_platform_probe attempts to use an interrupt when there isn't one.
I think the fix would be to change __pata_platform_probe to:
if (irq_res && irq_res->start != -1) {
but that might have other unintended consequences, so I'll defer to
whomever knows more about the intent of this code.
Steve
^ permalink raw reply
* Re: [RFC 2/3] powerpc: export all symbols from the definition file
From: Geert Uytterhoeven @ 2008-08-11 14:53 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arch, Matthew Wilcox, Rusty Russell, linux-kernel,
linuxppc-dev, Al Viro, David Woodhouse
In-Reply-To: <200808111617.53305.arnd@arndb.de>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 737 bytes --]
On Mon, 11 Aug 2008, Arnd Bergmann wrote:
> It's now possible to export symbols from .S files, so move all
Nice!
> exports out of the ppc_ksyms.c file to the definition of the
> symbols.
> drivers/macintosh/adb.c | 5 +++++
> drivers/macintosh/via-cuda.c | 3 +++
I think these 2 belong to patch 3?
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB
^ permalink raw reply
* Re: [RFC 1/3] add support for exporting symbols from .S files
From: David Woodhouse @ 2008-08-11 14:56 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arch, Matthew Wilcox, Rusty Russell, linux-kernel,
linuxppc-dev, Al Viro
In-Reply-To: <200808111618.08206.arnd@arndb.de>
On Mon, 2008-08-11 at 16:18 +0200, Arnd Bergmann wrote:
> This makes it possible to export symbols from assembly files, instead
> of having to export them through an extra ksyms.c file.
>
> I found this nicer to implement using a gas macro than a cpp macro.
Yeah, gas macros can be much nicer. This looks good to me; I don't see
and reason why it can't be used across all architectures, off-hand.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
^ permalink raw reply
* [PATCH] pata_of_platform: fix no irq handling
From: Anton Vorontsov @ 2008-08-11 15:19 UTC (permalink / raw)
To: Jeff Garzik, Steven A. Falco; +Cc: linuxppc-dev, linux-ide
In-Reply-To: <48A05152.7020508@harris.com>
When no irq specified, pata_of_platform fills irq_res with -1,
which is wrong to do for two reasons:
1. By definition, 'no irq' should be IRQ 0, not some negative integer;
2. pata_platform checks for irq_res.start > 0, but since irq_res.start
is unsigned type, the check will be true for `-1'.
Reported-by: Steven A. Falco <sfalco@harris.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
On Mon, Aug 11, 2008 at 10:48:50AM -0400, Steven A. Falco wrote:
> I think there is a bug in the communications between pata_of_platform
> and pata_platform. I will refer to the master branch of the DENX git
> tree, which is roughly v2.6.26.1 at this time. I am using a Sequoia
> board with a PPC440EPx.
>
> In pata_of_platform, we have:
>
> ret = of_irq_to_resource(dn, 0, &irq_res);
> if (ret == NO_IRQ)
> irq_res.start = irq_res.end = -1;
>
> so if there is no interrupt defined, then start and end are -1.
> However, __pata_platform_probe has:
>
> if (irq_res && irq_res->start > 0) {
> irq = irq_res->start;
> irq_flags = irq_res->flags;
> }
>
> You might think that the (irq_res->start > 0) test will fail, as it
> should in this no-irq case. But, start is a u64, so the -1 actually
> looks like a large positive number in the comparison. So,
> __pata_platform_probe attempts to use an interrupt when there isn't one.
>
> I think the fix would be to change __pata_platform_probe to:
>
> if (irq_res && irq_res->start != -1) {
>
> but that might have other unintended consequences, so I'll defer to
> whomever knows more about the intent of this code.
Something like this patch should work. Thanks for noticing!
drivers/ata/pata_of_platform.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index 408da30..1f18ad9 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -52,7 +52,7 @@ static int __devinit pata_of_platform_probe(struct of_device *ofdev,
ret = of_irq_to_resource(dn, 0, &irq_res);
if (ret == NO_IRQ)
- irq_res.start = irq_res.end = -1;
+ irq_res.start = irq_res.end = 0;
else
irq_res.flags = 0;
--
1.5.6.3
^ permalink raw reply related
* Re: [RFC 2/3] powerpc: export all symbols from the definition file
From: Arnd Bergmann @ 2008-08-11 15:27 UTC (permalink / raw)
To: linuxppc-dev
Cc: linux-arch, Matthew Wilcox, Rusty Russell, linux-kernel, Al Viro,
Geert Uytterhoeven, David Woodhouse
In-Reply-To: <Pine.LNX.4.64.0808111653170.3030@vixen.sonytel.be>
On Monday 11 August 2008, Geert Uytterhoeven wrote:
> > =A0drivers/macintosh/adb.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A05 +++++
> > =A0drivers/macintosh/via-cuda.c =A0 =A0 =A0 =A0 | =A0 =A03 +++
>=20
> I think these 2 belong to patch 3?
I tried to come up with other ways of splitting up the patch,
but since these come from ppc_ksyms, it makes sense to keep
them with the rest.
Maybe I could split the exports for C functions from those
in assember files that depend on patch 1.
Arnd <><
^ permalink raw reply
* Re: Strange Badness with RT Spin Lock
From: Darcy Watkins @ 2008-08-11 15:30 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <1218225371.3465.51.camel@localhost>
Further to what I reported earlier regarding my unusual bug, adding a
memory barrier such as shown below also prevents the oops (and is a lot
cleaner than putting in unused dummy static instance(s) of spinlocks).
This has me scratching my head. Isn't the PPC405EP a uni-processor? I
suppose my problem could be an interaction of RT-Preemption with
predictive loads / deferred stores or perhaps there is a memory barrier
related bug in the spinlock/rtmutex code?.
> // We dispatch the PDU.
> ...
>
> #ifdef USE_MUTEX_CHECK_HACK
> MUTEX_CHECK_SAVE_LOCKED;
> #endif
> spin_unlock(&tree_lock);
> #ifdef USE_MUTEX_CHECK_HACK
> rt_mutex_owner_check("process_packed_pdu() - no frag - before
> cblk()");
> MUTEX_CHECK_SAVE_UNLOCKED;
> #endif
> clbk(new_skb, gen_header_p->cid);
>
>
barrier(); // memory barrier
> #ifdef USE_MUTEX_CHECK_HACK
> MUTEX_CHECK_DUMP_ON_BUG;
> rt_mutex_owner_check("process_packed_pdu() - no frag - after
> cblk()");
> #endif
> spin_lock(&tree_lock);
On Fri, 2008-08-08 at 12:56 -0700, Darcy Watkins wrote:
> Hello,
>
> I have a very unusual bug I have been trying to get to the bottom of.
>
--snip!--
--
Regards,
Darcy
--------------
Darcy L. Watkins - Senior Software Developer
Tranzeo Wireless Technologies, Inc.
19273 Fraser Way, Pitt Meadows, BC, Canada V3Y 2V4
T:604-460-6002 ext:410
http://www.tranzeo.com
^ permalink raw reply
* Re: [Cbe-oss-dev] please pull cell merge branch
From: Carl Love @ 2008-08-11 15:34 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Robert Richter, linux-kernel, linuxppc-dev, oprofile-list,
Paul Mackerras, cel, cbe-oss-dev
In-Reply-To: <200808110918.57293.arnd@arndb.de>
On Mon, 2008-08-11 at 09:18 +0200, Arnd Bergmann wrote:
> On Monday 11 August 2008, Paul Mackerras wrote:
> > Arnd Bergmann writes:
> > > I've fixed one last bug in Carl's update for cell-oprofile (int flags
> > > instead of unsigned long flags) and made sure the comments fit the
> > > usual style. This fixes a long-standing bug that prevented us from
> > > using oprofile on SPUs in many real-world scenarios.
> >
> > Since you're touching generic oprofile code here, do you have an ack
> > from the oprofile maintainer? Or is the oprofile maintainer listed in
> > MAINTAINERS (Robert Richter) no longer active or something?
> >
>
> Sorry about that. I had assumed that at the very least Carl had had
> the oprofile list on Cc and that people there just didn't care.
>
> Robert has just recently taken over maintainership for oprofile,
> so I assume that he is indeed active and interested in the patches.
> I'll send them out again for his review on oprofile-list.
>
> Arnd <><
Sorry, my mistake. I did mean to post both patches to the OProfile list
as well. I was planning on following up with Robert on the patches this
week since I had not heard from him.
Carl Love
^ permalink raw reply
* Re: [PATCH] pata_of_platform: fix no irq handling
From: Steven A. Falco @ 2008-08-11 16:23 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, Jeff Garzik, linux-ide
In-Reply-To: <20080811151913.GA14690@oksana.dev.rtsoft.ru>
[-- Attachment #1: Type: text/plain, Size: 2272 bytes --]
Anton Vorontsov wrote:
> When no irq specified, pata_of_platform fills irq_res with -1,
> which is wrong to do for two reasons:
>
> 1. By definition, 'no irq' should be IRQ 0, not some negative integer;
> 2. pata_platform checks for irq_res.start > 0, but since irq_res.start
> is unsigned type, the check will be true for `-1'.
>
> Reported-by: Steven A. Falco <sfalco@harris.com>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
Thanks! Your fix is better - I didn't really like the -1 stuff.
I found this bug because I had to disable the ATA interrupt on my system
in order to get a compact-flash card to work. I am still trying to find
out why the interrupt doesn't work for me. Here is part of the console
log with the interrupt enabled:
Uniform Multi-Platform E-IDE driver
ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
Driver 'sd' needs updating - please use bus_type methods
irq: irq_create_mapping(0xc0574900, 0x1b)
irq: -> using host @c0574900
irq: -> obtained virq 32
scsi0 : pata_platform
ata1: PATA max PIO4 mmio cmd 0x1c1000000 ctl 0x1c1000080 irq 32
irq 32: nobody cared (try booting with the "irqpoll" option)
Call Trace:
[cf83fcc0] [c0005a64] show_stack+0x44/0x1ac (unreliable)
[cf83fd00] [c00489e4] __report_bad_irq+0x34/0xb8
[cf83fd20] [c0048cf0] note_interrupt+0x288/0x2d0
[cf83fd50] [c0049a94] handle_level_irq+0xac/0x114
[cf83fd60] [c0003df0] do_IRQ+0xa4/0xc8
[cf83fd70] [c000d60c] ret_from_except+0x0/0x18
[cf83fe30] [00000020] 0x20
[cf83fe50] [c0003d48] do_softirq+0x54/0x58
[cf83fe60] [c00241c0] irq_exit+0x90/0x94
[cf83fe70] [c0003df4] do_IRQ+0xa8/0xc8
[cf83fe80] [c000d60c] ret_from_except+0x0/0x18
[cf83ff40] [c01b2cc0] ata_pio_task+0x48/0x104
[cf83ff60] [c00307a0] run_workqueue+0xb8/0x148
[cf83ff90] [c0030d54] worker_thread+0x70/0xd0
[cf83ffd0] [c0034788] kthread+0x48/0x84
[cf83fff0] [c000cd6c] kernel_thread+0x44/0x60
handlers:
[<c01b2d7c>] (ata_sff_interrupt+0x0/0x234)
Disabling IRQ #32
So it looks like the ATA handler was attached - not sure yet why I got
the "nobody cared" message. Also, the system hangs. If I find
something, I'll post it.
Steve
[-- Attachment #2: Type: text/html, Size: 3162 bytes --]
^ permalink raw reply
* Re: [PATCH] pata_of_platform: fix no irq handling
From: Ben Dooks @ 2008-08-11 16:36 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev, Jeff Garzik, linux-ide
In-Reply-To: <20080811151913.GA14690@oksana.dev.rtsoft.ru>
On Mon, Aug 11, 2008 at 07:19:13PM +0400, Anton Vorontsov wrote:
> When no irq specified, pata_of_platform fills irq_res with -1,
> which is wrong to do for two reasons:
>
> 1. By definition, 'no irq' should be IRQ 0, not some negative integer;
interesting, IRQ 0 is actually valid on some ARM systems.
> 2. pata_platform checks for irq_res.start > 0, but since irq_res.start
> is unsigned type, the check will be true for `-1'.
>
> Reported-by: Steven A. Falco <sfalco@harris.com>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>
> On Mon, Aug 11, 2008 at 10:48:50AM -0400, Steven A. Falco wrote:
> > I think there is a bug in the communications between pata_of_platform
> > and pata_platform. I will refer to the master branch of the DENX git
> > tree, which is roughly v2.6.26.1 at this time. I am using a Sequoia
> > board with a PPC440EPx.
> >
> > In pata_of_platform, we have:
> >
> > ret = of_irq_to_resource(dn, 0, &irq_res);
> > if (ret == NO_IRQ)
> > irq_res.start = irq_res.end = -1;
> >
> > so if there is no interrupt defined, then start and end are -1.
> > However, __pata_platform_probe has:
> >
> > if (irq_res && irq_res->start > 0) {
> > irq = irq_res->start;
> > irq_flags = irq_res->flags;
> > }
> >
> > You might think that the (irq_res->start > 0) test will fail, as it
> > should in this no-irq case. But, start is a u64, so the -1 actually
> > looks like a large positive number in the comparison. So,
> > __pata_platform_probe attempts to use an interrupt when there isn't one.
> >
> > I think the fix would be to change __pata_platform_probe to:
> >
> > if (irq_res && irq_res->start != -1) {
> >
> > but that might have other unintended consequences, so I'll defer to
> > whomever knows more about the intent of this code.
>
> Something like this patch should work. Thanks for noticing!
>
> drivers/ata/pata_of_platform.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
> index 408da30..1f18ad9 100644
> --- a/drivers/ata/pata_of_platform.c
> +++ b/drivers/ata/pata_of_platform.c
> @@ -52,7 +52,7 @@ static int __devinit pata_of_platform_probe(struct of_device *ofdev,
>
> ret = of_irq_to_resource(dn, 0, &irq_res);
> if (ret == NO_IRQ)
> - irq_res.start = irq_res.end = -1;
> + irq_res.start = irq_res.end = 0;
> else
> irq_res.flags = 0;
>
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply
* Re: [PATCH] pata_of_platform: fix no irq handling
From: Steven A. Falco @ 2008-08-11 16:42 UTC (permalink / raw)
To: Ben Dooks; +Cc: linuxppc-dev, Jeff Garzik, linux-ide
In-Reply-To: <20080811163648.GI26082@trinity.fluff.org>
[-- Attachment #1: Type: text/plain, Size: 2710 bytes --]
Ben Dooks wrote:
> On Mon, Aug 11, 2008 at 07:19:13PM +0400, Anton Vorontsov wrote:
>
>> When no irq specified, pata_of_platform fills irq_res with -1,
>> which is wrong to do for two reasons:
>>
>> 1. By definition, 'no irq' should be IRQ 0, not some negative integer;
>>
>
> interesting, IRQ 0 is actually valid on some ARM systems.
>
>
It is here too, but I believe most of the code uses a virtualized irq
number, so physical IRQ 0 would presumably get mapped to a non-zero
virtual one.
>> 2. pata_platform checks for irq_res.start > 0, but since irq_res.start
>> is unsigned type, the check will be true for `-1'.
>>
>> Reported-by: Steven A. Falco <sfalco@harris.com>
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>> ---
>>
>> On Mon, Aug 11, 2008 at 10:48:50AM -0400, Steven A. Falco wrote:
>>
>>> I think there is a bug in the communications between pata_of_platform
>>> and pata_platform. I will refer to the master branch of the DENX git
>>> tree, which is roughly v2.6.26.1 at this time. I am using a Sequoia
>>> board with a PPC440EPx.
>>>
>>> In pata_of_platform, we have:
>>>
>>> ret = of_irq_to_resource(dn, 0, &irq_res);
>>> if (ret == NO_IRQ)
>>> irq_res.start = irq_res.end = -1;
>>>
>>> so if there is no interrupt defined, then start and end are -1.
>>> However, __pata_platform_probe has:
>>>
>>> if (irq_res && irq_res->start > 0) {
>>> irq = irq_res->start;
>>> irq_flags = irq_res->flags;
>>> }
>>>
>>> You might think that the (irq_res->start > 0) test will fail, as it
>>> should in this no-irq case. But, start is a u64, so the -1 actually
>>> looks like a large positive number in the comparison. So,
>>> __pata_platform_probe attempts to use an interrupt when there isn't one.
>>>
>>> I think the fix would be to change __pata_platform_probe to:
>>>
>>> if (irq_res && irq_res->start != -1) {
>>>
>>> but that might have other unintended consequences, so I'll defer to
>>> whomever knows more about the intent of this code.
>>>
>> Something like this patch should work. Thanks for noticing!
>>
>> drivers/ata/pata_of_platform.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
>> index 408da30..1f18ad9 100644
>> --- a/drivers/ata/pata_of_platform.c
>> +++ b/drivers/ata/pata_of_platform.c
>> @@ -52,7 +52,7 @@ static int __devinit pata_of_platform_probe(struct of_device *ofdev,
>>
>> ret = of_irq_to_resource(dn, 0, &irq_res);
>> if (ret == NO_IRQ)
>> - irq_res.start = irq_res.end = -1;
>> + irq_res.start = irq_res.end = 0;
>> else
>> irq_res.flags = 0;
>>
>>
>
>
[-- Attachment #2: Type: text/html, Size: 3435 bytes --]
^ permalink raw reply
* Re: [PATCH] pata_of_platform: fix no irq handling
From: Alan Cox @ 2008-08-11 16:26 UTC (permalink / raw)
To: Ben Dooks; +Cc: linuxppc-dev, Jeff Garzik, linux-ide
In-Reply-To: <20080811163648.GI26082@trinity.fluff.org>
On Mon, 11 Aug 2008 17:36:48 +0100
Ben Dooks <ben-linux@fluff.org> wrote:
>
> On Mon, Aug 11, 2008 at 07:19:13PM +0400, Anton Vorontsov wrote:
> > When no irq specified, pata_of_platform fills irq_res with -1,
> > which is wrong to do for two reasons:
> >
> > 1. By definition, 'no irq' should be IRQ 0, not some negative integer;
>
> interesting, IRQ 0 is actually valid on some ARM systems.
Not as far as Linux is concerned. It's expected that any IRQ that happens
to be "physical IRQ 0" whatever that means is remapped by the arch code
unless not visible outside the arch.
^ permalink raw reply
* Re: [PATCH] pata_of_platform: fix no irq handling
From: Alan Cox @ 2008-08-11 16:29 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev, Jeff Garzik, linux-ide
In-Reply-To: <20080811151913.GA14690@oksana.dev.rtsoft.ru>
On Mon, 11 Aug 2008 19:19:13 +0400
Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> When no irq specified, pata_of_platform fills irq_res with -1,
> which is wrong to do for two reasons:
>
> 1. By definition, 'no irq' should be IRQ 0, not some negative integer;
> 2. pata_platform checks for irq_res.start > 0, but since irq_res.start
> is unsigned type, the check will be true for `-1'.
>
> Reported-by: Steven A. Falco <sfalco@harris.com>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Alan Cox <alan@redhat.com>
^ permalink raw reply
* Re: [PATCH] pata_of_platform: fix no irq handling
From: Anton Vorontsov @ 2008-08-11 17:07 UTC (permalink / raw)
To: Steven A. Falco; +Cc: linuxppc-dev, Jeff Garzik, Sparks, Sam, linux-ide
In-Reply-To: <48A0676E.5020308@harris.com>
On Mon, Aug 11, 2008 at 12:23:10PM -0400, Steven A. Falco wrote:
> Anton Vorontsov wrote:
> > When no irq specified, pata_of_platform fills irq_res with -1,
> > which is wrong to do for two reasons:
> >
> > 1. By definition, 'no irq' should be IRQ 0, not some negative integer;
> > 2. pata_platform checks for irq_res.start > 0, but since irq_res.start
> > is unsigned type, the check will be true for `-1'.
> >
> > Reported-by: Steven A. Falco <sfalco@harris.com>
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > ---
>
> Thanks! Your fix is better - I didn't really like the -1 stuff.
>
> I found this bug because I had to disable the ATA interrupt on my system
> in order to get a compact-flash card to work. I am still trying to find
> out why the interrupt doesn't work for me. Here is part of the console
> log with the interrupt enabled:
>
> Uniform Multi-Platform E-IDE driver
> ide: Assuming 33MHz system bus speed for PIO modes; override with
> idebus=xx
> Driver 'sd' needs updating - please use bus_type methods
> irq: irq_create_mapping(0xc0574900, 0x1b)
> irq: -> using host @c0574900
> irq: -> obtained virq 32
> scsi0 : pata_platform
> ata1: PATA max PIO4 mmio cmd 0x1c1000000 ctl 0x1c1000080 irq 32
> irq 32: nobody cared (try booting with the "irqpoll" option)
> Call Trace:
> [cf83fcc0] [c0005a64] show_stack+0x44/0x1ac (unreliable)
> [cf83fd00] [c00489e4] __report_bad_irq+0x34/0xb8
> [cf83fd20] [c0048cf0] note_interrupt+0x288/0x2d0
> [cf83fd50] [c0049a94] handle_level_irq+0xac/0x114
> [cf83fd60] [c0003df0] do_IRQ+0xa4/0xc8
> [cf83fd70] [c000d60c] ret_from_except+0x0/0x18
> [cf83fe30] [00000020] 0x20
> [cf83fe50] [c0003d48] do_softirq+0x54/0x58
> [cf83fe60] [c00241c0] irq_exit+0x90/0x94
> [cf83fe70] [c0003df4] do_IRQ+0xa8/0xc8
> [cf83fe80] [c000d60c] ret_from_except+0x0/0x18
> [cf83ff40] [c01b2cc0] ata_pio_task+0x48/0x104
> [cf83ff60] [c00307a0] run_workqueue+0xb8/0x148
> [cf83ff90] [c0030d54] worker_thread+0x70/0xd0
> [cf83ffd0] [c0034788] kthread+0x48/0x84
> [cf83fff0] [c000cd6c] kernel_thread+0x44/0x60
> handlers:
> [<c01b2d7c>] (ata_sff_interrupt+0x0/0x234)
> Disabling IRQ #32
>
>
> So it looks like the ATA handler was attached - not sure yet why I got
> the "nobody cared" message.
Nobody cared means that ata_sff_interrupt handler didn't notice
any IDE events, and returned zero value. This could mean that
1. IDE status read does not work. (But am I understand correctly
that IDE works well if IRQ is unspecified? Then this is hardly
an issue.)
2. IDE interrupt comes when it should not. I'd recommend to use
oscilloscope to find out what is happening there, that is, if
the drive actually deasserts its irq line after status read.
If so, than this could be a PIC problem.
What is the platform on which you're observing the issue, btw?
Just asking because recently Sam Sparks reported that he is observing
similar issue on MPC8349E-mITX-based boards, which I can't not
reproduce on my board though:
http://www.nabble.com/Compact-Flash-on-8349mITX-td18754330.html
http://www.nabble.com/Compact-flash-on-mpc8349eITX-td18777724.html
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ 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