Received: by 10.213.65.68 with SMTP id h4csp2120017imn; Sun, 8 Apr 2018 20:11:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9vKUecgZ30rJBsmI3xfUIBLpLh777x5EpDWb4bxu/Mi9lsHLgA3s/1EYbjOXo+K2y/koR X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr35966003plg.195.1523243516524; Sun, 08 Apr 2018 20:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243516; cv=none; d=google.com; s=arc-20160816; b=QMjt4TPXJFhTTpy9QMc57ncdbVC/02SaPVNCe+Ud5eS3hLBVzfuH5zxD+/VmU3ltWK xQgcLP8t4k9M+STe5HeYEz/b1+of9uExXUKHWkn9DPy8KqooGh5clOnfsjRPyU2e+k3d lkJGSNEkyCgL7orSHbT1UVtdtVBRhn+eCIKrnXj4UJfZTPfzjIGlANvKJu08ezpjeSWt MQfLi4cp7tqvqfzdL1AsETZHvIw4u09iZnQDf53cZMU8wA5ROXilAby5y5Ku837m8GHe b9y4SN5VfSzUul/iMk/kM2fERJ8e9I/yUeouxRQU4V2q/XDT9D9vLSr8WqcGDOzCTSEM QT2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=5o0Gp6KZ9Tf4Xv71SgvCYFonaw8IFtVXXltacFtbIO8=; b=ZtHFnQxe+SHDB+OEY1ZnRb5pPVYW+iLGmtGCFsFNTbttxjbKKzZkOyqtWDojQWPN+p ykHrBnLewuNrCpfza/FTtl35QpdixsSV/Iy+AKhjJbFnmf9Qf6pnMk4KJDFByQTK1hHI Pk3+/8TipZXCuShRhV2fyIYAGADDBEMKW5oDZ6GZc0yI3v5MoYI1+DT8Tms3oDIL/ebC wgSUR9n7rOSEM6rY5Ia2O05ZAAD8kVFlxN2U+0/qjdybxleJoolZTb2jJMnWWRzXWDRT ikFlzoi8hj2QtUYmzOrgFsWoeYkGUwUI4/aNFyn0nzrd22wYs7kwydlZJIPr/cwfAo8W mTRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=XXU7XjST; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o69si11926572pfi.157.2018.04.08.20.11.19; Sun, 08 Apr 2018 20:11:56 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=XXU7XjST; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755768AbeDICsh (ORCPT + 98 others); Sun, 8 Apr 2018 22:48:37 -0400 Received: from mail-cys01nam02on0098.outbound.protection.outlook.com ([104.47.37.98]:9607 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755379AbeDIA0h (ORCPT ); Sun, 8 Apr 2018 20:26:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5o0Gp6KZ9Tf4Xv71SgvCYFonaw8IFtVXXltacFtbIO8=; b=XXU7XjSTV8m/4PffPjk916hMNLQ/N2YfLqwVaZdQUEPvdopN2kafwCpH2tV2cKwcK1+S+klOjlG3j58Spbo4IMSjA4vg4edU/W0DOdu8MZq66Wp6Z3HI1nRsiO0X26zNcDiZCse67bsFrtRwCsbu4/p/ISThQKHDTAQjPpGdgA4= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1015.namprd21.prod.outlook.com (52.132.133.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:26:30 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:26:30 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Ming Lei , Christoph Hellwig , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 003/293] nvme: fix hang in remove path Thread-Topic: [PATCH AUTOSEL for 4.9 003/293] nvme: fix hang in remove path Thread-Index: AQHTz5jjezob4o4mckaPt/N5DpmfrA== Date: Mon, 9 Apr 2018 00:22:48 +0000 Message-ID: <20180409002239.163177-3-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1015;7:XqTYrOV60+xVy9+SnWwL2b4uejmPuozti93+uXBC2hhC3afX5VrDXhB1431gPSrR+8WMDFkrgDwtB5a+Qq735vixOFxGatjHPjxFIun1UR64SJWSgdUAn4Bd03GHzoavuE8CdSFloINpn4vjEfeY7V//CntHclq07QHSkVvqf02moDSZt3OYqHqpk2UXhCmGkVZDExolSq5sDSjCrvAs9IjIVmEIq2Q/LCqD+hz649m2ROGHu7P2McLH5vw80a5n;20:Jxg7tt9heu7PjiDF7r8v8GC+W2TYzr34ItrG0KCCi8tbnGBTOiBm+5IbfuneiKirjFbYj5rUKIbrgISVk6981vIQyje0wBga4sYpt7zW5Yd9iXjn4f4rgWMv37FWNazkwQaCYVw66OK+s1mhN9tKWHtlp5nCVi+6uqQwZPV4r2k= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 0ddef4b9-918f-47a2-54ad-08d59db08a9d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1015; x-ms-traffictypediagnostic: DM5PR2101MB1015: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1015;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1015; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(39380400002)(376002)(346002)(366004)(189003)(199004)(53936002)(4326008)(478600001)(72206003)(3280700002)(2616005)(14454004)(305945005)(5250100002)(3660700001)(2501003)(2900100001)(54906003)(110136005)(86362001)(1076002)(107886003)(6506007)(36756003)(446003)(68736007)(6512007)(7736002)(486006)(2906002)(5660300001)(6436002)(3846002)(86612001)(6486002)(66066001)(11346002)(476003)(6666003)(59450400001)(26005)(10090500001)(316002)(22452003)(8676002)(81156014)(81166006)(6116002)(105586002)(99286004)(186003)(106356001)(76176011)(25786009)(97736004)(10290500003)(102836004)(8936002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1015;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: smxqBU1s3ce8BIulyWnsOLeA/f3BG/A4JSQLs7Sgnw44Aur+FX9x23t4GqeEpxgCW/+/4AMlq8ZD5mpzAEoQTuzp0KHioDIN+30K45RDXH6od+VSjAI9cq+X0VGTG1h8lGwBoGDeyMwLuNrDj7Iwg2CCrj39odaSlH4+oFhnkIyYlnEo+tj6DYISEMVUc9JRTZlAS5UJwFz5I+shbkPRZ98U/lgJnO6TZdIJYM6c/+K3xdCmPDk7yLOBeOB50vaBvaYQJb25AeNNNgCU7bzofkcmGAgkxF5wRzRwjSwrdU+EPyPrtkNOE77jEBGq/r17oR0Uu46JcwdKRLeB6iEgsaxU9UqURBFY5GRaUo9AE5+FAjW94JBeK55UqZDC/tPTNH96n2uipBbtDdc1yfh355czHMa/Iaza/0T56Gyckdk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ddef4b9-918f-47a2-54ad-08d59db08a9d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:22:48.0029 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1015 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index ad9d82eb2aed..c823e9346389 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2040,6 +2040,10 @@ void nvme_kill_queues(struct nvme_ctrl *ctrl) struct nvme_ns *ns; =20 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 --=20 2.15.1