driver questions

Greg Freemyer greg.freemyer at gmail.com
Wed Nov 21 18:59:35 EST 2012


On Wed, Nov 21, 2012 at 1:11 PM, Christopher Biessener
<christopherpb at voomtech.com> wrote:
> I have searched using google for information regarding linux driver
> development and have found a lot, but not the answers to these questions:
> * Can 2 different kernel drivers access the same device at the same time?
> * Is every driver known as a kernel module?
>
> Basically I need advice on if I can and how to sidestep some of the
> libata device calls.  We do not want to replace the entire libata, just
> some of it.

libata is extremely extensible in exactly that fashion.

When you define a new driver the templates define pointers to default
routines that do everything as far as interacting with the hardware.

If you only want to replace one routine, then you just write your new
routine and update the pointer to point to your routine and not the
default one.

> We have a custom piece of hardware that writes to hard
> drives.  When we use another one of our devices to act as the host the
> client device runs at full speed.  When we run the python GUI with our
> custom C++ extension using only SATA ports on the motherboard the
> program runs at full speed.  But when we use the python GUI to drive our
> custom hardware we lose 40% of the speed.  We believe the speed loss to
> be in how libata optimizes how it sends commands/data to the hard
> drive/device.

That sounds more invasive than I expected.

I'm not 100% sure if that will be as easy as I described or not.  I
would take a look at some of the libata drivers that override some of
the routines and see if you have the flexibility you need.

If not, the libata mailing list is pretty quite these days.  Just ask
questions there about what you want to do.  The main libata devs are
Jeff Garzik, Heo Tejun, and Alan Cox so answers from any of them
should be authoritative.

It may be that a more modular approach may need to be implemented.  If
so, I suspect they will cooperate assuming at the end you will add
your code to the main kernel tree.

"IDE/ATA development list" <linux-ide at vger.kernel.org>,

As with most lkml list, subscribing is not required to post and
reply-all is the default user behavior.

> Thanks in advance,
>
> Christopher

Good Luck
Greg



More information about the Kernelnewbies mailing list