Received: by 10.192.165.156 with SMTP id m28csp1105951imm; Wed, 11 Apr 2018 12:31:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx49m+5AEQq320Wctnf5p3K/P3/exi687AlAzWus/zhDLTmSOJPL216ihiFB7kh4lTBMEM4Zc X-Received: by 10.98.244.6 with SMTP id r6mr5061994pff.242.1523475087749; Wed, 11 Apr 2018 12:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523475087; cv=none; d=google.com; s=arc-20160816; b=XzUFNCvplR7qqn81e1/XrMMjegt34p7T5NkYN8uDpqrQLjifra6zVhyV1pKh1v4KYm v7g2ENgNPfk1cVzhVL2WeN+rfZfkIuc9LJo85QK2RYXNGgp/nINjUgWc1wi0kFreQu+r kXLQrvpbAeCEZB/oujwT7Cbrg6ALdabRSXK0tN5E76CBRTqffsauyxKY5ZQqlus/B7YX OK5mnYf21SJqBvX93b8A30rGEOjj55TqAb1jGnWsMYTj/ST35FGlK21GiOSg69M3/54e 4gHlzkNcJ2USA6B6miHwLnO38M6FEoJ5naTF/HISfwgtqHhyKLPxgr8iBH53lMlO0ltF MM+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ztwnajaFLBAYbwbc0xWAFZJz3IPrEXDUcIWycZaAOg0=; b=oCPjhmn8XuyQwNzi7pmz0JAKd0JnIHzYY0IjJp47IzH1meNGZhjk7d4I84wjoQ6/tq ELY+2NuUIIi/HyYSsc9F2HVkGNLJMBgHnNY5E3dR7nRTc02xrbtz+re4GJ2PURUJxSiI 7mz7BPMOhktQN47W5BBSu+O5+1KJ3GZ1W/+y9ss+/rZc22J+vqMYtlz7Bx3xqZQxtgGZ zcyVkkqVebs2VnDxg9L2dSWFKwLKH2On5fDDeQY6BRcFKrhuvEFfubPce4hMvOdbg4Xs B7+oSlOZwpIMWdlIhXvUgROx1aNM5uECbHPIYEBDT/l9Hs2zYNMpC9axJV3OzLHfCl0A yjZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p10-v6si1707678plo.727.2018.04.11.12.30.51; Wed, 11 Apr 2018 12:31:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934248AbeDKTYv (ORCPT + 99 others); Wed, 11 Apr 2018 15:24:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39004 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934708AbeDKTDh (ORCPT ); Wed, 11 Apr 2018 15:03:37 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B7F4DE71; Wed, 11 Apr 2018 19:03:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rakesh Pandit , Sagi Grimberg , Ming Lei , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.9 213/310] nvme: fix hang in remove path Date: Wed, 11 Apr 2018 20:35:52 +0200 Message-Id: <20180411183631.723699641@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Lei [ Upstream commit 82654b6b8ef8b93ee87a97fc562f87f081fc2f91 ] We need to start admin queues too in nvme_kill_queues() for avoiding hang in remove path[1]. This patch is very similar with 806f026f9b901eaf(nvme: use blk_mq_start_hw_queues() in nvme_kill_queues()). [1] hang stack trace [] blk_execute_rq+0x56/0x80 [] __nvme_submit_sync_cmd+0x89/0xf0 [] nvme_set_features+0x5e/0x90 [] nvme_configure_apst+0x166/0x200 [] nvme_set_latency_tolerance+0x35/0x50 [] apply_constraint+0xb1/0xc0 [] dev_pm_qos_constraints_destroy+0xf4/0x1f0 [] dpm_sysfs_remove+0x2a/0x60 [] device_del+0x101/0x320 [] device_unregister+0x1a/0x60 [] device_destroy+0x3c/0x50 [] nvme_uninit_ctrl+0x45/0xa0 [] nvme_remove+0x78/0x110 [] pci_device_remove+0x39/0xb0 [] device_release_driver_internal+0x155/0x210 [] device_release_driver+0x12/0x20 [] nvme_remove_dead_ctrl_work+0x6b/0x70 [] process_one_work+0x18c/0x3a0 [] worker_thread+0x4e/0x3b0 [] kthread+0x109/0x140 [] ret_from_fork+0x2c/0x40 [] 0xffffffffffffffff Fixes: c5552fde102fc("nvme: Enable autonomous power state transitions") Reported-by: Rakesh Pandit Tested-by: Rakesh Pandit Reviewed-by: Sagi Grimberg Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2040,6 +2040,10 @@ void nvme_kill_queues(struct nvme_ctrl * struct nvme_ns *ns; mutex_lock(&ctrl->namespaces_mutex); + + /* Forcibly start all queues to avoid having stuck requests */ + blk_mq_start_hw_queues(ctrl->admin_q); + list_for_each_entry(ns, &ctrl->namespaces, list) { /* * Revalidating a dead namespace sets capacity to 0. This will