* Powermac11,2
@ 2011-07-15 22:29 kevin diggs
2011-07-18 15:35 ` Busy waits take much longer in driver code vs. application code Matias Garcia
0 siblings, 1 reply; 2+ messages in thread
From: kevin diggs @ 2011-07-15 22:29 UTC (permalink / raw)
To: linuxppc-dev
Hi,
Anyone know what it means when a dual core dual cpu (total 4 cores)
beeps three times on startup? The white power led also blinks 3 times
every few seconds.
The machine in question is a recent acquisition. I have got it to boot once.
Thanks!
kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
* Busy waits take much longer in driver code vs. application code
2011-07-15 22:29 Powermac11,2 kevin diggs
@ 2011-07-18 15:35 ` Matias Garcia
0 siblings, 0 replies; 2+ messages in thread
From: Matias Garcia @ 2011-07-18 15:35 UTC (permalink / raw)
To: linuxppc-dev
Not sure if this is arch-dependant. If not, I'll register on the kernel
mailing list.
I'm working with some legacy driver code (an IOCTL) that busy waits
after requesting an operation from an FPGA. It reads a register in a
loop until the FPGA has finished the operation. The operation is
supposed to take about 1ms, but the driver code is returning after 11ms
or more. If I instead run the same busy loop inside the application that
calls the IOCTL, it takes <1ms. Instrumenting the driver loop shows that
the loop is only executed a couple of times about 5ms apart (though
printk may skew this slightly). The application loop is run MUCH more
often.
Platform is P2020 with kernel 2.6.37 running two applications. The one
in question is run with FIFO scheduler at priority 10, the other one is
run with FIFO scheduler at priority 50. All other processes are
regular/default priority.
The only difference in interface between calling the IOCTL and
reading/writing registers through the device file is that read/writes
use copy to/from user while the IOCTL calls io[read|write]32be. No data
needs to go to user-space for this operation.
A couple of questions:
1. Why is the application code running WAY faster than the IOCTL call? I
thought driver code was executed in process context at the same priority
as the calling process.
2. Can you suggest a better way to implement the busy wait in the driver
code if I can get the priorities right? Should I even leave it in there?
I'm doing a lot of reading, but could really use an expert opinion.
Any light shed will be toasted heartily.
Thanks,
Matias Garcia
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-18 15:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-15 22:29 Powermac11,2 kevin diggs
2011-07-18 15:35 ` Busy waits take much longer in driver code vs. application code Matias Garcia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).