The last 3 weeks

I haven’t written here in a while, mostly because of some final university-related things I had to do the past few weeks. On the bright side, as of yesterday I have a bachelor’s degree (with honors) in computer science. On the other hand, I haven’t had as much time as I’d like for the internship. I feel pretty bad about it, but hopefully I’ll be able to make up for it now that I’m done with school.

So I’ll describe what I have managed to do in the internsip the past 3 weeks.

3 weeks ago I went over all the drivers in the kernel’s staging tree (drivers/staging/). Currently that’s 118 drivers total, but the number changes all the time, as new drivers are added and current ones are either cleaned up and moved to their proper place in the kernel, or deleted as no one’s working on them. I had two goals: 1) to see which drivers haven’t been worked on in over a year, and are therefore candidates for removal, and 2) to see which drivers I’d like to work on to clean them up.

I used the git history for the first goal. Mostly I used the following command for each driver:

git log --format="%<(8)%C(yellow)%h %<(22)%Cgreen%ar %<(22)%Cblue%an %Creset%s" --no-merges driverdir/

The format looks a bit messy, but it just displays the commit ID, author, subject line, and how long ago the change was made, in a nicely aligned, readable and colored way. For each driver, I tried to check if it looked like someone had actually tried to move the driver out of staging in a year, by either completing things in the driver’s TODO list or doing other “substantial” improvements. This means that fixes to checkpatch, sparse, and Coccinelle warnings didn’t count.

In the end I found 48 drivers that seemed to be abandoned. 20 of those were in staging/iio/ (the “Industrial I/O” subsystem), and 4 in staging/media/ (the media subsystem).

As for the second goal, I mostly used the driver’s description in the Kconfig file, checked the TODO file (if it had one), and occasionally superficially read the code (function names etc.) to get an idea of what kinds of things the driver does. For most of the drivers I had to search and read about them online too, because their descriptions were pretty uninformative, and also because I don’t know that much about different types of devices. It was a great learning experience though.

In the end I came up with 5 “categories” of drivers I thought I would most enjoy working on. When choosing these, I focused on the types of drivers that were in staging but hadn’t been worked on too much. In no particular order:

  • network – this included drivers for 5 network cards in staging, 4 WiFi and one ethernet
  • media & video – including drivers for a TV tuner, an FM radio receiver, infrared remote controls, a video processing frontend, and a video decoder
  • display & graphics – including drivers for a text-based LCD panel, a One Laptop per Child display controller, and a framebuffer for a graphics card
  • sensors – drivers in the IIO subsystem, including drivers for accelerometers, gyroscopes, impact sensors, light & proximity sensors, and analog to digital converters
  • other – a couple of other interesting drivers for a card reader, an nVidia embedded controller, and a NAND flash device

Out of these, Greg (my mentor) thought that sensors/IIO would be my best long-term bet, as most of the other drivers were one-off types and their hardware would be difficult to acquire (except media drivers, he isn’t familiar with them). I think this is a great idea, sensors sound like a lot of fun to experiment with.

So that’s what I did 3 weeks ago. Then 2 weeks ago I took a week off to deal with school things. I had an exam, prepared for a final presentation in front of a tough committee, dealt with feedback for my bachelor’s thesis, things like that.

Last week I returned to continue work in the internship. I’d expected Greg to contact the maintainers of the abandoned drivers, but instead he thought I should do it. I wrote a form letter to send them all, and got the names and email addresses of the maintainers from either the TODO and MAINTAINERS files, or if they didn’t have anyone in there then I just got the person who first added the driver to the kernel. To be honest, it’s pretty scary to be contacting these people, as some of them have been involved with Linux for a very long time, and I’m still so new here.

Greg also contacted the IIO maintainer (Jonathan Cameron) to ask what still needs to be done with the IIO drivers left in staging, so that I could help clean them up. Jonathan had some initial ideas that I will be starting work with soon, and other people in the IIO mailing list (which was Cc’d on the initial email) have offered their ideas too.

As a sidenote, I found it interesting that the entire IIO mailing list was Cc’d on the email. I’m not used to this kind of transparency, and I’m liking it a lot. In general, I feel like everything is done very “publicly” in the kernel, and I think that’s really cool. It contrasts with several other projects that I’ve worked on (at university and at jobs) where lots of things that weren’t done right were “hidden” from others, and denied, and sometimes even outright lied about. And I was always expected to do the same and I hated it.

This week I put together all the emails I’ll be sending out to the maintainers of the abandoned drivers. I sent 5 out yesterday, and got some responses, and will send the rest out soon. Also, the discussion about which IIO tasks I’ll be working on is still ongoing.

Maybe the main thing that worries me about the internship right now is that with some of the responses I’m getting from either the IIO people or the maintainers of the abandoned drivers, I don’t really know what they’re talking about, and more importantly, if I’m supposed to know. I mean, if they didn’t clarify, then it must mean that they expect me to know, right? So I end up wondering if I should go and spend hours trying to find out, or just ask them what they meant and risk sounding like an idiot. And some of this stuff feels like it should be done by a longtime contributor who is known in the community, not a newb like me. Well, at least it’s challenging.

As for the internship as a whole, it’s been pretty different than what I expected. I thought I’d mostly be writing code, but I haven’t done that at all so far. There’s a lot of people interaction right now, which honestly I think is more difficult for me, but it also builds confidence (I hope), so that’s good.

And that’s it for now. This post turned out much longer than I expected, but I guess that’s what happens when you don’t write for several weeks. I’ll try to be more frequent from now on.