Author Archives: Lidza

Dan Carpenter had recommended I use smatch to pick up more small warnings. It is like Sparse.

How to get and use Smatch:

git clone git://
cd smatch
cd ~/kernel/src/
~/smatch/smatch_scripts/kchecker drivers/staging/dgnc/dgnc_tty.c

I’m still working on the warnings caught by this program. >_<

Today I learned how to use sparse. It is a great tool that picks up warnings that aren’t caught by the compiler.

Getting Sparse on Ubuntu:

sudo apt-get install sparse

How to use sparse:

make M=drivers/staging/dgnc/ C=1

The types of warnings that I got from sparse for this driver were about adding markers and changing the types of variables. For example, some variables need the “marker” __iomem (it is used by the kernel to keep track of how memory is being used). No warning would pop up when compiling the code like normal. Sparse catches these problems.

Sparse is like the grammar police. =]

I UNDERSTAND THE CODE~! Whoot! I’m really proud of myself. I printed all the *.c files and was reading them a lot and looking for the corresponding functions in the linux API to wrap my head around the code and see where the API has changed. Its very time consuming. All the code I printed is about 100 pages. And that’s just the *.c files. I’ve learned a lot about how driver code latches onto the kernel and gets off it too. Its pretty awesome. Lots of abstractions are involved, but everything is properly named and well documented (at least in the code =]).

I’ve been reading and re-reading sections of Linux Device Drivers and Linux Kernel Development to understand the code. These two books have been very helpful.

I’ve also been spending tons of time debugging. I knew a little, but not much about how to debug.

All in all, its been great. I’m halfway thru the internship, and very proud of myself. =]

Okay, I got a driver I’m working on~! Whoot~! I’m excited. I’m in the process of getting it into the kernel. The driver I’m going to be working on is the dgnc driver, its a driver that works on Driver for the Digi International Neo and Classic PCI based product line. It includes hardware like this:

I’ve run into problems with:

1) not integrating it into the kernel correctly.

2) not having it build at all. no *.o file.

I will keep reading and working on this driver.

“Impostor syndrome describes a situation where someone feels like an imposter or fraud because they think that their accomplishments are nowhere near as good as those of the people around them. Usually, their accomplishments are just as good, and the person is being needlessly insecure. It’s especially common in fields where people’s work is constantly under review by talented peers, such as academia or Open Source Software.”

When I’m stressed out, I’m already in a vulnerable place. And start to doubt how awesome I am at what I do. And when I’m stressed out I need time for myself to think about things. Some people feel better if they watch TV, play a game or something. For me, those are distractors. When I’m stressed I need to take the time so I can figure out exactly what’s wrong and why it bothers me so much. Otherwise the same problem will come up again (most likely worse than it was before as I’ve learned this week) and I’ll keep going thru this cycle of feeling stressed then distracting myself then being stressed again with the stress becoming worse and worse each time around.

I had a medical procedure earlier last week. Its my third one in a year, and I had a biopsy and a physical exam. Nothing’s wrong and I’m healthy. But, I really dislike it and I didn’t realize it or admit it to myself until last week. I need some time to heal. And in taking that time then the impostor syndrome becomes more apparent. I feel like a loser/failure for not working 24/7 because otherwise people will think I don’t know what I’m doing. I beat myself up for taking time for myself. Then I become more stressed for beating myself up. And the cycle continues…

So yea, that’s what I’m dealing with right now. Hopefully this explains a little about me and helps someone else dealing with these kinds of things.

Him: It seems I am an amazing listener to all my friends. I’m a good person or something.

Me: You are a good person or whatever.

The Netlogic and ASUS Oled aren’t really going anywhere. And this week I decided I want to start working on the Comedi driver.

Also I’ve been reading a ton. I finished everything Greg suggested I read from the Documentation folder this week (plus some files that seemed interesting) and I’m now reading “The Linux Command Line” by William E. Shotts Jr. and “Linux Kernel Development” by Robert Love (per recommendation of cosmoecho). The Linux Command Line is a pretty easy read, I’ve been going thru it very quickly at home and on the train and bus. But Linux Kernel Development requires a lot more attention. I re-read parts that I’ve already read and look up definitions of terms online. I’ve been understanding it so far, but I end up needing to pause every 45mins to hour of reading the text to absorb the information. I spend the “pause” time reading The Linux Command Line since its a much lighter read.

I enjoy reading the books and looking at the code that accompany it to see it in action (and see how the code changed since the book was published). Plus I’ve had a few experiences where the author explained the code, I didn’t really understand it, then I looked at the code, and the reading finally made sense.

I guess a block of code is worth 1000 words.

The kernel, although its still a beast, doesn’t look daunting any more after spending the time reading these texts. The kernel looked like chaos to me, and now I’m beginning to see its structure. I feel more confident about my ability to code and hack the kernel (still battling that “Impostor Syndrome”). I have tons of resources to help me, and I can always ask people look if I need help understanding something. =]

Plus this week was the week of the 4th. Whoot~!

I went to a Ruby on Rails workshop yesterday and today at Thoughtbot, it was awesome. We built an twitter-like application called “shout”. These are the features it had:
- User Sign In, Sign Out, Sign Up
- Streams of “shouts” on a homepage called the “dashboard”
- The ability to follow users
- We touched a little on test driven development, which is awesome!
- Spent a large portion emphasizing the importance of relationships in data
- And we were taught how to implement searches in our application.

I learned a lot. =]

The device drivers I’m going to be working on starting will be:

  • asus_oled – Its a small driver for a small display monitor. I think it would be really fun/interesting to work on. It has a TODO list I can follow along with.
  •  netlogic – its small network driver, I’ll learn more about how network drivers work by working on it, and it has a TODO list I can follow.

I’m really excited about these projects because I’ll be playing with hardware. WHOOT!!

So I made a pretty extended list of with the status and  fixes that they need. For some, I wasn’t sure how to summarize them aside from actually saying what needed to be done for each one.


The format is Name: Type of Fixes (Description of fixes) – Size of


Drivers without a TODO:

Without Maintainer:

I don’t know where these drivers are going; there aren’t any maintainers or a TODO to reference to.

csr (largest) – cxt1e1 – et131x – goldfish – line6 – octeon – phison (hasn’t been updated in over a year) – quickstart – rtl8192u –  sb105x – serqt_usb2 – slicoss – wlan-ng – zram -zsmalloc

With Maintainer:

dwc2 – usbip – vme


Drivers with a TODO without a maintainer:

May need more fixes than mentioned.

  • dgrp: minor fixes (use configfs for config stuff, dgrp_send() and dgrp_receive() could use some refactoring, shouldn’t automatically create CHAN_MAX (64) channel array entries for every device as many devices are going to have much less than 64 channels, the locking needs to be checked, check Kconfig dependencies) – 30.4KB

  • fwserial: major fixes (implement retries for RCODE_BUSY, RCODE_NO_ACK and RCODE_SEND_ERROR, implement _robust_ console on top of this, expose means of controlling attach/detach of peers via sysfs), minor fixes (unregistered vendor id can be a define in firewire.h)- 1.2KB

  • gdm72xx: minor fixes (replace kernel_thread with kthread in gdm_usb.c, replace hard-coded firmware paths with request_firmware in sdio_boot.c and usb_boot.c, clean up coding style to meet kernel standard)- 11.5KB

  • rts5139: major fixes (support more USB card reader of Realtek family, use kernel coding style, fixes, stop having thousands of lines of code duplicated with staging/rts_pstor, this driver contains an entire SD/MMC stack — it should use the stack in drivers/mmc instead; see drivers/mmc/host/ushc.c as an example, this driver presents cards as SCSI devices, but they should be MMC devices) – 42.1KB

  • silicom: minor fixes ( cleanups, locking audit, single module with all functionality, userland, fix monolithic build) – 56.8KB


(Almost) Ready to be Reviewed:

  • echo: send to lkml for review – 4KB

  • frontier: Almost ready, minor fixes (sparse clean, fix userspace interface to be sane, possibly just port to userspace with libusb), review by the USB developer community – 3.5KB

  • keucr: minor fixes (smcommon.h & smilsub.c: use kernel hweight8(), hweight16(), determine if the driver should not be using a duplicate version of the usb-storage scsi interface code, but should be merged into the drivers/usb/storage/ directory and infrastructure instead) Review by the USB developer community – 197.9KB

  • ozwpan: minor fixes (convert event tracing code to in-kernel tracing infrastructure, check for remaining ioctl & check if that can be converted into sysfs entries, convert debug prints to appropriate dev_debug or something better, modify Kconfig to add CONFIG option for enabling/disabling event tracing, check USB HCD implementation is complete and correct, testing with as many devices as possible.) Code review by USB developer community. – 8KB


Needs to merged and deleted:

  • rtl8192e: Clean up function naming. Merge into drivers/net/wireless/rtllib/rtl8192e. – 14.8KB


Waiting for something:

  • cptm1217: – wait for the official upstream general clearpad drivers as promised over the past few months, merge any device support needed from this driver into it – delete this driver – 1.3KB

  • imx-drm: Many major fixes (add features, factor out code to common helper functions, and more.) Waiting for common display framework to hit mainline and update the IPU – 2.5KB

  • sbe2t3e3: Additional cleaning and tests. Wait for the new configuration interface in generic HDLC layer and when available, convert the driver to it – 27.1KB

  • ste_rmi4: Wait for the official upstream synaptics rmi4 clearpad drivers as promised over the past few months. Merge any device support needed from this driver into it. Delete this driver. (No maintainer) – 718B


Drivers with a TODO with a maintainer:

  • android: Needs minor fixes (ensure they build as modules, add proper arch dependencies as needed, audit userspace interfaces to make sure they are sane) – 25.3kb

  • asus_oled: Needs minor fixes (audit the userspace interface: sysfs vs. char?, needs Documentation/ABI/, add sample .txt files and README file) – 3.8kb

  • bcm: Needs major fixes (/dev/tarang API should be replaced, Qos and queue model is non-standard and inflexible, support more than one board), and minor fixes (eliminate global variables, remove developer debug BCM_DEBUG() macros, add a limited number of messages through netif_msg(), fix non-standard kernel style, use request firmware, fix use of file I/O to load config with better API, merge some files together, cleanup/eliminate debug messages) – 2.1MB

  • ced1401: Needs minor fixes (build warning fixups, ioctl auditing, usb api auditing,  proper USB minor number) – 357.4KB

  • comedi: Needs minor fixes (Lindent,  remove all wrappers,  audit userspace interface, reserve major number, cleanup the individual comedi drivers as well) – 3.6KB

  • crystalhd: Needs minor fixes (testing, cleanup return codes, cleanup typedefs, allocate an accelerator device class specific major number) – 95.9KB

  • ft1000: Needs minor fixes(sparse fixes, coding style, adapt to latest usb and pcmoa api changes, change firmware loading for usb driver to proper kernel method [request_firmware]) – 8.7KB

  • iio: Needs lots of major fixes.

  • netlogic: Needs minor fixes (implementing 64bit stat counter in software, all memory allocation should be changed to DMA allocations, all the netdev should be linked to single pdev as parent, changing comments in to linux standard format) – 30.8KB

  • nvec: major fixes (add compile as module support, move half of the nvec init stuff to i2c-tegra.c, move event handling to nvec_events, finish suspend/resume support, modifiy the sync_write method to return the received, message in a variable (and return the error code), add support for more device implementations, THIS IS AN INCOMPLETE LIST) – 2.5KB

  • olpc_dcon: Needs major fixes (see if vx855 gpio API can be made similar enough to cs5535 so we can share more code, allow simultaneous XO-1 and XO-1.5 support, console event notifier support, drop global variables, use a proper olpc_dcon_priv struct, audit code for unnecessary code; old unsupported prototype, workarounds, ancient variables (noaa?), etc, verify sane i2c API usage, update to new stuff if necessary) – 1.8KB

  • panel: Needs minor fixes (Lindent, review major/minor usages, review userspace api, see if all of this could be easier done in userspace instead) – 1.2KB

  • rtl8187se: Needs minor fixes (switch to use LIB80211, switch to use MAC8021, use kernel coding style, fixes, sparse fixes, integrate with drivers/net/wireless/rtl818x), and major fixes (prepare private ieee80211 stack for merge with rtl8192su’s version, switch to use shared “librtl” instead of private ieee80211 stack)

  • rtl8712: Needs minor fixes (merge Realtek’s bugfixes and new features into the driver, switch to use LIB80211, switch to use MAC80211, fixes – only a few remain) – 225.6KB

  • sep: Has an incomplete list of TODOs. Clean up unused ioctls. Clean up unused fields in ioctl structures – 2.6KB

  • sm7xxfb: Needs major fixes (dual head support, 2D acceleration support), and minor fixes (use kernel coding style, refine the code and remove unused code, move it to drivers/video/sm7xxfb.c) – 3.3KB

  • speakup: Lots of issues that need to be resolved by the developers. Issues explained in the TODO.- 31.3KB

  • tidspbridge: 10 minor fixes, Migrate to existing upstream code such as iommu, wdt, mcbsp, gptimers.

  • ti-soc-thermal: minor fixes (Revisit PM support, revisit need for locking, make sure this code works on OMAP4430, OMAP4460 and OMAP5430) – 1.8KB

  • vt6655: 15 minor fixes (like add common vt665x infrastructure, kill ttype.h, switch to use LIB80211, switch to use MAC80211, verify unsigned long usage for x86-64 arch, reduce .data footprint, pli) – 2.1MB

  • vt6656: 13 minor fixes (similar to vt6655) – 5.3MB

  • winbond: Suffers from severeCamelCaseInfestation. Other minor fixes (remove unused ioctls, use cfg80211 for regulatory stuff, fix 4k stack problems, fix locking problems)- 234.7KB

  • wlags49_h2: Possibly becoming obsolete. Lots of major fixes. – 2.2MB

  • wlags49_h25: Same state as wlags49_h2. – 5.4KB

  • xgifb: minor fixes(tons of clean ups, sort out dup ids with SiS driver, remove seless/wrong/unused #ifdef/code/…, fix printk usages, get rid of non-linux related stuff) – 79.3KB

  • zcache: Plans are moving along to get it out of staging. Some major fixes.  - 4KB