Skip to content

Commit dc43354

Browse files
committed
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/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 88603b6 + cb8fd6f commit dc43354

File tree

4 files changed

+5
-43
lines changed

4 files changed

+5
-43
lines changed

drivers/memory/atmel-sdramc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,17 @@ static int atmel_ramc_probe(struct platform_device *pdev)
4747
caps = of_device_get_match_data(&pdev->dev);
4848

4949
if (caps->has_ddrck) {
50-
clk = devm_clk_get(&pdev->dev, "ddrck");
50+
clk = devm_clk_get_enabled(&pdev->dev, "ddrck");
5151
if (IS_ERR(clk))
5252
return PTR_ERR(clk);
53-
clk_prepare_enable(clk);
5453
}
5554

5655
if (caps->has_mpddr_clk) {
57-
clk = devm_clk_get(&pdev->dev, "mpddr");
56+
clk = devm_clk_get_enabled(&pdev->dev, "mpddr");
5857
if (IS_ERR(clk)) {
5958
pr_err("AT91 RAMC: couldn't get mpddr clock\n");
6059
return PTR_ERR(clk);
6160
}
62-
clk_prepare_enable(clk);
6361
}
6462

6563
return 0;

drivers/memory/mvebu-devbus.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,9 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
280280
if (IS_ERR(devbus->base))
281281
return PTR_ERR(devbus->base);
282282

283-
clk = devm_clk_get(&pdev->dev, NULL);
283+
clk = devm_clk_get_enabled(&pdev->dev, NULL);
284284
if (IS_ERR(clk))
285285
return PTR_ERR(clk);
286-
clk_prepare_enable(clk);
287286

288287
/*
289288
* Obtain clock period in picoseconds,

drivers/memory/omap-gpmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,8 @@ int gpmc_cs_program_settings(int cs, struct gpmc_settings *p)
19181918
}
19191919
}
19201920

1921-
if (p->wait_pin > gpmc_nr_waitpins) {
1921+
if (p->wait_pin != GPMC_WAITPIN_INVALID &&
1922+
p->wait_pin > gpmc_nr_waitpins) {
19221923
pr_err("%s: invalid wait-pin (%d)\n", __func__, p->wait_pin);
19231924
return -EINVAL;
19241925
}

drivers/memory/tegra/tegra186.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,6 @@
2222
#define MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED BIT(16)
2323
#define MC_SID_STREAMID_SECURITY_OVERRIDE BIT(8)
2424

25-
static void tegra186_mc_program_sid(struct tegra_mc *mc)
26-
{
27-
unsigned int i;
28-
29-
for (i = 0; i < mc->soc->num_clients; i++) {
30-
const struct tegra_mc_client *client = &mc->soc->clients[i];
31-
u32 override, security;
32-
33-
override = readl(mc->regs + client->regs.sid.override);
34-
security = readl(mc->regs + client->regs.sid.security);
35-
36-
dev_dbg(mc->dev, "client %s: override: %x security: %x\n",
37-
client->name, override, security);
38-
39-
dev_dbg(mc->dev, "setting SID %u for %s\n", client->sid,
40-
client->name);
41-
writel(client->sid, mc->regs + client->regs.sid.override);
42-
43-
override = readl(mc->regs + client->regs.sid.override);
44-
security = readl(mc->regs + client->regs.sid.security);
45-
46-
dev_dbg(mc->dev, "client %s: override: %x security: %x\n",
47-
client->name, override, security);
48-
}
49-
}
50-
5125
static int tegra186_mc_probe(struct tegra_mc *mc)
5226
{
5327
struct platform_device *pdev = to_platform_device(mc->dev);
@@ -85,8 +59,6 @@ static int tegra186_mc_probe(struct tegra_mc *mc)
8559
if (err < 0)
8660
return err;
8761

88-
tegra186_mc_program_sid(mc);
89-
9062
return 0;
9163
}
9264

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

98-
static int tegra186_mc_resume(struct tegra_mc *mc)
99-
{
100-
tegra186_mc_program_sid(mc);
101-
102-
return 0;
103-
}
104-
10570
#if IS_ENABLED(CONFIG_IOMMU_API)
10671
static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
10772
const struct tegra_mc_client *client,
@@ -173,7 +138,6 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
173138
const struct tegra_mc_ops tegra186_mc_ops = {
174139
.probe = tegra186_mc_probe,
175140
.remove = tegra186_mc_remove,
176-
.resume = tegra186_mc_resume,
177141
.probe_device = tegra186_mc_probe_device,
178142
.handle_irq = tegra30_mc_handle_irq,
179143
};

0 commit comments

Comments
 (0)