lkml.org 
[lkml]   [2000]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch] Cleanup struct gendisk registration, 2.3.40-pre1
On Sun, Jan 16, 2000 at 07:31:36PM -0500, Alexander Viro wrote:

> Good driver should not do partition-table reads in the first place.

Indeed. There are a few that in order to return a geometry in scsi_biosparam
or so read the partition table. This is altogether silly and wrong.

(For a hundred reasons, but I need not explain them to you.)

If you cut out each of these instances, I'll be happy.

> Period. And frankly, the more I'm looking through that code the more I
> believe that _any_ nontrivial conventions will be broken/misunderstood/
> forgotten/not propagated by 10-20 percents of drivers. The fewer things
> we have to leave for driver, the less fuckups we will get. If you don't
> believe me - look through the drivers and compare.

You are right in practice, but that is our fault, not the driver writer's.

What one would like is a formal description of the global invariants.
What the obligations of all routines are.
If there is such a description, then every driver writer will go through
his code with these rules in hand to verify that his code complies.
But presently the rules are only in the minds of some people.
The way to write a driver is to take another one that works, copy it,
modify the obvious things, test a little and release it.
Alessandro's book will help in understanding what this other driver does,
but is far from a formal specification.

As long as we do not provide the rules you cannot blame driver writers.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [from the cache]
©2003-2011 Jasper Spaans