From: Conor Dooley <conor.dooley@microchip.com> To: <mturquette@baylibre.com>, <sboyd@kernel.org>, <linux-clk@vger.kernel.org> Cc: <daire.mcnamara@microchip.com>, <linux-riscv@lists.infradead.org>, <palmer@rivosinc.com>, <andrew@lunn.ch>, <linux@armlinux.org.uk>, "Conor Dooley" <conor.dooley@microchip.com> Subject: [PATCH v2] clk: microchip: mpfs: don't reset disabled peripherals Date: Mon, 11 Apr 2022 08:23:41 +0100 [thread overview] Message-ID: <20220411072340.740981-1-conor.dooley@microchip.com> (raw) The current clock driver for PolarFire SoC puts the hardware behind "periph" clocks into reset if their clock is disabled. CONFIG_PM was recently added to the riscv defconfig and exposed issues caused by this behaviour, where the Cadence GEM was being put into reset between its bringup & the PHY bringup: https://lore.kernel.org/linux-riscv/9f4b057d-1985-5fd3-65c0-f944161c7792@microchip.com/ Fix this (for now) by removing the reset from mpfs_periph_clk_disable. Fixes: 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC") Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> --- Changes since v1: The first stage bootloader takes most, but not all, of the peripherals out of reset. In v1 all code touching the reset reg was removed, but in v2 the code taking peripherals out of reset is kept to cover the edge case peripherals. The permanent fix will be to move the reset stuff its own driver. drivers/clk/microchip/clk-mpfs.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/clk/microchip/clk-mpfs.c b/drivers/clk/microchip/clk-mpfs.c index aa1561b773d6..744ef2ba2a0c 100644 --- a/drivers/clk/microchip/clk-mpfs.c +++ b/drivers/clk/microchip/clk-mpfs.c @@ -200,10 +200,6 @@ static void mpfs_periph_clk_disable(struct clk_hw *hw) spin_lock_irqsave(&mpfs_clk_lock, flags); - reg = readl_relaxed(base_addr + REG_SUBBLK_RESET_CR); - val = reg | (1u << periph->shift); - writel_relaxed(val, base_addr + REG_SUBBLK_RESET_CR); - reg = readl_relaxed(base_addr + REG_SUBBLK_CLOCK_CR); val = reg & ~(1u << periph->shift); writel_relaxed(val, base_addr + REG_SUBBLK_CLOCK_CR); -- 2.35.1
WARNING: multiple messages have this Message-ID (diff)
From: Conor Dooley <conor.dooley@microchip.com> To: <mturquette@baylibre.com>, <sboyd@kernel.org>, <linux-clk@vger.kernel.org> Cc: <daire.mcnamara@microchip.com>, <linux-riscv@lists.infradead.org>, <palmer@rivosinc.com>, <andrew@lunn.ch>, <linux@armlinux.org.uk>, "Conor Dooley" <conor.dooley@microchip.com> Subject: [PATCH v2] clk: microchip: mpfs: don't reset disabled peripherals Date: Mon, 11 Apr 2022 08:23:41 +0100 [thread overview] Message-ID: <20220411072340.740981-1-conor.dooley@microchip.com> (raw) The current clock driver for PolarFire SoC puts the hardware behind "periph" clocks into reset if their clock is disabled. CONFIG_PM was recently added to the riscv defconfig and exposed issues caused by this behaviour, where the Cadence GEM was being put into reset between its bringup & the PHY bringup: https://lore.kernel.org/linux-riscv/9f4b057d-1985-5fd3-65c0-f944161c7792@microchip.com/ Fix this (for now) by removing the reset from mpfs_periph_clk_disable. Fixes: 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC") Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com> --- Changes since v1: The first stage bootloader takes most, but not all, of the peripherals out of reset. In v1 all code touching the reset reg was removed, but in v2 the code taking peripherals out of reset is kept to cover the edge case peripherals. The permanent fix will be to move the reset stuff its own driver. drivers/clk/microchip/clk-mpfs.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/clk/microchip/clk-mpfs.c b/drivers/clk/microchip/clk-mpfs.c index aa1561b773d6..744ef2ba2a0c 100644 --- a/drivers/clk/microchip/clk-mpfs.c +++ b/drivers/clk/microchip/clk-mpfs.c @@ -200,10 +200,6 @@ static void mpfs_periph_clk_disable(struct clk_hw *hw) spin_lock_irqsave(&mpfs_clk_lock, flags); - reg = readl_relaxed(base_addr + REG_SUBBLK_RESET_CR); - val = reg | (1u << periph->shift); - writel_relaxed(val, base_addr + REG_SUBBLK_RESET_CR); - reg = readl_relaxed(base_addr + REG_SUBBLK_CLOCK_CR); val = reg & ~(1u << periph->shift); writel_relaxed(val, base_addr + REG_SUBBLK_CLOCK_CR); -- 2.35.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next reply other threads:[~2022-04-11 7:24 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-11 7:23 Conor Dooley [this message] 2022-04-11 7:23 ` [PATCH v2] clk: microchip: mpfs: don't reset disabled peripherals Conor Dooley 2022-04-22 2:35 ` Stephen Boyd 2022-04-22 2:35 ` Stephen Boyd 2022-04-22 6:26 ` Conor.Dooley 2022-04-22 6:26 ` Conor.Dooley
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220411072340.740981-1-conor.dooley@microchip.com \ --to=conor.dooley@microchip.com \ --cc=andrew@lunn.ch \ --cc=daire.mcnamara@microchip.com \ --cc=linux-clk@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ --cc=linux@armlinux.org.uk \ --cc=mturquette@baylibre.com \ --cc=palmer@rivosinc.com \ --cc=sboyd@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.