Skip to content

Commit

Permalink
Merge tag 'mmc-v4.2' of git://git.linaro.org/people/ulf.hansson/mmc
Browse files Browse the repository at this point in the history
Pull MMC updates from Ulf Hansson:
 "Here are the changes for MMC for v4.2.

  MMC core:
   - Fix an error path in the mmc block layer
   - Fix PM domain attachment for the SDIO bus
   - Add support for driver strength selection
   - Increase a delay to let voltage stabilize
   - Add support for disabling write-protect detection
   - Add facility to support re-tuning
   - Re-tune and retry in the recovery path
   - Add reset option for SDIO
   - Consolidations and clean-ups

  MMC host:
   - Add Mediatek MMC driver
   - Constify platform_device_id for a couple of hosts
   - Fix modalias to make module auto-loading work for a couple of hosts
   - sdhci: Add support for sdhci-arasan4.9a
   - sdhci: Fix low memory corruption
   - sdhci: Restore behavior while creating OCR mask
   - sdhci: Add a callback to select drive strength
   - sdhci: Fix driver type B and D handling
   - sdhci: Add support for drive strength selection for SPT
   - sdhci: Enable HS400 for some Intel host controllers
   - sdhci: Convert to use the new re-tuning facility
   - sdhci: Various minor fixes and clean-ups
   - dw_mmc: Add support for hi6220
   - dw_mmc: Use core to handle absent write protect line
   - dw_mmc: Add support to switch voltage
   - tmio: Some fixes and modernizations
   - sh_mmcif: Improve clock rate calculation"

* tag 'mmc-v4.2' of git://git.linaro.org/people/ulf.hansson/mmc: (98 commits)
  mmc: queue: prevent soft lockups on PREEMPT=n
  mmc: mediatek: Add PM support for MMC driver
  mmc: mediatek: Add Mediatek MMC driver
  mmc: dt-bindings: add Mediatek MMC bindings
  mmc: card: Fixup request missing in mmc_blk_issue_rw_rq
  mmc: sdhci: fix low memory corruption
  mmc: sdhci-pci: Change AMD SDHCI quirk application scope
  i2c-piix4: Use Macro for AMD CZ SMBus device ID
  pci_ids: Add AMD KERNCZ device ID support
  mmc: queue: use swap() in mmc_queue_thread()
  mmc: dw_mmc: insmod followed by rmmod will hung for eMMC
  mmc: sdhci: Restore behavior while creating OCR mask
  mmc: sdhci-pxav3: fix device wakeup initialization
  mmc: core: Attach PM domain prior probing of SDIO func driver
  mmc: core: Remove redundant ->power_restore() callback for SD
  mmc: core: Remove redundant ->power_restore() callback for MMC
  mmc: sdhci-bcm2835: Actually enable the clock
  mmc: sdhci-bcm2835: Clean up platform allocations if sdhci init fails.
  mmc: sdhci-of-esdhc: enable interrupt mode to detect card
  mmc: sdhci-esdhc-imx: add quirk SDHCI_QUIRK2_BROKEN_HS200 for imx6qdl
  ...
  • Loading branch information
Linus Torvalds committed Jun 23, 2015
2 parents 10b4b09 + a8c27c0 commit a57f14b
Show file tree
Hide file tree
Showing 67 changed files with 2,727 additions and 607 deletions.
3 changes: 2 additions & 1 deletion Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Device Tree Bindings for the Arasan SDHCI Controller
[3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

Required Properties:
- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a'
- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
'arasan,sdhci-4.9a'
- reg: From mmc bindings: Register location and length.
- clocks: From clock bindings: Handles to clock inputs.
- clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
Expand Down
9 changes: 8 additions & 1 deletion Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ This file documents differences between the core properties described
by mmc.txt and the properties used by the sdhci-esdhc-imx driver.

Required properties:
- compatible : Should be "fsl,<chip>-esdhc"
- compatible : Should be "fsl,<chip>-esdhc", the supported chips include
"fsl,imx25-esdhc"
"fsl,imx35-esdhc"
"fsl,imx51-esdhc"
"fsl,imx53-esdhc"
"fsl,imx6q-usdhc"
"fsl,imx6sl-usdhc"
"fsl,imx6sx-usdhc"

Optional properties:
- fsl,cd-controller : Indicate to use controller internal card detection
Expand Down
28 changes: 28 additions & 0 deletions Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Required Properties:

* compatible: should be one of the following.
- "hisilicon,hi4511-dw-mshc": for controllers with hi4511 specific extensions.
- "hisilicon,hi6220-dw-mshc": for controllers with hi6220 specific extensions.

Optional Properties:
- hisilicon,peripheral-syscon: phandle of syscon used to control peripheral.

Example:

Expand Down Expand Up @@ -42,3 +46,27 @@ Example:
cap-mmc-highspeed;
cap-sd-highspeed;
};

/* for Hi6220 */

dwmmc_1: dwmmc1@f723e000 {
compatible = "hisilicon,hi6220-dw-mshc";
num-slots = <0x1>;
bus-width = <0x4>;
disable-wp;
cap-sd-highspeed;
sd-uhs-sdr12;
sd-uhs-sdr25;
card-detect-delay = <200>;
hisilicon,peripheral-syscon = <&ao_ctrl>;
reg = <0x0 0xf723e000 0x0 0x1000>;
interrupts = <0x0 0x49 0x4>;
clocks = <&clock_sys HI6220_MMC1_CIUCLK>, <&clock_sys HI6220_MMC1_CLK>;
clock-names = "ciu", "biu";
cd-gpios = <&gpio1 0 1>;
pinctrl-names = "default", "idle";
pinctrl-0 = <&sd_pmx_func &sd_clk_cfg_func &sd_cfg_func>;
pinctrl-1 = <&sd_pmx_idle &sd_clk_cfg_idle &sd_cfg_idle>;
vqmmc-supply = <&ldo7>;
vmmc-supply = <&ldo10>;
};
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ Example:

sdhci0_pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&gpio1 12 0>;
reset-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
clocks = <&clk_32768_ck>;
clock-names = "ext_clock";
}
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/mmc/mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Optional properties:
below for the case, when a GPIO is used for the CD line
- wp-inverted: when present, polarity on the WP line is inverted. See the note
below for the case, when a GPIO is used for the WP line
- disable-wp: When set no physical WP line is present. This property should
only be specified when the controller has a dedicated write-protect
detection logic. If a GPIO is always used for the write-protect detection
logic it is sufficient to not specify wp-gpios property in the absence of a WP
line.
- max-frequency: maximum operating clock frequency
- no-1-8-v: when present, denotes that 1.8v card voltage is not supported on
this system, even if the controller claims it is.
Expand Down
32 changes: 32 additions & 0 deletions Documentation/devicetree/bindings/mmc/mtk-sd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
* MTK MMC controller

The MTK MSDC can act as a MMC controller
to support MMC, SD, and SDIO types of memory cards.

This file documents differences between the core properties in mmc.txt
and the properties used by the msdc driver.

Required properties:
- compatible: Should be "mediatek,mt8173-mmc","mediatek,mt8135-mmc"
- interrupts: Should contain MSDC interrupt number
- clocks: MSDC source clock, HCLK
- clock-names: "source", "hclk"
- pinctrl-names: should be "default", "state_uhs"
- pinctrl-0: should contain default/high speed pin ctrl
- pinctrl-1: should contain uhs mode pin ctrl
- vmmc-supply: power to the Core
- vqmmc-supply: power to the IO

Examples:
mmc0: mmc@11230000 {
compatible = "mediatek,mt8173-mmc", "mediatek,mt8135-mmc";
reg = <0 0x11230000 0 0x108>;
interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
vmmc-supply = <&mt6397_vemc_3v3_reg>;
vqmmc-supply = <&mt6397_vio18_reg>;
clocks = <&pericfg CLK_PERI_MSDC30_0>, <&topckgen CLK_TOP_MSDC50_0_H_SEL>;
clock-names = "source", "hclk";
pinctrl-names = "default", "state_uhs";
pinctrl-0 = <&mmc0_pins_default>;
pinctrl-1 = <&mmc0_pins_uhs>;
};
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Required properties:
dma-names property.
- dma-names: must contain "tx" for the transmit DMA channel and "rx" for the
receive DMA channel.
- max-frequency: Maximum operating clock frequency, driver uses default clock
frequency if it is not set.


Example: R8A7790 (R-Car H2) MMCIF0
Expand All @@ -29,4 +31,5 @@ Example: R8A7790 (R-Car H2) MMCIF0
clocks = <&mstp3_clks R8A7790_CLK_MMCIF0>;
dmas = <&dmac0 0xd1>, <&dmac0 0xd2>;
dma-names = "tx", "rx";
max-frequency = <97500000>;
};
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10033,7 +10033,7 @@ F: include/linux/toshiba.h
F: include/uapi/linux/toshiba.h

TMIO MMC DRIVER
M: Ian Molton <ian.molton@codethink.co.uk>
M: Ian Molton <ian@mnementh.co.uk>
L: linux-mmc@vger.kernel.org
S: Maintained
F: drivers/mmc/host/tmio_mmc*
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@

/include/ "qoriq-esdhc-0.dtsi"
sdhc@114000 {
compatible = "fsl,p2041-esdhc", "fsl,esdhc";
fsl,iommu-parent = <&pamu1>;
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
sdhci,auto-cmd12;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@

/include/ "qoriq-esdhc-0.dtsi"
sdhc@114000 {
compatible = "fsl,p3041-esdhc", "fsl,esdhc";
fsl,iommu-parent = <&pamu1>;
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
sdhci,auto-cmd12;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@

/include/ "qoriq-esdhc-0.dtsi"
sdhc@114000 {
compatible = "fsl,p4080-esdhc", "fsl,esdhc";
fsl,iommu-parent = <&pamu1>;
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
voltage-ranges = <3300 3300>;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@

/include/ "qoriq-esdhc-0.dtsi"
sdhc@114000 {
compatible = "fsl,p5020-esdhc", "fsl,esdhc";
fsl,iommu-parent = <&pamu1>;
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
sdhci,auto-cmd12;
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@

/include/ "qoriq-esdhc-0.dtsi"
sdhc@114000 {
compatible = "fsl,p5040-esdhc", "fsl,esdhc";
fsl,iommu-parent = <&pamu2>;
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
sdhci,auto-cmd12;
Expand Down
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-piix4.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS &&
PIIX4_dev->revision >= 0x41) ||
(PIIX4_dev->vendor == PCI_VENDOR_ID_AMD &&
PIIX4_dev->device == 0x790b &&
PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS &&
PIIX4_dev->revision >= 0x49))
smb_en = 0x00;
else
Expand Down Expand Up @@ -545,7 +545,7 @@ static const struct pci_device_id piix4_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x790b) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) },
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
PCI_DEVICE_ID_SERVERWORKS_OSB4) },
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
Expand Down
25 changes: 20 additions & 5 deletions drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,9 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
if (!err)
break;

/* Re-tune if needed */
mmc_retune_recheck(card->host);

prev_cmd_status_valid = false;
pr_err("%s: error %d sending status command, %sing\n",
req->rq_disk->disk_name, err, retry ? "retry" : "abort");
Expand Down Expand Up @@ -1204,6 +1207,7 @@ static int mmc_blk_err_check(struct mmc_card *card,
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;

/*
Expand Down Expand Up @@ -1271,6 +1275,12 @@ static int mmc_blk_err_check(struct mmc_card *card,
}

if (brq->data.error) {
if (need_retune && !brq->retune_retry_done) {
pr_info("%s: retrying because a re-tune was needed\n",
req->rq_disk->disk_name);
brq->retune_retry_done = 1;
return MMC_BLK_RETRY;
}
pr_err("%s: error %d transferring data, sector %u, nr %u, cmd response %#x, card status %#x\n",
req->rq_disk->disk_name, brq->data.error,
(unsigned)blk_rq_pos(req),
Expand Down Expand Up @@ -1830,7 +1840,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
struct mmc_blk_data *md = mq->data;
struct mmc_card *card = md->queue.card;
struct mmc_blk_request *brq = &mq->mqrq_cur->brq;
int ret = 1, disable_multi = 0, retry = 0, type;
int ret = 1, disable_multi = 0, retry = 0, type, retune_retry_done = 0;
enum mmc_blk_status status;
struct mmc_queue_req *mq_rq;
struct request *req = rqc;
Expand Down Expand Up @@ -1910,10 +1920,13 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
break;
case MMC_BLK_CMD_ERR:
ret = mmc_blk_cmd_err(md, card, brq, req, ret);
if (!mmc_blk_reset(md, card->host, type))
break;
goto cmd_abort;
if (mmc_blk_reset(md, card->host, type))
goto cmd_abort;
if (!ret)
goto start_new_req;
break;
case MMC_BLK_RETRY:
retune_retry_done = brq->retune_retry_done;
if (retry++ < 5)
break;
/* Fall through */
Expand Down Expand Up @@ -1976,6 +1989,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
mmc_start_req(card->host,
&mq_rq->mmc_active, NULL);
}
mq_rq->brq.retune_retry_done = retune_retry_done;
}
} while (ret);

Expand Down Expand Up @@ -2217,7 +2231,8 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
* The CSD capacity field is in units of read_blkbits.
* set_capacity takes units of 512 bytes.
*/
size = card->csd.capacity << (card->csd.read_blkbits - 9);
size = (typeof(sector_t))card->csd.capacity
<< (card->csd.read_blkbits - 9);
}

return mmc_blk_alloc_req(card, &card->dev, size, false, NULL,
Expand Down
Loading

0 comments on commit a57f14b

Please sign in to comment.