Skip to content

Commit 89181f5

Browse files
committed
Merge tag 'mmc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC updates from Ulf Hansson: "MMC core: - Allow synchronous detection of (e)MMC/SD/SDIO cards - Fixup error check for ioctls for SPI hosts - Disable broken SD-Cache support for Kingston Canvas Go Plus from 2019 - Disable broken eMMC-Trim support for Kingston EMMC04G-M627 - Disable broken eMMC-Trim support for Micron MTFC4GACAJCN-1M MMC host: - bcm2835: Convert DT bindings to YAML - mmci: - Enable asynchronous probe - Transform the ux500 HW-busy detection into a proper state machine - Add support for SW busy-end timeouts for the ux500 variants - mmci_stm32: - Add support for sdm32 variant revision v3.0 used on STM32MP25 - Improve the tuning sequence - mtk-sd: Tune polling-period to improve performance - sdhci: Fixup DMA configuration for 64-bit DMA mode - sdhci-bcm-kona: Convert DT bindings to YAML - sdhci-msm: - Switch to use the new ICE API - Add support for the SC8280XP/IPQ6018/QDU1000/QRU1000 variants - sdhci-pci-gli: - Add support SD Express cards for GL9767 - Add support for the Genesys Logic GL9767 variant" * tag 'mmc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (42 commits) dt-bindings: mmc: fsl-imx-esdhc: Add imx6ul support mmc: mmci: Add support for SW busy-end timeouts mmc: Add MMC_QUIRK_BROKEN_SD_CACHE for Kingston Canvas Go Plus from 11/2019 mmc: core: disable TRIM on Kingston EMMC04G-M627 mmc: mmci: stm32: add delay block support for STM32MP25 mmc: mmci: stm32: prepare other delay block support mmc: mmci: stm32: manage block gap hardware flow control mmc: mmci: Add support for sdmmc variant revision v3.0 mmc: mmci: add stm32_idmabsize_align parameter dt-bindings: mmc: mmci: Add st,stm32mp25-sdmmc2 compatible mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M mmc: mmci: Break out a helper function mmc: mmci: Use a switch statement machine mmc: mmci: Use state machine state as exit condition mmc: mmci: Retry the busy start condition mmc: mmci: Make busy complete state machine explicit mmc: mmci: Break out error check in busy detect mmc: mmci: Stash status while waiting for busy mmc: mmci: Unwind big if() clause mmc: mmci: Clear busy_status when starting command ...
2 parents 1364b40 + 06b5d4f commit 89181f5

32 files changed

+1067
-333
lines changed

Documentation/devicetree/bindings/mmc/arm,pl18x.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ properties:
5353
items:
5454
- const: arm,pl18x
5555
- const: arm,primecell
56-
- description: Entry for STMicroelectronics variant of PL18x.
57-
This dedicated compatible is used by bootloaders.
56+
- description: Entries for STMicroelectronics variant of PL18x.
5857
items:
59-
- const: st,stm32-sdmmc2
58+
- enum:
59+
- st,stm32-sdmmc2
60+
- st,stm32mp25-sdmmc2
6061
- const: arm,pl18x
6162
- const: arm,primecell
6263

Documentation/devicetree/bindings/mmc/brcm,bcm2835-sdhost.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mmc/brcm,bcm2835-sdhost.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Broadcom BCM2835 SDHOST controller
8+
9+
maintainers:
10+
- Stefan Wahren <[email protected]>
11+
12+
allOf:
13+
- $ref: mmc-controller.yaml
14+
15+
properties:
16+
compatible:
17+
const: brcm,bcm2835-sdhost
18+
19+
reg:
20+
maxItems: 1
21+
22+
interrupts:
23+
maxItems: 1
24+
25+
clocks:
26+
maxItems: 1
27+
28+
dmas:
29+
maxItems: 1
30+
31+
dma-names:
32+
const: rx-tx
33+
34+
required:
35+
- compatible
36+
- reg
37+
- interrupts
38+
- clocks
39+
40+
unevaluatedProperties: false
41+
42+
examples:
43+
- |
44+
#include <dt-bindings/clock/bcm2835.h>
45+
46+
sdhost: mmc@7e202000 {
47+
compatible = "brcm,bcm2835-sdhost";
48+
reg = <0x7e202000 0x100>;
49+
interrupts = <2 24>;
50+
clocks = <&clocks BCM2835_CLOCK_VPU>;
51+
dmas = <&dma 13>;
52+
dma-names = "rx-tx";
53+
bus-width = <4>;
54+
};

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

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mmc/brcm,kona-sdhci.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Broadcom Kona family SDHCI controller
8+
9+
maintainers:
10+
- Florian Fainelli <[email protected]>
11+
12+
allOf:
13+
- $ref: sdhci-common.yaml#
14+
15+
properties:
16+
compatible:
17+
const: brcm,kona-sdhci
18+
19+
reg:
20+
maxItems: 1
21+
22+
clocks:
23+
maxItems: 1
24+
25+
interrupts:
26+
maxItems: 1
27+
28+
required:
29+
- compatible
30+
- reg
31+
- clocks
32+
- interrupts
33+
34+
unevaluatedProperties: false
35+
36+
examples:
37+
- |
38+
#include <dt-bindings/interrupt-controller/arm-gic.h>
39+
#include <dt-bindings/interrupt-controller/irq.h>
40+
#include <dt-bindings/clock/bcm281xx.h>
41+
42+
mmc@3f1a0000 {
43+
compatible = "brcm,kona-sdhci";
44+
reg = <0x3f1a0000 0x10000>;
45+
clocks = <&master_ccu BCM281XX_MASTER_CCU_SDIO3>;
46+
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
47+
};
48+
...

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ properties:
4242
- enum:
4343
- fsl,imx6sll-usdhc
4444
- fsl,imx6ull-usdhc
45+
- fsl,imx6ul-usdhc
4546
- const: fsl,imx6sx-usdhc
4647
- items:
4748
- const: fsl,imx7d-usdhc

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ properties:
3636
- enum:
3737
- qcom,ipq5018-sdhci
3838
- qcom,ipq5332-sdhci
39+
- qcom,ipq6018-sdhci
3940
- qcom,ipq9574-sdhci
4041
- qcom,qcm2290-sdhci
4142
- qcom,qcs404-sdhci
43+
- qcom,qdu1000-sdhci
4244
- qcom,sc7180-sdhci
4345
- qcom,sc7280-sdhci
46+
- qcom,sc8280xp-sdhci
4447
- qcom,sdm630-sdhci
4548
- qcom,sdm670-sdhci
4649
- qcom,sdm845-sdhci

drivers/memstick/host/r592.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ static const char *tpc_names[] = {
4444
* memstick_debug_get_tpc_name - debug helper that returns string for
4545
* a TPC number
4646
*/
47-
const char *memstick_debug_get_tpc_name(int tpc)
47+
static __maybe_unused const char *memstick_debug_get_tpc_name(int tpc)
4848
{
4949
return tpc_names[tpc-1];
5050
}
51-
EXPORT_SYMBOL(memstick_debug_get_tpc_name);
52-
5351

5452
/* Read a register*/
5553
static inline u32 r592_read_reg(struct r592_device *dev, int address)

drivers/mmc/core/block.c

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
178178
int recovery_mode,
179179
struct mmc_queue *mq);
180180
static void mmc_blk_hsq_req_done(struct mmc_request *mrq);
181+
static int mmc_spi_err_check(struct mmc_card *card);
181182

182183
static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
183184
{
@@ -608,6 +609,11 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
608609
if ((card->host->caps & MMC_CAP_WAIT_WHILE_BUSY) && use_r1b_resp)
609610
return 0;
610611

612+
if (mmc_host_is_spi(card->host)) {
613+
if (idata->ic.write_flag || r1b_resp || cmd.flags & MMC_RSP_SPI_BUSY)
614+
return mmc_spi_err_check(card);
615+
return err;
616+
}
611617
/* Ensure RPMB/R1B command has completed by polling with CMD13. */
612618
if (idata->rpmb || r1b_resp)
613619
err = mmc_poll_for_busy(card, busy_timeout_ms, false,
@@ -2505,9 +2511,9 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
25052511

25062512
string_get_size((u64)size, 512, STRING_UNITS_2,
25072513
cap_str, sizeof(cap_str));
2508-
pr_info("%s: %s %s %s %s\n",
2514+
pr_info("%s: %s %s %s%s\n",
25092515
md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
2510-
cap_str, md->read_only ? "(ro)" : "");
2516+
cap_str, md->read_only ? " (ro)" : "");
25112517

25122518
/* used in ->open, must be set before add_disk: */
25132519
if (area_type == MMC_BLK_DATA_AREA_MAIN)
@@ -2899,12 +2905,12 @@ static const struct file_operations mmc_dbg_ext_csd_fops = {
28992905
.llseek = default_llseek,
29002906
};
29012907

2902-
static int mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md)
2908+
static void mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md)
29032909
{
29042910
struct dentry *root;
29052911

29062912
if (!card->debugfs_root)
2907-
return 0;
2913+
return;
29082914

29092915
root = card->debugfs_root;
29102916

@@ -2913,19 +2919,13 @@ static int mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md)
29132919
debugfs_create_file_unsafe("status", 0400, root,
29142920
card,
29152921
&mmc_dbg_card_status_fops);
2916-
if (!md->status_dentry)
2917-
return -EIO;
29182922
}
29192923

29202924
if (mmc_card_mmc(card)) {
29212925
md->ext_csd_dentry =
29222926
debugfs_create_file("ext_csd", S_IRUSR, root, card,
29232927
&mmc_dbg_ext_csd_fops);
2924-
if (!md->ext_csd_dentry)
2925-
return -EIO;
29262928
}
2927-
2928-
return 0;
29292929
}
29302930

29312931
static void mmc_blk_remove_debugfs(struct mmc_card *card,
@@ -2934,22 +2934,17 @@ static void mmc_blk_remove_debugfs(struct mmc_card *card,
29342934
if (!card->debugfs_root)
29352935
return;
29362936

2937-
if (!IS_ERR_OR_NULL(md->status_dentry)) {
2938-
debugfs_remove(md->status_dentry);
2939-
md->status_dentry = NULL;
2940-
}
2937+
debugfs_remove(md->status_dentry);
2938+
md->status_dentry = NULL;
29412939

2942-
if (!IS_ERR_OR_NULL(md->ext_csd_dentry)) {
2943-
debugfs_remove(md->ext_csd_dentry);
2944-
md->ext_csd_dentry = NULL;
2945-
}
2940+
debugfs_remove(md->ext_csd_dentry);
2941+
md->ext_csd_dentry = NULL;
29462942
}
29472943

29482944
#else
29492945

2950-
static int mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md)
2946+
static void mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md)
29512947
{
2952-
return 0;
29532948
}
29542949

29552950
static void mmc_blk_remove_debugfs(struct mmc_card *card,

drivers/mmc/core/card.h

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ struct mmc_fixup {
5353
unsigned int manfid;
5454
unsigned short oemid;
5555

56+
/* Manufacturing date */
57+
unsigned short year;
58+
unsigned char month;
59+
5660
/* SDIO-specific fields. You can use SDIO_ANY_ID here of course */
5761
u16 cis_vendor, cis_device;
5862

@@ -68,6 +72,8 @@ struct mmc_fixup {
6872

6973
#define CID_MANFID_ANY (-1u)
7074
#define CID_OEMID_ANY ((unsigned short) -1)
75+
#define CID_YEAR_ANY ((unsigned short) -1)
76+
#define CID_MONTH_ANY ((unsigned char) -1)
7177
#define CID_NAME_ANY (NULL)
7278

7379
#define EXT_CSD_REV_ANY (-1u)
@@ -81,17 +87,21 @@ struct mmc_fixup {
8187
#define CID_MANFID_APACER 0x27
8288
#define CID_MANFID_KINGSTON 0x70
8389
#define CID_MANFID_HYNIX 0x90
90+
#define CID_MANFID_KINGSTON_SD 0x9F
8491
#define CID_MANFID_NUMONYX 0xFE
8592

8693
#define END_FIXUP { NULL }
8794

88-
#define _FIXUP_EXT(_name, _manfid, _oemid, _rev_start, _rev_end, \
89-
_cis_vendor, _cis_device, \
90-
_fixup, _data, _ext_csd_rev) \
95+
#define _FIXUP_EXT(_name, _manfid, _oemid, _year, _month, \
96+
_rev_start, _rev_end, \
97+
_cis_vendor, _cis_device, \
98+
_fixup, _data, _ext_csd_rev) \
9199
{ \
92100
.name = (_name), \
93101
.manfid = (_manfid), \
94102
.oemid = (_oemid), \
103+
.year = (_year), \
104+
.month = (_month), \
95105
.rev_start = (_rev_start), \
96106
.rev_end = (_rev_end), \
97107
.cis_vendor = (_cis_vendor), \
@@ -103,8 +113,8 @@ struct mmc_fixup {
103113

104114
#define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end, \
105115
_fixup, _data, _ext_csd_rev) \
106-
_FIXUP_EXT(_name, _manfid, \
107-
_oemid, _rev_start, _rev_end, \
116+
_FIXUP_EXT(_name, _manfid, _oemid, CID_YEAR_ANY, CID_MONTH_ANY, \
117+
_rev_start, _rev_end, \
108118
SDIO_ANY_ID, SDIO_ANY_ID, \
109119
_fixup, _data, _ext_csd_rev) \
110120

@@ -118,8 +128,9 @@ struct mmc_fixup {
118128
_ext_csd_rev)
119129

120130
#define SDIO_FIXUP(_vendor, _device, _fixup, _data) \
121-
_FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY, \
122-
CID_OEMID_ANY, 0, -1ull, \
131+
_FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY, CID_OEMID_ANY, \
132+
CID_YEAR_ANY, CID_MONTH_ANY, \
133+
0, -1ull, \
123134
_vendor, _device, \
124135
_fixup, _data, EXT_CSD_REV_ANY) \
125136

@@ -264,4 +275,9 @@ static inline int mmc_card_broken_sd_discard(const struct mmc_card *c)
264275
return c->quirks & MMC_QUIRK_BROKEN_SD_DISCARD;
265276
}
266277

278+
static inline int mmc_card_broken_sd_cache(const struct mmc_card *c)
279+
{
280+
return c->quirks & MMC_QUIRK_BROKEN_SD_CACHE;
281+
}
282+
267283
#endif

0 commit comments

Comments
 (0)