[PATCH v2 08/16] mmc: core: add preemptibility tracking fields to mmc command

2012-05-03 Thread Venkatraman S
Set a preemptibility command atrribute to MMC commands. This can be later used by write (multi block), trim etc for evaluating if a HPI is applicable. Note the starting time of executing a command so a decision can be made if it is too late for preemption. Signed-off-by: Venkatraman S

[PATCH v2 09/16] mmc: core: Add MMC abort interface

2012-05-03 Thread Venkatraman S
HPI (and possibly other) procedures require that an ongoing mmc request issued to a controller be aborted in the middle of a transaction. Define a abort interface function to the controller so that individual host controllers can safely abort a request, stop the dma and cleanup their statemachine

[PATCH v2 15/16] mmc: Update preempted request with CORRECTLY_PRG_SECTORS_NUM info

2012-05-03 Thread Venkatraman S
Ongoing request that was preempted during 'programming' state is partially completed. Number of correctly programmed sectors is available in the ext_csd field CORRECTLY_PRG_SECTORS_NUM. Read this field to update the bytes_xfered field of the request Signed-off-by: Venkatraman S svenk...@ti.com

[PATCH v2 16/16] mmc: omap_hsmmc: Implement abort_req host_ops

2012-05-03 Thread Venkatraman S
Provide the abort_req implementation for omap_hsmmc host. When invoked, the host controller should stop the transfer and end the ongoing request as early as possible. If the aborted command is a data transfer command, dma setup is aborted and a STOP command is issued. The transfer state is

[PATCHv2 00/16] [FS, MM, block, MMC]: eMMC High Priority Interrupt Feature

2012-05-03 Thread Venkatraman S
Standard eMMC (Embedded MultiMedia Card) specification expects to execute one request at a time. If some requests are more important than others, they can't be aborted while the flash procedure is in progress. New versions of the eMMC standard (4.41 and above) specfies a feature called High

[PATCH v2 02/16] MM: Added page swapping markers to memory management

2012-05-03 Thread Venkatraman S
From: Ilan Smith ilan.sm...@sandisk.com Add attribute to identify swapin requests Mark memory management requests with swapin requests Signed-off-by: Ilan Smith ilan.sm...@sandisk.com Signed-off-by: Alex Lemberg alex.lemb...@sandisk.com Signed-off-by: Venkatraman S svenk...@ti.com ---

[PATCH v2 05/16] block: Documentation: add sysfs ABI for expedite_dmpg and expedite_swapin

2012-05-03 Thread Venkatraman S
Add description on the usage of expedite_dmpg and expedite_swapin. Signed-off-by: Venkatraman S svenk...@ti.com --- Documentation/ABI/testing/sysfs-block | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block

[PATCH v2 04/16] block: add sysfs attributes for runtime control of dpmg and swapin

2012-05-03 Thread Venkatraman S
sysfs entries for DPMG and SWAPIN requests so that they can be set/reset from userspace. Signed-off-by: Venkatraman S svenk...@ti.com --- block/blk-sysfs.c | 16 1 file changed, 16 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index cf15001..764de9f 100644

[PATCH v2 07/16] mmc: core: helper function for finding preemptible command

2012-05-03 Thread Venkatraman S
According to table30 in eMMC spec, only some commands can be preempted by foreground HPI. Provide a helper function for the HPI procedure to identify if the command is preemptible. Signed-off-by: Venkatraman S svenk...@ti.com --- include/linux/mmc/core.h | 13 + 1 file changed, 13

[PATCH v2 12/16] mmc: sysfs: Add sysfs entry for tuning preempt_time_threshold

2012-05-03 Thread Venkatraman S
When High Priority Interrupt (HPI) is enabled, ongoing requests might be preempted. It is worthwhile to not preempt some requests which have progressed in the underlying driver for some time. The threshold of elapsed time after which HPI is not useful can be tuned on a per-device basis, using the

[PATCH v2 14/16] mmc: block: Implement HPI invocation and handling logic.

2012-05-03 Thread Venkatraman S
Intercept command which require high priority treatment. If the ongoing command can be preempted according to JEDEC HPI definition and sufficient window exist to complete an ongoing request, invoke HPI and abort the current request, and issue the high priority request. Otherwise, process the

[PATCH v2 13/16] mmc: Documentation: Add sysfs ABI for hpi_time_threshold

2012-05-03 Thread Venkatraman S
hpi_time_threshold can be set to configure elapsed time in ms, after which an ongoing request will not be preempted. Explain the hpi_time_threhold parameter for MMC devices. Signed-off-by: Venkatraman S svenk...@ti.com --- Documentation/ABI/testing/sysfs-devices-mmc | 12 1 file

[PATCH v2 10/16] mmc: block: Detect HPI support in card and host controller

2012-05-03 Thread Venkatraman S
If both the card and host controller support HPI related operations, set a flag in MMC queue to remember it. Signed-off-by: Venkatraman S svenk...@ti.com --- drivers/mmc/card/block.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/card/block.c

[PATCH v2 06/16] block: treat DMPG and SWAPIN requests as special

2012-05-03 Thread Venkatraman S
From: Ilan Smith ilan.sm...@sandisk.com When exp_swapin and exp_dmpg are set, treat read requests marked with DMPG and SWAPIN as high priority and move to the front of the queue. Signed-off-by: Ilan Smith ilan.sm...@sandisk.com Signed-off-by: Alex Lemberg alex.lemb...@sandisk.com Signed-off-by:

[PATCH v2 01/16] FS: Added demand paging markers to filesystem

2012-05-03 Thread Venkatraman S
From: Ilan Smith ilan.sm...@sandisk.com Add attribute to identify demand paging requests. Mark readpages with demand paging attribute. Signed-off-by: Ilan Smith ilan.sm...@sandisk.com Signed-off-by: Alex Lemberg alex.lemb...@sandisk.com Signed-off-by: Venkatraman S svenk...@ti.com ---

Re: [PATCH v2 06/16] block: treat DMPG and SWAPIN requests as special

2012-05-03 Thread Jeff Moyer
Venkatraman S svenk...@ti.com writes: From: Ilan Smith ilan.sm...@sandisk.com When exp_swapin and exp_dmpg are set, treat read requests marked with DMPG and SWAPIN as high priority and move to the front of the queue. [...] + if (bio_swapin(bio) blk_queue_exp_swapin(q)) { +

[PATCH 03/29] mmc: sh_mmcif: remove unused .down_pwr() callback

2012-05-03 Thread Guennadi Liakhovetski
Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- Please, hold this patch back, until [PATCH 02/29] sh: ecovec: remove unused .down_pwr() MMCIF callback is committed. include/linux/mmc/sh_mmcif.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git

[PATCH 01/29] mmc: sh_mmcif: remove redundant .down_pwr() callback

2012-05-03 Thread Guennadi Liakhovetski
From the original version of sh_mmcif the .set_pwr() callback has only been used to turn the card's power on, and the .down_pwr() callback has been used to turn it off. .set_pwr() can be used for both these tasks, which is also how it is implemented by the only user of this API: the SH7724 ecovec

[PATCH 09/29] mmc: tmio: stop interface clock before runtime PM suspending

2012-05-03 Thread Guennadi Liakhovetski
The call to pm_runtime_put() in tmio-mmc's .set_ios() method can switch off the supplying clock or even power down the whole unit. Therefore, calling tmio_mmc_clk_stop() after that can be redundant, put it before. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de ---

[PATCH 10/29] mmc: tmio: don't needlessly enable interrupts during probing

2012-05-03 Thread Guennadi Liakhovetski
We don't have to force-enable MMC interrupts in our .probe() method, mmc_add_host() will trigger card detection, that will enable all the necessary interrupts. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/host/tmio_mmc_pio.c | 21 +++-- 1 files

[PATCH 02/29] sh: ecovec: remove unused .down_pwr() MMCIF callback

2012-05-03 Thread Guennadi Liakhovetski
.down_pwr() on ecovec was equivalent to .set_pwr(0). Now that .down_pwr() is no longer used by the driver, it can be removed. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Paul Mundt let...@linux-sh.org --- arch/sh/boards/mach-ecovec24/setup.c |6 -- 1 files changed, 0

[PATCH 05/29] regulator: use IS_ERR_OR_NULL() instead of open-coding

2012-05-03 Thread Guennadi Liakhovetski
Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Mark Brown broo...@opensource.wolfsonmicro.com --- drivers/regulator/core.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index fdeabba..a57defb 100644

[PATCH 19/29] mmc: add two capability flags for CD and WP signal polarity

2012-05-03 Thread Guennadi Liakhovetski
To handle CD and WP SD/MMC slot pins we need generic flags to specify their polarity. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- include/linux/mmc/host.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/mmc/host.h

[PATCH 20/29] mmc: add CD GPIO polling support to slot functions

2012-05-03 Thread Guennadi Liakhovetski
A simple extension of mmc slot functions add support for CD GPIO polling for cases, where the GPIO cannot produce interrupts or this is for some reason not desired. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/core/slot-gpio.c | 42

[PATCH 23/29] mmc: tmio: use generic GPIO CD and WP handlers

2012-05-03 Thread Guennadi Liakhovetski
The tmio-mmc driver is already using the generic GPIO CD handler in IRQ mode. This patch adds support for CD polling mode and also checks for availability of a WP GPIO. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/host/tmio_mmc_pio.c |6 ++ 1 files changed,

[PATCH 15/29] mmc: extend and rename cd-gpio helpers to handle more slot GPIO functions

2012-05-03 Thread Guennadi Liakhovetski
GPIOs can be used in MMC/SD-card slots not only for hotplug detection, but also to implement the write-protection pin. Rename cd-gpio helpers to slot-gpio to make addition of further slot GPIO functions possible. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de ---

[PATCH 08/29] mmc: sh_mmcif: add regulator support

2012-05-03 Thread Guennadi Liakhovetski
Add regulator support to the sh_mmcif driver, but also preserve the current power-callback. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Mark Brown broo...@opensource.wolfsonmicro.com --- drivers/mmc/host/sh_mmcif.c | 48 -- 1 files

[PATCH 14/29] mmc: sdhi: do not install dummy callbacks

2012-05-03 Thread Guennadi Liakhovetski
Currently the SDHI glue for the TMIO MMC driver installs dummy .get_cd() and .set_pwr() callbacks even if the platform didn't supply them. This is not necessary, since the TMIO MMC driver itself checks for NULL callbacks. This is also dubious if the platform provides a regulator for SD-card power

[PATCH 26/29] mmc: sdhi: add OF support, make platform data optional

2012-05-03 Thread Guennadi Liakhovetski
Now, that most parameters, required to configure the TMIO MMC driver can be obtained from OF, we can also add support for it to the SDHI glue, which also makes it necessary to be able to run without platform data. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Grant Likely

[PATCH 24/29] mmc: add a simple generic OF parser

2012-05-03 Thread Guennadi Liakhovetski
Many MMC host drivers already use OF data to obtain their platform-specific configuration. Each of them is doing this in its special way, whereas many parameters are identical and can easily be generalised. This patch adds such a generic parser. So far it only adds and handles very few basic

[PATCH 13/29] mmc: tmio: add regulator support

2012-05-03 Thread Guennadi Liakhovetski
Currently the TMIO MMC driver derives the OCR mask from the platform data and uses a platform callback to turn card power on and off. This patch adds regulator support to the driver. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Mark Brown broo...@opensource.wolfsonmicro.com ---

[PATCH 25/29] mmc: tmio: add OF support

2012-05-03 Thread Guennadi Liakhovetski
Add OF support to the TMIO MMC to parse both standard and driver-specific properties. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Grant Likely grant.lik...@secretlab.ca --- drivers/mmc/host/tmio_mmc_pio.c | 39 --- 1 files changed, 36

[PATCH 27/29] mmc: mmcif: add OF support

2012-05-03 Thread Guennadi Liakhovetski
Add generic MMC OF parsing support to the sh-mmcif driver. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Grant Likely grant.lik...@secretlab.ca --- drivers/mmc/host/sh_mmcif.c | 33 +++-- 1 files changed, 27 insertions(+), 6 deletions(-) diff --git

[PATCH 29/29] sh: ecovec: switch MMC power control to regulators

2012-05-03 Thread Guennadi Liakhovetski
Power on the CN11 and CN12 SD/MMC slots on ecovec is controlled by GPIOs, which makes it possible to use the fixed voltage regulator driver to switch card power on and off. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Paul Mundt let...@linux-sh.org --- Optional, mainly FYI

[PATCH 00/29] mmc: mmcif and tmio regulator and OF support

2012-05-03 Thread Guennadi Liakhovetski
Hi I was not directly sure, what was the better way to send these out - as one seriess or as several. I would actually prefer several, but there are many dependencies. So, maybe best would be to try to review and address any issues on the MLs, only posting new versions of affected patches, and

[PATCH 22/29] mmc: add WP pin handler to slot functions

2012-05-03 Thread Guennadi Liakhovetski
Card Write-Protect pin is often implemented, using a GPIO, which makes it simple to provide a generic handler for it. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/core/slot-gpio.c | 51 - include/linux/mmc/slot-gpio.h |

[PATCH 28/29] mmc: mmcif: add support for generic GPIO CD polling

2012-05-03 Thread Guennadi Liakhovetski
The generic MMC OF support can be used to configure GPIO card-detection, use this ability. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/host/sh_mmcif.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/sh_mmcif.c

[PATCH 21/29] mmc: convert slot functions to managed allocation

2012-05-03 Thread Guennadi Liakhovetski
This prepares for the addition of further slot functions. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/core/host.c |2 + drivers/mmc/core/slot-gpio.c | 49 +++-- include/linux/mmc/host.h |2 + 3 files changed,

[PATCH 12/29] mmc: sdhi: implement tmio-mmc clock enable-update and disable callbacks

2012-05-03 Thread Guennadi Liakhovetski
Instead of delivering one static clock frequency value, read from the hardware during probing, enable the tmio-mmc driver to re-read the frequency dynamically. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/host/sh_mobile_sdhi.c | 24 +++- 1

[PATCH 17/29] mmc: use a more generic name for slot function types and fields

2012-05-03 Thread Guennadi Liakhovetski
struct mmc_host::hotplug is becoming a generic hook for slot functions. Rename it accordingly. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/core/host.c |2 ++ drivers/mmc/core/slot-gpio.c |8 include/linux/mmc/host.h | 17

[PATCH 04/29] regulator: fix devm_regulator_put() to call regulator_put() explicitly

2012-05-03 Thread Guennadi Liakhovetski
devres_destroy() doesn't call the release() method, it only destroys the resource. The caller should take care to release the associated object itself. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Mark Brown broo...@opensource.wolfsonmicro.com --- drivers/regulator/core.c |

[PATCH 16/29] mmc: tmio: use MMC opcode defines instead of numbers

2012-05-03 Thread Guennadi Liakhovetski
mmc.h defines macros for most frequently used MMC opcodes. Use them instead of hard-coded numbers. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/host/tmio_mmc_pio.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH 18/29] mmc: tmio: remove a duplicated comment line

2012-05-03 Thread Guennadi Liakhovetski
Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/host/tmio_mmc_pio.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index e843da0..d1eb611 100644 ---

[PATCH 07/29] mmc: add a function to get a regulator, supplying card's Vdd

2012-05-03 Thread Guennadi Liakhovetski
Add a function to get a regulator, supplying card's Vdd on a specific host. If such a regulator is found, the function checks, whether a valid OCR mask can be obtained from this regulator, and whether it can switch card's power on and off. Signed-off-by: Guennadi Liakhovetski

[PATCH 11/29] mmc: tmio: add callbacks to enable-update and disable the interface clock

2012-05-03 Thread Guennadi Liakhovetski
Every time the clockc is enabled after possibly being disabled, we have to re-read its frequency and update our configuration. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- drivers/mmc/host/tmio_mmc_pio.c | 35 --- include/linux/mfd/tmio.h

[PATCH 06/29] regulator: export a function to check if regulator can change status

2012-05-03 Thread Guennadi Liakhovetski
Some consumers, e.g., the mmc subsystem, can benefit from an ability to check, whether a regulator can switch power on and off. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de Cc: Mark Brown broo...@opensource.wolfsonmicro.com --- drivers/regulator/core.c | 17

Re: [PATCH 06/29] regulator: export a function to check if regulator can change status

2012-05-03 Thread Mark Brown
On Thu, May 03, 2012 at 05:05:35PM +0200, Guennadi Liakhovetski wrote: Some consumers, e.g., the mmc subsystem, can benefit from an ability to check, whether a regulator can switch power on and off. You're going to have to expand a lot more on why this is a good idea... Bear in mind that the

Re: [PATCH 05/29] regulator: use IS_ERR_OR_NULL() instead of open-coding

2012-05-03 Thread Mark Brown
On Thu, May 03, 2012 at 05:05:34PM +0200, Guennadi Liakhovetski wrote: - if (regulator == NULL || IS_ERR(regulator)) + if (IS_ERR_OR_NULL(regulator)) The bigger question here is why we're accepting NULL in the first place. signature.asc Description: Digital signature

Re: [PATCH 07/29] mmc: add a function to get a regulator, supplying card's Vdd

2012-05-03 Thread Mark Brown
On Thu, May 03, 2012 at 05:05:36PM +0200, Guennadi Liakhovetski wrote: + ret = mmc_regulator_get_ocrmask(supply); + if (ret 0) + mmc-ocr_avail = ret; + + if (regulator_can_change_status(supply)) { + mmc-caps |= MMC_CAP_POWER_OFF_CARD; +

Re: [PATCH 08/29] mmc: sh_mmcif: add regulator support

2012-05-03 Thread Mark Brown
On Thu, May 03, 2012 at 05:05:37PM +0200, Guennadi Liakhovetski wrote: +#include linux/regulator/consumer.h Where's this used? +static void sh_mmcif_set_power(struct sh_mmcif_host *host, struct mmc_ios *ios) +{ + struct sh_mmcif_plat_data *pd = host-pd-dev.platform_data; + + if

Re: [PATCH 13/29] mmc: tmio: add regulator support

2012-05-03 Thread Mark Brown
On Thu, May 03, 2012 at 05:05:42PM +0200, Guennadi Liakhovetski wrote: +static void tmio_mmc_set_power(struct tmio_mmc_host *host, struct mmc_ios *ios) +{ + if (!(host-mmc-caps MMC_CAP_POWER_OFF_CARD)) + return; + + if (host-vdd) + /* Errors ignored... */

Re: [PATCH v2 06/16] block: treat DMPG and SWAPIN requests as special

2012-05-03 Thread S, Venkatraman
On Thu, May 3, 2012 at 8:08 PM, Jeff Moyer jmo...@redhat.com wrote: Venkatraman S svenk...@ti.com writes: From: Ilan Smith ilan.sm...@sandisk.com When exp_swapin and exp_dmpg are set, treat read requests marked with DMPG and SWAPIN as high priority and move to the front of the queue.

Re: [PATCH 04/29] regulator: fix devm_regulator_put() to call regulator_put() explicitly

2012-05-03 Thread Mark Brown
On Thu, May 03, 2012 at 05:05:33PM +0200, Guennadi Liakhovetski wrote: devres_destroy() doesn't call the release() method, it only destroys the resource. The caller should take care to release the associated object itself. + regulator_put(regulator); rc =

Re: [PATCH 3/7] mmc: dw_mmc: add device tree support

2012-05-03 Thread Guennadi Liakhovetski
On Tue, 1 May 2012, Thomas Abraham wrote: Add device tree based discovery support. Signed-off-by: Thomas Abraham thomas.abra...@linaro.org --- .../devicetree/bindings/mmc/synposis-dw-mshc.txt | 85 + drivers/mmc/host/dw_mmc-pltfm.c| 24 +++