Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946201AbbEVQXd (ORCPT ); Fri, 22 May 2015 12:23:33 -0400 Received: from mga09.intel.com ([134.134.136.24]:25431 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946079AbbEVQXb (ORCPT ); Fri, 22 May 2015 12:23:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,476,1427785200"; d="scan'208";a="733820418" Date: Fri, 22 May 2015 16:23:30 +0000 (UTC) From: Keith Busch X-X-Sender: vmware@localhost.lm.intel.com To: Parav Pandit cc: Keith Busch , linux-nvme@lists.infradead.org, Matthew Wilcox , Jens Axboe , linux-kernel@vger.kernel.org Subject: Re: [PATCH] NVMe: Avoid interrupt disable during queue init. In-Reply-To: Message-ID: References: <1432253553-17045-1-git-send-email-parav.pandit@avagotech.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1057 Lines: 23 On Fri, 22 May 2015, Parav Pandit wrote: > During normal positive path probe, > (a) device is added to dev_list in nvme_dev_start() > (b) nvme_kthread got created, which will eventually refers to > dev->queues[qid] to check for NULL. > (c) dev_start() worker thread has started probing device and creating > the queue using nvme_alloc_queue > This is is assigning the dev->queue[qid] new pointer. > If this is done out of order, nvme_kthread will pickup uninitialized > q_lock, cq_phase, q_db. A memory barrier before incrementing the dev->queue_count (and assigning the pointer in the array before that) should address this concern. > Other thoughts to not create nvme_kthread until all the queues are active. No good, we want to poll during queue creation to detect controller errors and broken interrupts. -- 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/