* + mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch added to -mm tree
@ 2009-03-06 22:08 akpm
2009-03-06 22:39 ` Jiri Slaby
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2009-03-06 22:08 UTC (permalink / raw)
To: mm-commits; +Cc: cooloney, cliff.cai, drzeus
The patch titled
mmc: align data size for host which only supports power-of-2 block
has been added to the -mm tree. Its filename is
mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
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>
---
drivers/mmc/core/core.c | 8 +++++++-
include/linux/mmc/host.h | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff -puN drivers/mmc/core/core.c~mmc-align-data-size-for-host-which-only-supports-power-of-2-block drivers/mmc/core/core.c
--- 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);
+ } else
+ sz = ((sz + 3) / 4) * 4;
return sz;
}
diff -puN include/linux/mmc/host.h~mmc-align-data-size-for-host-which-only-supports-power-of-2-block include/linux/mmc/host.h
--- 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 */
};
extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
_
Patches currently in -mm which might be from cooloney@kernel.org are
linux-next.patch
input-ad7879-touchscreen-driver.patch
mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch
blackfin-nfc-driver-do-not-clobber-dmac1_perimux.patch
blackfin-nfc-driver-mark-bf5xx_nand_add_partition-as-__devinit.patch
blackfin-nfc-driver-drop-pointless-casts-with-set_dma_callback.patch
usb-serial-ftdi-enable-uart-detection-on-gnice-jtag-adaptors-blacklist-interface0.patch
flat-fix-data-sections-alignment.patch
flat-fix-data-sections-alignment-update.patch
blackfin-spi-driver-ensure-cache-coherency-before-doing-dma.patch
blackfin-spi-driver-fix-erroneous-spi-clock-divisor-calculation.patch
blackfin-spi-driver-remove-useless-asm-cplbinith.patch
blackfin-spi-driver-use-len_in_bytes-when-we-care-about-the-number-of-bytes-transferred.patch
blackfin-spi-driver-pass-dma-overflow-error-to-the-higher-level.patch
blackfin-spi-driver-unify-duplicated-code-in-dma-read-write-paths.patch
blackfin-spi-driver-drop-bogus-cast-and-touchup-dma-label.patch
blackfin-spi-driver-add-a-few-more-dma-debug-messages.patch
blackfin-spi-driver-do-not-check-for-spi-errors-if-dma-itself-did-not-flag-any.patch
blackfin-spi-driver-use-the-properl-bit_ctl_xxx-defines.patch
blackfin-spi-driver-spi-slave-select-code-cleanup.patch
blackfin-spi-driver-get-dma-working-for-spi-flashes.patch
blackfin-spi-driver-add-timeout-while-waiting-for-spif-in-dma-irq-handler.patch
blackfin-spi-driver-tweak-magic-spi-dma-sequence-to-get-it-working-on-bf54x.patch
blackfin-spi-driver-fix-bug-spi-controller-driver-does-not-assert-deassert-cs-correctly.patch
blackfin-spi-driver-fix-bug-correct-usage-of-struct-spi_transfercs_change.patch
blackfin-spi-driver-use-bfin_spi_-prefix-on-all-functions.patch
blackfin-spi-driver-fix-null-pointer-crash.patch
blackfin-spi-driver-add-gpio-controlled-spi-slave-select-support.patch
blackfin-spi-driver-make-mmc_spi-driver-work-on-blackfin.patch
bin_elf_fdpic-check-the-return-value-of-clear_user.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: + mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch added to -mm tree
2009-03-06 22:08 + mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch added to -mm tree akpm
@ 2009-03-06 22:39 ` Jiri Slaby
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2009-03-06 22:39 UTC (permalink / raw)
To: linux-kernel; +Cc: mm-commits, cooloney, cliff.cai, drzeus
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?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-06 22:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-06 22:08 + mmc-align-data-size-for-host-which-only-supports-power-of-2-block.patch added to -mm tree akpm
2009-03-06 22:39 ` Jiri Slaby
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.