Re: [PATCH] ata: Add support for Long Logical Sectors and Long Physical Sectors

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Cox
Date: Tuesday, August 5, 2008 - 1:46 pm

> + * Some commands are specified to transfer (a multiple of) 512 bytes of data

	static u32 ata_sector_or_block[]={...};

	if (test_bit(tf->cmd, &ata_sector_or_block))

looks so much more elegant than a giant switch statement and I suspect
produces far better code


word 106 is not defined in early ATA standards so it would be wise to
check that ATA8 is reported by the drive - and trust the relevant bits
for ATA7/8 as appropriate.

The drivers also need to know when a command is being issued which is a
funny shape as some hardware cannot do it because the internal state
machine knows the sector size and other stuff seems to need the internal
FIFO turning off or other things whacked repeatedly on the head to make
it work.

You also don't need to bother listing all the commands that don't have
data transfer phases as a sector size is meaningless there so we
shouldn't even bother doing a lookup for them. Indeed the more I look at
this the more it seems that keeping long complex ever out of date arrays
is the wrong way to do it.

We will also need a driver flag to indicate support in that HBA but that
is pretty trivial to add

Alan
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
LibATA support for long sectors, Matthew Wilcox, (Tue Aug 5, 10:26 am)
[PATCH] ata: Define new commands from ATA8, Matthew Wilcox, (Tue Aug 5, 10:26 am)
Re: [PATCH] ata: Define new commands from ATA8, Greg Freemyer, (Tue Aug 5, 1:10 pm)
Re: [PATCH] ata: Add support for Long Logical Sectors and ..., Alan Cox, (Tue Aug 5, 1:46 pm)