mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [BUG] ata: disk_ata_drive: SSD drive doesn't pass check for ata id validity
@ 2015-10-29 13:04 Peter Mamonov
  2015-10-30  7:31 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Mamonov @ 2015-10-29 13:04 UTC (permalink / raw)
  To: Barebox List

Hi!

Barebox refuses to deal with OCZ-VERTEX4 ssd sata drive, because:
	ata1: ata id invalid

This error is triggered by the following piece of code :

static int ata_id_is_valid(const uint16_t *id)
{
	if ((id[ATA_ID_FIELD_VALID] & 1) == 0) {
		pr_debug("Drive's ID seems invalid\n");
		return -EINVAL;
	}

	return 0;
}

The "id" is a sector-sized block of bytes, received after
issuing ATA_CMD_ID_ATA command.

If I remove this check, the drive works fine.

Can someone with better knowledge of ATA standard comment on this
issue?

Regards,
Peter

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG] ata: disk_ata_drive: SSD drive doesn't pass check for ata id validity
  2015-10-29 13:04 [BUG] ata: disk_ata_drive: SSD drive doesn't pass check for ata id validity Peter Mamonov
@ 2015-10-30  7:31 ` Sascha Hauer
  2015-10-30  8:53   ` Juergen Borleis
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2015-10-30  7:31 UTC (permalink / raw)
  To: Peter Mamonov; +Cc: Barebox List, Juergen Borleis

+Cc Juergen

On Thu, Oct 29, 2015 at 04:04:09PM +0300, Peter Mamonov wrote:
> Hi!
> 
> Barebox refuses to deal with OCZ-VERTEX4 ssd sata drive, because:
> 	ata1: ata id invalid
> 
> This error is triggered by the following piece of code :
> 
> static int ata_id_is_valid(const uint16_t *id)
> {
> 	if ((id[ATA_ID_FIELD_VALID] & 1) == 0) {
> 		pr_debug("Drive's ID seems invalid\n");
> 		return -EINVAL;
> 	}
> 
> 	return 0;
> }
> 
> The "id" is a sector-sized block of bytes, received after
> issuing ATA_CMD_ID_ATA command.
> 
> If I remove this check, the drive works fine.
> 
> Can someone with better knowledge of ATA standard comment on this
> issue?

Juergen, do you have an idea what this check is for? Neither U-Boot nor
the Kernel seem to ever check for bit 0 in this field.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG] ata: disk_ata_drive: SSD drive doesn't pass check for ata id validity
  2015-10-30  7:31 ` Sascha Hauer
@ 2015-10-30  8:53   ` Juergen Borleis
  2015-10-30 10:06     ` Peter Mamonov
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Borleis @ 2015-10-30  8:53 UTC (permalink / raw)
  To: barebox; +Cc: Peter Mamonov

On Friday 30 October 2015 08:31:04 Sascha Hauer wrote:
> On Thu, Oct 29, 2015 at 04:04:09PM +0300, Peter Mamonov wrote:
> > Hi!
> >
> > Barebox refuses to deal with OCZ-VERTEX4 ssd sata drive, because:
> > 	ata1: ata id invalid
> >
> > This error is triggered by the following piece of code :
> >
> > static int ata_id_is_valid(const uint16_t *id)
> > {
> > 	if ((id[ATA_ID_FIELD_VALID] & 1) == 0) {
> > 		pr_debug("Drive's ID seems invalid\n");
> > 		return -EINVAL;
> > 	}
> >
> > 	return 0;
> > }
> >
> > The "id" is a sector-sized block of bytes, received after
> > issuing ATA_CMD_ID_ATA command.
> >
> > If I remove this check, the drive works fine.
> >
> > Can someone with better knowledge of ATA standard comment on this
> > issue?
>
> Juergen, do you have an idea what this check is for? Neither U-Boot nor
> the Kernel seem to ever check for bit 0 in this field.

Seems this bit was meaningful in earlier days: it marked the ID member in the 
structure returned by the disk as valid (=1) or invalid (=0). In the meantime 
it seems obsolete. The last occurrence I found is in the Linux kernel in 
file "drivers/block/mg_disk.c". All other code which checks this register 
content just check bits 1 and 2. I vote for removing this piece of code.

jbe

-- 
Pengutronix e.K.                              | Juergen Borleis             |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [BUG] ata: disk_ata_drive: SSD drive doesn't pass check for ata id validity
  2015-10-30  8:53   ` Juergen Borleis
@ 2015-10-30 10:06     ` Peter Mamonov
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Mamonov @ 2015-10-30 10:06 UTC (permalink / raw)
  To: Juergen Borleis; +Cc: barebox

On Fri, 30 Oct 2015 09:53:50 +0100
Juergen Borleis <jbe@pengutronix.de> wrote:

> On Friday 30 October 2015 08:31:04 Sascha Hauer wrote:
> > On Thu, Oct 29, 2015 at 04:04:09PM +0300, Peter Mamonov wrote:
> > > Hi!
> > >
> > > Barebox refuses to deal with OCZ-VERTEX4 ssd sata drive, because:
> > > 	ata1: ata id invalid
> > >
> > > This error is triggered by the following piece of code :
> > >
> > > static int ata_id_is_valid(const uint16_t *id)
> > > {
> > > 	if ((id[ATA_ID_FIELD_VALID] & 1) == 0) {
> > > 		pr_debug("Drive's ID seems invalid\n");
> > > 		return -EINVAL;
> > > 	}
> > >
> > > 	return 0;
> > > }
> > >
> > > The "id" is a sector-sized block of bytes, received after
> > > issuing ATA_CMD_ID_ATA command.
> > >
> > > If I remove this check, the drive works fine.
> > >
> > > Can someone with better knowledge of ATA standard comment on this
> > > issue?
> >
> > Juergen, do you have an idea what this check is for? Neither U-Boot
> > nor the Kernel seem to ever check for bit 0 in this field.
> 
> Seems this bit was meaningful in earlier days: it marked the ID
> member in the structure returned by the disk as valid (=1) or invalid
> (=0). In the meantime it seems obsolete. The last occurrence I found
> is in the Linux kernel in file "drivers/block/mg_disk.c". All other
> code which checks this register content just check bits 1 and 2. I
> vote for removing this piece of code.

Thanks for clarification.

> 
> jbe
> 


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-10-30 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-29 13:04 [BUG] ata: disk_ata_drive: SSD drive doesn't pass check for ata id validity Peter Mamonov
2015-10-30  7:31 ` Sascha Hauer
2015-10-30  8:53   ` Juergen Borleis
2015-10-30 10:06     ` Peter Mamonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox