From: Philip Langdale <philipl@overt.org>
To: Pierre Ossman <drzeus-list@drzeus.cx>, Alex Dubov <oakad@yahoo.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.19] mmc: Add support for SDHC cards (Take 2)
Date: Wed, 03 Jan 2007 21:24:52 -0800 [thread overview]
Message-ID: <459C8FA4.7080709@overt.org> (raw)
In-Reply-To: <20070103150620.ac733abb.akpm@osdl.org>
Andrew Morton wrote:
> On Mon, 01 Jan 2007 07:29:55 -0800
> Philip Langdale <philipl@overt.org> wrote:
>
>> #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
>> #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
>> #define MMC_RSP_R3 (MMC_RSP_PRESENT)
>> -#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC)
>> +#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
>> +#define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
>
> This gives MMC_RSP_R1 and MMC_RSP_R6 the same value, so
>
> drivers/mmc/tifm_sd.c: In function 'tifm_sd_op_flags':
> drivers/mmc/tifm_sd.c:190: error: duplicate case value
> drivers/mmc/tifm_sd.c:181: error: previously used here
This is a bug. The MMC_RSP_R? #defines do not fully characterise the
responses (specically, the way that the response is parsed is not
characterised) and consequently there is no guarantee of uniqueness.
Given this reality - the way that the tifm_sd driver works is unsafe.
If R6 had not been incorrectly defined (the missing RSP_OPCODE should
always have been there), then this code would not have worked. As things
currently stand, it is necessary to also check the command number to
decide on the correct response type - that's suboptimal and it's probably
good to uniquely identify the response in the mmc_command in some other
fashion.
I'm going to remove the R6 fix from my next diff to keep these things
distinct but this needs to be resolved.
--phil
next prev parent reply other threads:[~2007-01-04 5:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-01 15:29 [PATCH 2.6.19] mmc: Add support for SDHC cards (Take 2) Philip Langdale
2007-01-03 21:06 ` Pierre Ossman
2007-01-03 23:06 ` Andrew Morton
2007-01-04 5:24 ` Philip Langdale [this message]
2007-01-04 5:59 ` Pierre Ossman
2007-01-04 6:35 ` Philip Langdale
2007-01-04 7:32 ` Pierre Ossman
2007-01-04 12:50 ` Alex Dubov
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=459C8FA4.7080709@overt.org \
--to=philipl@overt.org \
--cc=akpm@osdl.org \
--cc=drzeus-list@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=oakad@yahoo.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