The Experimentation tasks are for you to get familiar with the IIO subsystem. You do not need to claim these via the Outreachy tasks page.
Please post all questions to firstname.lastname@example.org. IIO mentors and other applicants will respond on the list and it will serve as a troubleshooting resource for all applicants.
You can also join #linux-iio IRC channel (server irc.oftc.net) to ask questions of the IIO community.
Please email your solutions to amsfield22 at gmail dot com and daniel.baluta at gmail dot com. Your email should have the subject Task XX: Short task description
Experimenting with IIO subsystem
For this we will use two kernel modules found in drivers/iio/dummy:
Dummy modules compilation
You need to select the following config options:
CONFIG_IIO_DUMMY_EVGEN - for building iio_dummy_evgen kernel module
CONFIG_IIO_SIMPLE_DUMMY - for building iio_dummy kernel module
CONFIG_IIO_CONFIGFS - for creating the dummy device under configfs
Mount the configfs filesystem: read Documentation/iio/iio_configfs.txt
Use the following commands for modules compilation:
Use the following commands for module loading:
Use the following command to create your dummy device under the configfs filesystem:
IIO event monitor
IIO event monitor is an user space example application which reads events from IIO layer and pretty prints the results. Implementation can be found in iio_event_monitor.c under tools/iio/.
Read events using iio_event_monitor
run iio_event_monitor without arguments to figure out how it should be used
read events from iio_dummy module
send us the commands used to read/generate the events
Create triggers using configfs interface.
read Documentation/iio/iio_configfs.txt in order to create an hrtimer software trigger named t1.
where in the sysfs hierarchy does the trigger resides?
sends us the commands used to create the trigger
Read samples from buffer generated by the iio_dummy module.
compile iio_generic_buffer.c from tools/iio. This program will be used to read data from buffer.
have a look at ./iio_generic_buffer -h options. You will use the trigger t1 created with the previous tasks and iio_dummy_part_no for IIO device.
send us the full command history
Note for all IIO Coding Tasks:
Coding Task 1:
Clean-up idea: IIO Headers: This was previously posted to the email@example.com
See description and follow-ups here: https://groups.google.com/forum/#!topic/outreachy-kernel/LtI90_SwjHE
I believe this task is completed or close to being completed. If you find a driver which you think applies here, be sure to search for it in the outreachy group mailing list to see if it has already been done or disregarded.
Coding Task 2:
Coding Task 2: Remove driver usages of mlock
The locking scheme in the IIO subsystem includes a lock in the iio_dev structure called mlock. The usage of iio_dev->mlock is being redefined as protecting operating mode changes - as in changes between BUFFER* and DIRECT modes.
Notice how the struct iio_dev fields are labelled [INTERN] or [DRIVER]. The mlock will revert to an [INTERN] field once all the non-conforming usages are removed from drivers. The IIO core functions in (drivers/iio/industrialio-*.c) will be the only users of mlock. Drivers will use helper functions to control operating mode changes.
That's a bunch of background that you don't need to totally grasp to do this task, but it's nice to see the bigger picture.
The piece of the migration this task focuses on is removing the usages of mlock that don't meet the new model. I suspect we'll find that these drivers were using mlock as it was previously defined: "to protect simultaneous device *state* changes." Typically this means they are changing some configuration bits in the hardware. Those changes are important to protect, just do it with a driver private lock, not mlock.
Review this recently submitted patch: staging: iio: ad9832: replace mlock with driver private lock http://marc.info/?l=linux-iio&m=148943215125820&w=2
This is probably the simplest case patch for this task. I want to emphasize simple, because I did pass over a few others on my way to creating an example patch. I saved the more interesting drivers for you
Jonathan pleads: "Make sure that they fully review the locking whilst at it though as chances are some of it may be less than ideal!"
You may uncover issues with the usage or placement of locks in general. Take the time to understand the usage of the locks. This is not intended as a search&replace exercise.
Your reviewer may notice other things that need tidying up. If they're not immediately required for this patch, save it for a follow up patch.
Your mission is to remove the usage of mlock from the IIO drivers in staging. A simple 'git grep mlock' finds the drivers and I've posted that list on the Outreachy tasks page.
Please sign up for one driver at a time, take it all the way through ACK, before selecting another one. Be sure to follow along as these are posted and learn from others patches.
Sign up is on the OutreachyTaskPage
PATCHES need to be sent to all of:
the IIO Maintainer, IIO Reviewers, and IIO Mailing List,
Jonathan Cameron <firstname.lastname@example.org> (maintainer:IIO SUBSYSTEM AND DRIVERS) Hartmut Knaack <email@example.com> (reviewer:IIO SUBSYSTEM AND DRIVERS) Lars-Peter Clausen <firstname.lastname@example.org> (reviewer:IIO SUBSYSTEM AND DRIVERS) Peter Meerwald <email@example.com> (reviewer:IIO SUBSYSTEM AND DRIVERS) firstname.lastname@example.org (open list:IIO SUBSYSTEM AND DRIVERS)
and, for good measure, Jonathan likes to make sure the original Author(s) are directly copied on all patches. So, grab the MODULE_AUTHOR found at the tail end of the driver source.
Post questions to email@example.com or the #linux-iio IRC channel (server irc.oftc.net).