All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ben Collins <ben.collins@ubuntu.com>,
	Olivier Demarto <olivierd@sonycom.com>,
	linux-ide@vger.kernel.org
Subject: Re: [RFC/PATCH] libata and bogus LBA48 drives
Date: Mon, 29 Oct 2007 16:28:42 -0400	[thread overview]
Message-ID: <4726427A.3070106@garzik.org> (raw)
In-Reply-To: <Pine.LNX.4.62.0710292103500.9180@pademelon.sonytel.be>

Geert Uytterhoeven wrote:
> 	Hi Jeff,
> 
> A colleague noticed recent versions of Ubuntu no longer detect his 80 GB
> ST380020ACE drive. This drive is special in that it advertises LBA48 support,
> but has the lba_capacity_2 field set to zero (cfr.
> http://lkml.org/lkml/2004/3/30/163).
> 
> Upon closer look, libata indeed doesn't seem to handle this case yet.
> Below is an (untested) fix.
> 
> ---
> Subject: libata: Ignore bogus lba48 drives
> 
> Some drives (e.g. the 80 GB ST380020ACE) advertise they support LBA48, but have
> lba_capacity_2 field set to zero. This causes the drive not being detected by
> the libata driver.
> 
> Add a check for this to ata_id_has_lba48(), cfr. what is done in
> idedisk_supports_lba48().
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> NOTE: Untested due to the lack of hardware
> 
>  include/linux/ata.h |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/include/linux/ata.h
> +++ b/include/linux/ata.h
> @@ -402,6 +402,8 @@ static inline int ata_id_has_lba48(const
>  {
>  	if ((id[83] & 0xC000) != 0x4000)
>  		return 0;
> +	if (!ata_id_u64(id, 100))
> +		return 0;
>  	return id[83] & (1 << 10);
>  }

Is there any hope of getting a dump of the IDENTIFY DEVICE page?

'hdparm --Istdout /dev/DEVICE' should do the trick, for either IDE 
driver or libata.

	Jeff




  reply	other threads:[~2007-10-29 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29 20:21 [RFC/PATCH] libata and bogus LBA48 drives Geert Uytterhoeven
2007-10-29 20:28 ` Jeff Garzik [this message]
2007-10-29 21:14   ` Geert Uytterhoeven

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=4726427A.3070106@garzik.org \
    --to=jeff@garzik.org \
    --cc=ben.collins@ubuntu.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=olivierd@sonycom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.