Welcome to IIO tasks page

This page is dedicated to students applying for GSoC/Outreachy programs.

It also aims to help newcomers getting started with the Industrial IO subsystem, offering pointers to documentation and small tasks.

For GSoC/Outreachy students:

Please use a single email thread for communication. During the application always reply to this thread if you have a question or sending the solution for a task. The email should have the following format:

subject: GSoC IIO project: Your Name

body: <short description of content: e.g Task 01 / Question about the schedule / etc> <the actual email body>

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:

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:

Task 01:

Task 02:

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/.

Task 03:

Compile iio_event_monitor:

Task 04:

Read events using iio_event_monitor

Generic buffer

Task 05:

Create triggers using configfs interface.

Task 06:

Read samples from buffer generated by the iio_dummy module.

Coding Tasks

Note for all IIO Coding Tasks:

Coding Task 1:

Clean-up idea: IIO Headers: This was previously posted to the

See description and follow-ups here:!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.

PATCH Example:

Review this recently submitted patch: staging: iio: ad9832: replace mlock with driver private lock

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.

The Directions:

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 <> (maintainer:IIO SUBSYSTEM AND DRIVERS) Hartmut Knaack <> (reviewer:IIO SUBSYSTEM AND DRIVERS) Lars-Peter Clausen <> (reviewer:IIO SUBSYSTEM AND DRIVERS) Peter Meerwald <> (reviewer:IIO SUBSYSTEM AND DRIVERS) (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 or the #linux-iio IRC channel (server

KernelNewbies: IIO_tasks (last edited 2018-02-18 15:48:08 by DanielBaluta)