Skip to content

Commit 7c42d6f

Browse files
committed
Merge tag 'mmc-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: - Provide helper for resetting both SDHCI and CQHCI - Fix reset for CQHCI (am654, brcmstb, esdhc-imx, of-arasan, tegra) - Fixup support for MMC_CAP_8_BIT_DATA (esdhc-imx) * tag 'mmc-v6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA mmc: sdhci_am654: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-tegra: Fix SDHCI_RESET_ALL for CQHCI mms: sdhci-esdhc-imx: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-brcmstb: Fix SDHCI_RESET_ALL for CQHCI mmc: sdhci-of-arasan: Fix SDHCI_RESET_ALL for CQHCI mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI
2 parents 9c730fe + f002f45 commit 7c42d6f

6 files changed

Lines changed: 38 additions & 9 deletions

File tree

drivers/mmc/host/sdhci-brcmstb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/bitops.h>
1313
#include <linux/delay.h>
1414

15+
#include "sdhci-cqhci.h"
1516
#include "sdhci-pltfm.h"
1617
#include "cqhci.h"
1718

@@ -55,7 +56,7 @@ static void brcmstb_reset(struct sdhci_host *host, u8 mask)
5556
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
5657
struct sdhci_brcmstb_priv *priv = sdhci_pltfm_priv(pltfm_host);
5758

58-
sdhci_reset(host, mask);
59+
sdhci_and_cqhci_reset(host, mask);
5960

6061
/* Reset will clear this, so re-enable it */
6162
if (priv->flags & BRCMSTB_PRIV_FLAGS_GATE_CLOCK)

drivers/mmc/host/sdhci-cqhci.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright 2022 The Chromium OS Authors
4+
*
5+
* Support that applies to the combination of SDHCI and CQHCI, while not
6+
* expressing a dependency between the two modules.
7+
*/
8+
9+
#ifndef __MMC_HOST_SDHCI_CQHCI_H__
10+
#define __MMC_HOST_SDHCI_CQHCI_H__
11+
12+
#include "cqhci.h"
13+
#include "sdhci.h"
14+
15+
static inline void sdhci_and_cqhci_reset(struct sdhci_host *host, u8 mask)
16+
{
17+
if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL) &&
18+
host->mmc->cqe_private)
19+
cqhci_deactivate(host->mmc);
20+
21+
sdhci_reset(host, mask);
22+
}
23+
24+
#endif /* __MMC_HOST_SDHCI_CQHCI_H__ */

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/of_device.h>
2626
#include <linux/pinctrl/consumer.h>
2727
#include <linux/pm_runtime.h>
28+
#include "sdhci-cqhci.h"
2829
#include "sdhci-pltfm.h"
2930
#include "sdhci-esdhc.h"
3031
#include "cqhci.h"
@@ -1288,7 +1289,7 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing)
12881289

12891290
static void esdhc_reset(struct sdhci_host *host, u8 mask)
12901291
{
1291-
sdhci_reset(host, mask);
1292+
sdhci_and_cqhci_reset(host, mask);
12921293

12931294
sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
12941295
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
@@ -1671,14 +1672,14 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
16711672
if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)
16721673
host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
16731674

1674-
if (host->caps & MMC_CAP_8_BIT_DATA &&
1675+
if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
16751676
imx_data->socdata->flags & ESDHC_FLAG_HS400)
16761677
host->mmc->caps2 |= MMC_CAP2_HS400;
16771678

16781679
if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23)
16791680
host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN;
16801681

1681-
if (host->caps & MMC_CAP_8_BIT_DATA &&
1682+
if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
16821683
imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
16831684
host->mmc->caps2 |= MMC_CAP2_HS400_ES;
16841685
host->mmc_host_ops.hs400_enhanced_strobe =

drivers/mmc/host/sdhci-of-arasan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/firmware/xlnx-zynqmp.h>
2626

2727
#include "cqhci.h"
28+
#include "sdhci-cqhci.h"
2829
#include "sdhci-pltfm.h"
2930

3031
#define SDHCI_ARASAN_VENDOR_REGISTER 0x78
@@ -366,7 +367,7 @@ static void sdhci_arasan_reset(struct sdhci_host *host, u8 mask)
366367
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
367368
struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
368369

369-
sdhci_reset(host, mask);
370+
sdhci_and_cqhci_reset(host, mask);
370371

371372
if (sdhci_arasan->quirks & SDHCI_ARASAN_QUIRK_FORCE_CDTEST) {
372373
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);

drivers/mmc/host/sdhci-tegra.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include <soc/tegra/common.h>
3030

31+
#include "sdhci-cqhci.h"
3132
#include "sdhci-pltfm.h"
3233
#include "cqhci.h"
3334

@@ -367,7 +368,7 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
367368
const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
368369
u32 misc_ctrl, clk_ctrl, pad_ctrl;
369370

370-
sdhci_reset(host, mask);
371+
sdhci_and_cqhci_reset(host, mask);
371372

372373
if (!(mask & SDHCI_RESET_ALL))
373374
return;

drivers/mmc/host/sdhci_am654.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/sys_soc.h>
1616

1717
#include "cqhci.h"
18+
#include "sdhci-cqhci.h"
1819
#include "sdhci-pltfm.h"
1920

2021
/* CTL_CFG Registers */
@@ -378,7 +379,7 @@ static void sdhci_am654_reset(struct sdhci_host *host, u8 mask)
378379
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
379380
struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host);
380381

381-
sdhci_reset(host, mask);
382+
sdhci_and_cqhci_reset(host, mask);
382383

383384
if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_FORCE_CDTEST) {
384385
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
@@ -464,7 +465,7 @@ static struct sdhci_ops sdhci_am654_ops = {
464465
.set_clock = sdhci_am654_set_clock,
465466
.write_b = sdhci_am654_write_b,
466467
.irq = sdhci_am654_cqhci_irq,
467-
.reset = sdhci_reset,
468+
.reset = sdhci_and_cqhci_reset,
468469
};
469470

470471
static const struct sdhci_pltfm_data sdhci_am654_pdata = {
@@ -494,7 +495,7 @@ static struct sdhci_ops sdhci_j721e_8bit_ops = {
494495
.set_clock = sdhci_am654_set_clock,
495496
.write_b = sdhci_am654_write_b,
496497
.irq = sdhci_am654_cqhci_irq,
497-
.reset = sdhci_reset,
498+
.reset = sdhci_and_cqhci_reset,
498499
};
499500

500501
static const struct sdhci_pltfm_data sdhci_j721e_8bit_pdata = {

0 commit comments

Comments
 (0)