Skip to content

Commit 40aa597

Browse files
committed
Merge tag 'mmc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC updates from Ulf Hansson: " MMC core: - Enable host caps to be modified via debugfs to test speed-modes - Improve random I/O writes for 4k buffers for hsq enabled hosts MMC host: - atmel-mci/sdhci-of-at91: Aubin Constans takes over as maintainer - dw_mmc-starfive: Re-work tuning support - meson-gx: Fix bogus IRQ when using CMD_CFG_ERROR - mmci: Use peripheral flow control for the STM32 variant - renesas,sdhi: Add support for the RZ/G3S variant - sdhci-esdhc-imx: Optimize the manual tuning logic - sdhci-msm: Add support for the SM8650 variant - sdhci-npcm: Add driver to support the Nuvoton NPCM BMC variant - sdhci-pci-gli: Add workaround to allow GL9750 to enter ASPM L1.2" * tag 'mmc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (25 commits) dt-bindings: mmc: sdhci-msm: document the SM8650 SDHCI Controller mmc: meson-gx: Remove setting of CMD_CFG_ERROR MAINTAINERS: mmc: take over as maintainer of MCI & SDHCI MICROCHIP DRIVERS mmc: jz4740: Use device_get_match_data() mmc: sdhci-npcm: Add NPCM SDHCI driver dt-bindings: mmc: npcm,sdhci: Document NPCM SDHCI controller mmc: sdhci-pltfm: Make driver OF independent mmc: sdhci-pltfm: Drop unnecessary error messages in sdhci_pltfm_init() mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed() mmc: debugfs: Allow host caps to be modified mmc: core: Always reselect card type mmc: mmci: use peripheral flow control for STM32 mmc: vub300: replace deprecated strncpy with strscpy memstick: jmb38x_ms: Annotate struct jmb38x_ms with __counted_by mmc: starfive: Change tuning implementation dt-bindings: mmc: starfive: Remove properties from required mmc: hsq: Improve random I/O write performance for 4k buffers mmc: core: Allow dynamical updates of the number of requests for hsq mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 dt-bindings: mmc: renesas,sdhi: Document RZ/G3S support ...
2 parents 0364249 + 5428a40 commit 40aa597

26 files changed

+384
-184
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mmc/npcm,sdhci.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NPCM SDHCI Controller
8+
9+
maintainers:
10+
- Tomer Maimon <[email protected]>
11+
12+
allOf:
13+
- $ref: mmc-controller.yaml#
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- nuvoton,npcm750-sdhci
19+
- nuvoton,npcm845-sdhci
20+
21+
reg:
22+
maxItems: 1
23+
24+
interrupts:
25+
maxItems: 1
26+
27+
clocks:
28+
maxItems: 1
29+
30+
required:
31+
- compatible
32+
- reg
33+
- interrupts
34+
- clocks
35+
36+
unevaluatedProperties: false
37+
38+
examples:
39+
- |
40+
mmc@f0840000 {
41+
compatible = "nuvoton,npcm750-sdhci";
42+
reg = <0xf0840000 0x200>;
43+
interrupts = <0 27 4>;
44+
clocks = <&clk 4>;
45+
};

Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ properties:
5959
- renesas,sdhi-r9a07g043 # RZ/G2UL
6060
- renesas,sdhi-r9a07g044 # RZ/G2{L,LC}
6161
- renesas,sdhi-r9a07g054 # RZ/V2L
62+
- renesas,sdhi-r9a08g045 # RZ/G3S
6263
- renesas,sdhi-r9a09g011 # RZ/V2M
6364
- const: renesas,rcar-gen3-sdhi # R-Car Gen3 or RZ/G2
6465
- items:
@@ -122,6 +123,7 @@ allOf:
122123
- renesas,sdhi-r9a07g043
123124
- renesas,sdhi-r9a07g044
124125
- renesas,sdhi-r9a07g054
126+
- renesas,sdhi-r9a08g045
125127
- renesas,sdhi-r9a09g011
126128
then:
127129
properties:

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ properties:
5858
- qcom,sm8350-sdhci
5959
- qcom,sm8450-sdhci
6060
- qcom,sm8550-sdhci
61+
- qcom,sm8650-sdhci
6162
- const: qcom,sdhci-msm-v5 # for sdcc version 5.0
6263

6364
reg:
@@ -85,10 +86,10 @@ properties:
8586
- const: iface
8687
- const: core
8788
- const: xo
88-
- const: ice
89-
- const: bus
90-
- const: cal
91-
- const: sleep
89+
- enum: [ice, bus, cal, sleep]
90+
- enum: [ice, bus, cal, sleep]
91+
- enum: [ice, bus, cal, sleep]
92+
- enum: [ice, bus, cal, sleep]
9293

9394
dma-coherent: true
9495

Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ required:
5555
- clocks
5656
- clock-names
5757
- interrupts
58-
- starfive,sysreg
5958

6059
unevaluatedProperties: false
6160

@@ -73,5 +72,4 @@ examples:
7372
fifo-depth = <32>;
7473
fifo-watermark-aligned;
7574
data-addr = <0>;
76-
starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>;
7775
};

MAINTAINERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14110,7 +14110,7 @@ F: Documentation/devicetree/bindings/iio/adc/microchip,mcp3911.yaml
1411014110
F: drivers/iio/adc/mcp3911.c
1411114111

1411214112
MICROCHIP MMC/SD/SDIO MCI DRIVER
14113-
M: Ludovic Desroches <ludovic.desroches@microchip.com>
14113+
M: Aubin Constans <aubin.constans@microchip.com>
1411414114
S: Maintained
1411514115
F: drivers/mmc/host/atmel-mci.c
1411614116

@@ -19335,7 +19335,8 @@ F: Documentation/devicetree/bindings/mmc/sdhci-common.yaml
1933519335
F: drivers/mmc/host/sdhci*
1933619336

1933719337
SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) MICROCHIP DRIVER
19338-
M: Eugen Hristev <[email protected]>
19338+
M: Aubin Constans <[email protected]>
19339+
R: Eugen Hristev <[email protected]>
1933919340
1934019341
S: Supported
1934119342
F: drivers/mmc/host/sdhci-of-at91.c

drivers/memstick/host/jmb38x_ms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct jmb38x_ms_host {
6666
struct jmb38x_ms {
6767
struct pci_dev *pdev;
6868
int host_cnt;
69-
struct memstick_host *hosts[];
69+
struct memstick_host *hosts[] __counted_by(host_cnt);
7070
};
7171

7272
#define BLOCK_COUNT_MASK 0xffff0000

drivers/mmc/core/debugfs.c

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
#include <linux/slab.h>
1313
#include <linux/stat.h>
1414
#include <linux/fault-inject.h>
15+
#include <linux/time.h>
1516

1617
#include <linux/mmc/card.h>
1718
#include <linux/mmc/host.h>
19+
#include <linux/mmc/mmc.h>
20+
#include <linux/mmc/sd.h>
1821

1922
#include "core.h"
2023
#include "card.h"
@@ -298,6 +301,49 @@ static const struct file_operations mmc_err_stats_fops = {
298301
.release = single_release,
299302
};
300303

304+
static int mmc_caps_get(void *data, u64 *val)
305+
{
306+
*val = *(u32 *)data;
307+
return 0;
308+
}
309+
310+
static int mmc_caps_set(void *data, u64 val)
311+
{
312+
u32 *caps = data;
313+
u32 diff = *caps ^ val;
314+
u32 allowed = MMC_CAP_AGGRESSIVE_PM |
315+
MMC_CAP_SD_HIGHSPEED |
316+
MMC_CAP_MMC_HIGHSPEED |
317+
MMC_CAP_UHS |
318+
MMC_CAP_DDR;
319+
320+
if (diff & ~allowed)
321+
return -EINVAL;
322+
323+
*caps = val;
324+
325+
return 0;
326+
}
327+
328+
static int mmc_caps2_set(void *data, u64 val)
329+
{
330+
u32 allowed = MMC_CAP2_HSX00_1_8V | MMC_CAP2_HSX00_1_2V;
331+
u32 *caps = data;
332+
u32 diff = *caps ^ val;
333+
334+
if (diff & ~allowed)
335+
return -EINVAL;
336+
337+
*caps = val;
338+
339+
return 0;
340+
}
341+
342+
DEFINE_DEBUGFS_ATTRIBUTE(mmc_caps_fops, mmc_caps_get, mmc_caps_set,
343+
"0x%08llx\n");
344+
DEFINE_DEBUGFS_ATTRIBUTE(mmc_caps2_fops, mmc_caps_get, mmc_caps2_set,
345+
"0x%08llx\n");
346+
301347
void mmc_add_host_debugfs(struct mmc_host *host)
302348
{
303349
struct dentry *root;
@@ -306,8 +352,9 @@ void mmc_add_host_debugfs(struct mmc_host *host)
306352
host->debugfs_root = root;
307353

308354
debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops);
309-
debugfs_create_x32("caps", S_IRUSR, root, &host->caps);
310-
debugfs_create_x32("caps2", S_IRUSR, root, &host->caps2);
355+
debugfs_create_file("caps", 0600, root, &host->caps, &mmc_caps_fops);
356+
debugfs_create_file("caps2", 0600, root, &host->caps2,
357+
&mmc_caps2_fops);
311358
debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, host,
312359
&mmc_clock_fops);
313360

drivers/mmc/core/mmc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
419419

420420
card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT];
421421
card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
422-
mmc_select_card_type(card);
423422

424423
card->ext_csd.raw_s_a_timeout = ext_csd[EXT_CSD_S_A_TIMEOUT];
425424
card->ext_csd.raw_erase_timeout_mult =
@@ -1732,6 +1731,12 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
17321731
mmc_set_erase_size(card);
17331732
}
17341733

1734+
/*
1735+
* Reselect the card type since host caps could have been changed when
1736+
* debugging even if the card is not new.
1737+
*/
1738+
mmc_select_card_type(card);
1739+
17351740
/* Enable ERASE_GRP_DEF. This bit is lost after a reset or power off. */
17361741
if (card->ext_csd.rev >= 3) {
17371742
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,

drivers/mmc/core/queue.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,7 @@ static blk_status_t mmc_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
260260
}
261261
break;
262262
case MMC_ISSUE_ASYNC:
263-
/*
264-
* For MMC host software queue, we only allow 2 requests in
265-
* flight to avoid a long latency.
266-
*/
267-
if (host->hsq_enabled && mq->in_flight[issue_type] > 2) {
263+
if (host->hsq_enabled && mq->in_flight[issue_type] > host->hsq_depth) {
268264
spin_unlock_irq(&mq->lock);
269265
return BLK_STS_RESOURCE;
270266
}

drivers/mmc/host/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,14 @@ config MMC_SDHCI_IPROC
429429

430430
If unsure, say N.
431431

432+
config MMC_SDHCI_NPCM
433+
tristate "Secure Digital Host Controller Interface support for NPCM"
434+
depends on ARCH_NPCM || COMPILE_TEST
435+
depends on MMC_SDHCI_PLTFM
436+
help
437+
This provides support for the SD/eMMC controller found in
438+
NPCM BMC family SoCs.
439+
432440
config MMC_MESON_GX
433441
tristate "Amlogic S905/GX*/AXG SD/MMC Host Controller support"
434442
depends on ARCH_MESON|| COMPILE_TEST
@@ -677,9 +685,9 @@ config MMC_SDHI_SYS_DMAC
677685

678686
config MMC_SDHI_INTERNAL_DMAC
679687
tristate "DMA for SDHI SD/SDIO controllers using on-chip bus mastering"
680-
depends on ARM64 || ARCH_R7S9210 || ARCH_R8A77470 || COMPILE_TEST
688+
depends on ARCH_RENESAS || COMPILE_TEST
681689
depends on MMC_SDHI
682-
default MMC_SDHI if (ARM64 || ARCH_R7S9210 || ARCH_R8A77470)
690+
default MMC_SDHI if ARCH_RENESAS
683691
help
684692
This provides DMA support for SDHI SD/SDIO controllers
685693
using on-chip bus mastering. This supports the controllers

0 commit comments

Comments
 (0)