Unverified Commit dc43354c authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'memory-controller-drv-fixes-6.2' of...

Merge tag 'memory-controller-drv-fixes-6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/fixes

Memory controller drivers - fixes for v6.2

Broken in v6.2:
1. OMAP GPMC: do not fail if "gpmc,wait-pin" optional property
   (introduced for v6.2) is missing.

Broken earlier:
1. Tegra MC: Drop SID override programming as it is handled by
   bootloader and doing it in the kernel can cause unexpected results.
2. Atmel SDRAMC, MVEBU devbus: Add missing clock unprepare/disable in
   exit and error paths.

* tag 'memory-controller-drv-fixes-6.2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe()
  memory: atmel-sdramc: Fix missing clk_disable_unprepare in atmel_ramc_probe()
  memory: tegra: Remove clients SID override programming
  memory: omap-gpmc: fix wait pin validation

Link: https://lore.kernel.org/r/20230109150322.329614-1-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 88603b6d cb8fd6f7
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -47,19 +47,17 @@ static int atmel_ramc_probe(struct platform_device *pdev)
	caps = of_device_get_match_data(&pdev->dev);

	if (caps->has_ddrck) {
		clk = devm_clk_get(&pdev->dev, "ddrck");
		clk = devm_clk_get_enabled(&pdev->dev, "ddrck");
		if (IS_ERR(clk))
			return PTR_ERR(clk);
		clk_prepare_enable(clk);
	}

	if (caps->has_mpddr_clk) {
		clk = devm_clk_get(&pdev->dev, "mpddr");
		clk = devm_clk_get_enabled(&pdev->dev, "mpddr");
		if (IS_ERR(clk)) {
			pr_err("AT91 RAMC: couldn't get mpddr clock\n");
			return PTR_ERR(clk);
		}
		clk_prepare_enable(clk);
	}

	return 0;
+1 −2
Original line number Diff line number Diff line
@@ -280,10 +280,9 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
	if (IS_ERR(devbus->base))
		return PTR_ERR(devbus->base);

	clk = devm_clk_get(&pdev->dev, NULL);
	clk = devm_clk_get_enabled(&pdev->dev, NULL);
	if (IS_ERR(clk))
		return PTR_ERR(clk);
	clk_prepare_enable(clk);

	/*
	 * Obtain clock period in picoseconds,
+2 −1
Original line number Diff line number Diff line
@@ -1918,7 +1918,8 @@ int gpmc_cs_program_settings(int cs, struct gpmc_settings *p)
		}
	}

	if (p->wait_pin > gpmc_nr_waitpins) {
	if (p->wait_pin != GPMC_WAITPIN_INVALID &&
	    p->wait_pin > gpmc_nr_waitpins) {
		pr_err("%s: invalid wait-pin (%d)\n", __func__, p->wait_pin);
		return -EINVAL;
	}
+0 −36
Original line number Diff line number Diff line
@@ -22,32 +22,6 @@
#define MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED BIT(16)
#define MC_SID_STREAMID_SECURITY_OVERRIDE BIT(8)

static void tegra186_mc_program_sid(struct tegra_mc *mc)
{
	unsigned int i;

	for (i = 0; i < mc->soc->num_clients; i++) {
		const struct tegra_mc_client *client = &mc->soc->clients[i];
		u32 override, security;

		override = readl(mc->regs + client->regs.sid.override);
		security = readl(mc->regs + client->regs.sid.security);

		dev_dbg(mc->dev, "client %s: override: %x security: %x\n",
			client->name, override, security);

		dev_dbg(mc->dev, "setting SID %u for %s\n", client->sid,
			client->name);
		writel(client->sid, mc->regs + client->regs.sid.override);

		override = readl(mc->regs + client->regs.sid.override);
		security = readl(mc->regs + client->regs.sid.security);

		dev_dbg(mc->dev, "client %s: override: %x security: %x\n",
			client->name, override, security);
	}
}

static int tegra186_mc_probe(struct tegra_mc *mc)
{
	struct platform_device *pdev = to_platform_device(mc->dev);
@@ -85,8 +59,6 @@ static int tegra186_mc_probe(struct tegra_mc *mc)
	if (err < 0)
		return err;

	tegra186_mc_program_sid(mc);

	return 0;
}

@@ -95,13 +67,6 @@ static void tegra186_mc_remove(struct tegra_mc *mc)
	of_platform_depopulate(mc->dev);
}

static int tegra186_mc_resume(struct tegra_mc *mc)
{
	tegra186_mc_program_sid(mc);

	return 0;
}

#if IS_ENABLED(CONFIG_IOMMU_API)
static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
					    const struct tegra_mc_client *client,
@@ -173,7 +138,6 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
const struct tegra_mc_ops tegra186_mc_ops = {
	.probe = tegra186_mc_probe,
	.remove = tegra186_mc_remove,
	.resume = tegra186_mc_resume,
	.probe_device = tegra186_mc_probe_device,
	.handle_irq = tegra30_mc_handle_irq,
};