MMC core:
 - Decrease polling rate for erase/trim/discard
 - Allow non-sleeping GPIOs for card detect
 - Improve mmc block removal path
 - Enable support for mmc_sw_reset() for SDIO cards
 - Add mmc_sw_reset() to allow users to do a soft reset of the card
 - Allow power delay to be tunable via DT
 - Allow card detect debounce delay to be tunable via DT
 - Enable new quirk to limit clock rate for Marvell 8887 chip
 - Don't show eMMC RPMB and BOOT areas in /proc/partitions
 - Add capability to avoid 3.3V signaling for fragile HWs

MMC host:
 - Improve/fixup support for handle highmem pages
 - Remove depends on HAS_DMA in case of platform dependency
 - mvsdio: Enable support for erase/trim/discard
 - rtsx_usb: Enable support for erase/trim/discard
 - renesas_sdhi: Fix WP logic regressions
 - renesas_sdhi: Add r8a77965 support
 - renesas_sdhi: Add R8A77980 to whitelist
 - meson: Add optional support for device reset
 - meson: Add support for the Meson-AXG platform
 - dw_mmc: Add new driver for BlueField DW variant
 - mediatek: Add support for 64G DRAM DMA
 - sunxi: Deploy runtime PM support
 - jz4740: Add support for JZ4780
 - jz4740: Enable support for DT based platforms
 - sdhci: Various improvement to timeout handling
 - sdhci: Disable support for HS200/HS400/UHS when no 1.8V support
 - sdhci-omap: Add support for controller in k2g SoC
 - sdhci-omap: Add workarounds for a couple of Erratas
 - sdhci-omap: Enable support for generic sdhci DT properties
 - sdhci-cadence: Re-send tune request to deal with errata
 - sdhci-pci: Fix 3.3V voltage switch for some BYT-based Intel controllers
 - sdhci-pci: Avoid 3.3V signaling on some NI 904x
 - sdhci-esdhc-imx: Use watermark levels for PIO access
 - sdhci-msm: Improve card detection handling
 - sdhci-msm: Add support voltage pad switching
mmc: renesas_sdhi: really fix WP logic regressions

This reverts commit e060d376cc61 ("mmc: renesas_sdhi: fix WP detection")
and adds some code to really fix the regressions.

It was missed so far that Renesas R-Car instantiations of SDHI chose to
disable internal WP and used the existence of "wp-gpios" to en/disable
WP at all.

With the first refactoring by Yamada-san with commit 2ad1db059b9a ("mmc:
renesas_sdhi: use MMC_CAP2_NO_WRITE_PROTECT instead of TMIO own flag"),
WP was always disabled even when GPIOs were present. With Wolfram's
first fix which gets now reverted, GPIOs were honored. But when not
available, the fallback was to internal WP and not to disabled WP. This
caused wrong WP status on uSD card slots.

Restore the old behaviour now. By default, WP is disabled. When a GPIO
is found, the GPIO re-enables WP. We will think about possible better
ways to handle this in the future.

Tested on a previously regressing Renesas Lager board (H2) and a still
working Renesas Salvator-X board (M3-W).

Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: stable@vger.kernel.org # v4.17+
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 files changed