linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH]:  Sanity checking for drives that claim to be LBA-48, but aren't!
@ 2002-10-17 10:02 James Finnie
  0 siblings, 0 replies; 4+ messages in thread
From: James Finnie @ 2002-10-17 10:02 UTC (permalink / raw)
  To: 'ebiederm@xmission.com', James Finnie
  Cc: 'linux-kernel@vger.kernel.org', 'andre@linux-ide.org'

 
> There are also a set of bits that reports which revs of the 
> ATA standard
> a drive complies with.  Should we check that one as well?  
> 
> Eric
>  

Knowing my luck, those bits are probably broken on my drives too :)

Sounds like common sense though.  I don't pretend to know enough about how
the IDE driver works in order fix it... Andre? :) 


James


Oh, appologies to everyone for the line-wrapped patch, M$Exchange has *LOTS*
to answer for.  If you want the patch without line-wraps, email me and I'll
send it as an attachment.  Didn't want to polute the list.
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Imerge Limited                          Tel :- +44 (0)1954 783600 
Unit 6 Bar Hill Business Park           Fax :- +44 (0)1954 783601 
Saxon Way                               Web :- http://www.imerge.co.uk 
Bar Hill 
Cambridge 
CB3 8SL 
United Kingdom 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH]:  Sanity checking for drives that claim to be LBA-48, but aren't!
  2002-10-17  9:02 James Finnie
  2002-10-17  9:35 ` Eric W. Biederman
@ 2002-10-17 10:26 ` Andries Brouwer
  1 sibling, 0 replies; 4+ messages in thread
From: Andries Brouwer @ 2002-10-17 10:26 UTC (permalink / raw)
  To: James Finnie
  Cc: 'linux-kernel@vger.kernel.org', 'andre@linux-ide.org'

On Thu, Oct 17, 2002 at 10:02:00AM +0100, James Finnie wrote:

> Upon investigation of this with Seagate, it turns out that the firmware
> version in question is for CE (consumer electronics) use.  They have used
> bit 10 of word 86 (0x56) of the IDENTIFY DEVICE information to indicate some
> feature in their "AV streaming data transfer set".  This breaks ATA-7, which
> says this bit indicates that the drive understands LBA-48 commands.  
> 
> The kernel sees this bit set, tries to use LBA-48 commands, and the drive
> errors, complaining that it doesn't understand!  Meaning this drive is
> unusable with the >=2.4.19 kernels.  I think at least one other person has
> reported something very similar, IIRC with a very old Maxtor IDE drive.

Could you post the identify data for your disks? (cat /proc/ide/*/identify)

Andries

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH]:  Sanity checking for drives that claim to be LBA-48, but aren't!
  2002-10-17  9:02 James Finnie
@ 2002-10-17  9:35 ` Eric W. Biederman
  2002-10-17 10:26 ` Andries Brouwer
  1 sibling, 0 replies; 4+ messages in thread
From: Eric W. Biederman @ 2002-10-17  9:35 UTC (permalink / raw)
  To: James Finnie
  Cc: 'linux-kernel@vger.kernel.org', 'andre@linux-ide.org'

James Finnie <jf1@IMERGE.co.uk> writes:

> The kernel sees this bit set, tries to use LBA-48 commands, and the drive
> errors, complaining that it doesn't understand!  Meaning this drive is
> unusable with the >=2.4.19 kernels.  I think at least one other person has
> reported something very similar, IIRC with a very old Maxtor IDE drive.
> 
> Here is a patch that does some basic sanity checking.  If the drive has an
> lba_capacity_2==0, and has the bit set claiming to be LBA-48, it ignores
> this claim.
> 
There are also a set of bits that reports which revs of the ATA standard
a drive complies with.  Should we check that one as well?  

Eric
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH]:  Sanity checking for drives that claim to be LBA-48, but aren't!
@ 2002-10-17  9:02 James Finnie
  2002-10-17  9:35 ` Eric W. Biederman
  2002-10-17 10:26 ` Andries Brouwer
  0 siblings, 2 replies; 4+ messages in thread
From: James Finnie @ 2002-10-17  9:02 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'; +Cc: 'andre@linux-ide.org'

Hi guys,

I had previously posted about a relatively new Seagate drive that had worked
prior to 2.4.19, but in 2.4.19 failed to identify it's geometry properly. 

http://marc.theaimsgroup.com/?l=linux-kernel&m=103253071519548&w=2

Upon investigation of this with Seagate, it turns out that the firmware
version in question is for CE (consumer electronics) use.  They have used
bit 10 of word 86 (0x56) of the IDENTIFY DEVICE information to indicate some
feature in their "AV streaming data transfer set".  This breaks ATA-7, which
says this bit indicates that the drive understands LBA-48 commands.  

The kernel sees this bit set, tries to use LBA-48 commands, and the drive
errors, complaining that it doesn't understand!  Meaning this drive is
unusable with the >=2.4.19 kernels.  I think at least one other person has
reported something very similar, IIRC with a very old Maxtor IDE drive.

Here is a patch that does some basic sanity checking.  If the drive has an
lba_capacity_2==0, and has the bit set claiming to be LBA-48, it ignores
this claim.

I think this should go into the kernel, but I don't have any LBA-48 kit to
check that I'm not breaking things for other people.  Hope this helps anyone
else scratching their heads with drives that used to work.  


James Finnie


Standard disclaimer: it works for me, use at your own risk.

--BEGIN PATCH

diff -Naur linux-2.4.19/drivers/ide/ide-disk.c
linux-2.4.19-lba48sanity/drivers/ide/ide-disk.c
--- linux-2.4.19/drivers/ide/ide-disk.c Sat Aug  3 01:39:44 2002
+++ linux-2.4.19-lba48sanity/drivers/ide/ide-disk.c     Thu Oct 17 09:51:10
2002
@@ -924,6 +924,15 @@
        unsigned long long capacity_2 = capacity;
        unsigned long long set_max_ext;

+       // if the disk claims to be LBA-48, and yet has a capacity of 0,
+       // it's fairly safe to say that the firmware doesn't comply with
ATA-7
+       if ((id->cfs_enable_2 & 0x0400) && (id->lba_capacity_2==0)) {
+               printk ("%s: Broken firmware - this is NOT an LBA-48
drive!\n",drive->name);
+               printk ("%s: Disabling LBA-48 addressing for this
drive\n",drive->name);
+               //reset bit 10 so that we can use the disk in a non LBA-48
fashion
+               id->cfs_enable_2 &= ~ 0x0400;
+       }
+
        drive->capacity48 = 0;
        drive->select.b.lba = 0;

--END PATCH





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Imerge Limited                          Tel :- +44 (0)1954 783600 
Unit 6 Bar Hill Business Park           Fax :- +44 (0)1954 783601 
Saxon Way                               Web :- http://www.imerge.co.uk 
Bar Hill 
Cambridge 
CB3 8SL 
United Kingdom 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-17 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-17 10:02 [PATCH]: Sanity checking for drives that claim to be LBA-48, but aren't! James Finnie
  -- strict thread matches above, loose matches on Subject: below --
2002-10-17  9:02 James Finnie
2002-10-17  9:35 ` Eric W. Biederman
2002-10-17 10:26 ` Andries Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).