Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-13 Thread neo
Hi Brandon I am learning to use the BBB to interface a 802.15.4 radio to BBB without a MCU between BBB and CC2500. I want to remove the MCU and interface directly to the Kernel. So for this i have to service interrupts which will be a gpio interrupt to BBB if a new packet arrives. So that the

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-13 Thread John Syn
From: neo prag.in...@gmail.com Reply-To: beagleboard@googlegroups.com beagleboard@googlegroups.com Date: Saturday, September 13, 2014 at 6:17 AM To: beagleboard@googlegroups.com beagleboard@googlegroups.com Subject: Re: [beagleboard] Re: registering asynchronous events on kernel thread

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-13 Thread neo star
@googlegroups.com Subject: Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space Hi Brandon I am learning to use the BBB to interface a 802.15.4 radio to BBB without a MCU between BBB and CC2500. I want to remove the MCU and interface directly to the Kernel

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-11 Thread neo
: Subject: Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space Hi Brandon Thanks for the reply. I will summarize here what i found about controlling a GPIO and about using interrupts. 1. Using sysfs one can easily control the gpio and using threading can

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-11 Thread neo
Hi Brandon 1. I agree with jitter involved with processing interrupts and 100% cpu usage during polling for the same, so is there no way to let the user-space know that interrupt has occurred apart from polling ? 2. The reason why i said pseudo-interrupt is because we are polling

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-11 Thread Brandon I
OK, one more time. All userspace interrupts work the same, pru, network driver, *anything*. The process blocks until the interrupt handler unblocks the process with a semaphore or completion in the kernel. For example, when you read data for a socket connection, it blocks. When data comes in, the

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-10 Thread neo
Hi Brandon Thanks for the reply. I will summarize here what i found about controlling a GPIO and about using interrupts. 1. Using sysfs one can easily control the gpio and using threading can re-create pseudo-interrupt from user space. Found a useful project called libsoc

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-10 Thread John Syn
From: neo prag.in...@gmail.com Reply-To: beagleboard@googlegroups.com beagleboard@googlegroups.com Date: Wednesday, September 10, 2014 at 5:13 AM To: beagleboard@googlegroups.com beagleboard@googlegroups.com Subject: Re: [beagleboard] Re: registering asynchronous events on kernel thread

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-10 Thread Brandon I
pseudo-interrupt from user space There's nothing pseudo about it. Again, any usual way to have a userspace application respond to an interrupt will be the exact same. The kernel will block the userspace process until the interrupt is seen. The only real alternative is burning up the cpu with

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-10 Thread John Syn
From: Brandon I brandon.ir...@gmail.com Reply-To: beagleboard@googlegroups.com beagleboard@googlegroups.com Date: Wednesday, September 10, 2014 at 1:55 PM To: beagleboard@googlegroups.com beagleboard@googlegroups.com Subject: Re: [beagleboard] Re: registering asynchronous events on kernel

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-09 Thread neo
Hi Kavita I understood the part of request_threaded_irq() found a sample implementation here- http://lxr.free-electrons.com/source/drivers/input/touchscreen/cy8ctmg110_ts.c for touch controllers. But did not understand the bit about In userspace use evetest like application to wait on the

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-09 Thread Brandon I
Before you jump into the kernel hole, is there a reason that you're not using the existing sysfs gpio interface ( https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) for the interrupts? Using this, if you set the gpio up as an interrupt with the sysfs interface, you poll() the value file and

Re: [beagleboard] Re: registering asynchronous events on kernel thread in user space

2014-09-08 Thread kavitha bk
May be you can use udev In the err = request_threaded_irq(pdata-irq, NULL, receive_thread, pdata-irqflags, interrupt, ir); In reciever thread static irqreturn_t receive_threar(int irq, void *context_data) { struct data *dh = context_data;