public inbox for linux-kernel@vger.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, Michael Kelley <mikelley@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wei Liu <wei.liu@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.8 055/118] Drivers: hv: vmbus: Add timeout to vmbus_wait_for_unload
Date: Mon, 21 Sep 2020 18:27:47 +0200	[thread overview]
Message-ID: <20200921162038.899037678@linuxfoundation.org> (raw)
In-Reply-To: <20200921162036.324813383@linuxfoundation.org>

From: Michael Kelley <mikelley@microsoft.com>

[ Upstream commit 911e1987efc8f3e6445955fbae7f54b428b92bd3 ]

vmbus_wait_for_unload() looks for a CHANNELMSG_UNLOAD_RESPONSE message
coming from Hyper-V.  But if the message isn't found for some reason,
the panic path gets hung forever.  Add a timeout of 10 seconds to prevent
this.

Fixes: 415719160de3 ("Drivers: hv: vmbus: avoid scheduling in interrupt context in vmbus_initiate_unload()")
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/1600026449-23651-1-git-send-email-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/hv/channel_mgmt.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 417a95e5094dd..af7832e131674 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -750,7 +750,7 @@ static void vmbus_wait_for_unload(void)
 	void *page_addr;
 	struct hv_message *msg;
 	struct vmbus_channel_message_header *hdr;
-	u32 message_type;
+	u32 message_type, i;
 
 	/*
 	 * CHANNELMSG_UNLOAD_RESPONSE is always delivered to the CPU which was
@@ -760,8 +760,11 @@ static void vmbus_wait_for_unload(void)
 	 * functional and vmbus_unload_response() will complete
 	 * vmbus_connection.unload_event. If not, the last thing we can do is
 	 * read message pages for all CPUs directly.
+	 *
+	 * Wait no more than 10 seconds so that the panic path can't get
+	 * hung forever in case the response message isn't seen.
 	 */
-	while (1) {
+	for (i = 0; i < 1000; i++) {
 		if (completion_done(&vmbus_connection.unload_event))
 			break;
 
-- 
2.25.1




  parent reply	other threads:[~2020-09-21 16:46 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 16:26 [PATCH 5.8 000/118] 5.8.11-rc1 review Greg Kroah-Hartman
2020-09-21 16:26 ` [PATCH 5.8 001/118] RDMA/bnxt_re: Restrict the max_gids to 256 Greg Kroah-Hartman
2020-09-21 16:26 ` [PATCH 5.8 002/118] dt-bindings: spi: Fix spi-bcm-qspi compatible ordering Greg Kroah-Hartman
2020-09-21 16:26 ` [PATCH 5.8 003/118] mptcp: sendmsg: reset iter on error Greg Kroah-Hartman
2020-09-21 16:26 ` [PATCH 5.8 004/118] net: handle the return value of pskb_carve_frag_list() correctly Greg Kroah-Hartman
2020-09-21 16:26 ` [PATCH 5.8 005/118] dt-bindings: PCI: intel,lgm-pcie: Fix matching on all snps,dw-pcie instances Greg Kroah-Hartman
2020-09-21 16:26 ` [PATCH 5.8 006/118] hv_netvsc: Remove "unlikely" from netvsc_select_queue Greg Kroah-Hartman
2020-09-21 16:26 ` [PATCH 5.8 007/118] loop: Set correct device size when using LOOP_CONFIGURE Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 008/118] firmware_loader: fix memory leak for paged buffer Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 009/118] xprtrdma: Release in-flight MRs on disconnect Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 010/118] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 011/118] phy: omap-usb2-phy: disable PHY charger detect Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 012/118] habanalabs: prevent user buff overflow Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 013/118] habanalabs: fix report of RAZWI initiator coordinates Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 014/118] scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 015/118] scsi: libfc: Fix for double free() Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 016/118] scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 017/118] scsi: lpfc: Extend the RDF FPIN Registration descriptor for additional events Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 018/118] regulator: pwm: Fix machine constraints application Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 019/118] spi: spi-loopback-test: Fix out-of-bounds read Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 020/118] interconnect: Show bandwidth for disabled paths as zero in debugfs Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 021/118] NFS: Zero-stateid SETATTR should first return delegation Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 022/118] SUNRPC: stop printk reading past end of string Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 023/118] rapidio: Replace select DMAENGINES with depends on Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 024/118] cifs: fix DFS mount with cifsacl/modefromsid Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 025/118] openrisc: Fix cache API compile issue when not inlining Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 026/118] nvme-fc: cancel async events before freeing event struct Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 027/118] nvme-rdma: " Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 028/118] nvme-tcp: " Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 029/118] block: only call sched requeue_request() for scheduled requests Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 030/118] f2fs: fix indefinite loop scanning for free nid Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 031/118] f2fs: Return EOF on unaligned end of file DIO read Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 032/118] i2c: algo: pca: Reapply i2c bus settings after reset Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 033/118] spi: Fix memory leak on splited transfers Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 034/118] KVM: Check the allocation of pv cpu mask Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 035/118] KVM: MIPS: Change the definition of kvm type Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 036/118] clk: davinci: Use the correct size when allocating memory Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 037/118] clk: rockchip: Fix initialization of mux_pll_src_4plls_p Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 038/118] ASoC: Intel: skl_hda_dsp_generic: Fix NULLptr dereference in autosuspend delay Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 039/118] ASoC: qcom: Set card->owner to avoid warnings Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 040/118] ASoC: rt1308-sdw: Fix return check for devm_regmap_init_sdw() Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 041/118] ASoC: rt711: " Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 042/118] ASoC: rt715: " Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 043/118] ASoC: rt700: " Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 044/118] ASoC: qcom: common: Fix refcount imbalance on error Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 045/118] drm/mediatek: dsi: Fix scrolling of panel with small hfp or hbp Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 046/118] powerpc/book3s64/radix: Fix boot failure with large amount of guest memory Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 047/118] ASoC: soc-core: add snd_soc_find_dai_with_mutex() Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 048/118] ASoC: meson: axg-toddr: fix channel order on g12 platforms Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 049/118] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 050/118] ASoC: Intel: haswell: Fix power transition refactor Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 051/118] ASoC: core: Do not cleanup uninitialized dais on soc_pcm_open failure Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 052/118] Drivers: hv: vmbus: hibernation: do not hang forever in vmbus_bus_resume() Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 053/118] scsi: libsas: Fix error path in sas_notify_lldd_dev_found() Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 054/118] arm64: Allow CPUs unffected by ARM erratum 1418040 to come in late Greg Kroah-Hartman
2020-09-21 16:27 ` Greg Kroah-Hartman [this message]
2020-09-21 16:27 ` [PATCH 5.8 056/118] perf test: Fix the "signal" test inline assembly Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 057/118] perf record: Dont clear events period if set by a term Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 058/118] MIPS: SNI: Fix MIPS_L1_CACHE_SHIFT Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 059/118] perf test: Free aliases for PMU event map aliases test Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 060/118] perf metric: Fix some memory leaks Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 061/118] perf evlist: Fix cpu/thread map leak Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 062/118] perf parse-event: Fix memory leak in evsel->unit Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 063/118] perf test: Free formats for perf pmu parse test Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 064/118] drm/i915/gem: Reduce context termination list iteration guard to RCU Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 065/118] fbcon: Fix user font detection test at fbcon_resize() Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 066/118] MIPS: SNI: Fix spurious interrupts Greg Kroah-Hartman
2020-09-21 16:27 ` [PATCH 5.8 067/118] drm/mediatek: Use CPU when fail to get cmdq event Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 068/118] drm/mediatek: Add missing put_device() call in mtk_ddp_comp_init() Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 069/118] drm/mediatek: Add exception handing in mtk_drm_probe() if component init fail Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 070/118] drm/mediatek: Add missing put_device() call in mtk_drm_kms_init() Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 071/118] drm/mediatek: Add missing put_device() call in mtk_hdmi_dt_parse_pdata() Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 072/118] arm64: bpf: Fix branch offset in JIT Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 073/118] iommu/amd: Fix potential @entry null deref Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 074/118] iommu/amd: Restore IRTE.RemapEn bit for amd_iommu_activate_guest_mode Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 075/118] kconfig: qconf: use delete[] instead of delete to free array (again) Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 076/118] i2c: mediatek: Fix generic definitions for bus frequency Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 077/118] i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 078/118] riscv: Add sfence.vma after early page table changes Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 079/118] locking/lockdep: Fix "USED" <- "IN-NMI" inversions Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 080/118] efi: efibc: check for efivars write capability Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 081/118] locking/percpu-rwsem: Use this_cpu_{inc,dec}() for read_count Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 082/118] x86/unwind/fp: Fix FP unwinding in ret_from_fork Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 083/118] drm/kfd: fix a system crash issue during GPU recovery Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 084/118] drm/i915/gem: Delay tracking the GEM context until it is registered Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 085/118] drm/i915: Filter wake_flags passed to default_wake_function Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 086/118] USB: quirks: Add USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk for BYD zhaoxin notebook Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 087/118] USB: UAS: fix disconnect by unplugging a hub Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 088/118] usblp: fix race between disconnect() and read() Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 089/118] usb: typec: ucsi: acpi: Increase command completion timeout value Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 090/118] usb: typec: ucsi: Prevent mode overrun Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 091/118] i2c: i801: Fix resume bug Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 092/118] Revert "ALSA: hda - Fix silent audio output and corrupted input on MSI X570-A PRO" Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 093/118] ALSA: hda: fixup headset for ASUS GX502 laptop Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 094/118] ALSA: hda/realtek - The Mic on a RedmiBook doesnt work Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 095/118] percpu: fix first chunk size calculation for populated bitmap Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 096/118] Input: trackpoint - add new trackpoint variant IDs Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 097/118] Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 098/118] thunderbolt: Retry DROM read once if parsing fails Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 099/118] serial: 8250_pci: Add Realtek 816a and 816b Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 100/118] serial: core: fix port-lock initialisation Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 101/118] serial: core: fix console port-lock regression Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 102/118] x86/boot/compressed: Disable relocation relaxation Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 103/118] ksm: reinstate memcg charge on copied pages Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 104/118] kprobes: fix kill kprobe which has been marked as gone Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 105/118] mm/thp: fix __split_huge_pmd_locked() for migration PMD Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 106/118] s390: add 3f program exception handler Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 107/118] s390/pci: fix leak of DMA tables on hard unplug Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 108/118] s390/zcrypt: fix kmalloc 256k failure Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 109/118] ehci-hcd: Move include to keep CRC stable Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 110/118] arm64: paravirt: Initialize steal time when cpu is online Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 111/118] powerpc/dma: Fix dma_map_ops::get_required_mask Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 112/118] selftests/vm: fix display of page size in map_hugetlb Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 113/118] dm/dax: Fix table reference counts Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 114/118] mm/memory_hotplug: drain per-cpu pages again during memory offline Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 115/118] dm: Call proper helper to determine dax support Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 116/118] dax: Fix compilation for CONFIG_DAX && !CONFIG_FS_DAX Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 117/118] mm: memcg: fix memcg reclaim soft lockup Greg Kroah-Hartman
2020-09-21 16:28 ` [PATCH 5.8 118/118] nvme-loop: set ctrl state connecting after init Greg Kroah-Hartman
2020-09-21 18:44 ` [PATCH 5.8 000/118] 5.8.11-rc1 review Geert Uytterhoeven
2020-09-23 11:00   ` Greg Kroah-Hartman
2020-09-22  5:02 ` Naresh Kamboju
2020-09-24 17:05   ` Greg Kroah-Hartman
2020-09-22 20:19 ` Guenter Roeck
2020-09-24 17:06   ` 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=20200921162038.899037678@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=decui@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox