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>] [day] [month] [year] [list]
Message-ID: <49B1A624.9040704@gmail.com>
Date:	Fri, 06 Mar 2009 23:39:32 +0100
From:	Jiri Slaby <jirislaby@...il.com>
To:	linux-kernel@...r.kernel.org
CC:	mm-commits@...r.kernel.org, cooloney@...nel.org,
	cliff.cai@...log.com, drzeus@...eus.cx
Subject: Re: + mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch
 added to -mm tree

On 6.3.2009 23:08, akpm@...ux-foundation.org wrote:
> Subject: mmc: align data size for host which only supports power-of-2 block
> From: Bryan Wu<cooloney@...nel.org>
>
>
> Signed-off-by: Cliff Cai<cliff.cai@...log.com>
> Signed-off-by: Bryan Wu<cooloney@...nel.org>
> Cc: Pierre Ossman<drzeus@...eus.cx>
> Signed-off-by: Andrew Morton<akpm@...ux-foundation.org>
> ---
> --- a/drivers/mmc/core/core.c~mmc-align-data-size-for-host-which-only-supports-power-of-2-block
> +++ a/drivers/mmc/core/core.c
> @@ -321,7 +321,13 @@ unsigned int mmc_align_data_size(struct
>   	 * the core about its problems yet, so for now we just 32-bit
>   	 * align the size.
>   	 */
> -	sz = ((sz + 3) / 4) * 4;
> +
> +	/* Align size for host which only supports power-of-2 block */
> +	if (card->host->powerof2_block) {
> +		if (sz&  (sz - 1))
> +			sz = 1<<  fls(sz);

Is there a reason why not use
sz = roundup_pow_of_two(sz)
instead of the two lines?

> +	} else
> +		sz = ((sz + 3) / 4) * 4;

While you are at it:
sz = roundup(sz, 4);

> --- a/include/linux/mmc/host.h~mmc-align-data-size-for-host-which-only-supports-power-of-2-block
> +++ a/include/linux/mmc/host.h
> @@ -162,6 +162,7 @@ struct mmc_host {
>   	struct dentry		*debugfs_root;
>
>   	unsigned long		private[0] ____cacheline_aligned;
> +	unsigned int		powerof2_block;	/* host only supports power-of-2 block */

Does this have any users? The patch description is too bare. I'm trying 
to cope with one mmc device failure, may this help?
--
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