projects/linux·commit 5233c331

Merge tag 'mmc-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

5233c331 · Linus Torvalds <[email protected]> · 2016-12-13 08:34:11 -08:00

Pull MMC updates from Ulf Hansson:
 "It's been an busy period for mmc. Quite some changes in the mmc core,
  two new mmc host drivers, some existing drivers being extended to
  support new IP versions and lots of other updates.

  MMC core:
   - Delete eMMC packed command support
   - Introduce mmc_abort_tuning() to enable eMMC tuning to fail
     gracefully
   - Introduce mmc_can_retune() to see if a host can be retuned
   - Re-work and improve the sequence when sending a CMD6 for mmc
   - Enable CDM13 polling when switching to HS and HS DDR mode for mmc
   - Relax checking for CMD6 errors after switch to HS200
   - Re-factoring the code dealing with the mmc block queue
   - Recognize whether the eMMC card supports CMDQ
   - Fix 4K native sector check
   - Don't power off the card when starting the host
   - Increase MMC_IOC_MAX_BYTES to support bigger firmware binaries
   - Improve error handling and drop meaningless BUG_ONs()
   - Lots of clean-ups and changes to improve the quality of the code

  MMC host:
   - sdhci: Fix tuning sequence and clean-up the related code
   - sdhci: Add support to via DT override broken SDHCI cap register
     bits
   - sdhci-cadence: Add new driver for Cadence SD4HC SDHCI variant
   - sdhci-msm: Update clock management
   - sdhci-msm: Add support for eMMC HS400 mode
   - sdhci-msm: Deploy runtime/system PM support
   - sdhci-iproc: Extend driver support to newer IP versions
   - sdhci-pci: Add support for Intel GLK
   - sdhci-pci: Add support for Intel NI byt sdio
   - sdhci-acpi: Add support for 80860F14 UID 2 SDIO bus
   - sdhci: Lots of various small improvements and clean-ups
   - tmio: Add support for tuning
   - sh_mobile_sdhi: Add support for tuning
   - sh_mobile_sdhi: Extend driver to support SDHI IP on R7S72100 SoC
   - sh_mobile_sdhi: remove support for sh7372
   - davinci: Use mmc_of_parse() to enable generic mmc DT bindings
   - meson: Add new driver to support GX platforms
   - dw_mmc: Deploy generic runtime/system PM support
   - dw_mmc: Lots of various small improvements

  As a part of the mmc changes this time, I have also pulled in an
  immutable branch/tag (soc-device-match-tag1) hosted by Geert
  Uytterhoeven, to share the implementation of the new
  soc_device_match() interface. This is needed by these mmc related
  changes:

   - mmc: sdhci-of-esdhc: Get correct IP version for T4240-R1.0-R2.0
   - soc: fsl: add GUTS driver for QorIQ platforms"

* tag 'mmc-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (136 commits)
  mmc: sdhci-cadence: add Cadence SD4HC support
  mmc: sdhci: export sdhci_execute_tuning()
  mmc: sdhci: Tidy tuning loop
  mmc: sdhci: Simplify tuning block size logic
  mmc: sdhci: Factor out tuning helper functions
  mmc: sdhci: Use mmc_abort_tuning()
  mmc: mmc: Introduce mmc_abort_tuning()
  mmc: sdhci: Always allow tuning to fall back to fixed sampling
  mmc: sdhci: Fix tuning reset after exhausting the maximum number of loops
  mmc: sdhci: Fix recovery from tuning timeout
  Revert "mmc: sdhci: Reset cmd and data circuits after tuning failure"
  mmc: mmc: Relax checking for switch errors after HS200 switch
  mmc: sdhci-acpi: support 80860F14 UID 2 SDIO bus
  mmc: sdhci-of-at91: remove bogus MMC_SDHCI_IO_ACCESSORS select
  mmc: sdhci-pci: Use ACPI to get max frequency for Intel NI byt sdio
  mmc: sdhci-pci: Add PCI ID for Intel NI byt sdio
  mmc: sdhci-s3c: add spin_unlock_irq() before calling clk_round_rate
  mmc: dw_mmc: display the clock message only one time when card is polling
  mmc: dw_mmc: add the debug message for polling and non-removable
  mmc: dw_mmc: check the "present" variable before checking flags
  ...
Commit
5233c331cfb41433bc167fc7c70ea67c1133ffec
Parents
58f253d2 · ff6af28f

Merge commit. Changes below are compared with the first parent: 58f253d2.

Changes

79 files changed · +4092 −1574

FileStatusAddDelContent
Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txtadded+32−0View file
Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txtmodified+9−0View file
Documentation/devicetree/bindings/mmc/renesas,mmcif.txtmodified+3−0View file
Documentation/devicetree/bindings/mmc/sdhci-cadence.txtadded+30−0View file
Documentation/devicetree/bindings/mmc/sdhci-msm.txtmodified+1−0View file
Documentation/devicetree/bindings/mmc/sdhci.txtadded+13−0View file
Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txtmodified+2−6View file
Documentation/devicetree/bindings/mmc/tmio_mmc.txtmodified+1−1View file
Documentation/devicetree/bindings/powerpc/fsl/guts.txt → Documentation/devicetree/bindings/soc/fsl/guts.txtrenamed+3−0View file
MAINTAINERSmodified+11−1View file
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsimodified+6−0View file
drivers/base/Kconfigmodified+1−0View file
drivers/base/soc.cmodified+79−0View file
drivers/mmc/card/block.cmodified+45−454View file
drivers/mmc/card/mmc_test.cmodified+43−15View file
drivers/mmc/card/queue.cmodified+123−189View file
drivers/mmc/card/queue.hmodified+5−24View file
drivers/mmc/card/sdio_uart.cmodified+0−2View file
drivers/mmc/core/core.cmodified+36−61View file
drivers/mmc/core/debugfs.cmodified+5−1View file
drivers/mmc/core/mmc.cmodified+58−55View file
drivers/mmc/core/mmc_ops.cmodified+131−89View file
drivers/mmc/core/mmc_ops.hmodified+4−3View file
drivers/mmc/core/sd.cmodified+0−14View file
drivers/mmc/core/sd_ops.cmodified+4−23View file
drivers/mmc/core/sdio.cmodified+2−15View file
drivers/mmc/core/sdio_cis.cmodified+2−1View file
drivers/mmc/core/sdio_irq.cmodified+7−5View file
drivers/mmc/core/slot-gpio.cmodified+8−0View file
drivers/mmc/host/Kconfigmodified+22−1View file
drivers/mmc/host/Makefilemodified+2−0View file
drivers/mmc/host/davinci_mmc.cmodified+66−64View file
drivers/mmc/host/dw_mmc-exynos.cmodified+36−16View file
drivers/mmc/host/dw_mmc-k3.cmodified+9−30View file
drivers/mmc/host/dw_mmc-pci.cmodified+9−20View file
drivers/mmc/host/dw_mmc-pltfm.cmodified+8−20View file
drivers/mmc/host/dw_mmc-rockchip.cmodified+39−3View file
drivers/mmc/host/dw_mmc.cmodified+115−66View file
drivers/mmc/host/dw_mmc.hmodified+4−3View file
drivers/mmc/host/jz4740_mmc.cmodified+1−2View file
drivers/mmc/host/meson-gx-mmc.cadded+851−0View file
drivers/mmc/host/mmci.cmodified+91−37View file
drivers/mmc/host/mmci.hmodified+39−32View file
drivers/mmc/host/mtk-sd.cmodified+2−2View file
drivers/mmc/host/omap_hsmmc.cmodified+1−2View file
drivers/mmc/host/rtsx_pci_sdmmc.cmodified+1−2View file
drivers/mmc/host/rtsx_usb_sdmmc.cmodified+3−0View file
drivers/mmc/host/s3cmci.cmodified+4−11View file
drivers/mmc/host/sdhci-acpi.cmodified+1−0View file
drivers/mmc/host/sdhci-cadence.cadded+283−0View file
drivers/mmc/host/sdhci-iproc.cmodified+33−2View file
drivers/mmc/host/sdhci-msm.cmodified+651−43View file
drivers/mmc/host/sdhci-of-at91.cmodified+1−0View file
drivers/mmc/host/sdhci-of-esdhc.cmodified+20−0View file
drivers/mmc/host/sdhci-pci-core.cmodified+92−6View file
drivers/mmc/host/sdhci-pci.hmodified+3−0View file
drivers/mmc/host/sdhci-pltfm.hmodified+1−1View file
drivers/mmc/host/sdhci-s3c.cmodified+2−0View file
drivers/mmc/host/sdhci.cmodified+204−158View file
drivers/mmc/host/sdhci.hmodified+3−1View file
drivers/mmc/host/sh_mobile_sdhi.cmodified+273−1View file
drivers/mmc/host/sunxi-mmc.cmodified+10−5View file
drivers/mmc/host/tmio_mmc.hmodified+31−1View file
drivers/mmc/host/tmio_mmc_pio.cmodified+111−8View file
drivers/mmc/host/wbsd.cmodified+7−4View file
drivers/soc/Kconfigmodified+1−2View file
drivers/soc/fsl/Kconfigadded+18−0View file
drivers/soc/fsl/Makefilemodified+1−0View file
drivers/soc/fsl/guts.cadded+239−0View file
include/linux/fsl/guts.hmodified+77−48View file
include/linux/mfd/tmio.hmodified+5−0View file
include/linux/mmc/card.hmodified+2−12View file
include/linux/mmc/core.hmodified+15−1View file
include/linux/mmc/dw_mmc.hmodified+6−0View file
include/linux/mmc/host.hmodified+7−10View file
include/linux/mmc/mmc.hmodified+17−0View file
include/linux/mmc/slot-gpio.hmodified+1−0View file
include/linux/sys_soc.hmodified+9−0View file
include/uapi/linux/mmc/ioctl.hmodified+1−1View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
new file mode 100644
index 0000000..7f95ec4
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
@@ -0,0 +1,32 @@
+Amlogic SD / eMMC controller for S905/GXBB family SoCs
+
+The MMC 5.1 compliant host controller on Amlogic provides the
+interface for SD, eMMC and SDIO devices.
+
+This file documents the properties in addition to those available in
+the MMC core bindings, documented by mmc.txt.
+
+Required properties:
+- compatible : contains one of:
+ - "amlogic,meson-gx-mmc"
+ - "amlogic,meson-gxbb-mmc"
+ - "amlogic,meson-gxl-mmc"
+ - "amlogic,meson-gxm-mmc"
+- clocks : A list of phandle + clock-specifier pairs for the clocks listed in clock-names.
+- clock-names: Should contain the following:
+ "core" - Main peripheral bus clock
+ "clkin0" - Parent clock of internal mux
+ "clkin1" - Other parent clock of internal mux
+ The driver has an interal mux clock which switches between clkin0 and clkin1 depending on the
+ clock rate requested by the MMC core.
+
+Example:
+
+ sd_emmc_a: mmc@70000 {
+ compatible = "amlogic,meson-gxbb-mmc";
+ reg = <0x0 0x70000 0x0 0x2000>;
+ interrupts = < GIC_SPI 216 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, <&clkc CLKID_FCLK_DIV2>;
+ clock-names = "core", "clkin0", "clkin1";
+ pinctrl-0 = <&emmc_pins>;
+ };

Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt b/Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt
index be56d2b..954561d 100644
--- a/Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt
+++ b/Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt
@@ -7,6 +7,15 @@ Required properties:
- compatible : Should be one of the following
"brcm,bcm2835-sdhci"
"brcm,sdhci-iproc-cygnus"
+ "brcm,sdhci-iproc"
+
+Use brcm2835-sdhci for Rasperry PI.
+
+Use sdhci-iproc-cygnus for Broadcom SDHCI Controllers
+restricted to 32bit host accesses to SDHCI registers.
+
+Use sdhci-iproc for Broadcom SDHCI Controllers that allow standard
+8, 16, 32-bit host access to SDHCI register.
- clocks : The clock feeding the SDHCI controller.

Documentation/devicetree/bindings/mmc/renesas,mmcif.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt b/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
index ff611fa..e4ba92a 100644
--- a/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
+++ b/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
@@ -8,11 +8,14 @@ Required properties:
- compatible: should be "renesas,mmcif-<soctype>", "renesas,sh-mmcif" as a
fallback. Examples with <soctype> are:
+ - "renesas,mmcif-r8a73a4" for the MMCIF found in r8a73a4 SoCs
- "renesas,mmcif-r8a7740" for the MMCIF found in r8a7740 SoCs
+ - "renesas,mmcif-r8a7778" for the MMCIF found in r8a7778 SoCs
- "renesas,mmcif-r8a7790" for the MMCIF found in r8a7790 SoCs
- "renesas,mmcif-r8a7791" for the MMCIF found in r8a7791 SoCs
- "renesas,mmcif-r8a7793" for the MMCIF found in r8a7793 SoCs
- "renesas,mmcif-r8a7794" for the MMCIF found in r8a7794 SoCs
+ - "renesas,mmcif-sh73a0" for the MMCIF found in sh73a0 SoCs
- clocks: reference to the functional clock

Documentation/devicetree/bindings/mmc/sdhci-cadence.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-cadence.txt b/Documentation/devicetree/bindings/mmc/sdhci-cadence.txt
new file mode 100644
index 0000000..750374f
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/sdhci-cadence.txt
@@ -0,0 +1,30 @@
+* Cadence SD/SDIO/eMMC Host Controller
+
+Required properties:
+- compatible: should be "cdns,sd4hc".
+- reg: offset and length of the register set for the device.
+- interrupts: a single interrupt specifier.
+- clocks: phandle to the input clock.
+
+Optional properties:
+For eMMC configuration, supported speed modes are not indicated by the SDHCI
+Capabilities Register. Instead, the following properties should be specified
+if supported. See mmc.txt for details.
+- mmc-ddr-1_8v
+- mmc-ddr-1_2v
+- mmc-hs200-1_8v
+- mmc-hs200-1_2v
+- mmc-hs400-1_8v
+- mmc-hs400-1_2v
+
+Example:
+ emmc: sdhci@5a000000 {
+ compatible = "cdns,sd4hc";
+ reg = <0x5a000000 0x400>;
+ interrupts = <0 78 4>;
+ clocks = <&clk 4>;
+ bus-width = <8>;
+ mmc-ddr-1_8v;
+ mmc-hs200-1_8v;
+ mmc-hs400-1_8v;
+ };

Documentation/devicetree/bindings/mmc/sdhci-msm.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
index 485483a..0576264 100644
--- a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
+++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
@@ -17,6 +17,7 @@ Required properties:
"iface" - Main peripheral bus clock (PCLK/HCLK - AHB Bus clock) (required)
"core" - SDC MMC clock (MCLK) (required)
"bus" - SDCC bus voter clock (optional)
+ "xo" - TCXO clock (optional)
Example:

Documentation/devicetree/bindings/mmc/sdhci.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/sdhci.txt b/Documentation/devicetree/bindings/mmc/sdhci.txt
new file mode 100644
index 0000000..1c95a1a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/sdhci.txt
@@ -0,0 +1,13 @@
+The properties specific for SD host controllers. For properties shared by MMC
+host controllers refer to the mmc[1] bindings.
+
+ [1] Documentation/devicetree/bindings/mmc/mmc.txt
+
+Optional properties:
+- sdhci-caps-mask: The sdhci capabilities register is incorrect. This 64bit
+ property corresponds to the bits in the sdhci capabilty register. If the bit
+ is on in the mask then the bit is incorrect in the register and should be
+ turned off, before applying sdhci-caps.
+- sdhci-caps: The sdhci capabilities register is incorrect. This 64bit
+ property corresponds to the bits in the sdhci capability register. If the
+ bit is on in the property then the bit should be turned on.

Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
index bfa461a..7fd17c3 100644
--- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
+++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
@@ -59,8 +59,9 @@ Optional properties:
is specified and the ciu clock is specified then we'll try to set the ciu
clock to this at probe time.
-* clock-freq-min-max: Minimum and Maximum clock frequency for card output
+* clock-freq-min-max (DEPRECATED): Minimum and Maximum clock frequency for card output
clock(cclk_out). If it's not specified, max is 200MHZ and min is 400KHz by default.
+ (Use the "max-frequency" instead of "clock-freq-min-max".)
* num-slots: specifies the number of slots supported by the controller.
The number of physical slots actually used could be equal or less than the
@@ -74,11 +75,6 @@ Optional properties:
* card-detect-delay: Delay in milli-seconds before detecting card after card
insert event. The default value is 0.
-* supports-highspeed (DEPRECATED): Enables support for high speed cards (up to 50MHz)
- (use "cap-mmc-highspeed" or "cap-sd-highspeed" instead)
-
-* broken-cd: as documented in mmc core bindings.
-
* vmmc-supply: The phandle to the regulator to use for vmmc. If this is
specified we'll defer probe until we can find this regulator.

Documentation/devicetree/bindings/mmc/tmio_mmc.txt

View file
diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index 13df9c2..a1650ed 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -11,8 +11,8 @@ optional bindings can be used.
Required properties:
- compatible: "renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
- "renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
"renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
+ "renesas,sdhi-r7s72100" - SDHI IP on R7S72100 SoC
"renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
"renesas,sdhi-r8a7740" - SDHI IP on R8A7740 SoC
"renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC

Documentation/devicetree/bindings/soc/fsl/guts.txt

View file
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt b/Documentation/devicetree/bindings/soc/fsl/guts.txt
similarity index 97%
rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txt
rename to Documentation/devicetree/bindings/soc/fsl/guts.txt
index b71b203..07adca9 100644
--- a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/guts.txt
@@ -25,6 +25,9 @@ Recommended properties:
- fsl,liodn-bits : Indicates the number of defined bits in the LIODN
registers, for those SOCs that have a PAMU device.
+ - little-endian : Indicates that the global utilities block is little
+ endian. The default is big endian.
+
Examples:
global-utilities@e0000 { /* global utilities block */
compatible = "fsl,mpc8548-guts";

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index d043350..ef461e0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1052,6 +1052,7 @@ F: arch/arm/mach-meson/
F: arch/arm/boot/dts/meson*
F: arch/arm64/boot/dts/amlogic/
F: drivers/pinctrl/meson/
+F: drivers/mmc/host/meson*
N: meson
ARM/Annapurna Labs ALPINE ARCHITECTURE
@@ -5068,9 +5069,18 @@ S: Maintained
F: drivers/net/ethernet/freescale/fman
F: Documentation/devicetree/bindings/powerpc/fsl/fman.txt
+FREESCALE SOC DRIVERS
+M: Scott Wood <[email protected]>
+S: Maintained
+F: drivers/soc/fsl/
+F: include/linux/fsl/
+
FREESCALE QUICC ENGINE LIBRARY
+M: Qiang Zhao <[email protected]>
-S: Orphan
+S: Maintained
F: drivers/soc/fsl/qe/
F: include/soc/fsl/*qe*.h
F: include/soc/fsl/*ucc*.h

arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi

View file
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
index 7f0dc13..d058e56 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
@@ -216,6 +216,12 @@
clocks = <&sysclk>;
};
+ dcfg: dcfg@1e00000 {
+ compatible = "fsl,ls2080a-dcfg", "syscon";
+ reg = <0x0 0x1e00000 0x0 0x10000>;
+ little-endian;
+ };
+
serial0: serial@21c0500 {
compatible = "fsl,ns16550", "ns16550a";
reg = <0x0 0x21c0500 0x0 0x100>;

drivers/base/Kconfig

View file
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index d02e7c0..2abea87 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
config SOC_BUS
bool
+ select GLOB
source "drivers/base/regmap/Kconfig"

drivers/base/soc.c

View file
diff --git a/drivers/base/soc.c b/drivers/base/soc.c
index b63f23e..dc26e59 100644
--- a/drivers/base/soc.c
+++ b/drivers/base/soc.c
@@ -13,6 +13,7 @@
#include <linux/spinlock.h>
#include <linux/sys_soc.h>
#include <linux/err.h>
+#include <linux/glob.h>
static DEFINE_IDA(soc_ida);
@@ -113,6 +114,12 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr
struct soc_device *soc_dev;
int ret;
+ if (!soc_bus_type.p) {
+ ret = bus_register(&soc_bus_type);
+ if (ret)
+ goto out1;
+ }
+
soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL);
if (!soc_dev) {
ret = -ENOMEM;
@@ -156,6 +163,78 @@ void soc_device_unregister(struct soc_device *soc_dev)
static int __init soc_bus_register(void)
{
+ if (soc_bus_type.p)
+ return 0;
+
return bus_register(&soc_bus_type);
}
core_initcall(soc_bus_register);
+
+static int soc_device_match_one(struct device *dev, void *arg)
+{
+ struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
+ const struct soc_device_attribute *match = arg;
+
+ if (match->machine &&
+ (!soc_dev->attr->machine ||
+ !glob_match(match->machine, soc_dev->attr->machine)))
+ return 0;
+
+ if (match->family &&
+ (!soc_dev->attr->family ||
+ !glob_match(match->family, soc_dev->attr->family)))
+ return 0;
+
+ if (match->revision &&
+ (!soc_dev->attr->revision ||
+ !glob_match(match->revision, soc_dev->attr->revision)))
+ return 0;
+
+ if (match->soc_id &&
+ (!soc_dev->attr->soc_id ||
+ !glob_match(match->soc_id, soc_dev->attr->soc_id)))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * soc_device_match - identify the SoC in the machine
+ * @matches: zero-terminated array of possible matches
+ *
+ * returns the first matching entry of the argument array, or NULL
+ * if none of them match.
+ *
+ * This function is meant as a helper in place of of_match_node()
+ * in cases where either no device tree is available or the information
+ * in a device node is insufficient to identify a particular variant
+ * by its compatible strings or other properties. For new devices,
+ * the DT binding should always provide unique compatible strings
+ * that allow the use of of_match_node() instead.
+ *
+ * The calling function can use the .data entry of the
+ * soc_device_attribute to pass a structure or function pointer for
+ * each entry.
+ */
+const struct soc_device_attribute *soc_device_match(
+ const struct soc_device_attribute *matches)
+{
+ int ret = 0;
+
+ if (!matches)
+ return NULL;
+
+ while (!ret) {
+ if (!(matches->machine || matches->family ||
+ matches->revision || matches->soc_id))
+ break;
+ ret = bus_for_each_dev(&soc_bus_type, NULL, (void *)matches,
+ soc_device_match_one);
+ if (!ret)
+ matches++;
+ else
+ return matches;
+ }
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(soc_device_match);

drivers/mmc/card/block.c

View file
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 709a872..646d1a1 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -66,9 +66,6 @@ MODULE_ALIAS("mmc:block");
#define mmc_req_rel_wr(req) ((req->cmd_flags & REQ_FUA) && \
(rq_data_dir(req) == WRITE))
-#define PACKED_CMD_VER 0x01
-#define PACKED_CMD_WR 0x02
-
static DEFINE_MUTEX(block_mutex);
/*
@@ -102,7 +99,6 @@ struct mmc_blk_data {
unsigned int flags;
#define MMC_BLK_CMD23 (1 << 0) /* Can do SET_BLOCK_COUNT for multiblock */
#define MMC_BLK_REL_WR (1 << 1) /* MMC Reliable write support */
-#define MMC_BLK_PACKED_CMD (1 << 2) /* MMC packed command support */
unsigned int usage;
unsigned int read_only;
@@ -126,12 +122,6 @@ struct mmc_blk_data {
static DEFINE_MUTEX(open_lock);
-enum {
- MMC_PACKED_NR_IDX = -1,
- MMC_PACKED_NR_ZERO,
- MMC_PACKED_NR_SINGLE,
-};
-
module_param(perdev_minors, int, 0444);
MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
@@ -139,17 +129,6 @@ static inline int mmc_blk_part_switch(struct mmc_card *card,
struct mmc_blk_data *md);
static int get_card_status(struct mmc_card *card, u32 *status, int retries);
-static inline void mmc_blk_clear_packed(struct mmc_queue_req *mqrq)
-{
- struct mmc_packed *packed = mqrq->packed;
-
- mqrq->cmd_type = MMC_PACKED_NONE;
- packed->nr_entries = MMC_PACKED_NR_ZERO;
- packed->idx_failure = MMC_PACKED_NR_IDX;
- packed->retries = 0;
- packed->blocks = 0;
-}
-
static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
{
struct mmc_blk_data *md;
@@ -854,7 +833,7 @@ static int get_card_status(struct mmc_card *card, u32 *status, int retries)
}
static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
- bool hw_busy_detect, struct request *req, int *gen_err)
+ bool hw_busy_detect, struct request *req, bool *gen_err)
{
unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
int err = 0;
@@ -871,7 +850,7 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
if (status & R1_ERROR) {
pr_err("%s: %s: error sending status cmd, status %#x\n",
req->rq_disk->disk_name, __func__, status);
- *gen_err = 1;
+ *gen_err = true;
}
/* We may rely on the host hw to handle busy detection.*/
@@ -902,7 +881,7 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
}
static int send_stop(struct mmc_card *card, unsigned int timeout_ms,
- struct request *req, int *gen_err, u32 *stop_status)
+ struct request *req, bool *gen_err, u32 *stop_status)
{
struct mmc_host *host = card->host;
struct mmc_command cmd = {0};
@@ -940,7 +919,7 @@ static int send_stop(struct mmc_card *card, unsigned int timeout_ms,
(*stop_status & R1_ERROR)) {
pr_err("%s: %s: general error sending stop command, resp %#x\n",
req->rq_disk->disk_name, __func__, *stop_status);
- *gen_err = 1;
+ *gen_err = true;
}
return card_busy_detect(card, timeout_ms, use_r1b_resp, req, gen_err);
@@ -1014,7 +993,7 @@ static int mmc_blk_cmd_error(struct request *req, const char *name, int error,
* Otherwise we don't understand what happened, so abort.
*/
static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
- struct mmc_blk_request *brq, int *ecc_err, int *gen_err)
+ struct mmc_blk_request *brq, bool *ecc_err, bool *gen_err)
{
bool prev_cmd_status_valid = true;
u32 status, stop_status = 0;
@@ -1053,7 +1032,7 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
if ((status & R1_CARD_ECC_FAILED) ||
(brq->stop.resp[0] & R1_CARD_ECC_FAILED) ||
(brq->cmd.resp[0] & R1_CARD_ECC_FAILED))
- *ecc_err = 1;
+ *ecc_err = true;
/* Flag General errors */
if (!mmc_host_is_spi(card->host) && rq_data_dir(req) != READ)
@@ -1062,7 +1041,7 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
pr_err("%s: %s: general error sending stop or status command, stop cmd response %#x, card status %#x\n",
req->rq_disk->disk_name, __func__,
brq->stop.resp[0], status);
- *gen_err = 1;
+ *gen_err = true;
}
/*
@@ -1085,7 +1064,7 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
}
if (stop_status & R1_CARD_ECC_FAILED)
- *ecc_err = 1;
+ *ecc_err = true;
}
/* Check for set block count errors */
@@ -1154,7 +1133,7 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
int mmc_access_rpmb(struct mmc_queue *mq)
{
- struct mmc_blk_data *md = mq->data;
+ struct mmc_blk_data *md = mq->blkdata;
/*
* If this is a RPMB partition access, return ture
*/
@@ -1166,7 +1145,7 @@ int mmc_access_rpmb(struct mmc_queue *mq)
static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
{
- struct mmc_blk_data *md = mq->data;
+ struct mmc_blk_data *md = mq->blkdata;
struct mmc_card *card = md->queue.card;
unsigned int from, nr, arg;
int err = 0, type = MMC_BLK_DISCARD;
@@ -1210,7 +1189,7 @@ out:
static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
struct request *req)
{
- struct mmc_blk_data *md = mq->data;
+ struct mmc_blk_data *md = mq->blkdata;
struct mmc_card *card = md->queue.card;
unsigned int from, nr, arg;
int err = 0, type = MMC_BLK_SECDISCARD;
@@ -1276,7 +1255,7 @@ out:
static int mmc_blk_issue_flush(struct mmc_queue *mq, struct request *req)
{
- struct mmc_blk_data *md = mq->data;
+ struct mmc_blk_data *md = mq->blkdata;
struct mmc_card *card = md->queue.card;
int ret = 0;
@@ -1320,15 +1299,16 @@ static inline void mmc_apply_rel_rw(struct mmc_blk_request *brq,
R1_CC_ERROR | /* Card controller error */ \
R1_ERROR) /* General/unknown error */
-static int mmc_blk_err_check(struct mmc_card *card,
- struct mmc_async_req *areq)
+static enum mmc_blk_status mmc_blk_err_check(struct mmc_card *card,
+ struct mmc_async_req *areq)
{
struct mmc_queue_req *mq_mrq = container_of(areq, struct mmc_queue_req,
mmc_active);
struct mmc_blk_request *brq = &mq_mrq->brq;
struct request *req = mq_mrq->req;
int need_retune = card->host->need_retune;
- int ecc_err = 0, gen_err = 0;
+ bool ecc_err = false;
+ bool gen_err = false;
/*
* sbc.error indicates a problem with the set block count
@@ -1378,7 +1358,7 @@ static int mmc_blk_err_check(struct mmc_card *card,
pr_err("%s: %s: general error sending stop command, stop cmd response %#x\n",
req->rq_disk->disk_name, __func__,
brq->stop.resp[0]);
- gen_err = 1;
+ gen_err = true;
}
err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, false, req,
@@ -1419,67 +1399,12 @@ static int mmc_blk_err_check(struct mmc_card *card,
if (!brq->data.bytes_xfered)
return MMC_BLK_RETRY;
- if (mmc_packed_cmd(mq_mrq->cmd_type)) {
- if (unlikely(brq->data.blocks << 9 != brq->data.bytes_xfered))
- return MMC_BLK_PARTIAL;
- else
- return MMC_BLK_SUCCESS;
- }
-
if (blk_rq_bytes(req) != brq->data.bytes_xfered)
return MMC_BLK_PARTIAL;
return MMC_BLK_SUCCESS;
}
-static int mmc_blk_packed_err_check(struct mmc_card *card,
- struct mmc_async_req *areq)
-{
- struct mmc_queue_req *mq_rq = container_of(areq, struct mmc_queue_req,
- mmc_active);
- struct request *req = mq_rq->req;
- struct mmc_packed *packed = mq_rq->packed;
- int err, check, status;
- u8 *ext_csd;
-
- packed->retries--;
- check = mmc_blk_err_check(card, areq);
- err = get_card_status(card, &status, 0);
- if (err) {
- pr_err("%s: error %d sending status command\n",
- req->rq_disk->disk_name, err);
- return MMC_BLK_ABORT;
- }
-
- if (status & R1_EXCEPTION_EVENT) {
- err = mmc_get_ext_csd(card, &ext_csd);
- if (err) {
- pr_err("%s: error %d sending ext_csd\n",
- req->rq_disk->disk_name, err);
- return MMC_BLK_ABORT;
- }

This diff is incomplete. Download the complete patch.

drivers/mmc/card/mmc_test.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/card/queue.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/card/queue.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/card/sdio_uart.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/debugfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/mmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/mmc_ops.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/mmc_ops.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/sd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/sd_ops.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/sdio.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/sdio_cis.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/sdio_irq.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/core/slot-gpio.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/davinci_mmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/dw_mmc-exynos.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/dw_mmc-k3.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/dw_mmc-pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/dw_mmc-pltfm.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/dw_mmc-rockchip.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/dw_mmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/dw_mmc.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/jz4740_mmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/meson-gx-mmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/mmci.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/mmci.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/mtk-sd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/omap_hsmmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/rtsx_pci_sdmmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/rtsx_usb_sdmmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/s3cmci.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-acpi.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-cadence.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-iproc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-msm.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-of-at91.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-of-esdhc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-pci-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-pci.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-pltfm.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci-s3c.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sdhci.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sh_mobile_sdhi.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/sunxi-mmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/tmio_mmc.h

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/tmio_mmc_pio.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/wbsd.c

View file

This diff is incomplete. Download the complete patch.

drivers/soc/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/soc/fsl/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/soc/fsl/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/soc/fsl/guts.c

View file

This diff is incomplete. Download the complete patch.

include/linux/fsl/guts.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/tmio.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmc/card.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmc/core.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmc/dw_mmc.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmc/host.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmc/mmc.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmc/slot-gpio.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sys_soc.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/mmc/ioctl.h

View file

This diff is incomplete. Download the complete patch.