From: Jiri Slaby <jirislaby@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: mm-commits@vger.kernel.org, cooloney@kernel.org,
cliff.cai@analog.com, drzeus@drzeus.cx
Subject: Re: + mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch added to -mm tree
Date: Fri, 06 Mar 2009 23:39:32 +0100 [thread overview]
Message-ID: <49B1A624.9040704@gmail.com> (raw)
In-Reply-To: <200903062208.n26M8NSH004472@imap1.linux-foundation.org>
On 6.3.2009 23:08, akpm@linux-foundation.org wrote:
> Subject: mmc: align data size for host which only supports power-of-2 block
> From: Bryan Wu<cooloney@kernel.org>
>
>
> Signed-off-by: Cliff Cai<cliff.cai@analog.com>
> Signed-off-by: Bryan Wu<cooloney@kernel.org>
> Cc: Pierre Ossman<drzeus@drzeus.cx>
> Signed-off-by: Andrew Morton<akpm@linux-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?
parent reply other threads:[~2009-03-06 22:41 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200903062208.n26M8NSH004472@imap1.linux-foundation.org>]
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=49B1A624.9040704@gmail.com \
--to=jirislaby@gmail.com \
--cc=cliff.cai@analog.com \
--cc=cooloney@kernel.org \
--cc=drzeus@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
/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