mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Gordeev <agordeev@redhat.com>,
	Keith Busch <keith.busch@intel.com>,
	Matthew Wilcox <willy@linux.intel.com>,
	linux-nvme@lists.infradead.org
Subject: [PATCH 11/14] NVMe: Factor out nvme_init_bar()
Date: Tue, 28 Jan 2014 09:38:57 +0100	[thread overview]
Message-ID: <751c697697ca9b38b9f775d0908bb0cc741fe68c.1390897693.git.agordeev@redhat.com> (raw)
In-Reply-To: <cover.1390897693.git.agordeev@redhat.com>

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 drivers/block/nvme-core.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index d81b4c4..1e30c42 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1886,10 +1886,10 @@ static size_t db_bar_size(struct nvme_dev *dev, unsigned nr_io_queues)
 	return 4096 + ((nr_io_queues + 1) * 8 * dev->db_stride);
 }
 
-static int nvme_setup_io_queues(struct nvme_dev *dev, int nr_io_queues)
+static int nvme_init_bar(struct nvme_dev *dev, int nr_io_queues)
 {
 	struct pci_dev *pdev = dev->pci_dev;
-	int result, cpu, i, vecs, size, q_depth;
+	int size;
 
 	size = db_bar_size(dev, nr_io_queues);
 	if (size > 8192) {
@@ -1906,6 +1906,14 @@ static int nvme_setup_io_queues(struct nvme_dev *dev, int nr_io_queues)
 		dev->queues[0]->q_db = dev->dbs;
 	}
 
+	return nr_io_queues;
+}
+
+static int nvme_setup_io_queues(struct nvme_dev *dev, int nr_io_queues)
+{
+	struct pci_dev *pdev = dev->pci_dev;
+	int result, cpu, i, vecs, q_depth;
+
 	/* Deregister the admin queue's interrupt */
 	free_irq(dev->entry[dev->queues[0]->cq_vector].vector, dev->queues[0]);
 
@@ -2420,6 +2428,10 @@ static int nvme_dev_start(struct nvme_dev *dev)
 	if (result < 0)
 		goto disable;
 
+	result = nvme_init_bar(dev, result);
+	if (result < 0)
+		goto disable;
+
 	result = nvme_setup_io_queues(dev, result);
 	if (result)
 		goto disable;
-- 
1.7.7.6


  parent reply	other threads:[~2014-01-28  8:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28  8:38 [PATCH 00/14] NVMe: Cleanup device initialization Alexander Gordeev
2014-01-28  8:38 ` [PATCH 01/14] NVMe: Fix setup of affinity hint for unallocated queues Alexander Gordeev
2014-01-28  8:38 ` [PATCH 02/14] NVMe: Cleanup nvme_alloc_queue() and nvme_free_queue() Alexander Gordeev
2014-01-28  8:38 ` [PATCH 03/14] NVMe: Cleanup nvme_create_queue() and nvme_disable_queue() Alexander Gordeev
2014-01-28  8:38 ` [PATCH 04/14] NVMe: Cleanup adapter_alloc_cq/sg() and adapter_delete_cq/sg() Alexander Gordeev
2014-01-28  8:38 ` [PATCH 05/14] NVMe: Get rid of superfluous qid parameter to nvme_init_queue() Alexander Gordeev
2014-01-28  8:38 ` [PATCH 06/14] NVMe: Get rid of superfluous dev parameter to queue_request_irq() Alexander Gordeev
2014-01-28  8:38 ` [PATCH 07/14] NVMe: Make returning value consistent across all functions Alexander Gordeev
2014-01-28  8:38 ` [PATCH 08/14] NVMe: nvme_dev_map() is a bad place to set admin queue IRQ number Alexander Gordeev
2014-01-28  8:38 ` [PATCH 09/14] NVMe: Access interrupt vectors using nvme_queue::cq_vector only Alexander Gordeev
2014-01-28  8:38 ` [PATCH 10/14] NVMe: Factor out nvme_set_queue_count() Alexander Gordeev
2014-01-28  8:38 ` Alexander Gordeev [this message]
2014-01-28  8:38 ` [PATCH 12/14] NVMe: Factor out nvme_init_interrupts() Alexander Gordeev
2014-01-28  8:38 ` [PATCH 13/14] NVMe: Factor out nvme_setup_interrupts() Alexander Gordeev
2014-01-28  8:39 ` [PATCH 14/14] NVMe: Rework "NVMe: Disable admin queue on init failure" commit Alexander Gordeev
2014-02-18 16:53 ` [PATCH 00/14] NVMe: Cleanup device initialization Alexander Gordeev
2014-03-11 15:08 ` Alexander Gordeev
     [not found]   ` <196070e8.d690.144bb7e553f.Coremail.liaohengquan1986@163.com>
2014-03-13 19:20     ` problem in the development of nvme disk Matthew Wilcox
     [not found]       ` <785daaf7.5696.144e2af49b0.Coremail.liaohengquan1986@163.com>
2014-03-21 20:11         ` A question about NVMe's nvme-irq Matthew Wilcox
     [not found]           ` <45840288.abae.144f2312ef0.Coremail.liaohengquan1986@163.com>
2014-03-24  6:09             ` if the NVMe driver has been validated on dual-cpu platform Matthew Wilcox
     [not found]           ` <42744e02.6f7d.144f1b148b3.Coremail.liaohengquan1986@163.com>
2014-03-24  6:09             ` Re: A question about NVMe's nvme-irq Matthew Wilcox

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=751c697697ca9b38b9f775d0908bb0cc741fe68c.1390897693.git.agordeev@redhat.com \
    --to=agordeev@redhat.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=willy@linux.intel.com \
    /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

all inboxes | Powered by JetHome®