Skip to content

Commit a57f14b

Browse files
committed
Merge tag 'mmc-v4.2' of git://git.linaro.org/people/ulf.hansson/mmc
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 ...
2 parents 10b4b09 + a8c27c0 commit a57f14b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2727
-607
lines changed

Documentation/devicetree/bindings/mmc/arasan,sdhci.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Device Tree Bindings for the Arasan SDHCI Controller
88
[3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
99

1010
Required Properties:
11-
- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a'
11+
- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
12+
'arasan,sdhci-4.9a'
1213
- reg: From mmc bindings: Register location and length.
1314
- clocks: From clock bindings: Handles to clock inputs.
1415
- clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"

Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ This file documents differences between the core properties described
77
by mmc.txt and the properties used by the sdhci-esdhc-imx driver.
88

99
Required properties:
10-
- compatible : Should be "fsl,<chip>-esdhc"
10+
- compatible : Should be "fsl,<chip>-esdhc", the supported chips include
11+
"fsl,imx25-esdhc"
12+
"fsl,imx35-esdhc"
13+
"fsl,imx51-esdhc"
14+
"fsl,imx53-esdhc"
15+
"fsl,imx6q-usdhc"
16+
"fsl,imx6sl-usdhc"
17+
"fsl,imx6sx-usdhc"
1118

1219
Optional properties:
1320
- fsl,cd-controller : Indicate to use controller internal card detection

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Required Properties:
1313

1414
* compatible: should be one of the following.
1515
- "hisilicon,hi4511-dw-mshc": for controllers with hi4511 specific extensions.
16+
- "hisilicon,hi6220-dw-mshc": for controllers with hi6220 specific extensions.
17+
18+
Optional Properties:
19+
- hisilicon,peripheral-syscon: phandle of syscon used to control peripheral.
1620

1721
Example:
1822

@@ -42,3 +46,27 @@ Example:
4246
cap-mmc-highspeed;
4347
cap-sd-highspeed;
4448
};
49+
50+
/* for Hi6220 */
51+
52+
dwmmc_1: dwmmc1@f723e000 {
53+
compatible = "hisilicon,hi6220-dw-mshc";
54+
num-slots = <0x1>;
55+
bus-width = <0x4>;
56+
disable-wp;
57+
cap-sd-highspeed;
58+
sd-uhs-sdr12;
59+
sd-uhs-sdr25;
60+
card-detect-delay = <200>;
61+
hisilicon,peripheral-syscon = <&ao_ctrl>;
62+
reg = <0x0 0xf723e000 0x0 0x1000>;
63+
interrupts = <0x0 0x49 0x4>;
64+
clocks = <&clock_sys HI6220_MMC1_CIUCLK>, <&clock_sys HI6220_MMC1_CLK>;
65+
clock-names = "ciu", "biu";
66+
cd-gpios = <&gpio1 0 1>;
67+
pinctrl-names = "default", "idle";
68+
pinctrl-0 = <&sd_pmx_func &sd_clk_cfg_func &sd_cfg_func>;
69+
pinctrl-1 = <&sd_pmx_idle &sd_clk_cfg_idle &sd_cfg_idle>;
70+
vqmmc-supply = <&ldo7>;
71+
vmmc-supply = <&ldo10>;
72+
};

Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ Example:
2121

2222
sdhci0_pwrseq {
2323
compatible = "mmc-pwrseq-simple";
24-
reset-gpios = <&gpio1 12 0>;
24+
reset-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
25+
clocks = <&clk_32768_ck>;
26+
clock-names = "ext_clock";
2527
}

Documentation/devicetree/bindings/mmc/mmc.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ Optional properties:
2121
below for the case, when a GPIO is used for the CD line
2222
- wp-inverted: when present, polarity on the WP line is inverted. See the note
2323
below for the case, when a GPIO is used for the WP line
24+
- disable-wp: When set no physical WP line is present. This property should
25+
only be specified when the controller has a dedicated write-protect
26+
detection logic. If a GPIO is always used for the write-protect detection
27+
logic it is sufficient to not specify wp-gpios property in the absence of a WP
28+
line.
2429
- max-frequency: maximum operating clock frequency
2530
- no-1-8-v: when present, denotes that 1.8v card voltage is not supported on
2631
this system, even if the controller claims it is.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
* MTK MMC controller
2+
3+
The MTK MSDC can act as a MMC controller
4+
to support MMC, SD, and SDIO types of memory cards.
5+
6+
This file documents differences between the core properties in mmc.txt
7+
and the properties used by the msdc driver.
8+
9+
Required properties:
10+
- compatible: Should be "mediatek,mt8173-mmc","mediatek,mt8135-mmc"
11+
- interrupts: Should contain MSDC interrupt number
12+
- clocks: MSDC source clock, HCLK
13+
- clock-names: "source", "hclk"
14+
- pinctrl-names: should be "default", "state_uhs"
15+
- pinctrl-0: should contain default/high speed pin ctrl
16+
- pinctrl-1: should contain uhs mode pin ctrl
17+
- vmmc-supply: power to the Core
18+
- vqmmc-supply: power to the IO
19+
20+
Examples:
21+
mmc0: mmc@11230000 {
22+
compatible = "mediatek,mt8173-mmc", "mediatek,mt8135-mmc";
23+
reg = <0 0x11230000 0 0x108>;
24+
interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
25+
vmmc-supply = <&mt6397_vemc_3v3_reg>;
26+
vqmmc-supply = <&mt6397_vio18_reg>;
27+
clocks = <&pericfg CLK_PERI_MSDC30_0>, <&topckgen CLK_TOP_MSDC50_0_H_SEL>;
28+
clock-names = "source", "hclk";
29+
pinctrl-names = "default", "state_uhs";
30+
pinctrl-0 = <&mmc0_pins_default>;
31+
pinctrl-1 = <&mmc0_pins_uhs>;
32+
};

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Required properties:
1818
dma-names property.
1919
- dma-names: must contain "tx" for the transmit DMA channel and "rx" for the
2020
receive DMA channel.
21+
- max-frequency: Maximum operating clock frequency, driver uses default clock
22+
frequency if it is not set.
2123

2224

2325
Example: R8A7790 (R-Car H2) MMCIF0
@@ -29,4 +31,5 @@ Example: R8A7790 (R-Car H2) MMCIF0
2931
clocks = <&mstp3_clks R8A7790_CLK_MMCIF0>;
3032
dmas = <&dmac0 0xd1>, <&dmac0 0xd2>;
3133
dma-names = "tx", "rx";
34+
max-frequency = <97500000>;
3235
};

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10033,7 +10033,7 @@ F: include/linux/toshiba.h
1003310033
F: include/uapi/linux/toshiba.h
1003410034

1003510035
TMIO MMC DRIVER
10036-
M: Ian Molton <ian.molton@codethink.co.uk>
10036+
M: Ian Molton <ian@mnementh.co.uk>
1003710037
1003810038
S: Maintained
1003910039
F: drivers/mmc/host/tmio_mmc*

arch/powerpc/boot/dts/fsl/p2041si-post.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@
370370

371371
/include/ "qoriq-esdhc-0.dtsi"
372372
sdhc@114000 {
373+
compatible = "fsl,p2041-esdhc", "fsl,esdhc";
373374
fsl,iommu-parent = <&pamu1>;
374375
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
375376
sdhci,auto-cmd12;

arch/powerpc/boot/dts/fsl/p3041si-post.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@
397397

398398
/include/ "qoriq-esdhc-0.dtsi"
399399
sdhc@114000 {
400+
compatible = "fsl,p3041-esdhc", "fsl,esdhc";
400401
fsl,iommu-parent = <&pamu1>;
401402
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
402403
sdhci,auto-cmd12;

arch/powerpc/boot/dts/fsl/p4080si-post.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@
469469

470470
/include/ "qoriq-esdhc-0.dtsi"
471471
sdhc@114000 {
472+
compatible = "fsl,p4080-esdhc", "fsl,esdhc";
472473
fsl,iommu-parent = <&pamu1>;
473474
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
474475
voltage-ranges = <3300 3300>;

arch/powerpc/boot/dts/fsl/p5020si-post.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@
384384

385385
/include/ "qoriq-esdhc-0.dtsi"
386386
sdhc@114000 {
387+
compatible = "fsl,p5020-esdhc", "fsl,esdhc";
387388
fsl,iommu-parent = <&pamu1>;
388389
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
389390
sdhci,auto-cmd12;

arch/powerpc/boot/dts/fsl/p5040si-post.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@
362362

363363
/include/ "qoriq-esdhc-0.dtsi"
364364
sdhc@114000 {
365+
compatible = "fsl,p5040-esdhc", "fsl,esdhc";
365366
fsl,iommu-parent = <&pamu2>;
366367
fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */
367368
sdhci,auto-cmd12;

drivers/i2c/busses/i2c-piix4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
245245
PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS &&
246246
PIIX4_dev->revision >= 0x41) ||
247247
(PIIX4_dev->vendor == PCI_VENDOR_ID_AMD &&
248-
PIIX4_dev->device == 0x790b &&
248+
PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS &&
249249
PIIX4_dev->revision >= 0x49))
250250
smb_en = 0x00;
251251
else
@@ -545,7 +545,7 @@ static const struct pci_device_id piix4_ids[] = {
545545
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) },
546546
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) },
547547
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) },
548-
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x790b) },
548+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) },
549549
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
550550
PCI_DEVICE_ID_SERVERWORKS_OSB4) },
551551
{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,

drivers/mmc/card/block.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,9 @@ static int mmc_blk_cmd_recovery(struct mmc_card *card, struct request *req,
913913
if (!err)
914914
break;
915915

916+
/* Re-tune if needed */
917+
mmc_retune_recheck(card->host);
918+
916919
prev_cmd_status_valid = false;
917920
pr_err("%s: error %d sending status command, %sing\n",
918921
req->rq_disk->disk_name, err, retry ? "retry" : "abort");
@@ -1204,6 +1207,7 @@ static int mmc_blk_err_check(struct mmc_card *card,
12041207
mmc_active);
12051208
struct mmc_blk_request *brq = &mq_mrq->brq;
12061209
struct request *req = mq_mrq->req;
1210+
int need_retune = card->host->need_retune;
12071211
int ecc_err = 0, gen_err = 0;
12081212

12091213
/*
@@ -1271,6 +1275,12 @@ static int mmc_blk_err_check(struct mmc_card *card,
12711275
}
12721276

12731277
if (brq->data.error) {
1278+
if (need_retune && !brq->retune_retry_done) {
1279+
pr_info("%s: retrying because a re-tune was needed\n",
1280+
req->rq_disk->disk_name);
1281+
brq->retune_retry_done = 1;
1282+
return MMC_BLK_RETRY;
1283+
}
12741284
pr_err("%s: error %d transferring data, sector %u, nr %u, cmd response %#x, card status %#x\n",
12751285
req->rq_disk->disk_name, brq->data.error,
12761286
(unsigned)blk_rq_pos(req),
@@ -1830,7 +1840,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
18301840
struct mmc_blk_data *md = mq->data;
18311841
struct mmc_card *card = md->queue.card;
18321842
struct mmc_blk_request *brq = &mq->mqrq_cur->brq;
1833-
int ret = 1, disable_multi = 0, retry = 0, type;
1843+
int ret = 1, disable_multi = 0, retry = 0, type, retune_retry_done = 0;
18341844
enum mmc_blk_status status;
18351845
struct mmc_queue_req *mq_rq;
18361846
struct request *req = rqc;
@@ -1910,10 +1920,13 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
19101920
break;
19111921
case MMC_BLK_CMD_ERR:
19121922
ret = mmc_blk_cmd_err(md, card, brq, req, ret);
1913-
if (!mmc_blk_reset(md, card->host, type))
1914-
break;
1915-
goto cmd_abort;
1923+
if (mmc_blk_reset(md, card->host, type))
1924+
goto cmd_abort;
1925+
if (!ret)
1926+
goto start_new_req;
1927+
break;
19161928
case MMC_BLK_RETRY:
1929+
retune_retry_done = brq->retune_retry_done;
19171930
if (retry++ < 5)
19181931
break;
19191932
/* Fall through */
@@ -1976,6 +1989,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
19761989
mmc_start_req(card->host,
19771990
&mq_rq->mmc_active, NULL);
19781991
}
1992+
mq_rq->brq.retune_retry_done = retune_retry_done;
19791993
}
19801994
} while (ret);
19811995

@@ -2217,7 +2231,8 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
22172231
* The CSD capacity field is in units of read_blkbits.
22182232
* set_capacity takes units of 512 bytes.
22192233
*/
2220-
size = card->csd.capacity << (card->csd.read_blkbits - 9);
2234+
size = (typeof(sector_t))card->csd.capacity
2235+
<< (card->csd.read_blkbits - 9);
22212236
}
22222237

22232238
return mmc_blk_alloc_req(card, &card->dev, size, false, NULL,

0 commit comments

Comments
 (0)