Re: [PATCH 2/2] mmc: sd: Fix sd current limit setting

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

 



Hi,

On Tue, Jul 03 2012, Aaron Lu wrote:
> Host has different current capabilities at different voltages, we need
> to record these settings seperately. Before set current limit for the sd
> card, find out the current voltage first and then find out the current
> capabilities of the host to set the limit.
>
> Signed-off-by: Aaron Lu <aaron.lu@xxxxxxx>
> [...]
> +	switch (1 << card->host->ios.vdd) {
> +		case MMC_VDD_165_195:
> +			voltage = 0; /* host's voltage is 1.8V */
> +			break;
> +		case MMC_VDD_29_30:
> +		case MMC_VDD_30_31:
> +			voltage = 1; /* host's voltage is 3.0V */
> +			break;
> +		case MMC_VDD_32_33:
> +		case MMC_VDD_33_34:
> +			voltage = 2; /* host's voltage is 3.3V */
> +			break;
> +		default:
> +			BUG(); /* host's voltage is invalid */

Please don't call BUG() -- that could easily cause a kernel panic here
(the mmc_core module will hang), which is unjustified.  You'll need to
figure out what exactly you want to have happen when the host's voltage
is invalid, and do that without affecting other controllers that are
in use on the board.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@xxxxxxxxxx>   <http://printf.net/>
One Laptop Per Child
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux