mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	jgarzik@pobox.com, Matt_Domsch@dell.com,
	Matthew Wilcox <willy@linux.intel.com>
Subject: Re: [PATCH] ata: Add support for Long Logical Sectors and Long Physical Sectors
Date: Wed, 6 Aug 2008 10:06:47 +0100	[thread overview]
Message-ID: <20080806100647.21529284@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20080806022255.GC2055@parisc-linux.org>

On Tue, 5 Aug 2008 20:22:55 -0600
Matthew Wilcox <matthew@wil.cx> wrote:

> On Tue, Aug 05, 2008 at 09:46:51PM +0100, Alan Cox wrote:
> > > + * Some commands are specified to transfer (a multiple of) 512 bytes of data
> > > + * while others transfer a multiple of the number of bytes in a sector.  This
> > > + * function knows which commands transfer how much 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
> 
> Probably ... I did consider it, but I think I was too influenced by the
> existing READ/WRITE LONG code.
> 
> > > + * ATA supports sector sizes up to 2^33 - 1.  The reported sector size may
> > > + * not be a power of two.  The extra bytes are used for user-visible data
> > > + * integrity calculations.  Note this is not the same as the ECC which is
> > > + * accessed through the SCT Command Transport or READ / WRITE LONG.
> > > + */
> > > +static u64 ata_id_sect_size(const u16 *id)
> > 
> > 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.
> 
> I'm not sure that's necessary.  The spec says to check whether words are
> valid by doing the & 0xc000 == 0x4000 test.

What early spec says what state word 106 is in ? Healthy paranoia is a
good idea in the IDE world because its all a bit murky in the early days
and you get some quite strange ident data from early devices - one reason
for 0xC000 = 0x4000 is that some early drives use 0xFFFF for unknown words
for example!

> good migration path?  We could have the driver set a flag, or call into
> the driver from the midlayer to check whether it can cope with a
> particular sector size.

On the driver side I need to know so I can control the FIFO so I guess
knowing when you start/end planning to use large sector sizes. The driver
could do it per command but the cost is almost certainly not worth it as
I'd expect us to stick to a size. A driver method would do the trick
nicely if it could return -EOPNOTSUPP or similar.

Alan

  reply	other threads:[~2008-08-06  9:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05 17:26 LibATA support for long sectors Matthew Wilcox
2008-08-05 17:26 ` [PATCH] ata: Define new commands from ATA8 Matthew Wilcox
2008-08-05 20:10   ` Greg Freemyer
2008-08-05 17:26 ` [PATCH] ata: Add support for Long Logical Sectors and Long Physical Sectors Matthew Wilcox
2008-08-05 20:46   ` Alan Cox
2008-08-06  2:22     ` Matthew Wilcox
2008-08-06  9:06       ` Alan Cox [this message]
2008-08-06 13:11         ` Matthew Wilcox
2008-08-06 14:13           ` Alan Cox
2008-08-06 15:13             ` Matthew Wilcox
2008-08-06 15:06               ` Alan Cox
2008-08-17 23:19   ` Jeff Garzik
2008-08-18 18:15     ` Matthew Wilcox
2008-08-18 18:06       ` Alan Cox
2008-08-18 18:42         ` Matthew Wilcox
2008-08-18 18:49           ` Alan Cox
2008-08-18 19:04         ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080806100647.21529284@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=Matt_Domsch@dell.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®