Commit 7fbfe604 authored by Ulf Hansson's avatar Ulf Hansson
Browse files

mmc: Merge branch fixes into next



Merge the mmc fixes for v6.5-rc[n] into the next branch, to allow them to
get tested together with the new mmc changes that are targeted for v6.6.

Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parents 8069a60a cf3f15b8
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2097,14 +2097,14 @@ static void mmc_blk_mq_poll_completion(struct mmc_queue *mq,
	mmc_blk_urgent_bkops(mq, mqrq);
}

static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req)
static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, enum mmc_issue_type issue_type)
{
	unsigned long flags;
	bool put_card;

	spin_lock_irqsave(&mq->lock, flags);

	mq->in_flight[mmc_issue_type(mq, req)] -= 1;
	mq->in_flight[issue_type] -= 1;

	put_card = (mmc_tot_in_flight(mq) == 0);

@@ -2117,6 +2117,7 @@ static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req)
static void mmc_blk_mq_post_req(struct mmc_queue *mq, struct request *req,
				bool can_sleep)
{
	enum mmc_issue_type issue_type = mmc_issue_type(mq, req);
	struct mmc_queue_req *mqrq = req_to_mmc_queue_req(req);
	struct mmc_request *mrq = &mqrq->brq.mrq;
	struct mmc_host *host = mq->card->host;
@@ -2136,7 +2137,7 @@ static void mmc_blk_mq_post_req(struct mmc_queue *mq, struct request *req,
			blk_mq_complete_request(req);
	}

	mmc_blk_mq_dec_in_flight(mq, req);
	mmc_blk_mq_dec_in_flight(mq, issue_type);
}

void mmc_blk_mq_recovery(struct mmc_queue *mq)
+1 −7
Original line number Diff line number Diff line
@@ -338,13 +338,7 @@ static void moxart_transfer_pio(struct moxart_host *host)
				return;
			}
			for (len = 0; len < remain && len < host->fifo_width;) {
				/* SCR data must be read in big endian. */
				if (data->mrq->cmd->opcode == SD_APP_SEND_SCR)
					*sgp = ioread32be(host->base +
							  REG_DATA_WINDOW);
				else
					*sgp = ioread32(host->base +
							REG_DATA_WINDOW);
				*sgp = ioread32(host->base + REG_DATA_WINDOW);
				sgp++;
				len += 4;
			}
+27 −33
Original line number Diff line number Diff line
@@ -29,9 +29,16 @@ struct f_sdhost_priv {
	bool enable_cmd_dat_delay;
};

static void *sdhci_f_sdhost_priv(struct sdhci_host *host)
{
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);

	return sdhci_pltfm_priv(pltfm_host);
}

static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
{
	struct f_sdhost_priv *priv = sdhci_priv(host);
	struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
	u32 ctrl = 0;

	usleep_range(2500, 3000);
@@ -64,7 +71,7 @@ static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)

static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
{
	struct f_sdhost_priv *priv = sdhci_priv(host);
	struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
	u32 ctl;

	if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
@@ -95,30 +102,32 @@ static const struct sdhci_ops sdhci_f_sdh30_ops = {
	.set_uhs_signaling = sdhci_set_uhs_signaling,
};

static const struct sdhci_pltfm_data sdhci_f_sdh30_pltfm_data = {
	.ops = &sdhci_f_sdh30_ops,
	.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
		| SDHCI_QUIRK_INVERTED_WRITE_PROTECT,
	.quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE
		|  SDHCI_QUIRK2_TUNING_WORK_AROUND,
};

static int sdhci_f_sdh30_probe(struct platform_device *pdev)
{
	struct sdhci_host *host;
	struct device *dev = &pdev->dev;
	int irq, ctrl = 0, ret = 0;
	int ctrl = 0, ret = 0;
	struct f_sdhost_priv *priv;
	struct sdhci_pltfm_host *pltfm_host;
	u32 reg = 0;

	irq = platform_get_irq(pdev, 0);
	if (irq < 0)
		return irq;

	host = sdhci_alloc_host(dev, sizeof(struct f_sdhost_priv));
	host = sdhci_pltfm_init(pdev, &sdhci_f_sdh30_pltfm_data,
				sizeof(struct f_sdhost_priv));
	if (IS_ERR(host))
		return PTR_ERR(host);

	priv = sdhci_priv(host);
	pltfm_host = sdhci_priv(host);
	priv = sdhci_pltfm_priv(pltfm_host);
	priv->dev = dev;

	host->quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
		       SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
	host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE |
			SDHCI_QUIRK2_TUNING_WORK_AROUND;

	priv->enable_cmd_dat_delay = device_property_read_bool(dev,
						"fujitsu,cmd-dat-delay-select");

@@ -126,18 +135,6 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
	if (ret)
		goto err;

	platform_set_drvdata(pdev, host);

	host->hw_name = "f_sdh30";
	host->ops = &sdhci_f_sdh30_ops;
	host->irq = irq;

	host->ioaddr = devm_platform_ioremap_resource(pdev, 0);
	if (IS_ERR(host->ioaddr)) {
		ret = PTR_ERR(host->ioaddr);
		goto err;
	}

	if (dev_of_node(dev)) {
		sdhci_get_of_property(pdev);

@@ -204,24 +201,21 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
err_clk:
	clk_disable_unprepare(priv->clk_iface);
err:
	sdhci_free_host(host);
	sdhci_pltfm_free(pdev);

	return ret;
}

static int sdhci_f_sdh30_remove(struct platform_device *pdev)
{
	struct sdhci_host *host = platform_get_drvdata(pdev);
	struct f_sdhost_priv *priv = sdhci_priv(host);

	sdhci_remove_host(host, readl(host->ioaddr + SDHCI_INT_STATUS) ==
			  0xffffffff);
	struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);

	reset_control_assert(priv->rst);
	clk_disable_unprepare(priv->clk);
	clk_disable_unprepare(priv->clk_iface);

	sdhci_free_host(host);
	platform_set_drvdata(pdev, NULL);
	sdhci_pltfm_unregister(pdev);

	return 0;
}
+13 −13
Original line number Diff line number Diff line
@@ -863,11 +863,9 @@ static int spmmc_drv_probe(struct platform_device *pdev)
	struct spmmc_host *host;
	int ret = 0;

	mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
	if (!mmc) {
		ret = -ENOMEM;
		goto probe_free_host;
	}
	mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(struct spmmc_host));
	if (!mmc)
		return -ENOMEM;

	host = mmc_priv(mmc);
	host->mmc = mmc;
@@ -902,7 +900,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)

	ret = mmc_of_parse(mmc);
	if (ret)
		goto probe_free_host;
		goto clk_disable;

	mmc->ops = &spmmc_ops;
	mmc->f_min = SPMMC_MIN_CLK;
@@ -911,7 +909,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)

	ret = mmc_regulator_get_supply(mmc);
	if (ret)
		goto probe_free_host;
		goto clk_disable;

	if (!mmc->ocr_avail)
		mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
@@ -927,14 +925,17 @@ static int spmmc_drv_probe(struct platform_device *pdev)
	host->tuning_info.enable_tuning = 1;
	pm_runtime_set_active(&pdev->dev);
	pm_runtime_enable(&pdev->dev);
	mmc_add_host(mmc);
	ret = mmc_add_host(mmc);
	if (ret)
		goto pm_disable;

	return ret;
	return 0;

probe_free_host:
	if (mmc)
		mmc_free_host(mmc);
pm_disable:
	pm_runtime_disable(&pdev->dev);

clk_disable:
	clk_disable_unprepare(host->clk);
	return ret;
}

@@ -948,7 +949,6 @@ static int spmmc_drv_remove(struct platform_device *dev)
	pm_runtime_put_noidle(&dev->dev);
	pm_runtime_disable(&dev->dev);
	platform_set_drvdata(dev, NULL);
	mmc_free_host(host->mmc);

	return 0;
}
+0 −2
Original line number Diff line number Diff line
@@ -1705,8 +1705,6 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma,

		wbsd_release_resources(host);
		wbsd_free_mmc(dev);

		mmc_free_host(mmc);
		return ret;
	}