]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
mmc: Remove distinction between hw and phys segments
authorMartin K. Petersen <martin.petersen@oracle.com>
Fri, 10 Sep 2010 05:33:59 +0000 (01:33 -0400)
committerChris Ball <cjb@laptop.org>
Sat, 23 Oct 2010 13:11:11 +0000 (21:11 +0800)
We have deprecated the distinction between hardware and physical
segments in the block layer.  Consolidate the two limits into one in
drivers/mmc/.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
24 files changed:
drivers/mmc/card/queue.c
drivers/mmc/core/host.c
drivers/mmc/host/at91_mci.c
drivers/mmc/host/atmel-mci.c
drivers/mmc/host/au1xmmc.c
drivers/mmc/host/bfin_sdh.c
drivers/mmc/host/davinci_mmc.c
drivers/mmc/host/imxmmc.c
drivers/mmc/host/jz4740_mmc.c
drivers/mmc/host/mmc_spi.c
drivers/mmc/host/mmci.c
drivers/mmc/host/msm_sdcc.c
drivers/mmc/host/mvsdio.c
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/omap.c
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/pxamci.c
drivers/mmc/host/s3cmci.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sh_mmcif.c
drivers/mmc/host/tifm_sd.c
drivers/mmc/host/via-sdmmc.c
drivers/mmc/host/wbsd.c
include/linux/mmc/host.h

index 9c0b42bfe0898be59cb8210b6e57dcc6a47ec448..7c3392e5072256813bf55dd80bbc375ad923f511 100644 (file)
@@ -146,7 +146,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
        }
 
 #ifdef CONFIG_MMC_BLOCK_BOUNCE
-       if (host->max_hw_segs == 1) {
+       if (host->max_segs == 1) {
                unsigned int bouncesz;
 
                bouncesz = MMC_QUEUE_BOUNCESZ;
@@ -196,16 +196,16 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
                blk_queue_bounce_limit(mq->queue, limit);
                blk_queue_max_hw_sectors(mq->queue,
                        min(host->max_blk_count, host->max_req_size / 512));
-               blk_queue_max_segments(mq->queue, host->max_hw_segs);
+               blk_queue_max_segments(mq->queue, host->max_segs);
                blk_queue_max_segment_size(mq->queue, host->max_seg_size);
 
                mq->sg = kmalloc(sizeof(struct scatterlist) *
-                       host->max_phys_segs, GFP_KERNEL);
+                       host->max_segs, GFP_KERNEL);
                if (!mq->sg) {
                        ret = -ENOMEM;
                        goto cleanup_queue;
                }
-               sg_init_table(mq->sg, host->max_phys_segs);
+               sg_init_table(mq->sg, host->max_segs);
        }
 
        init_MUTEX(&mq->thread_sem);
index d80cfdc8edd2663841894348fa33e7dc4e597b1e..10b8af27e03ad535e8d4bd1a6ce3c25794a58ccd 100644 (file)
@@ -94,8 +94,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
         * By default, hosts do not support SGIO or large requests.
         * They have to set these according to their abilities.
         */
-       host->max_hw_segs = 1;
-       host->max_phys_segs = 1;
+       host->max_segs = 1;
        host->max_seg_size = PAGE_CACHE_SIZE;
 
        host->max_req_size = PAGE_CACHE_SIZE;
index 339e5913e5ccf0b8f0422f6f494cf5808d98b6fb..591ab540b407ad9805c3aa384795b2c59a7d8c69 100644 (file)
@@ -947,8 +947,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
        mmc->max_blk_size  = MCI_MAXBLKSIZE;
        mmc->max_blk_count = MCI_BLKATONCE;
        mmc->max_req_size  = MCI_BUFSIZE;
-       mmc->max_phys_segs = MCI_BLKATONCE;
-       mmc->max_hw_segs   = MCI_BLKATONCE;
+       mmc->max_segs      = MCI_BLKATONCE;
        mmc->max_seg_size  = MCI_BUFSIZE;
 
        host = mmc_priv(mmc);
index 1d4e5464ea2fed76855dccc8cd858220e7d86718..301351a5d83853f877953a1ecd10553ecc8f5c22 100644 (file)
@@ -1618,8 +1618,7 @@ static int __init atmci_init_slot(struct atmel_mci *host,
        if (slot_data->bus_width >= 4)
                mmc->caps |= MMC_CAP_4_BIT_DATA;
 
-       mmc->max_hw_segs = 64;
-       mmc->max_phys_segs = 64;
+       mmc->max_segs = 64;
        mmc->max_req_size = 32768 * 512;
        mmc->max_blk_size = 32768;
        mmc->max_blk_count = 512;
index e14b866b270f5ba89f2c9ad63c723b54f8cb25fa..41e5a60493ad6d64a665f785e8feb1491f3d797f 100644 (file)
@@ -998,7 +998,7 @@ static int __devinit au1xmmc_probe(struct platform_device *pdev)
        mmc->f_max = 24000000;
 
        mmc->max_seg_size = AU1XMMC_DESCRIPTOR_SIZE;
-       mmc->max_phys_segs = AU1XMMC_DESCRIPTOR_COUNT;
+       mmc->max_segs = AU1XMMC_DESCRIPTOR_COUNT;
 
        mmc->max_blk_size = 2048;
        mmc->max_blk_count = 512;
index 4b0e677d7295091dbd4772054a8c06e20a4d3184..bac7d62866b731cc60e924a34521015b7c2cc288 100644 (file)
@@ -469,7 +469,7 @@ static int __devinit sdh_probe(struct platform_device *pdev)
        }
 
        mmc->ops = &sdh_ops;
-       mmc->max_phys_segs = 32;
+       mmc->max_segs = 32;
        mmc->max_seg_size = 1 << 16;
        mmc->max_blk_size = 1 << 11;
        mmc->max_blk_count = 1 << 11;
index 33d9f1b00862f805aca98acf72c497d91239be02..e15547cf701f177931dadc64a6ec87229f002dc4 100644 (file)
 /*
  * One scatterlist dma "segment" is at most MAX_CCNT rw_threshold units,
  * and we handle up to MAX_NR_SG segments.  MMC_BLOCK_BOUNCE kicks in only
- * for drivers with max_hw_segs == 1, making the segments bigger (64KB)
+ * for drivers with max_segs == 1, making the segments bigger (64KB)
  * than the page or two that's otherwise typical. nr_sg (passed from
  * platform data) == 16 gives at least the same throughput boost, using
  * EDMA transfer linkage instead of spending CPU time copying pages.
@@ -1239,8 +1239,7 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
         * Each hw_seg uses one EDMA parameter RAM slot, always one
         * channel and then usually some linked slots.
         */
-       mmc->max_hw_segs        = 1 + host->n_link;
-       mmc->max_phys_segs      = mmc->max_hw_segs;
+       mmc->max_segs           = 1 + host->n_link;
 
        /* EDMA limit per hw segment (one or two MBytes) */
        mmc->max_seg_size       = MAX_CCNT * rw_threshold;
@@ -1250,8 +1249,7 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
        mmc->max_blk_count      = 65535; /* NBLK is 16 bits */
        mmc->max_req_size       = mmc->max_blk_size * mmc->max_blk_count;
 
-       dev_dbg(mmc_dev(host->mmc), "max_phys_segs=%d\n", mmc->max_phys_segs);
-       dev_dbg(mmc_dev(host->mmc), "max_hw_segs=%d\n", mmc->max_hw_segs);
+       dev_dbg(mmc_dev(host->mmc), "max_segs=%d\n", mmc->max_segs);
        dev_dbg(mmc_dev(host->mmc), "max_blk_size=%d\n", mmc->max_blk_size);
        dev_dbg(mmc_dev(host->mmc), "max_req_size=%d\n", mmc->max_req_size);
        dev_dbg(mmc_dev(host->mmc), "max_seg_size=%d\n", mmc->max_seg_size);
index 5a950b16d9e629dc3d08041bda547b165cadee76..881f7ba545aefa05dd0e8c5389b06f2092723b7d 100644 (file)
@@ -966,8 +966,7 @@ static int __init imxmci_probe(struct platform_device *pdev)
        mmc->caps = MMC_CAP_4_BIT_DATA;
 
        /* MMC core transfer sizes tunable parameters */
-       mmc->max_hw_segs = 64;
-       mmc->max_phys_segs = 64;
+       mmc->max_segs = 64;
        mmc->max_seg_size = 64*512;     /* default PAGE_CACHE_SIZE */
        mmc->max_req_size = 64*512;     /* default PAGE_CACHE_SIZE */
        mmc->max_blk_size = 2048;
index ad4f9870e3caffefd8c8b2922296cd7fc4b97a03..b3a0ab0e4c2b6ce37ed2ff68321c154e45d5c1f0 100644 (file)
@@ -876,8 +876,7 @@ static int __devinit jz4740_mmc_probe(struct platform_device* pdev)
        mmc->max_blk_count = (1 << 15) - 1;
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
 
-       mmc->max_phys_segs = 128;
-       mmc->max_hw_segs = 128;
+       mmc->max_segs = 128;
        mmc->max_seg_size = mmc->max_req_size;
 
        host->mmc = mmc;
index 62a35822003ef5b0383c1c97ddaaaf05c1c7a479..5b0b50636ec40079efed06e2b9bcbe967f1ae0f0 100644 (file)
@@ -1345,8 +1345,7 @@ static int mmc_spi_probe(struct spi_device *spi)
 
        mmc->ops = &mmc_spi_ops;
        mmc->max_blk_size = MMC_SPI_BLOCKSIZE;
-       mmc->max_hw_segs = MMC_SPI_BLOCKSATONCE;
-       mmc->max_phys_segs = MMC_SPI_BLOCKSATONCE;
+       mmc->max_segs = MMC_SPI_BLOCKSATONCE;
        mmc->max_req_size = MMC_SPI_BLOCKSATONCE * MMC_SPI_BLOCKSIZE;
        mmc->max_blk_count = MMC_SPI_BLOCKSATONCE;
 
index f2e02d7d9f3d45555356a54aecb5e5ec3228472d..5f2e72d38b5d3da6fce5d75e323f9de583712988 100644 (file)
@@ -734,8 +734,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
        /*
         * We can do SGIO
         */
-       mmc->max_hw_segs = 16;
-       mmc->max_phys_segs = NR_SG;
+       mmc->max_segs = NR_SG;
 
        /*
         * Since only a certain number of bits are valid in the data length
index ff7752348b113cd154582187372e658784f66dc2..1290d14c5839572a27f6354f3ab227ec6ff79c93 100644 (file)
@@ -1164,8 +1164,7 @@ msmsdcc_probe(struct platform_device *pdev)
                mmc->caps |= MMC_CAP_SDIO_IRQ;
        mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
 
-       mmc->max_phys_segs = NR_SG;
-       mmc->max_hw_segs = NR_SG;
+       mmc->max_segs = NR_SG;
        mmc->max_blk_size = 4096;       /* MCI_DATA_CTL BLOCKSIZE up to 4096 */
        mmc->max_blk_count = 65536;
 
index 366eefa77c5a4b96f2a1c8ce9f822ff053aecb1c..a5bf60e01af44b96059e0c145afe4bb3ea2ebdc4 100644 (file)
@@ -742,8 +742,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
        mmc->max_blk_size = 2048;
        mmc->max_blk_count = 65535;
 
-       mmc->max_hw_segs = 1;
-       mmc->max_phys_segs = 1;
+       mmc->max_segs = 1;
        mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count;
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
 
index 350f78e8624511cfd1378c4b8365a2d6d956a4ae..bdd2cbb87cba7892c068129a5a4d15a09e110757 100644 (file)
@@ -790,8 +790,7 @@ static int mxcmci_probe(struct platform_device *pdev)
        mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
 
        /* MMC core transfer sizes tunable parameters */
-       mmc->max_hw_segs = 64;
-       mmc->max_phys_segs = 64;
+       mmc->max_segs = 64;
        mmc->max_blk_size = 2048;
        mmc->max_blk_count = 65535;
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
index d98ddcfac5e5cb2e0ddf1fd32fac9318cc09b29b..0c7e37f496efae9f8e24179f6f907a5f3b696abe 100644 (file)
@@ -1335,8 +1335,7 @@ static int __init mmc_omap_new_slot(struct mmc_omap_host *host, int id)
         * NOTE max_seg_size assumption that small blocks aren't
         * normally used (except e.g. for reading SD registers).
         */
-       mmc->max_phys_segs = 32;
-       mmc->max_hw_segs = 32;
+       mmc->max_segs = 32;
        mmc->max_blk_size = 2048;       /* BLEN is 11 bits (+1) */
        mmc->max_blk_count = 2048;      /* NBLK is 11 bits (+1) */
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
index 4526d2791f2990229acbe9ef0f5c88286819807f..03c26e026506042ba567fce42404368a75aed6f3 100644 (file)
@@ -2105,8 +2105,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
 
        /* Since we do only SG emulation, we can have as many segs
         * as we want. */
-       mmc->max_phys_segs = 1024;
-       mmc->max_hw_segs = 1024;
+       mmc->max_segs = 1024;
 
        mmc->max_blk_size = 512;       /* Block Length at max can be 1024 */
        mmc->max_blk_count = 0xFFFF;    /* No. of Blocks is 16 bits */
index 0a4e43f371408733f43ba9fae73be7647222b5b6..b7dfcac31e8a8ad29cb16be886656c8ca60ae16c 100644 (file)
@@ -576,7 +576,7 @@ static int pxamci_probe(struct platform_device *pdev)
         * We can do SG-DMA, but we don't because we never know how much
         * data we successfully wrote to the card.
         */
-       mmc->max_phys_segs = NR_SG;
+       mmc->max_segs = NR_SG;
 
        /*
         * Our hardware DMA can handle a maximum of one page per SG entry.
index 976330de379ecc78cbe91f19c4bd9495d4722dae..1ccd4b256ceec11008370a1691d00c7018570cbe 100644 (file)
@@ -1736,8 +1736,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev)
        mmc->max_req_size       = 4095 * 512;
        mmc->max_seg_size       = mmc->max_req_size;
 
-       mmc->max_phys_segs      = 128;
-       mmc->max_hw_segs        = 128;
+       mmc->max_segs           = 128;
 
        dbg(host, dbg_debug,
            "probe: mode:%s mapped mci_base:%p irq:%u irq_cd:%u dma:%u.\n",
index 401527d273b5811e7a1981af12751ba099b490a8..f608626c482101ac18a331073a94bd583a51126f 100644 (file)
@@ -1850,12 +1850,11 @@ int sdhci_add_host(struct sdhci_host *host)
         * can do scatter/gather or not.
         */
        if (host->flags & SDHCI_USE_ADMA)
-               mmc->max_hw_segs = 128;
+               mmc->max_segs = 128;
        else if (host->flags & SDHCI_USE_SDMA)
-               mmc->max_hw_segs = 1;
+               mmc->max_segs = 1;
        else /* PIO */
-               mmc->max_hw_segs = 128;
-       mmc->max_phys_segs = 128;
+               mmc->max_segs = 128;
 
        /*
         * Maximum number of sectors in one transfer. Limited by DMA boundary
index 5d3f824bb5a31078257ecbb0c10941fc874d3ad7..0f06b80028141939fad056c35c3166d70d7eb6f0 100644 (file)
@@ -846,8 +846,7 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
        mmc->caps = MMC_CAP_MMC_HIGHSPEED;
        if (pd->caps)
                mmc->caps |= pd->caps;
-       mmc->max_phys_segs = 128;
-       mmc->max_hw_segs = 128;
+       mmc->max_segs = 128;
        mmc->max_blk_size = 512;
        mmc->max_blk_count = 65535;
        mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
index cec99958b65286b3768fb3e5c06e91140909bbf5..457c26ea09de4923abe6725b4c2ae7d75d01f3ed 100644 (file)
@@ -978,11 +978,10 @@ static int tifm_sd_probe(struct tifm_dev *sock)
        mmc->f_max = 24000000;
 
        mmc->max_blk_count = 2048;
-       mmc->max_hw_segs = mmc->max_blk_count;
+       mmc->max_segs = mmc->max_blk_count;
        mmc->max_blk_size = min(TIFM_MMCSD_MAX_BLOCK_SIZE, PAGE_SIZE);
        mmc->max_seg_size = mmc->max_blk_count * mmc->max_blk_size;
        mmc->max_req_size = mmc->max_seg_size;
-       mmc->max_phys_segs = mmc->max_hw_segs;
 
        sock->card_event = tifm_sd_card_event;
        sock->data_event = tifm_sd_data_event;
index 19f2d72dbca58c4b8e4ecaad1d029029b3e43cf3..9ed84ddb478060358cce983c0996b6268b1edd93 100644 (file)
@@ -1050,8 +1050,7 @@ static void via_init_mmc_host(struct via_crdr_mmc_host *host)
        mmc->ops = &via_sdc_ops;
 
        /*Hardware cannot do scatter lists*/
-       mmc->max_hw_segs = 1;
-       mmc->max_phys_segs = 1;
+       mmc->max_segs = 1;
 
        mmc->max_blk_size = VIA_CRDR_MAX_BLOCK_LENGTH;
        mmc->max_blk_count = VIA_CRDR_MAX_BLOCK_COUNT;
index 0012f5d13d28715c0ecd4404e28a8f9502e3a085..7fca0a386ba052bf398bad4462c66d5f673c02a9 100644 (file)
@@ -1235,8 +1235,7 @@ static int __devinit wbsd_alloc_mmc(struct device *dev)
         * Maximum number of segments. Worst case is one sector per segment
         * so this will be 64kB/512.
         */
-       mmc->max_hw_segs = 128;
-       mmc->max_phys_segs = 128;
+       mmc->max_segs = 128;
 
        /*
         * Maximum request size. Also limited by 64KiB buffer.
index 1575b52c3bfafa663d0fcfbea24c91269dfa83cb..ded4017037621d2a9bf237099ae1ae2e7fed2913 100644 (file)
@@ -162,8 +162,7 @@ struct mmc_host {
 
        /* host specific block data */
        unsigned int            max_seg_size;   /* see blk_queue_max_segment_size */
-       unsigned short          max_hw_segs;    /* see blk_queue_max_hw_segments */
-       unsigned short          max_phys_segs;  /* see blk_queue_max_phys_segments */
+       unsigned short          max_segs;       /* see blk_queue_max_segments */
        unsigned short          unused;
        unsigned int            max_req_size;   /* maximum number of bytes in one req */
        unsigned int            max_blk_size;   /* maximum size of one mmc block */