All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Ben Gardner <gardner.ben@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: Delkin Devices CFA not recognized
Date: Tue, 23 Feb 2010 17:41:11 +0000	[thread overview]
Message-ID: <20100223174111.6113c862@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <808c8e9d1002230903pea21f5al2c09e2420af141c9@mail.gmail.com>

> I tracked the problem down to ata_id_is_cfa() in include/linux/ata.h.
> The Delkin card doesn't match either assumption in that function.
> On the Delkin card, id[0] is 0x844a and id[83] is 0.

844A is not CF so the kernel is behaving correctly.
83 = 0 means it doesn't support the CFA feature set as an ATA device

So the question is why it is reporting 844A

My guess would be that it's trying to report a low byte of 'removable
device' not 'removable media'

> The simple fix for me is to change the id[0] check ata_id_is_cfa() in to
> include 0x844a.
> 
> --- linux-2.6.33-rc8.orig/include/linux/ata.h
> +++ linux-2.6.33-rc8/include/linux/ata.h
> @@ -841,7 +841,8 @@
> 
>  static inline int ata_id_is_cfa(const u16 *id)
>  {
> -	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
> +	if ((id[ATA_ID_CONFIG] == 0x848A) ||	/* Traditional CF */
> +	    (id[ATA_ID_CONFIG] == 0x844A))	/* Delkin Devices CF */
>  		return 1;
>  	/*
>  	 * CF specs don't require specific value in the word 0 anymore and yet
> ---
> 
> While that works, it doesn't seem like a very good solution.
> Here are some of the ATA-related logs after the change:

If they simply got the identifier wrong then it ought to be fine. Might
be worth double checking it's removable behaviour is right. The one thing
you might do is to change in your hack is for the Delkin case also doing
a memcpy(id + whatever, "Delkin Devices", ..) to check the vendor info
matches the expected case. I'm not sure thats even worth it as I can't
see it triggering on anything but misidentified cards anyway.

Submit it to Jeff with a signed off by line.

Alan

      reply	other threads:[~2010-02-23 17:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23 17:03 Delkin Devices CFA not recognized Ben Gardner
2010-02-23 17:41 ` Alan Cox [this message]

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=20100223174111.6113c862@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=gardner.ben@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    /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.