All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Han Xu <han.xu@nxp.com>,
	Ran Wang <ran.wang_1@nxp.com>, Mark Brown <broonie@kernel.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.9 056/105] spi: spi-nxp-fspi: fix fspi panic by unexpected interrupts
Date: Mon, 14 Dec 2020 18:28:30 +0100	[thread overview]
Message-ID: <20201214172557.965095879@linuxfoundation.org> (raw)
In-Reply-To: <20201214172555.280929671@linuxfoundation.org>

From: Ran Wang <ran.wang_1@nxp.com>

[ Upstream commit 71d80563b0760a411cd90a3680536f5d887fff6b ]

Given the case that bootloader(such as UEFI)'s FSPI driver might not
handle all interrupts before loading kernel, those legacy interrupts
would assert immidiately once kernel's FSPI driver enable them. Further,
if it was FSPI_INTR_IPCMDDONE, the irq handler nxp_fspi_irq_handler()
would call complete(&f->c) to notify others. However, f->c might not be
initialized yet at that time, then cause kernel panic.

Of cause, we should fix this issue within bootloader. But it would be
better to have this pacth to make dirver more robust (by clearing all
interrupt status bits before enabling interrupts).

Suggested-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Link: https://lore.kernel.org/r/20201123025715.14635-1-ran.wang_1@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-nxp-fspi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 1ccda82da2063..158e09470898b 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -991,6 +991,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct nxp_fspi *f;
 	int ret;
+	u32 reg;
 
 	ctlr = spi_alloc_master(&pdev->dev, sizeof(*f));
 	if (!ctlr)
@@ -1017,6 +1018,12 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 		goto err_put_ctrl;
 	}
 
+	/* Clear potential interrupts */
+	reg = fspi_readl(f, f->iobase + FSPI_INTR);
+	if (reg)
+		fspi_writel(f, reg, f->iobase + FSPI_INTR);
+
+
 	/* find the resources - controller memory mapped space */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap");
 	if (!res) {
-- 
2.27.0




  parent reply	other threads:[~2020-12-14 17:41 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 17:27 [PATCH 5.9 000/105] 5.9.15-rc1 review Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 001/105] Kbuild: do not emit debug info for assembly with LLVM_IAS=1 Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 002/105] mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 003/105] kprobes: Remove NMI context check Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 004/105] kprobes: Tell lockdep about kprobe nesting Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 005/105] ASoC: Intel: bytcr_rt5640: Fix HP Pavilion x2 Detachable quirks Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 006/105] tools/bootconfig: Fix to check the write failure correctly Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 007/105] net, xsk: Avoid taking multiple skbuff references Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 008/105] bpftool: Fix error return value in build_btf_type_table Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 009/105] vhost-vdpa: fix page pinning leakage in error path (rework) Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 010/105] powerpc/64s: Fix hash ISA v3.0 TLBIEL instruction generation Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 011/105] batman-adv: Consider fragmentation for needed_headroom Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 012/105] batman-adv: Reserve needed_*room for fragments Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 013/105] batman-adv: Dont always reallocate the fragmentation skb head Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 014/105] ipvs: fix possible memory leak in ip_vs_control_net_init Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 015/105] ibmvnic: handle inconsistent login with reset Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 016/105] ibmvnic: stop free_all_rwi on failed reset Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 017/105] ibmvnic: avoid memset null scrq msgs Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 018/105] ibmvnic: delay next reset if hard reset fails Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 019/105] ibmvnic: track pending login Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 020/105] ibmvnic: send_login should check for crq errors Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 021/105] ibmvnic: reduce wait for completion time Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 022/105] drm/rockchip: Avoid uninitialized use of endpoint id in LVDS Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 023/105] drm/panel: sony-acx565akm: Fix race condition in probe Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 024/105] can: m_can: tcan4x5x_can_probe(): fix error path: remove erroneous clk_disable_unprepare() Greg Kroah-Hartman
2020-12-14 17:27 ` [PATCH 5.9 025/105] can: sja1000: sja1000_err(): dont count arbitration lose as an error Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 026/105] can: sun4i_can: sun4i_can_err(): " Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 027/105] can: c_can: c_can_power_up(): fix error handling Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 028/105] can: kvaser_pciefd: kvaser_pciefd_open(): " Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 029/105] samples/ftrace: Mark my_tramp[12]? global Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 030/105] scsi: storvsc: Fix error return in storvsc_probe() Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 031/105] net: broadcom CNIC: requires MMU Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 032/105] vdpa: mlx5: fix vdpa/vhost dependencies Greg Kroah-Hartman
2020-12-14 17:28   ` Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 033/105] iwlwifi: pcie: invert values of NO_160 device config entries Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 034/105] perf/x86/intel: Fix a warning on x86_pmu_stop() with large PEBS Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 035/105] usb: ohci-omap: Fix descriptor conversion Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 036/105] zlib: export S390 symbols for zlib modules Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 037/105] mm/mmap.c: fix mmap return value when vma is merged after call_mmap() Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 038/105] phy: usb: Fix incorrect clearing of tca_drv_sel bit in SETUP reg for 7211 Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 039/105] arm64: dts: rockchip: Remove system-power-controller from pmic on Odroid Go Advance Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 040/105] iwlwifi: pcie: limit memory read spin time Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 041/105] arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 042/105] arm64: dts: rockchip: Reorder LED triggers from mmc devices on rk3399-roc-pc Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 043/105] iwlwifi: sta: set max HE max A-MPDU according to HE capa Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 044/105] iwlwifi: pcie: set LTR to avoid completion timeout Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 045/105] iwlwifi: mvm: fix kernel panic in case of assert during CSA Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 046/105] powerpc: Drop -me200 addition to build flags Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 047/105] arm64: dts: broadcom: clear the warnings caused by empty dma-ranges Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 048/105] ARC: stack unwinding: dont assume non-current task is sleeping Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 049/105] scsi: ufs: Fix unexpected values from ufshcd_read_desc_param() Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 050/105] scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 051/105] interconnect: qcom: msm8916: Remove rpm-ids from non-RPM nodes Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 052/105] interconnect: qcom: qcs404: Remove GPU and display RPM IDs Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 053/105] ibmvnic: skip tx timeout reset while in resetting Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 054/105] irqchip/gic-v3-its: Unconditionally save/restore the ITS state on suspend Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 055/105] drm/exynos: depend on COMMON_CLK to fix compile tests Greg Kroah-Hartman
2020-12-14 17:28 ` Greg Kroah-Hartman [this message]
2020-12-14 17:28 ` [PATCH 5.9 057/105] arm-smmu-qcom: Ensure the qcom_scm driver has finished probing Greg Kroah-Hartman
2020-12-14 17:28   ` Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 058/105] habanalabs/gaudi: fix missing code in ECC handling Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 059/105] btrfs: do nofs allocations when adding and removing qgroup relations Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 060/105] btrfs: fix lockdep splat when enabling and disabling qgroups Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 061/105] soc: fsl: dpio: Get the cpumask through cpumask_of(cpu) Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 062/105] sched/idle: Fix arch_cpu_idle() vs tracing Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 063/105] intel_idle: Fix intel_idle() " Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 064/105] arm64: tegra: Disable the ACONNECT for Jetson TX2 Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 065/105] platform/x86: thinkpad_acpi: add P1 gen3 second fan support Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 066/105] platform/x86: thinkpad_acpi: Do not report SW_TABLET_MODE on Yoga 11e Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 067/105] platform/x86: thinkpad_acpi: Add BAT1 is primary battery quirk for Thinkpad Yoga 11e 4th gen Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 068/105] platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan control Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 069/105] platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 070/105] platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PC Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 071/105] platform/x86: touchscreen_dmi: Add info for the Predia Basic tablet Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 072/105] platform/x86: touchscreen_dmi: Add info for the Irbis TW118 tablet Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 073/105] can: m_can: m_can_dev_setup(): add support for bosch mcan version 3.3.0 Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 074/105] s390: fix irq state tracing Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 075/105] intel_idle: Build fix Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 076/105] media: pulse8-cec: fix duplicate free at disconnect or probe error Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 077/105] media: pulse8-cec: add support for FW v10 and up Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 078/105] mmc: mediatek: Fix system suspend/resume support for CQHCI Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 079/105] mmc: mediatek: Extend recheck_sdio_irq fix to more variants Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 080/105] ktest.pl: Fix incorrect reboot for grub2bls Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 081/105] xen: add helpers for caching grant mapping pages Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 082/105] xen: dont use page->lru for ZONE_DEVICE memory Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 083/105] Input: cm109 - do not stomp on control URB Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 084/105] Input: i8042 - add Acer laptops to the i8042 reset list Greg Kroah-Hartman
2020-12-14 17:28 ` [PATCH 5.9 085/105] pinctrl: jasperlake: Fix HOSTSW_OWN offset Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 086/105] pinctrl: amd: remove debounce filter setting in IRQ type setting Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 087/105] mmc: sdhci-of-arasan: Fix clock registration error for Keem Bay SOC Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 088/105] mmc: block: Fixup condition for CMD13 polling for RPMB requests Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 089/105] drm/amdgpu/disply: set num_crtc earlier Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 090/105] drm/i915/gem: Propagate error from cancelled submit due to context closure Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 091/105] drm/i915/display/dp: Compute the correct slice count for VDSC on DP Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 092/105] drm/i915/gt: Declare gen9 has 64 mocs entries! Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 093/105] drm/i915/gt: Ignore repeated attempts to suspend request flow across reset Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 094/105] drm/i915/gt: Cancel the preemption timeout on responding to it Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 095/105] drm/amdgpu: fix sdma instance fw version and feature version init Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 096/105] kbuild: avoid static_assert for genksyms Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 097/105] proc: use untagged_addr() for pagemap_read addresses Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 098/105] mm/hugetlb: clear compound_nr before freeing gigantic pages Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 099/105] zonefs: fix page reference and BIO leak Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 100/105] scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()" Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 101/105] x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 102/105] x86/membarrier: Get rid of a dubious optimization Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 103/105] x86/apic/vector: Fix ordering in vector assignment Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 104/105] x86/kprobes: Fix optprobe to detect INT3 padding correctly Greg Kroah-Hartman
2020-12-14 17:29 ` [PATCH 5.9 105/105] compiler.h: fix barrier_data() on clang Greg Kroah-Hartman
2020-12-14 22:06 ` [PATCH 5.9 000/105] 5.9.15-rc1 review Jeffrin Jose T
2020-12-14 23:53 ` Shuah Khan
2020-12-16 13:20   ` Greg Kroah-Hartman
2020-12-15  2:27 ` Naresh Kamboju
2020-12-16 13:20   ` Greg Kroah-Hartman
2020-12-15  9:06 ` Jon Hunter
2020-12-16 13:21   ` Greg Kroah-Hartman
2020-12-15 20:32 ` Guenter Roeck
2020-12-16 13:21   ` Greg Kroah-Hartman

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=20201214172557.965095879@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=broonie@kernel.org \
    --cc=han.xu@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ran.wang_1@nxp.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.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: 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.