Re: UIO driver test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi mandeep,

THanks for sharing the test code. Its a good starting point without
having a physical device or emulating a physical device with Kmalloc
and a fake interrupt.

Thanks.
Nayan

On Fri, Apr 15, 2016 at 11:06 PM, Mandeep Sandhu
<mandeepsandhu.chd@xxxxxxxxx> wrote:
>>>  * Main initialization/remove routines
>>>  */
>>> static int __init uio_dummy_init(void)
>>> {
>>>         printk("uio_dummy_init( )\n" );
>>>         uio_dummy_device = platform_device_register_simple("uio_dummy", -1,
>>>                                                            NULL, 0);
>
> You also need to register the UIO driver by calling
> uio_register_device() after populating your "struct uio_info"
> appropriately.
>
>>
>> Why are you using a platform driver and device on x86?  That's not going
>> to work at all, as your device doesn't have an irq.  Please use this on
>> a "real" device that has an interrupt assigned to it.
>
> If it's only for learning purpose, I guess one can skip registering a
> IRQ handler and use UIO_IRQ_CUSTOM, right?
>
> I did something similar for testing a UIO hotplug bug once. I used to
> fake an IRQ event from a timer by using uio_event_notify().
> https://github.com/mandeepsandhu/uio-hotplug-test/blob/master/uio_fake_hotplug.c
>
> Although, I'm not sure if the OP wants to do something similar
>
> HTH,
> -mandeep
>
>
>>
>> hope this helps,
>>
>> greg k-h
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies@xxxxxxxxxxxxxxxxx
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux