dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5708
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Fri Nov 06, 2015 1:10 pm

ilbarone92 wrote:hi again dom,
sorry for delay but i was a bit busy, thanks again for all the suggest but i have still a problem in running perf,
i copied the binary u sent me on RPI but if i try to run perf or just perf list , this is the result:
Where is the binary? Did you copy it to /usr/bin? It sounds like you are actually running something else called perf that is on your path.

Try

Code: Select all

./perf
if perf is in current directory.

wwg
Posts: 20
Joined: Mon Jan 21, 2013 4:17 pm

Re: Linux kernel is now 4.1

Sat Dec 12, 2015 8:55 pm

Has the procedure changed for allocating DMA within the 4.1 kernel?

I have a char driver that calls:

Code: Select all

        dma_chan = bcm_dma_chan_alloc(
            bcm_dma_features(sarg.features),
            &res->dma_base,
            &res->dma_irq);
which worked fine for the 3.x kernels.

With the 4.1.14-v7+ kernel from git, compiled and running on a Pi 2, I always get -2 returned, indicating no devices available. For features, I try for anything (0x000F), but nothing gets allocated.

I've already made the change to /dev/vcio to get this far, but this particular problem is currently a show stopper.

AndyPi
Posts: 83
Joined: Wed Feb 22, 2012 10:24 pm
Location: Gloucestershire,UK

Re: Linux kernel is now 4.1

Wed Dec 16, 2015 5:17 pm

I may be going mad but......

When using mailbox to communicate to VC, we used to create a character device with major number 100.

This changed with the introduction of /dev/vcio which has major number 249.

In mailbox.h there is
define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *)
but it requires that major_num is 100.

I understand from https://www.kernel.org/doc/Documentatio ... number.txt that the first argument of IOWR is some unique identifier, not necessarily the major number.

So have I got this right, the major number is 249 but the ioctl identifier is 100 ?

I am sure that at some point the ioctl identifier was 249 as well.

Its a bit confusing

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5708
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Wed Dec 16, 2015 6:25 pm

You should be using 249. That is an officially allocated major number.
100 was just used before we had an official number and is no longer supported.

Where is the mailbox.h file you refer to?

AndyPi
Posts: 83
Joined: Wed Feb 22, 2012 10:24 pm
Location: Gloucestershire,UK

Re: Linux kernel is now 4.1

Wed Dec 16, 2015 7:02 pm

I am using an up to date arch system. Th only mailbox.h I have is
/opt/vc/src/hello_pi/hello_fft/mailbox.h
.

ls -al /dev/vcio
crw------- 1 root root 249, 0 Jan 1 1970 /dev/vcio
I am thinking that because the constant IOCTL_MBOX_PROPERTY is constructed with ioctl identifier of 100

AndyPi
Posts: 83
Joined: Wed Feb 22, 2012 10:24 pm
Location: Gloucestershire,UK

Re: Linux kernel is now 4.1

Wed Dec 16, 2015 9:38 pm

Also see https://github.com/raspberrypi/linux/bl ... com/vcio.c lines 25 and 26
#define VCIO_IOC_MAGIC 100
#define IOCTL_MBOX_PROPERTY _IOWR(VCIO_IOC_MAGIC, 0, char *)

arpitjindal
Posts: 3
Joined: Sat Feb 21, 2015 12:04 pm

Re: Linux kernel is now 4.1

Wed Nov 30, 2016 10:30 am

Hello Dom
I've just tried the lines I quoted and they still work.
You can try running the perf I built: https://dl.dropboxusercontent.com/u/3669512/temp/perf
I downloaded your perf tool and trying to run it on my rpi1 Linux 4.1.13-rt15+. I am not getting any output for "perf top". I am getting output for other commands but for "perf top", I am only getting header line and thats it.

Any idea? Is "perf top" not supported in rpi1.

Return to “Advanced users”