Skip to content

Commit 245b6f3

Browse files
committed
Merge tag 'mmc-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC updates from Ulf Hansson: "MMC core: - Drop the use of BLK_BOUNCE_HIGH - Fix partition switch for GP3 - Remove usage of the deprecated ida_simple API MMC host: - cqhci: Update bouncing email-addresses in MAINTAINERS - davinci_mmc: Use sg_miter for PIO - dw_mmc-hi3798cv200: Convert the DT bindings to YAML - dw_mmc-hi3798mv200: Add driver for the new dw_mmc variant - fsl-imx-esdhc: A couple of corrections/updates to the DT bindings - meson-mx-sdhc: Drop use of the ->card_hw_reset() callback - moxart-mmc: Use sg_miter for PIO - moxart-mmc: Fix accounting for DMA transfers - mvsdio: Use sg_miter for PIO - mxcmmc: Use sg_miter for PIO - omap: Use sg_miter for PIO - renesas,sdhi: Add support for R-Car V4M variant - sdhci-esdhc-mcf: Use sg_miter for swapping - sdhci-of-dwcmshc: Add support for Sophgo CV1800B and SG2002 variants - sh_mmcif: Use sg_miter for PIO - tmio: Avoid concurrent runs of mmc_request_done()" * tag 'mmc-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (44 commits) mmc: core: make mmc_host_class constant mmc: core: Fix switch on gp3 partition mmc: tmio: comment the ERR_PTR usage in this driver mmc: mmc_spi: Don't mention DMA direction mmc: dw_mmc: Remove unused of_gpio.h mmc: dw_mmc: add support for hi3798mv200 dt-bindings: mmc: hisilicon,hi3798cv200-dw-mshc: add Hi3798MV200 binding dt-bindings: mmc: dw-mshc-hi3798cv200: convert to YAML mmc: dw_mmc-hi3798cv200: remove MODULE_ALIAS() mmc: core: Use a struct device* as in-param to mmc_of_parse_clk_phase() mmc: wmt-sdmmc: remove an incorrect release_mem_region() call in the .remove function mmc: tmio: avoid concurrent runs of mmc_request_done() dt-bindings: mmc: fsl-imx-mmc: Document the required clocks mmc: sh_mmcif: Advance sg_miter before reading blocks mmc: sh_mmcif: sg_miter must not be atomic mmc: sdhci-esdhc-mcf: Flag the sg_miter as atomic dt-bindings: mmc: fsl-imx-esdhc: add default and 100mhz state mmc: core: constify the struct device_type usage mmc: sdhci-of-dwcmshc: Add support for Sophgo CV1800B and SG2002 dt-bindings: mmc: sdhci-of-dwcmhsc: Add Sophgo CV1800B and SG2002 support ...
2 parents aeb1529 + faf3b80 commit 245b6f3

Some content is hidden

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

41 files changed

+791
-319
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ properties:
5555
- enum:
5656
- fsl,imx8mn-usdhc
5757
- fsl,imx8mp-usdhc
58-
- fsl,imx93-usdhc
5958
- fsl,imx8ulp-usdhc
59+
- fsl,imx93-usdhc
60+
- fsl,imx95-usdhc
6061
- const: fsl,imx8mm-usdhc
6162
- items:
6263
- enum:
@@ -162,6 +163,9 @@ properties:
162163
- const: ahb
163164
- const: per
164165

166+
iommus:
167+
maxItems: 1
168+
165169
power-domains:
166170
maxItems: 1
167171

@@ -173,6 +177,11 @@ properties:
173177
- const: state_100mhz
174178
- const: state_200mhz
175179
- const: sleep
180+
- minItems: 2
181+
items:
182+
- const: default
183+
- const: state_100mhz
184+
- const: sleep
176185
- minItems: 1
177186
items:
178187
- const: default

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ properties:
2424
reg:
2525
maxItems: 1
2626

27+
clocks:
28+
maxItems: 2
29+
30+
clock-names:
31+
items:
32+
- const: ipg
33+
- const: per
34+
2735
interrupts:
2836
maxItems: 1
2937

@@ -34,6 +42,8 @@ properties:
3442
const: rx-tx
3543

3644
required:
45+
- clocks
46+
- clock-names
3747
- compatible
3848
- reg
3949
- interrupts
@@ -46,6 +56,8 @@ examples:
4656
compatible = "fsl,imx27-mmc", "fsl,imx21-mmc";
4757
reg = <0x10014000 0x1000>;
4858
interrupts = <11>;
59+
clocks = <&clks 29>, <&clks 60>;
60+
clock-names = "ipg", "per";
4961
dmas = <&dma 7>;
5062
dma-names = "rx-tx";
5163
bus-width = <4>;

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

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mmc/hisilicon,hi3798cv200-dw-mshc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Hisilicon HiSTB SoCs specific extensions to the Synopsys DWMMC controller
8+
9+
maintainers:
10+
- Yang Xiwen <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- hisilicon,hi3798cv200-dw-mshc
16+
- hisilicon,hi3798mv200-dw-mshc
17+
18+
reg:
19+
maxItems: 1
20+
21+
interrupts:
22+
maxItems: 1
23+
24+
clocks:
25+
items:
26+
- description: bus interface unit clock
27+
- description: card interface unit clock
28+
- description: card input sample phase clock
29+
- description: controller output drive phase clock
30+
31+
clock-names:
32+
items:
33+
- const: ciu
34+
- const: biu
35+
- const: ciu-sample
36+
- const: ciu-drive
37+
38+
hisilicon,sap-dll-reg:
39+
$ref: /schemas/types.yaml#/definitions/phandle-array
40+
description: |
41+
DWMMC core on Hi3798MV2x SoCs has a delay-locked-loop(DLL) attached to card data input path.
42+
It is integrated into CRG core on the SoC and has to be controlled during tuning.
43+
items:
44+
- description: A phandle pointed to the CRG syscon node
45+
- description: Sample DLL register offset in CRG address space
46+
47+
required:
48+
- compatible
49+
- reg
50+
- interrupts
51+
- clocks
52+
- clock-names
53+
54+
allOf:
55+
- $ref: synopsys-dw-mshc-common.yaml#
56+
57+
- if:
58+
properties:
59+
compatible:
60+
contains:
61+
const: hisilicon,hi3798mv200-dw-mshc
62+
then:
63+
required:
64+
- hisilicon,sap-dll-reg
65+
else:
66+
properties:
67+
hisilicon,sap-dll-reg: false
68+
69+
unevaluatedProperties: false
70+
71+
examples:
72+
- |
73+
#include <dt-bindings/clock/histb-clock.h>
74+
#include <dt-bindings/interrupt-controller/arm-gic.h>
75+
76+
mmc@9830000 {
77+
compatible = "hisilicon,hi3798cv200-dw-mshc";
78+
reg = <0x9830000 0x10000>;
79+
interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
80+
clocks = <&crg HISTB_MMC_CIU_CLK>,
81+
<&crg HISTB_MMC_BIU_CLK>,
82+
<&crg HISTB_MMC_SAMPLE_CLK>,
83+
<&crg HISTB_MMC_DRV_CLK>;
84+
clock-names = "ciu", "biu", "ciu-sample", "ciu-drive";
85+
resets = <&crg 0xa0 4>;
86+
reset-names = "reset";
87+
pinctrl-names = "default";
88+
pinctrl-0 = <&emmc_pins_1 &emmc_pins_2
89+
&emmc_pins_3 &emmc_pins_4>;
90+
fifo-depth = <256>;
91+
clock-frequency = <200000000>;
92+
cap-mmc-highspeed;
93+
mmc-ddr-1_8v;
94+
mmc-hs200-1_8v;
95+
non-removable;
96+
bus-width = <8>;
97+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ properties:
6767
- renesas,sdhi-r8a779a0 # R-Car V3U
6868
- renesas,sdhi-r8a779f0 # R-Car S4-8
6969
- renesas,sdhi-r8a779g0 # R-Car V4H
70+
- renesas,sdhi-r8a779h0 # R-Car V4M
7071
- const: renesas,rcar-gen4-sdhi # R-Car Gen4
7172

7273
reg:

Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ properties:
1919
- rockchip,rk3568-dwcmshc
2020
- rockchip,rk3588-dwcmshc
2121
- snps,dwcmshc-sdhci
22+
- sophgo,cv1800b-dwcmshc
23+
- sophgo,sg2002-dwcmshc
2224
- thead,th1520-dwcmshc
2325

2426
reg:

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7809,8 +7809,8 @@ F: drivers/media/usb/em28xx/
78097809

78107810
EMMC CMDQ HOST CONTROLLER INTERFACE (CQHCI) DRIVER
78117811
M: Adrian Hunter <[email protected]>
7812-
M: Ritesh Harjani <[email protected]>
7813-
M: Asutosh Das <[email protected]>
7812+
M: Asutosh Das <[email protected]>
7813+
R: Ritesh Harjani <[email protected]>
78147814
78157815
S: Supported
78167816
F: drivers/mmc/host/cqhci*

drivers/memstick/core/memstick.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static struct attribute *memstick_dev_attrs[] = {
164164
};
165165
ATTRIBUTE_GROUPS(memstick_dev);
166166

167-
static struct bus_type memstick_bus_type = {
167+
static const struct bus_type memstick_bus_type = {
168168
.name = "memstick",
169169
.dev_groups = memstick_dev_groups,
170170
.match = memstick_bus_match,

drivers/mmc/core/block.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ struct mmc_blk_data {
144144
static dev_t mmc_rpmb_devt;
145145

146146
/* Bus type for RPMB character devices */
147-
static struct bus_type mmc_rpmb_bus_type = {
147+
static const struct bus_type mmc_rpmb_bus_type = {
148148
.name = "mmc_rpmb",
149149
};
150150

@@ -206,7 +206,7 @@ static void mmc_blk_kref_release(struct kref *ref)
206206
int devidx;
207207

208208
devidx = mmc_get_devidx(md->disk);
209-
ida_simple_remove(&mmc_blk_ida, devidx);
209+
ida_free(&mmc_blk_ida, devidx);
210210

211211
mutex_lock(&open_lock);
212212
md->disk->private_data = NULL;
@@ -874,10 +874,11 @@ static const struct block_device_operations mmc_bdops = {
874874
static int mmc_blk_part_switch_pre(struct mmc_card *card,
875875
unsigned int part_type)
876876
{
877-
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB;
877+
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_MASK;
878+
const unsigned int rpmb = EXT_CSD_PART_CONFIG_ACC_RPMB;
878879
int ret = 0;
879880

880-
if ((part_type & mask) == mask) {
881+
if ((part_type & mask) == rpmb) {
881882
if (card->ext_csd.cmdq_en) {
882883
ret = mmc_cmdq_disable(card);
883884
if (ret)
@@ -892,10 +893,11 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card,
892893
static int mmc_blk_part_switch_post(struct mmc_card *card,
893894
unsigned int part_type)
894895
{
895-
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB;
896+
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_MASK;
897+
const unsigned int rpmb = EXT_CSD_PART_CONFIG_ACC_RPMB;
896898
int ret = 0;
897899

898-
if ((part_type & mask) == mask) {
900+
if ((part_type & mask) == rpmb) {
899901
mmc_retune_unpause(card->host);
900902
if (card->reenable_cmdq && !card->ext_csd.cmdq_en)
901903
ret = mmc_cmdq_enable(card);
@@ -2467,7 +2469,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
24672469
bool cache_enabled = false;
24682470
bool fua_enabled = false;
24692471

2470-
devidx = ida_simple_get(&mmc_blk_ida, 0, max_devices, GFP_KERNEL);
2472+
devidx = ida_alloc_max(&mmc_blk_ida, max_devices - 1, GFP_KERNEL);
24712473
if (devidx < 0) {
24722474
/*
24732475
* We get -ENOSPC because there are no more any available
@@ -2577,7 +2579,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
25772579
err_kfree:
25782580
kfree(md);
25792581
out:
2580-
ida_simple_remove(&mmc_blk_ida, devidx);
2582+
ida_free(&mmc_blk_ida, devidx);
25812583
return ERR_PTR(ret);
25822584
}
25832585

@@ -2703,7 +2705,7 @@ static void mmc_blk_rpmb_device_release(struct device *dev)
27032705
{
27042706
struct mmc_rpmb_data *rpmb = dev_get_drvdata(dev);
27052707

2706-
ida_simple_remove(&mmc_rpmb_ida, rpmb->id);
2708+
ida_free(&mmc_rpmb_ida, rpmb->id);
27072709
kfree(rpmb);
27082710
}
27092711

@@ -2719,13 +2721,13 @@ static int mmc_blk_alloc_rpmb_part(struct mmc_card *card,
27192721
struct mmc_rpmb_data *rpmb;
27202722

27212723
/* This creates the minor number for the RPMB char device */
2722-
devidx = ida_simple_get(&mmc_rpmb_ida, 0, max_devices, GFP_KERNEL);
2724+
devidx = ida_alloc_max(&mmc_rpmb_ida, max_devices - 1, GFP_KERNEL);
27232725
if (devidx < 0)
27242726
return devidx;
27252727

27262728
rpmb = kzalloc(sizeof(*rpmb), GFP_KERNEL);
27272729
if (!rpmb) {
2728-
ida_simple_remove(&mmc_rpmb_ida, devidx);
2730+
ida_free(&mmc_rpmb_ida, devidx);
27292731
return -ENOMEM;
27302732
}
27312733

drivers/mmc/core/bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static const struct dev_pm_ops mmc_bus_pm_ops = {
214214
SET_SYSTEM_SLEEP_PM_OPS(mmc_bus_suspend, mmc_bus_resume)
215215
};
216216

217-
static struct bus_type mmc_bus_type = {
217+
static const struct bus_type mmc_bus_type = {
218218
.name = "mmc",
219219
.dev_groups = mmc_dev_groups,
220220
.uevent = mmc_bus_uevent,
@@ -272,7 +272,7 @@ static void mmc_release_card(struct device *dev)
272272
/*
273273
* Allocate and initialise a new MMC card structure.
274274
*/
275-
struct mmc_card *mmc_alloc_card(struct mmc_host *host, struct device_type *type)
275+
struct mmc_card *mmc_alloc_card(struct mmc_host *host, const struct device_type *type)
276276
{
277277
struct mmc_card *card;
278278

0 commit comments

Comments
 (0)