lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45476AA3.6070505@solidboot.com>
Date:	Tue, 31 Oct 2006 17:24:19 +0200
From:	Juha Yrjola <juha.yrjola@...idboot.com>
To:	Pierre Ossman <drzeus-list@...eus.cx>,
	Timo Teras <timo.teras@...idboot.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MMC: Select only one voltage bit in OCR response

Russell King wrote:

>>> Maybe something like "ocr &= 3 << bit;" would be more approriate?
>>>   
>> Russell? Comments? Do you still have the offending card?
> 
> It wasn't my cards, but was reported by several other folk.  I don't think
> we can revert on this without breakage.
> 
> However, we should probably ensure that we don't end up setting voltage
> bits which the cards don't support.  So maybe masking the resulting OCR
> value with the received combined OCR would be a good idea?  Such as:

Isn't this exactly what Timo is proposing above?

Cheers,
Juha

> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index ee8863c..45e0598 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -467,23 +467,24 @@ static inline void mmc_delay(unsigned in
>   */
>  static u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
>  {
> +	u32 selected_ocr;
>  	int bit;
>  
> -	ocr &= host->ocr_avail;
> +	selected_ocr = ocr & host->ocr_avail;
>  
> -	bit = ffs(ocr);
> +	bit = ffs(selected_ocr);
>  	if (bit) {
>  		bit -= 1;
>  
> -		ocr = 3 << bit;
> +		selected_ocr = 3 << bit;
>  
>  		host->ios.vdd = bit;
>  		mmc_set_ios(host);
>  	} else {
> -		ocr = 0;
> +		selected_ocr = 0;
>  	}
>  
> -	return ocr;
> +	return selected_ocr & ocr;
>  }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ