Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755695AbbEUSgl (ORCPT ); Thu, 21 May 2015 14:36:41 -0400 Received: from cmrelayp1.emulex.com ([138.239.112.140]:55392 "EHLO CMRELAYP1.ad.emulex.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752526AbbEUSgk (ORCPT ); Thu, 21 May 2015 14:36:40 -0400 From: Parav Pandit To: linux-nvme@lists.infradead.org, willy@linux.intel.com Cc: parav.pandit@avagotech.com, axboe@kernel.dk, linux-kernel@vger.kernel.org Subject: [PATCH] NVMe: Avoid interrupt disable during queue init. Date: Thu, 21 May 2015 20:12:33 -0400 Message-Id: <1432253553-17045-1-git-send-email-parav.pandit@avagotech.com> X-Mailer: git-send-email 1.8.3.1 X-OriginalArrivalTime: 21 May 2015 18:36:39.0885 (UTC) FILETIME=[13999FD0:01D093F5] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1362 Lines: 41 Avoid diabling interrupt and holding q_lock for the queue which is just getting initialized. With this change, online_queues is also incremented without lock during queue setup stage. if Power management nvme_suspend() kicks in during queue setup time, per nvmeq based q_lock spinlock cannot protect device wide online_queues variable anyway. Signed-off-by: Parav Pandit --- drivers/block/nvme-core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 58041c7..7f09e5e 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -1437,14 +1437,12 @@ static void nvme_init_queue(struct nvme_queue *nvmeq, u16 qid) { struct nvme_dev *dev = nvmeq->dev; - spin_lock_irq(&nvmeq->q_lock); nvmeq->sq_tail = 0; nvmeq->cq_head = 0; nvmeq->cq_phase = 1; nvmeq->q_db = &dev->dbs[qid * 2 * dev->db_stride]; memset((void *)nvmeq->cqes, 0, CQ_SIZE(nvmeq->q_depth)); dev->online_queues++; - spin_unlock_irq(&nvmeq->q_lock); } static int nvme_create_queue(struct nvme_queue *nvmeq, int qid) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/