linux/drivers/mmc/host
Will Deacon 8f7f6b7e46 mmc: mmci: reduce max_blk_count to avoid overflowing max_req_size
On a system with large pages (64k in my case), the following BUG is
triggered in MMC core:

[    2.338023] BUG: failure at drivers/mmc/core/core.c:221/mmc_start_request()!
[    2.338102] Kernel panic - not syncing: BUG!
[    2.338155] Call trace:
[    2.338228] [<ffffffc00008635c>] dump_backtrace+0x0/0x120
[    2.338317] [<ffffffc0003365ec>] dump_stack+0x14/0x1c
[    2.338403] [<ffffffc000336990>] panic+0xbc/0x1f0
[    2.338498] [<ffffffc00027a494>] mmc_start_request+0x154/0x184
[    2.338600] [<ffffffc00027abdc>] mmc_start_req+0x110/0x140
[    2.338701] [<ffffffc00028604c>] mmc_blk_issue_rw_rq+0x7c/0x39c
[    2.338804] [<ffffffc00028652c>] mmc_blk_issue_rq+0x1c0/0x468
[    2.338905] [<ffffffc000287564>] mmc_queue_thread+0x68/0x118
[    2.338995] [<ffffffc0000bc308>] kthread+0x84/0x8c

This is because of a 64k request with a max_req_size of 64k-1 bytes.

The following patch fixes the problem by limiting the max_blk_count
such that max_blk_count * max_blk_size == max_req_size. I couldn't
pursuade the compiler to emit a shift instead of a div without encoding
the shift explicitly.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2012-03-04 12:25:14 -05:00
..
at91_mci.c MMC highlights for 3.3: 2012-01-13 20:41:15 -08:00
at91_mci.h mmc: at91_mci: move register header from include/ to drivers/ 2011-07-21 10:35:08 -04:00
atmel-mci-regs.h mmc: atmel-mci: add pdc support and runtime capabilities detection 2011-10-26 15:43:26 -04:00
atmel-mci.c mmc: atmel-mci: don't use dma features when using DMA with no chan available 2012-03-02 16:06:40 -05:00
au1xmmc.c MIPS: Alchemy: Au1300 SoC support 2011-12-07 22:02:05 +00:00
bfin_sdh.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
cb710-mmc.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
cb710-mmc.h mmc: Driver for CB710/720 memory card reader (MMC part) 2009-06-13 22:42:58 +02:00
davinci_mmc.c mmc: davinci: Add support for set_power callback 2011-09-17 15:53:23 +05:30
dw_mmc.c mmc: dw_mmc: Fix PIO mode with support of highmem 2012-02-13 20:39:05 -05:00
dw_mmc.h mmc: dw_mmc: fixed wrong bit operation for SDMMC_GET_FCNT() 2012-01-12 15:17:15 -05:00
imxmmc.c mmc: replace printk with appropriate display macro 2011-10-26 16:32:22 -04:00
imxmmc.h
jz4740_mmc.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
Kconfig drivers: misc: Remove MISC_DEVICES config option 2012-01-24 16:24:02 -08:00
Makefile mmc: sdhci-pci: add platform data 2012-01-11 23:58:47 -05:00
mmc_spi.c mmc: Remove redundant spi driver bus initialization 2012-01-11 23:58:42 -05:00
mmci.c mmc: mmci: reduce max_blk_count to avoid overflowing max_req_size 2012-03-04 12:25:14 -05:00
mmci.h mmc: mmci: implement pre_req() and post_req() 2011-07-20 17:21:11 -04:00
msm_sdcc.c mmc: remove the second argument of k[un]map_atomic() 2012-01-11 23:58:42 -05:00
msm_sdcc.h mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts 2011-10-26 15:43:37 -04:00
mvsdio.c ARM: Orion: Get address map from plat-orion instead of via platform_data 2011-12-13 18:46:55 -05:00
mvsdio.h mmc: SDIO driver for Marvell SoCs 2009-03-24 21:30:03 +01:00
mxcmmc.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
mxs-mmc.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
of_mmc_spi.c mmc: of_mmc_spi: fix little endian support 2012-02-13 20:38:58 -05:00
omap_hsmmc.c MMC highlights for 3.3: 2012-01-13 20:41:15 -08:00
omap.c misc latin1 to utf8 conversions 2012-01-02 13:04:55 +01:00
pxamci.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
pxamci.h
s3cmci.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
s3cmci.h s3cmci: DMA fixes 2009-10-01 16:11:15 -07:00
sdhci-cns3xxx.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
sdhci-dove.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
sdhci-esdhc-imx.c mmc: sdhci-esdhc-imx: fix for mmc cards on i.MX5 2012-03-04 12:25:02 -05:00
sdhci-esdhc.h mmc: sdhci-esdhc: Change delay after setting clock from 100ms to 1ms 2012-01-11 23:58:41 -05:00
sdhci-of-esdhc.c mmc: esdhc: fix errors when booting kernel on Freescale eSDHC version 2.3 2012-02-12 00:24:24 -05:00
sdhci-of-hlwd.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
sdhci-pci-data.c mmc: sdhci-pci: add platform data 2012-01-11 23:58:47 -05:00
sdhci-pci.c mmc: sdhci-pci: set Medfield SDIO as non-removable 2012-02-13 20:39:01 -05:00
sdhci-pltfm.c mmc: esdhc: set the timeout to the max value 2012-02-13 20:38:59 -05:00
sdhci-pltfm.h mmc: sdhci: remove "state" argument from sdhci_suspend_host 2011-12-19 15:50:11 -08:00
sdhci-pxav2.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
sdhci-pxav3.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
sdhci-s3c.c MMC highlights for 3.3: 2012-01-13 20:41:15 -08:00
sdhci-spear.c mmc: sdhci-spear: Fix compilation error 2012-01-12 15:17:09 -05:00
sdhci-tegra.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
sdhci.c mmc: sdhci: restore the enabled dma when do reset all 2012-01-12 15:17:17 -05:00
sdhci.h mmc: host: Adds support for eMMC 4.5 HS200 mode 2012-01-12 15:17:16 -05:00
sdricoh_cs.c mmc: Add module.h to drivers/mmc users assuming implicit presence. 2011-10-26 16:32:19 -04:00
sh_mmcif.c mmc: sh_mmcif: fix late delayed work initialisation 2012-02-13 20:39:03 -05:00
sh_mobile_sdhi.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
tifm_sd.c Autogenerated GPG tag for Rusty D1ADB8F1: 15EE 8D6C AB0E 7F0C F999 BFCB D920 0E6C D1AD B8F1 2012-01-14 12:32:16 -08:00
tmio_mmc_dma.c mmc: tmio_mmc: fix card eject during IO with DMA 2012-02-13 20:39:03 -05:00
tmio_mmc_pio.c mmc: tmio_mmc: fix card eject during IO with DMA 2012-02-13 20:39:03 -05:00
tmio_mmc.c mmc: convert drivers/mmc/host/* to use module_platform_driver() 2012-01-11 23:58:42 -05:00
tmio_mmc.h mmc: tmio_mmc: fix card eject during IO with DMA 2012-02-13 20:39:03 -05:00
ushc.c USB: convert some miscellanies drivers to use module_usb_driver() 2011-11-18 09:52:10 -08:00
via-sdmmc.c mmc: replace printk with appropriate display macro 2011-10-26 16:32:22 -04:00
vub300.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
wbsd.c mmc: replace printk with appropriate display macro 2011-10-26 16:32:22 -04:00
wbsd.h