Re: [PATCH] pdcraid and weird IDE geometry

From: David Zaffiro (davzaffiro@tasking.nl)
Date: Thu Jul 17 2003 - 07:19:03 EST


I don't think this has any to do with the calculation, you probably just have to use:

CONFIG_PDC202XX_FORCE=y

(well, combined with...

CONFIG_BLK_DEV_PDC202XX_NEW=y
CONFIG_BLK_DEV_PDC202XX=y
CONFIG_BLK_DEV_ATARAID=y
CONFIG_BLK_DEV_ATARAID_PDC=y

...and a lot of other options...)

With 2.4.20 the FORCE option had to be set at "n", now it should be set at "y".

> The calc_pdcblock_offset function calculates lba by taking the capacity
> of the drive and dividing it by (head * sector), multiplying the result
> times (head * sector) and subtracting the sector (SPT) count.
> Unfortunately, with the strange geometry reported by the new drive,
> using INTs to store these values will fail.

Avoiding floating-point precision, this would do the same as your calculation:

lba = ideinfo->capacity - ideinfo->sect;

However, I don't think the expression "fails". the way it is expressed now, it will divide something integer-wise and then multiply it with the same value (and then minus sect), thus I assume this was intended: To round the capacity value to the next multiple of (head * start), and then do a minus sect...

I don't think any hardcore programmer ever does a integerwise divide /before/ an integerwise multiply without a very good reason... (And don't give me that "you'd be surprised"!!!)

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



This archive was generated by hypermail 2b29 : Wed Jul 23 2003 - 22:00:29 EST