platform/kernel/linux-exynos.git
6 years agommc: core: Turn off CQE before sending commands
Adrian Hunter [Thu, 10 Aug 2017 12:08:09 +0000 (15:08 +0300)]
mmc: core: Turn off CQE before sending commands

CQE needs to be off for the host controller to accept non-CQ commands. Turn
off the CQE before sending commands, and ensure it is off in any reset or
power management paths, or re-tuning.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: host: Add CQE interface
Adrian Hunter [Fri, 25 Aug 2017 12:43:46 +0000 (15:43 +0300)]
mmc: host: Add CQE interface

Add CQE host operations, capabilities, and host members.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: Add members to mmc_request and mmc_data for CQE's
Adrian Hunter [Thu, 10 Aug 2017 12:08:07 +0000 (15:08 +0300)]
mmc: core: Add members to mmc_request and mmc_data for CQE's

Most of the information needed to issue requests to a CQE is already in
struct mmc_request and struct mmc_data. Add data block address, some flags,
and the task id (tag), and allow for cmd being NULL which it is for CQE
tasks.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: Add mmc_retune_hold_now()
Adrian Hunter [Thu, 10 Aug 2017 12:08:06 +0000 (15:08 +0300)]
mmc: core: Add mmc_retune_hold_now()

mmc_return_hold() / mmc_retune_release() are used around a group of
commands to prevent re-tuning between the commands. Re-tuning can still
happen before the first command. In some cases, re-tuning must be
prevented entirely. Add mmc_retune_hold_now() for that purpose. It is
added in preparation for CQE support where it will be used by CQE recovery.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: Remove unused MMC_CAP2_PACKED_CMD
Adrian Hunter [Thu, 10 Aug 2017 12:08:11 +0000 (15:08 +0300)]
mmc: core: Remove unused MMC_CAP2_PACKED_CMD

Packed commands support was removed but some bits got left behind. Remove
them.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: Fix clock rate passed to sunxi_mmc_clk_set_phase
Chen-Yu Tsai [Thu, 10 Aug 2017 03:29:54 +0000 (11:29 +0800)]
mmc: sunxi: Fix clock rate passed to sunxi_mmc_clk_set_phase

sunxi_mmc_clk_set_phase expects the actual card clock rate to be passed
to it. When the internal divider code was reworked in change ("mmc: sunxi:
Support MMC DDR52 transfer mode with new timing mode"), this requirement
was missed, and the module clock rate was passed in instead. This broke 8
bit DDR MMC on old controllers, as the module clock rate is double the
card clock rate, for which we have no valid delay settings.

Fix this by applying the internal divider to the clock rate right after
we configure it in hardware.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhi: use maximum width for the sdbuf register
Wolfram Sang [Wed, 9 Aug 2017 18:29:26 +0000 (20:29 +0200)]
mmc: sdhi: use maximum width for the sdbuf register

Make use of the 64 bit sdbuf width on Renesas R-Car Gen3. If the
registers are 8 byte apart, the width is also 64 bit. For all others,
the width is 32 bit, even if the registers are only 16 bit apart.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: renesas_sdhi: document version of RZ/A1 instance
Wolfram Sang [Wed, 9 Aug 2017 19:14:52 +0000 (21:14 +0200)]
mmc: renesas_sdhi: document version of RZ/A1 instance

We don't use this new define yet, but it is helpful to document which
versions we know of.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Chris Brandt <Chris.Brandt@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: renesas_sdhi: enably CBSY bit for RZ platform
Wolfram Sang [Wed, 9 Aug 2017 19:14:51 +0000 (21:14 +0200)]
mmc: renesas_sdhi: enably CBSY bit for RZ platform

It is documented, so enable it to follow the recommendation in the docs
and also save a few cycles.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Chris Brandt <Chris.Brandt@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: renesas_sdhi: use extra flag for CBSY usage
Wolfram Sang [Wed, 9 Aug 2017 19:00:41 +0000 (21:00 +0200)]
mmc: renesas_sdhi: use extra flag for CBSY usage

There is one SDHI instance on Gen2 which does not have the CBSY bit.
So, turn CBSY usage into an extra flag and set it accordingly. This has
the additional advantage that we can also set it for other incarnations
later.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Chris Brandt <Chris.Brandt@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: vub300: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 17:50:58 +0000 (23:20 +0530)]
mmc: vub300: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-xenon: Add Xenon SDHCI specific system-level PM support
Hu Ziji [Wed, 12 Jul 2017 22:16:19 +0000 (15:16 -0700)]
mmc: sdhci-xenon: Add Xenon SDHCI specific system-level PM support

Add Xenon specific system-level suspend and resume support.
Especially during resume, re-configure Xenon specific registers
since registers setting will be lost in suspend if Xenon is power off.

Signed-off-by: Hu Ziji <huziji@marvell.com>
Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
Tested-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: dw_mmc: introduce timer for broken command transfer over scheme
Addy Ke [Tue, 11 Jul 2017 09:38:37 +0000 (17:38 +0800)]
mmc: dw_mmc: introduce timer for broken command transfer over scheme

Per the databook of designware mmc controller 2.70a, table 3-2, cmd
done interrupt should be fired as soon as the the cmd is sent via
cmd line. And the response timeout interrupt should be generated
unconditioinally as well if the controller doesn't receive the resp.
However that doesn't seem to meet the fact of rockchip specified Soc
platforms using dwmmc. We have continuously found the the cmd done or
response timeout interrupt missed somehow which took us a long time to
understand what was happening. Finally we narrow down the root to
the reconstruction of sample circuit for dwmmc IP introduced by
rockchip and the buggy design sweeps over all the existing rockchip
Socs using dwmmc disastrously.

It seems no way to work around this bug without the proper break-out
mechanism so that we seek for a parallel pair the same as the handling
for missing data response timeout, namely dto timer. Adding this cto
timer seems easily to handle this bug but it's hard to restrict the code
under the rockchip specified context. So after merging this patch, it
sets up the cto timer for all the platforms using dwmmc IP which isn't
ideal but at least we don't advertise new quirk here. Fortunately, no
obvious performance regression was found by test and the pre-existing
similar catch-all timer for sdhci has proved it's an acceptant way to
make the code as robust as possible.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196321
Signed-off-by: Addy Ke <addy.ke@rock-chips.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
[shawn.lin: rewrite the code and the commit msg throughout]
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: dw_mmc-k3: add sd support for hi3660
liwei [Fri, 11 Aug 2017 08:06:24 +0000 (16:06 +0800)]
mmc: dw_mmc-k3: add sd support for hi3660

Add sd card support for hi3660 soc

Signed-off-by: Li Wei <liwei213@huawei.com>
Signed-off-by: Chen Jun <chenjun14@huawei.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: dw_mmc: move controller reset before driver init
liwei [Fri, 11 Aug 2017 08:06:23 +0000 (16:06 +0800)]
mmc: dw_mmc: move controller reset before driver init

This commit modifies dw_mci_probe(), it moves reset assertion before
drv_data->init(host)

Some driver needs to access controller registers in its .init() ops. So,
in order to make such access safe, we should do controller reset before
.init() being called.

Signed-off-by: Wei Li <liwei213@huawei.com>
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Chen Jun <chenjun14@huawei.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: mxcmmc: Handle return value of clk_prepare_enable
Arvind Yadav [Tue, 8 Aug 2017 05:57:43 +0000 (11:27 +0530)]
mmc: mxcmmc: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: wmt-sdmmc: Handle return value of clk_prepare_enable
Arvind Yadav [Tue, 8 Aug 2017 05:46:38 +0000 (11:16 +0530)]
mmc: wmt-sdmmc: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-msm: set sdma_boundary to zero
Srinivas Kandagatla [Thu, 3 Aug 2017 12:46:14 +0000 (14:46 +0200)]
mmc: sdhci-msm: set sdma_boundary to zero

Programming legacy HOST SDMA Buffer Boundary bits in Block Size Register
(0x04) is not supported in Qualcomm sdhci controllers. Writing to this
would cause the controller not to transfer last block in case block size
is 4 bytes or less.

This issue was noticed while testing sdio wlan card on Qcom DB410c board.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci: add sdma_boundary member to struct sdhci_host
Srinivas Kandagatla [Thu, 3 Aug 2017 12:46:13 +0000 (14:46 +0200)]
mmc: sdhci: add sdma_boundary member to struct sdhci_host

This patch adds sdma_boundary member to struct sdhci_host to give more
flexibility to drivers to control the sdma boundary buffer value and
also to fix issue on some sdhci controllers which are broken when
HOST SDMA Buffer Boundary is programmed in Block Size Register (0x04)
when using ADMA. Qualcomm sdhci controller is one of such type, writing
to this bits is un-supported.

Default value of sdma_boundary is set to SDHCI_DEFAULT_BOUNDARY_ARG.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: renesas-sdhi: constify renesas_sdhi_internal_dmac_dma_ops
Julia Lawall [Mon, 7 Aug 2017 20:15:03 +0000 (22:15 +0200)]
mmc: renesas-sdhi: constify renesas_sdhi_internal_dmac_dma_ops

The structure renesas_sdhi_internal_dmac_dma_ops is only passed as
the second argument to renesas_sdhi_probe, which is const, so
renesas_sdhi_internal_dmac_dma_ops can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-brcmstb: constify sdhci_pltfm_data structures
Julia Lawall [Mon, 7 Aug 2017 09:50:44 +0000 (11:50 +0200)]
mmc: sdhci-brcmstb: constify sdhci_pltfm_data structures

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, so the sdhci_pltfm_data structure
can be const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-of-arasan: constify sdhci_pltfm_data and sdhci_ops structures
Julia Lawall [Mon, 7 Aug 2017 09:50:43 +0000 (11:50 +0200)]
mmc: sdhci-of-arasan: constify sdhci_pltfm_data and sdhci_ops structures

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, while the sdhci_ops structure
is only stored in the ops field of a sdhci_pltfm_data structure,
which is also const.  Thus both kinds of structures can be const as
well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-sirf: constify sdhci_pltfm_data and sdhci_ops structures
Julia Lawall [Mon, 7 Aug 2017 09:50:42 +0000 (11:50 +0200)]
mmc: sdhci-sirf: constify sdhci_pltfm_data and sdhci_ops structures

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, while the sdhci_ops structure
is only stored in the ops field of a sdhci_pltfm_data structure,
which is also const.  Thus both kinds of structures can be const as
well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-bcm-kona: constify sdhci_pltfm_data and sdhci_ops structures
Julia Lawall [Mon, 7 Aug 2017 09:50:41 +0000 (11:50 +0200)]
mmc: sdhci-bcm-kona: constify sdhci_pltfm_data and sdhci_ops structures

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, while the sdhci_ops structure
is only stored in the ops field of a sdhci_pltfm_data structure,
which is also const.  Thus both kinds of structures can be const as
well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci: constify sdhci_pltfm_data structures
Julia Lawall [Mon, 7 Aug 2017 09:50:40 +0000 (11:50 +0200)]
mmc: sdhci: constify sdhci_pltfm_data structures

The sdhci_pltfm_data structure is only passed as the second argument
of sdhci_pltfm_init, which is const, so the sdhci_pltfm_data structure can
be const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: remove the check of mmc_card_blockaddr for SD cards
Shawn Lin [Mon, 7 Aug 2017 02:07:14 +0000 (10:07 +0800)]
mmc: core: remove the check of mmc_card_blockaddr for SD cards

Per the SD physical layer simplified specification V4.10,
section 4.6.2, CSD version 1.0 SD card should use taac, nsac
and r2w_factor for calculating the data access time. But the
taac and nsac for SDHC(CSD version 2.0) are always fixed and
the software should use the recommended value for timeout. When
parsing the CSD, we sanely set them to zero for SDHC(CSD version
2.0), all the calculation for timeout_ns and timeout_clk is zero
as well. So what we actually want to limit here is either SDHC
case or unreasonable timeout reported by the cards. In principle
we should at least be able to remove the bogus check for the
mmc_card_blockaddr.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci: ignore restoring the I/O state if MMC_POWER_OFF
Zhoujie Wu [Thu, 3 Aug 2017 19:28:40 +0000 (12:28 -0700)]
mmc: sdhci: ignore restoring the I/O state if MMC_POWER_OFF

One issue was found on a removable high speed sd card with
runtime pm enabled.
When SD card is unplugged, it keep printing "Switching to 3.3V
signalling voltage failed".
And found below sequence triggers the error.

mmc_rescan
-> mmc_sd_detect
-> mmc_power_off  -- mmc->ios.vdd is updated to 0.
-> mmc_claim_host
-> sdhci_runtime_resume_host
-> sdhci_start_signal_voltage_switch
-> mmc_regulator_set_vqmmc
-> mmc_ocrbitnum_to_vdd

When mmc_ocrbitnum_to_vdd is called, the mmc->ios.vdd is 0, so it
always return -EINVAL. The signal switch will always fail and
print out warning.
Ignore restoring the I/O state when runtime resume if MMC_POWER_OFF.

Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: fix support for new timings mode only SoCs
Icenowy Zheng [Tue, 8 Aug 2017 07:09:03 +0000 (15:09 +0800)]
mmc: sunxi: fix support for new timings mode only SoCs

The A83T MMC support code introduces the timings mode switch, however
such a switch doesn't exist on new SoCs with only new timings mode.

Only execute the switch if the SoC really have the timings mode switch,
to fix the regression shown on new timings mode only SoCs (A64, H5,
etc).

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: Fix NULL pointer reference on clk_delays
Chen-Yu Tsai [Tue, 8 Aug 2017 07:02:44 +0000 (15:02 +0800)]
mmc: sunxi: Fix NULL pointer reference on clk_delays

Some SoCs do not support clk delays for MMC in the clock control unit.
These include the old controllers in A10/A10s/A13/R8, and the new eMMC
controller in A64. The config structure for these controllers do not
specify clk_delays, but the check for this was replaced in change
"mmc: sunxi: Support controllers that can use both old and new timings".

This patch adds back the check for clk_delays, and also adds comments
for both checks in sunxi_mmc_clk_set_phase().

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: Add support for A83T eMMC (MMC2)
Chen-Yu Tsai [Mon, 24 Jul 2017 13:59:01 +0000 (21:59 +0800)]
mmc: sunxi: Add support for A83T eMMC (MMC2)

The third MMC controller (MMC2) on the Allwinner A83T SoC is slightly
different. It supports a wider 8-bit bus, has a dedicated controllable
reset pin for eMMC, and a "new timing mode" which is supposed to deliver
better signals and thus better performance.

Add a compatible for this one to use the new timing mode not found in the
other controllers.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: Support MMC DDR52 transfer mode with new timing mode
Chen-Yu Tsai [Mon, 24 Jul 2017 13:59:00 +0000 (21:59 +0800)]
mmc: sunxi: Support MMC DDR52 transfer mode with new timing mode

The MMC controller can support DDR52 transfers under the new timing
mode. According to the BSP kernel, the module clock has to be double
the card clock, regardless of the bus width. The default timings in
the hardware can be used.

This also reworks the code setting the internal divider, getting rid
of a extra conditional.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: Support controllers that can use both old and new timings
Chen-Yu Tsai [Mon, 24 Jul 2017 13:58:59 +0000 (21:58 +0800)]
mmc: sunxi: Support controllers that can use both old and new timings

On the SoCs that introduced the new timing mode for MMC controllers,
both the old (where the clock delays are set in the CCU) and new
(where the clock delays are set in the MMC controller) timing modes
are available, and we have to support them both. However there are
two bits that control which mode is active. One is in the CCU, the
other is in the MMC controller. The settings on both sides must be
the same, or nothing will work.

The sunxi-ng clock driver provides an API to query and set the
active timing mode. At probe time, we try to set the active mode
to the "new timing mode". If it succeeds, we can then use the MMC
controller in the new mode. If not, we fall back to the old mode.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agoclk: sunxi-ng: a83t: Support new timing mode for mmc2 clock
Chen-Yu Tsai [Mon, 24 Jul 2017 13:58:58 +0000 (21:58 +0800)]
clk: sunxi-ng: a83t: Support new timing mode for mmc2 clock

The MMC2 clock supports a new timing mode. When the new mode is active,
the output clock rate is halved.

This patch sets the feature flag for the new timing mode, and adds
a pre-divider based on the mode bit.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agoclk: sunxi-ng: Add MP_MMC clocks that support MMC timing modes switching
Chen-Yu Tsai [Mon, 24 Jul 2017 13:58:57 +0000 (21:58 +0800)]
clk: sunxi-ng: Add MP_MMC clocks that support MMC timing modes switching

All of our MMC clocks are of the MP clock type. A few MMC clocks on some
SoCs, such as MMC2 on the A83T, support new/old timing mode switching.

>From a clock rate point of view, when the new timing mode is active. the
output clock rate is halved.

This patch adds a special wrapper class of clocks, MP_MMC, around the
generic MP type clocks. The rate related callbacks in ccu_mp_mmc_ops
for this class look at the timing mode bit and apply the /2 post-divider
when needed, before passing it through to the generic class ops,
ccu_mp_ops.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agoclk: sunxi-ng: Add interface to query or configure MMC timing modes.
Chen-Yu Tsai [Mon, 24 Jul 2017 13:58:56 +0000 (21:58 +0800)]
clk: sunxi-ng: Add interface to query or configure MMC timing modes.

Starting with the A83T SoC, Allwinner introduced a new timing mode for
its MMC clocks. The new mode changes how the MMC controller sample and
output clocks are delayed to match chip and board specifics. There are
two controls for this, one on the CCU side controlling how the clocks
behave, and one in the MMC controller controlling what inputs to take
and how to route them.

In the old mode, the MMC clock had 2 child clocks providing the output
and sample clocks, which could be delayed by a number of clock cycles
measured from the MMC clock's parent.

With the new mode, the 2 delay clocks are no longer active. Instead,
the delays and associated controls are moved into the MMC controller.
The output of the MMC clock is also halved.

The difference in how things are wired between the modes means that the
clock controls and the MMC controls must match. To achieve this in a
clear, explicit way, we introduce two functions for the MMC driver to
use: one queries the hardware for the current mode set, and the other
allows the MMC driver to request a mode.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: renesas-sdhi: provide a whitelist for Gen3 SoC ES versions
Simon Horman [Wed, 2 Aug 2017 12:48:42 +0000 (14:48 +0200)]
mmc: renesas-sdhi: provide a whitelist for Gen3 SoC ES versions

Provide a whitelist for Gen3 SoC ES versions for both the SYS DMAC and
internal DMAC variants of the SDHI driver.  This is to allow drivers to
only initialise for Gen3 SoC ES versions for which they are the appropriate
DMAC implementation.  Currently internal DMAC is the appropriate
implementation for all supported Gen3 SoC ES versions.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: correct taac parameter according to the specification
Shawn Lin [Wed, 2 Aug 2017 03:12:42 +0000 (11:12 +0800)]
mmc: core: correct taac parameter according to the specification

Per the spec of JESD84-B51, section 7.3, replace tacc with taac to
fix the obvious typo.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-msm: add static to local functions
Masahiro Yamada [Mon, 31 Jul 2017 12:00:46 +0000 (21:00 +0900)]
mmc: sdhci-msm: add static to local functions

Detected by sparse.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: of_mmc_spi: fix restricted cast warning of sparse
Masahiro Yamada [Mon, 31 Jul 2017 12:03:53 +0000 (21:03 +0900)]
mmc: of_mmc_spi: fix restricted cast warning of sparse

Sparse reports "warning: cast to restricted __be32".

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: bcm2835: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:41 +0000 (07:59 +0200)]
mmc: bcm2835: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: mediatek: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:40 +0000 (07:59 +0200)]
mmc: mediatek: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdricoh_cs: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:39 +0000 (07:59 +0200)]
mmc: sdricoh_cs: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:38 +0000 (07:59 +0200)]
mmc: sunxi: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: vub300: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:37 +0000 (07:59 +0200)]
mmc: vub300: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: usdhi6rol0: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:36 +0000 (07:59 +0200)]
mmc: usdhi6rol0: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: toshsd: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:35 +0000 (07:59 +0200)]
mmc: toshsd: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sh_mmcif: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:34 +0000 (07:59 +0200)]
mmc: sh_mmcif: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: moxart: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:33 +0000 (07:59 +0200)]
mmc: moxart: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: davinci: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:32 +0000 (07:59 +0200)]
mmc: davinci: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: s3cmci: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:31 +0000 (07:59 +0200)]
mmc: s3cmci: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: wmt-sdmmc: constify mmc_host_ops structures
Julia Lawall [Sat, 29 Jul 2017 05:59:30 +0000 (07:59 +0200)]
mmc: wmt-sdmmc: constify mmc_host_ops structures

The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const.  Thus the mmc_host_ops
structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };

@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct mmc_host_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agosdhci: pci: Fix up power if device has ACPI companion
Andy Shevchenko [Mon, 24 Jul 2017 15:07:50 +0000 (18:07 +0300)]
sdhci: pci: Fix up power if device has ACPI companion

Fix up a power state in case PCI device has an ACPI companion.

Do it only for Intel Merrifield for now.

This is almost copy'n'paste of part of sdhci_acpi_probe() and might be
split out to a helper function in the future.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agosdhci: acpi: Use new method to get ACPI companion
Andy Shevchenko [Mon, 24 Jul 2017 14:59:58 +0000 (17:59 +0300)]
sdhci: acpi: Use new method to get ACPI companion

ACPI_COMPANION() macro reduces a code to get a companion device out of
struct device.

Use it instead of an old method.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-xenon: ignore timing DDR52 in tuning
Zhoujie Wu [Fri, 21 Jul 2017 18:30:58 +0000 (11:30 -0700)]
mmc: sdhci-xenon: ignore timing DDR52 in tuning

Emmc DDR52 mode uses fixed delay, return earlier if
timing is MMC_TIMING_MMC_DDR52 in execute tuning function.

Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tegra: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:45 +0000 (17:25 +0200)]
mmc: tegra: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: linux-mmc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sunxi: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:44 +0000 (17:25 +0200)]
mmc: sunxi: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-st: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:43 +0000 (17:25 +0200)]
mmc: sdhci-st: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: dw_mmc: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:42 +0000 (17:25 +0200)]
mmc: dw_mmc: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: Convert to using %pOF instead of full_name
Rob Herring [Tue, 18 Jul 2017 21:43:16 +0000 (16:43 -0500)]
mmc: Convert to using %pOF instead of full_name

Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Jan Glauber <jglauber@cavium.com>
Cc: David Daney <david.daney@cavium.com>
Cc: "Steven J. Hill" <Steven.Hill@cavium.com>
Cc: linux-mmc@vger.kernel.org
Acked-by: David Daney <david.daney@cavium.com>
Tested-by: Steven J. Hill <Steven.Hill@cavium.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agoMMC: Remove HIGHMEM dependency from mmc-spi driver
Ian Molton [Tue, 18 Jul 2017 12:19:15 +0000 (13:19 +0100)]
MMC: Remove HIGHMEM dependency from mmc-spi driver

I cannot see why this is needed. kmap() should be safe in this case.

Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: host: via-sdmmc: constify pci_device_id.
Arvind Yadav [Mon, 17 Jul 2017 16:31:33 +0000 (22:01 +0530)]
mmc: host: via-sdmmc: constify pci_device_id.

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   text    data     bss     dec     hex filename
   6952     880       0    7832    1e98 drivers/mmc/host/via-sdmmc.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   7032     800       0    7832    1e98 drivers/mmc/host/via-sdmmc.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci: remove CONFIG_MMC_DEBUG from the driver
Shawn Lin [Wed, 19 Jul 2017 07:55:49 +0000 (15:55 +0800)]
mmc: sdhci: remove CONFIG_MMC_DEBUG from the driver

sdhci uses CONFIG_MMC_DEBUG for showing ADMA descriptor
when occurring ADMA error. And it's also used to  dump the
registers whenever calling sdhci_add_host.

On one hand, I don't see any burden to always print the state
ADMA descriptor as it's rare and will help folks better understand
what was happening when seeing ADMA error.

On the other, folks may be interested in checking some registers
at probe time. So we remove the sdhci_dumpregs from __sdhci_add_host
and print some really useful registers in sdhci_setup_host.

Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: wbsd: remove CONFIG_MMC_DEBUG from the driver
Shawn Lin [Wed, 19 Jul 2017 07:55:48 +0000 (15:55 +0800)]
mmc: wbsd: remove CONFIG_MMC_DEBUG from the driver

wbsd only use this to print some unsupported command.
However the pr_warn should be enough for dynamic log
control and CONFIG_MMC_DEBUG seems bogus here. Remove it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: Kconfig: downgrade CONFIG_MMC_DEBUG for host drivers only
Shawn Lin [Wed, 19 Jul 2017 07:55:47 +0000 (15:55 +0800)]
mmc: Kconfig: downgrade CONFIG_MMC_DEBUG for host drivers only

We have removed all code depending on CONFIG_MMC_DEBUG
from mmc core now. So it's safe to make CONFIG_MMC_DEBUG
just for host drivers only and we expect to kill this option
in the future.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: turn the pr_info under CONFIG_MMC_DEBUG into pr_debug
Shawn Lin [Wed, 19 Jul 2017 07:55:46 +0000 (15:55 +0800)]
mmc: core: turn the pr_info under CONFIG_MMC_DEBUG into pr_debug

There are lots of debug message in core.c which use pr_debug
for better dynamic log level control. So it doesn't make sense
for those print to still keep working only under CONFIG_MMC_DEBUG.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: always check the length of sglist with total data size
Shawn Lin [Wed, 19 Jul 2017 07:55:45 +0000 (15:55 +0800)]
mmc: core: always check the length of sglist with total data size

All the check within mmc_mrq_prep seems to be all-or-none
proposition, so it doesn't make sense to only check the
length of sglist only under the CONFIG_MMC_DEBUG context.
I'd prefer to always keep the check there unconditionally.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: core: remove check of host->removed for rescan routine
Shawn Lin [Wed, 19 Jul 2017 07:50:56 +0000 (15:50 +0800)]
mmc: core: remove check of host->removed for rescan routine

The intention of this check was to prevent the conflict between
hotplug and removing driver for whatever reason. Currently it
doesn't improve anything and the following rescan process could
still saftly perform the scan flow. So these code seems pointless
now and let's remove them.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-acpi: remove unused struct sdhci_host variable
Shawn Lin [Fri, 21 Jul 2017 01:19:50 +0000 (09:19 +0800)]
mmc: sdhci-acpi: remove unused struct sdhci_host variable

It was never used and introduce a warning

drivers/mmc/host/sdhci-acpi.c: In function 'sdhci_acpi_sdio_probe_slot':
drivers/mmc/host/sdhci-acpi.c:297:21: warning: variable 'host' set but
not used [-Wunused-but-set-variable]

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-of-arasan: use io functions from sdhci.h
Jean-Francois Dagenais [Mon, 17 Jul 2017 01:23:32 +0000 (21:23 -0400)]
mmc: sdhci-of-arasan: use io functions from sdhci.h

This increases consistency of the code across the sdhci family.

Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agoarc: remove num-slots from arc platforms
Shawn Lin [Wed, 19 Jul 2017 00:39:09 +0000 (08:39 +0800)]
arc: remove num-slots from arc platforms

dwmmc driver deprecated num-slots and plan to get rid
of it finally. Just move a step to cleanup it from DT.

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Acked-by: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: atmel-mci: add missing of_node_put
Julia Lawall [Sat, 15 Jul 2017 16:27:41 +0000 (18:27 +0200)]
mmc: atmel-mci: add missing of_node_put

for_each_child_of_node performs an of_node_get on each iteration, so a
break out the loop requires an of_node_put.

The semantic patch that fixes this problem is as follows
(http://coccinelle.lip6.fr):

// <smpl>
@@
local idexpression n;
expression e,e1;
iterator name for_each_child_of_node;
@@

 for_each_child_of_node(e1,n) {
   ...
(
   of_node_put(n);
|
   e = n
|
+  of_node_put(n);
?  break;
)
   ...
 }
... when != n
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-of-at91: set clocks and presets after resume from deepest PM
Quentin Schulz [Thu, 13 Jul 2017 08:04:18 +0000 (10:04 +0200)]
mmc: sdhci-of-at91: set clocks and presets after resume from deepest PM

This adds deepest (Backup+Self-Refresh) PM support to the ATMEL SAMA5D2
SoC's SDHCI controller.

When resuming from deepest state, it is required to restore preset
registers as the registers are lost since VDD core has been shut down
when entering deepest state on the SAMA5D2. The clocks need to be
reconfigured as well.

The other registers and init process are taken care of by the SDHCI
core.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-of-at91: factor out clks and presets setting
Quentin Schulz [Thu, 13 Jul 2017 08:04:17 +0000 (10:04 +0200)]
mmc: sdhci-of-at91: factor out clks and presets setting

The setting of clocks and presets is currently done in probe only but
once deep PM support is added, it'll be needed in the resume function.

Let's create a function for this setting.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agodt-bindings: mmc: sh_mmcif: Document r8a7743 DT bindings
Chris Paterson [Wed, 12 Jul 2017 10:03:23 +0000 (11:03 +0100)]
dt-bindings: mmc: sh_mmcif: Document r8a7743 DT bindings

Signed-off-by: Chris Paterson <chris.paterson2@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: atmel-mci: remove unused sg_len variable
Shawn Lin [Thu, 6 Jul 2017 08:43:45 +0000 (16:43 +0800)]
mmc: atmel-mci: remove unused sg_len variable

We got a warning:

drivers/mmc/host/atmel-mci.c:1086:15: warning: variable 'sg_len' set but
not used [-Wunused-but-set-variable]

Ideally we should check to see if sg_len is zero but looking
into the code closely, I didn't find any possible to do that as
atmci_start_request didn't even deploy any error handling for
its host->prepare_data hook. So even we return error value for iflags
like what other host drivers did, for instance, sdhci and dwmmc, it still
need some extra work to improve the code.

Just remove it to silent the warning, although it isn't perfect.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-xenon: remove pointless struct xenon_priv *priv
Shawn Lin [Thu, 6 Jul 2017 08:15:23 +0000 (16:15 +0800)]
mmc: sdhci-xenon: remove pointless struct xenon_priv *priv

It was never used and leave a long standing compile warning:

drivers/mmc/host/sdhci-xenon.c: In function 'xenon_probe':
drivers/mmc/host/sdhci-xenon.c:447:21: warning: variable 'priv' set but
not used [-Wunused-but-set-variable]

Remove it to fix the warning.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: block: remove unused struct mmc_card *card
Shawn Lin [Thu, 6 Jul 2017 08:26:55 +0000 (16:26 +0800)]
mmc: block: remove unused struct mmc_card *card

It was never used and introduced a long standing compile
warning:

drivers/mmc/core/block.c: In function 'power_ro_lock_store':
drivers/mmc/core/block.c:191:19: warning: variable 'card' set but not
used [-Wunused-but-set-variable]

Remove it to fix the warning.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: mxcmmc: check the return value of mxcmci_finish_data
Shawn Lin [Thu, 6 Jul 2017 08:09:12 +0000 (16:09 +0800)]
mmc: mxcmmc: check the return value of mxcmci_finish_data

We got a compile warning for mxcmmc,

drivers/mmc/host/mxcmmc.c: In function 'mxcmci_data_done':
drivers/mmc/host/mxcmmc.c:661:6: warning: variable 'data_error' set but
not used [-Wunused-but-set-variable]

The easiest method is to remove the data_error. But looking into
the code closely, I think we should check the return value of
mxcmci_finish_data as if it got data->error(the same as data_error),
we shouldn't try to read the response.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: mmc_ops: fix a typo for comment of mmc_start_bkops
Shawn Lin [Tue, 4 Jul 2017 02:30:03 +0000 (10:30 +0800)]
mmc: mmc_ops: fix a typo for comment of mmc_start_bkops

Just a trivial fix for that found by reading the code.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: mediatek: add ops->get_cd() support
Chaotian Jing [Mon, 3 Jul 2017 06:24:56 +0000 (14:24 +0800)]
mmc: mediatek: add ops->get_cd() support

if user plug out sd card slowly, finally card is plugged out but
cat /proc/partitions can find that card is still exist in kernel.
that's because alougth get card detect interrupt but CMD13 still
can get correct response(all other pins are connected expect card
detect pin).
add ops->get_cd() can avoid this issue.

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: rtsx_usb_sdmmc: make array 'width' static const
Colin Ian King [Thu, 29 Jun 2017 18:12:19 +0000 (19:12 +0100)]
mmc: rtsx_usb_sdmmc: make array 'width' static const

array width is on-stack and not modified and should be
made static const.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: renesas_sdhi_core: on R-Car 2+, make use of CBSY bit
Wolfram Sang [Wed, 28 Jun 2017 15:21:56 +0000 (17:21 +0200)]
mmc: renesas_sdhi_core: on R-Car 2+, make use of CBSY bit

Most registers need to wait until the command is completed, not
necessarily until the bus is free. At least, R-Car 2+ SoCs can signal
that via the CBSY bit, so let's use it there instead of SCLKDIVEN to
save a little bit of delay.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tmio: don't wait on R-Car2+ when handling the clock
Wolfram Sang [Wed, 28 Jun 2017 15:23:11 +0000 (17:23 +0200)]
mmc: tmio: don't wait on R-Car2+ when handling the clock

Our hardware engineers confirmed that it is unnecessary to wait when
turning the clock on/off. The documentation was a tad vague, so we
used to play safe.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tmio: no magic values when enabling DMA
Wolfram Sang [Fri, 30 Jun 2017 10:56:48 +0000 (12:56 +0200)]
mmc: tmio: no magic values when enabling DMA

Use a proper define.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tmio: add references to bit defines in the header
Wolfram Sang [Fri, 30 Jun 2017 10:56:47 +0000 (12:56 +0200)]
mmc: tmio: add references to bit defines in the header

When defining bits, make sure we always have a reference to the register
they belong to. For now, renaming all bits properly seems too intrusive,
so at least make sure we have proper documentation.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tmio: remove obsolete TMIO_BBS
Wolfram Sang [Fri, 30 Jun 2017 10:56:46 +0000 (12:56 +0200)]
mmc: tmio: remove obsolete TMIO_BBS

Since commit 10c7fcbd0f00a0 ("ARM: shmobile: sh7372: Remove ZBOOT
MMC/SDHI support"), this define is not needed anymore.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tmio: fix CMD12 (STOP) handling
Wolfram Sang [Mon, 3 Jul 2017 19:28:23 +0000 (21:28 +0200)]
mmc: tmio: fix CMD12 (STOP) handling

I always anticipated this code to be not correct, but now I had a test
case to prove it. According to all documentation I have, setting the
TMIO_STOP_STP bit ever only worked during block transfers. This bit is
like manually enforcing an autocmd12 during a so far seamless transfer.
It does NOT work when the block transfer had errors. It also does NOT
work with any other cmd except block commands. For all those, CMD12 has
to be treated like any other command. So, basically, we could use this
bit only for mrq->data->stop cmds. But for these, we happily use the
autocmd12 feature using the TMIO_STOP_SEC bit. As a result, the above
bit is not useful for us and we need to treat CMD12 as a regular cmd
always. Just remove the special handling code. Note that the BSP
recognized this issue as well yet had a more cautious solution to the
problem [1]. Which is understandable but makes CMD12 handling even more
complicated.

Checked with a Renesas Salvator-X/M3-W which needed to send CMD12 when
retuning one of my SD cards.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=2838a2ff8ca776f6d18b7fbbe75f3df8dd64183a

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Jan Klötzke <jan.kloetzke@preh.de>
Tested-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: mxcmmc: fix error return code in mxcmci_probe()
Gustavo A. R. Silva [Fri, 7 Jul 2017 05:59:28 +0000 (00:59 -0500)]
mmc: mxcmmc: fix error return code in mxcmci_probe()

platform_get_irq() returns an error code, but the mxcmmc driver
ignores it and always returns -EINVAL. This is not correct,
and prevents -EPROBE_DEFER from being propagated properly.

Print error message and propagate the return value of
platform_get_irq on failure.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: android-goldfish: remove logically dead code in goldfish_mmc_irq()
Gustavo A. R. Silva [Wed, 28 Jun 2017 13:55:15 +0000 (08:55 -0500)]
mmc: android-goldfish: remove logically dead code in goldfish_mmc_irq()

Local variable transfer_error is assigned to a constant value and
it is never updated again.

Remove this variable and the dead code it guards.

Addresses-Coverity-ID: 1222110
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-st: add FSP2(ppc476fpe) into depends for sdhci-st
Ivan Mikhaylov [Fri, 30 Jun 2017 11:53:30 +0000 (14:53 +0300)]
mmc: sdhci-st: add FSP2(ppc476fpe) into depends for sdhci-st

shdci-st driver can be used for ppc476 fsp2 soc.

Signed-off-by: Ivan Mikhaylov <ivan@de.ibm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: omap_hsmmc: Reduce max_segs for reliability
Will Newton [Thu, 22 Jun 2017 10:57:53 +0000 (11:57 +0100)]
mmc: omap_hsmmc: Reduce max_segs for reliability

Reduce max_segs to 64, a value that allows allocation of an entire
EDMA descriptor list within a single page - EDMA descriptors
are 40 bytes and the header is much larger. This avoids doing a
higher order GFP_ATOMIC allocation in edma_prep_slave_sg
when setting up a transfer which can potentially fail due to
fragmentation under heavy I/O load.

The current value of 1024 is unusually high in comparison to
other mmc host drivers which mostly use values of between 1
and 256. The EDMA driver at present splits lists above 20
segments in any case so reducing the size of lists we pass to
it shouldn't add much overhead.

Signed-off-by: Will Newton <willn@resin.io>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agoDocumentation: rockchip-dw-mshc: add description for rk3228
Shawn Lin [Thu, 22 Jun 2017 10:29:58 +0000 (18:29 +0800)]
Documentation: rockchip-dw-mshc: add description for rk3228

Add "rockchip,rk3228-dw-mshc", "rockchip,rk3288-dw-mshc" for
dwmmc on rk322x platform.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: renesas-sdhi: add support for R-Car Gen3 SDHI DMAC
Simon Horman [Wed, 21 Jun 2017 14:00:29 +0000 (16:00 +0200)]
mmc: renesas-sdhi: add support for R-Car Gen3 SDHI DMAC

Add a new variant of the SDHI driver to support R-Car Gen3 with DMA via
on-chip bus mastering.  Since the DMAC is in a part of the SDHI module it
is not suitable to be used via DMA Engine.

Clearing of DM_CM_INFO1 after DMA thanks to Dirk Behme

Cc: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Ai Kyuse <ai.kyuse.uw@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tmio, renesas-sdhi: add dataend to DMA ops
Simon Horman [Wed, 21 Jun 2017 14:00:28 +0000 (16:00 +0200)]
mmc: tmio, renesas-sdhi: add dataend to DMA ops

Add dataend to DMA ops to allow DMAC implementation dependent
handling of DMA data end.

Also implement the operation for SDHI.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: tmio, renesas-sdhi: add max_{segs, blk_count} to tmio_mmc_data
Yoshihiro Shimoda [Wed, 21 Jun 2017 14:00:27 +0000 (16:00 +0200)]
mmc: tmio, renesas-sdhi: add max_{segs, blk_count} to tmio_mmc_data

Allow TMIO and SDHI driver implementations to provide values for
max_segs and max_blk_count.

A follow-up patch will set these values for Renesas Gen3 SoCs
the using an SDHI driver.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Ai Kyuse <ai.kyuse.uw@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: omap_hsmmc: constify dev_pm_ops structures
Arvind Yadav [Thu, 29 Jun 2017 08:09:29 +0000 (13:39 +0530)]
mmc: omap_hsmmc: constify dev_pm_ops structures

dev_pm_ops are not supposed to change at runtime. All functions
working with dev_pm_ops provided by <linux/device.h> work with const
dev_pm_ops. So mark the non-const structs as const.

File size before:
   text    data     bss     dec     hex filename
  11586     624       0   12210    2fb2 drivers/mmc/host/omap_hsmmc.o

File size After adding 'const':
   text    data     bss     dec     hex filename
  11778     432       0   12210    2fb2 drivers/mmc/host/omap_hsmmc.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agommc: sdhci-st: Handle return value of clk_prepare_enable
Arvind Yadav [Tue, 20 Jun 2017 11:57:00 +0000 (17:27 +0530)]
mmc: sdhci-st: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
6 years agoLinux 4.13-rc7 v4.13-rc7
Linus Torvalds [Mon, 28 Aug 2017 00:20:40 +0000 (17:20 -0700)]
Linux 4.13-rc7

6 years agoMerge tag 'iommu-fixes-v4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 28 Aug 2017 00:10:34 +0000 (17:10 -0700)]
Merge tag 'iommu-fixes-v4.13-rc6' of git://git./linux/kernel/git/joro/iommu

Pull IOMMU fix from Joerg Roedel:
 "Another fix, this time in common IOMMU sysfs code.

  In the conversion from the old iommu sysfs-code to the
  iommu_device_register interface, I missed to update the release path
  for the struct device associated with an IOMMU. It freed the 'struct
  device', which was a pointer before, but is now embedded in another
  struct.

  Freeing from the middle of allocated memory had all kinds of nasty
  side effects when an IOMMU was unplugged. Unfortunatly nobody
  unplugged and IOMMU until now, so this was not discovered earlier. The
  fix is to make the 'struct device' a pointer again"

* tag 'iommu-fixes-v4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu: Fix wrong freeing of iommu_device->dev

6 years agoMerge tag 'char-misc-4.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Mon, 28 Aug 2017 00:08:37 +0000 (17:08 -0700)]
Merge tag 'char-misc-4.13-rc7' of git://git./linux/kernel/git/gregkh/char-misc

Pull char/misc fix from Greg KH:
 "Here is a single misc driver fix for 4.13-rc7. It resolves a reported
  problem in the Android binder driver due to previous patches in
  4.13-rc.

  It's been in linux-next with no reported issues"

* tag 'char-misc-4.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  ANDROID: binder: fix proc->tsk check.