-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,6 +216,40 @@ static void dev_mbox_register(const char *dev_name, struct device *dev) | |
mbox_dev = dev; | ||
} | ||
|
||
extern int bcm_mailbox_property(void *data, int size) | ||
{ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
popcornmix
Author
Collaborator
|
||
uint32_t success; | ||
dma_addr_t mem_bus; /* the memory address accessed from videocore */ | ||
void *mem_kern; /* the memory address accessed from driver */ | ||
int s = 0; | ||
|
||
/* allocate some memory for the messages communicating with GPU */ | ||
mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus, GFP_ATOMIC); | ||
if (mem_kern) { | ||
/* create the message */ | ||
memcpy(mem_kern, data, size); | ||
|
||
/* send the message */ | ||
wmb(); | ||
s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus); | ||
if (s == 0) { | ||
s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success); | ||
} | ||
if (s == 0) { | ||
/* copy the response */ | ||
rmb(); | ||
memcpy(data, mem_kern, size); | ||
} | ||
dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus); | ||
} else { | ||
s = -ENOMEM; | ||
} | ||
if (s != 0) | ||
printk(KERN_ERR DRIVER_NAME ": %s failed (%d)\n", __func__, s); | ||
return s; | ||
} | ||
EXPORT_SYMBOL_GPL(bcm_mailbox_property); | ||
|
||
/* ---------------------------------------------------------------------- | ||
* Platform Device for Mailbox | ||
* -------------------------------------------------------------------- */ | ||
|
10 comments
on commit adae199
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't compile : http://pastebin.com/9eTyXs8E
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will with KALLSYMS_EXTRA_PASS=1. It's not this change that makes that necessary (I added it months ago).
Not sure what the real cause is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should i add KALLSYMS_EXTRA_PASS to make. Never seen that this option is required for a kernel build. The PI one is the first one where this is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the output of:
diff .tmp_kallsyms2.S .tmp_kallsyms3.S
may give a hint as to what's causing this failure.
(I think you need to do KALLSYMS_EXTRA_PASS=1 first, then run the diff).
For me it's currently building with or without KALLSYMS_EXTRA_PASS=1, so I can't identify the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small part of the diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping for symbol names. What about
diff .tmp_System.map System.map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When i go back to commit 55549f3 KALLSYMS_EXTRA_PASS is not needed. Diff of the System.map will follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From:
http://paste.ubuntu.com/1196699/
Looks like kallsyms_names is 16 bytes bigger in one than the other.
The references I've found suggests a bug in kallsyms.c. Need to ask asb...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost all evidence points to this being an upstream bug, rather than something we have introduced to the Linux build system.
There's some discussion here djwillis/meta-raspberrypi#38 and LKML discussion/patch here https://lkml.org/lkml/2012/6/1/267 and some more in-depth discussion here: http://www.spinics.net/lists/linux-kbuild/msg06042.html
I was going to suggest we wait until this is fixed upstream, but I'm pleased to see that a derivative of David Brown's proposed patch has been applied: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9973290ce20ace7cac8ad06f753468c0b826fd0f
We can apply that patch to our tree trivially (only reason we can't just git apply without manual fixup is that "PERCPU_SECTION(32)" has since been changed to "PERCPU_SECTION(L1_CACHE_BYTES)".
It looks like it shouldn't hurt for us to pull in this patch, but if @huceke you could double check that applying it fixes the build on your configuration that would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Alex. Good investigative work. I seem to be building successfully without KALLSYMS_EXTRA_PASS, so I've committed the patch.
Is there a special reason why this function is declared extern in the .c file ?