Re: [PATCH 2.6.18 1/1] mmc: Add support for mmc v4 high speed mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[email protected] wrote:
>> Pierre Ossman wrote:
>>     
>>> +	 	cmd.arg = 0x03B90100;
>>>
>>>       
>> I'd prefer some defines and shifts here. Also, this should be done at
>> init, not at select. The reason SD does it is that the spec says it
>> drops out of wide mode when it gets unselected.
>>     
>
> I have done this, but your suggestion somewhat contradicts your original
> suggestion to remove the defines. Essentially, my updated change restores
> the relevant definitions from my very first diff. I hope this is what you
> wanted. I prefer to have the #defines, so I'm not complaining.
>   

I know I can be a bit unclear some times, so feel free to be utterly
confused. :)

What I don't like is defines used for structure offsets where those
fields will be transformed into a normal C structure. I.e. the defines
will only be used once.

In this case, it's protocol opcodes, which are far more vital to have
readable. Currently we only use this in one place, but this will
probably grow. If I understand things correctly, switching to 4-bit and
8-bit bus also uses the SWITCH command?

> I also moved the explaination of the MMC_SWITCH argument to protocol.h I
> think it's worth documenting somewhere.
>   

A variant of this would be to do a macro. But this is fine as well.

> I have moved this work into the read_ext_csd function and renamed it
> process_ext_csd.
>
>   

Looks good.

>> A "max_dtr" int the mmc_ext_csd structure would be nicer here. And you
>> cannot do a kernel BUG because the card is broken. You should mark it as
>> dead.
>>     
>
> I have replaced storing the CARD_TYPE value with storing a dtr based on
> the CARD_TYPE which should achieve what you wanted. I've replaced the
> BUG with marking the card as bad.
>
>   

Very nice. This is a lot less confusing when someone else will be
mucking about with the clock selection routines (e.g. adding SDIO support).

> Finally, as pointed out by Jarkko, I added the missing MMC_CMD flags to
> the calls to MMC_SWITCH and MMC_SEND_EXT_CSD;
>   

Rgds
Pierre

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux