All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>,
	Carl Philipp Klemm <philipp@uvos.xyz>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Suman Anna <s-anna@ti.com>, Tero Kristo <t-kristo@ti.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH AUTOSEL 5.10 01/36] soc: ti: omap-prm: Fix boot time errors for rst_map_012 bits 0 and 1
Date: Mon,  8 Feb 2021 12:57:31 -0500	[thread overview]
Message-ID: <20210208175806.2091668-1-sashal@kernel.org> (raw)

From: Tony Lindgren <tony@atomide.com>

[ Upstream commit 7078a5ba7a58e5db07583b176f8a03e0b8714731 ]

We have rst_map_012 used for various accelerators like dsp, ipu and iva.
For these use cases, we have rstctrl bit 2 control the subsystem module
reset, and have and bits 0 and 1 control the accelerator specific
features.

If the bootloader, or kexec boot, has left any accelerator specific
reset bits deasserted, deasserting bit 2 reset will potentially enable
an accelerator with unconfigured MMU and no firmware. And we may get
spammed with a lot by warnings on boot with "Data Access in User mode
during Functional access", or depending on the accelerator, the system
can also just hang.

This issue can be quite easily reproduced by setting a rst_map_012 type
rstctrl register to 0 or 4 in the bootloader, and booting the system.

Let's just assert all reset bits for rst_map_012 type resets. So far
it looks like the other rstctrl types don't need this. If it turns out
that the other type rstctrl bits also need reset on init, we need to
add an instance specific reset mask for the bits to avoid resetting
unwanted bits.

Reported-by: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Cc: Suman Anna <s-anna@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Tested-by: Carl Philipp Klemm <philipp@uvos.xyz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/ti/omap_prm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c
index 4d41dc3cdce1f..c8b14b3a171f7 100644
--- a/drivers/soc/ti/omap_prm.c
+++ b/drivers/soc/ti/omap_prm.c
@@ -552,6 +552,7 @@ static int omap_prm_reset_init(struct platform_device *pdev,
 	const struct omap_rst_map *map;
 	struct ti_prm_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	char buf[32];
+	u32 v;
 
 	/*
 	 * Check if we have controllable resets. If either rstctrl is non-zero
@@ -599,6 +600,16 @@ static int omap_prm_reset_init(struct platform_device *pdev,
 		map++;
 	}
 
+	/* Quirk handling to assert rst_map_012 bits on reset and avoid errors */
+	if (prm->data->rstmap == rst_map_012) {
+		v = readl_relaxed(reset->prm->base + reset->prm->data->rstctrl);
+		if ((v & reset->mask) != reset->mask) {
+			dev_dbg(&pdev->dev, "Asserting all resets: %08x\n", v);
+			writel_relaxed(reset->mask, reset->prm->base +
+				       reset->prm->data->rstctrl);
+		}
+	}
+
 	return devm_reset_controller_register(&pdev->dev, &reset->rcdev);
 }
 
-- 
2.27.0


WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Carl Philipp Klemm <philipp@uvos.xyz>,
	Sasha Levin <sashal@kernel.org>, Tony Lindgren <tony@atomide.com>,
	Tero Kristo <t-kristo@ti.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH AUTOSEL 5.10 01/36] soc: ti: omap-prm: Fix boot time errors for rst_map_012 bits 0 and 1
Date: Mon,  8 Feb 2021 12:57:31 -0500	[thread overview]
Message-ID: <20210208175806.2091668-1-sashal@kernel.org> (raw)

From: Tony Lindgren <tony@atomide.com>

[ Upstream commit 7078a5ba7a58e5db07583b176f8a03e0b8714731 ]

We have rst_map_012 used for various accelerators like dsp, ipu and iva.
For these use cases, we have rstctrl bit 2 control the subsystem module
reset, and have and bits 0 and 1 control the accelerator specific
features.

If the bootloader, or kexec boot, has left any accelerator specific
reset bits deasserted, deasserting bit 2 reset will potentially enable
an accelerator with unconfigured MMU and no firmware. And we may get
spammed with a lot by warnings on boot with "Data Access in User mode
during Functional access", or depending on the accelerator, the system
can also just hang.

This issue can be quite easily reproduced by setting a rst_map_012 type
rstctrl register to 0 or 4 in the bootloader, and booting the system.

Let's just assert all reset bits for rst_map_012 type resets. So far
it looks like the other rstctrl types don't need this. If it turns out
that the other type rstctrl bits also need reset on init, we need to
add an instance specific reset mask for the bits to avoid resetting
unwanted bits.

Reported-by: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Cc: Suman Anna <s-anna@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Tested-by: Carl Philipp Klemm <philipp@uvos.xyz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/ti/omap_prm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c
index 4d41dc3cdce1f..c8b14b3a171f7 100644
--- a/drivers/soc/ti/omap_prm.c
+++ b/drivers/soc/ti/omap_prm.c
@@ -552,6 +552,7 @@ static int omap_prm_reset_init(struct platform_device *pdev,
 	const struct omap_rst_map *map;
 	struct ti_prm_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	char buf[32];
+	u32 v;
 
 	/*
 	 * Check if we have controllable resets. If either rstctrl is non-zero
@@ -599,6 +600,16 @@ static int omap_prm_reset_init(struct platform_device *pdev,
 		map++;
 	}
 
+	/* Quirk handling to assert rst_map_012 bits on reset and avoid errors */
+	if (prm->data->rstmap == rst_map_012) {
+		v = readl_relaxed(reset->prm->base + reset->prm->data->rstctrl);
+		if ((v & reset->mask) != reset->mask) {
+			dev_dbg(&pdev->dev, "Asserting all resets: %08x\n", v);
+			writel_relaxed(reset->mask, reset->prm->base +
+				       reset->prm->data->rstctrl);
+		}
+	}
+
 	return devm_reset_controller_register(&pdev->dev, &reset->rcdev);
 }
 
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2021-02-08 19:16 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 17:57 Sasha Levin [this message]
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 01/36] soc: ti: omap-prm: Fix boot time errors for rst_map_012 bits 0 and 1 Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 02/36] arm64: dts: rockchip: Fix PCIe DT properties on rk3399 Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 03/36] Input: goodix - add support for Goodix GT9286 chip Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 04/36] arm64: dts: qcom: sdm845: Reserve LPASS clocks in gcc Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 05/36] ARM: OMAP2+: Fix suspcious RCU usage splats for omap_enter_idle_coupled Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 06/36] arm64: dts: rockchip: remove interrupt-names property from rk3399 vdec node Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 07/36] kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gcc Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 08/36] Input: xpad - sync supported devices with fork on GitHub Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 09/36] platform/x86: hp-wmi: Disable tablet-mode reporting by default Sasha Levin
2021-02-10 23:22   ` mark gross
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 10/36] arm64: dts: rockchip: Disable display for NanoPi R2S Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 11/36] ovl: perform vfs_getxattr() with mounter creds Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 12/36] cap: fix conversions on getxattr Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 13/36] ovl: skip getxattr of security labels Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 14/36] media: rkisp1: uapi: change hist_bins array type from __u16 to __u32 Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 20:46   ` Hans Verkuil
2021-02-08 20:46     ` Hans Verkuil
2021-02-09 12:45     ` Dafna Hirschfeld
2021-02-09 12:45       ` Dafna Hirschfeld
2021-02-09 13:02       ` Greg Kroah-Hartman
2021-02-09 13:02         ` Greg Kroah-Hartman
2021-02-09 13:39         ` Hans Verkuil
2021-02-09 13:39           ` Hans Verkuil
2021-02-09 13:44           ` Greg Kroah-Hartman
2021-02-09 13:44             ` Greg Kroah-Hartman
2021-02-10 15:33             ` Sasha Levin
2021-02-10 15:33               ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 15/36] media: rkisp1: stats: remove a wrong cast to u8 Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 16/36] media: rkisp1: stats: mask the hist_bins values Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 17/36] scsi: lpfc: Fix EEH encountering oops with NVMe traffic Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 18/36] x86/split_lock: Enable the split lock feature on another Alder Lake CPU Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 19/36] nvme-pci: ignore the subsysem NQN on Phison E16 Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 20/36] drm/amd/display: Fix DPCD translation for LTTPR AUX_RD_INTERVAL Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 21/36] drm/amd/display: Add more Clock Sources to DCN2.1 Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 22/36] drm/amd/display: Release DSC before acquiring Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 23/36] drm/amd/display: Fix dc_sink kref count in emulated_link_detect Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 24/36] drm/amd/display: Free atomic state after drm_atomic_commit Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 25/36] drm/amd/display: Decrement refcount of dc_sink before reassignment Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 26/36] riscv: virt_addr_valid must check the address belongs to linear mapping Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 27/36] bfq-iosched: Revert "bfq: Fix computation of shallow depth" Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 28/36] ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL Sasha Levin
2021-02-08 17:57   ` Sasha Levin
2021-02-08 17:57 ` [PATCH AUTOSEL 5.10 29/36] kallsyms: fix nonconverging kallsyms table with lld Sasha Levin
2021-02-08 17:58 ` [PATCH AUTOSEL 5.10 30/36] ARM: ensure the signal page contains defined contents Sasha Levin
2021-02-08 17:58   ` Sasha Levin
2021-02-08 17:58 ` [PATCH AUTOSEL 5.10 31/36] ARM: kexec: fix oops after TLB are invalidated Sasha Levin
2021-02-08 17:58   ` Sasha Levin
2021-02-08 17:58 ` [PATCH AUTOSEL 5.10 32/36] init/gcov: allow CONFIG_CONSTRUCTORS on UML to fix module gcov Sasha Levin
2021-02-08 17:58 ` [PATCH AUTOSEL 5.10 33/36] kasan: add explicit preconditions to kasan_report() Sasha Levin
2021-02-08 17:58 ` [PATCH AUTOSEL 5.10 34/36] ubsan: implement __ubsan_handle_alignment_assumption Sasha Levin
2021-02-08 17:58 ` [PATCH AUTOSEL 5.10 35/36] Revert "lib: Restrict cpumask_local_spread to houskeeping CPUs" Sasha Levin
2021-02-08 17:58 ` [PATCH AUTOSEL 5.10 36/36] x86/efi: Remove EFI PGD build time checks Sasha Levin

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=20210208175806.2091668-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=philipp@uvos.xyz \
    --cc=s-anna@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    /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: link
Be 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.