~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/powerpc/platforms/pseries/dtl.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
 
54
54
/*
55
 
 * Size of per-cpu log buffers. Default is just under 16 pages worth.
 
55
 * Size of per-cpu log buffers. Firmware requires that the buffer does
 
56
 * not cross a 4k boundary.
56
57
 */
57
 
static int dtl_buf_entries = (16 * 85);
58
 
 
 
58
static int dtl_buf_entries = N_DISPATCH_LOG;
59
59
 
60
60
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
61
61
struct dtl_ring {
151
151
 
152
152
        /* Register our dtl buffer with the hypervisor. The HV expects the
153
153
         * buffer size to be passed in the second word of the buffer */
154
 
        ((u32 *)dtl->buf)[1] = dtl->buf_entries * sizeof(struct dtl_entry);
 
154
        ((u32 *)dtl->buf)[1] = DISPATCH_LOG_BYTES;
155
155
 
156
156
        hwcpu = get_hard_smp_processor_id(dtl->cpu);
157
157
        addr = __pa(dtl->buf);
196
196
        long int rc;
197
197
        struct dtl_entry *buf = NULL;
198
198
 
 
199
        if (!dtl_cache)
 
200
                return -ENOMEM;
 
201
 
199
202
        /* only allow one reader */
200
203
        if (dtl->buf)
201
204
                return -EBUSY;
202
205
 
203
206
        n_entries = dtl_buf_entries;
204
 
        buf = kmalloc_node(n_entries * sizeof(struct dtl_entry),
205
 
                        GFP_KERNEL, cpu_to_node(dtl->cpu));
 
207
        buf = kmem_cache_alloc_node(dtl_cache, GFP_KERNEL, cpu_to_node(dtl->cpu));
206
208
        if (!buf) {
207
209
                printk(KERN_WARNING "%s: buffer alloc failed for cpu %d\n",
208
210
                                __func__, dtl->cpu);
223
225
        spin_unlock(&dtl->lock);
224
226
 
225
227
        if (rc)
226
 
                kfree(buf);
 
228
                kmem_cache_free(dtl_cache, buf);
227
229
        return rc;
228
230
}
229
231
 
231
233
{
232
234
        spin_lock(&dtl->lock);
233
235
        dtl_stop(dtl);
234
 
        kfree(dtl->buf);
 
236
        kmem_cache_free(dtl_cache, dtl->buf);
235
237
        dtl->buf = NULL;
236
238
        dtl->buf_entries = 0;
237
239
        spin_unlock(&dtl->lock);
365
367
 
366
368
        event_mask_file = debugfs_create_x8("dtl_event_mask", 0600,
367
369
                                dtl_dir, &dtl_event_mask);
368
 
        buf_entries_file = debugfs_create_u32("dtl_buf_entries", 0600,
 
370
        buf_entries_file = debugfs_create_u32("dtl_buf_entries", 0400,
369
371
                                dtl_dir, &dtl_buf_entries);
370
372
 
371
373
        if (!event_mask_file || !buf_entries_file) {