From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH v2 5/9] nvme: Fix invalid call to irq_set_affinity_hint()
Date: Fri, 17 Jan 2014 15:01:10 -0700 (MST) [thread overview]
Message-ID: <alpine.LRH.2.03.1401171419370.25844@AMR> (raw)
In-Reply-To: <CAErSpo4g_xm4vZWZDgyjtJu+z5ARSerQLrtJ6W_peXv4bKwcgg@mail.gmail.com>
On Fri, 17 Jan 2014, Bjorn Helgaas wrote:
> On Fri, Jan 17, 2014@9:02 AM, Alexander Gordeev <agordeev@redhat.com> wrote:
>> In case MSI-X and MSI initialization failed the function
>> irq_set_affinity_hint() is called with uninitialized value
>> in dev->entry[0].vector. This update fixes the issue.
>
> dev->entry[0].vector is initialized in nvme_dev_map(), and it's used
> for free_irq() above the area of your patch, so I don't think this is
> actually a bug, though it might be somewhat confusing.
It is confusing, but there's a reason. :)
We send a single command using legacy irq to discover how many msix
vectors we want. The legacy entry needs to be set some time before calling
request_irq in nvme_configure_admin_queue, but also within nvme_dev_start
(for power-management). I don't think there's a place to set it that
won't look odd when looking at nvme_setup_io_queues. I settled on
'nvme_dev_map' was because 'nvme_dev_unmap' invalidates the entries,
so this seemed to provide some amount of symmetry.
>> Signed-off-by: Alexander Gordeev <agordeev at redhat.com>
>> ---
>> drivers/block/nvme-core.c | 12 ++++++------
>> 1 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
>> index 26d03fa..e292450 100644
>> --- a/drivers/block/nvme-core.c
>> +++ b/drivers/block/nvme-core.c
>> @@ -1790,15 +1790,15 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
>> vecs = 32;
>> for (;;) {
>> result = pci_enable_msi_block(pdev, vecs);
>> - if (result == 0) {
>> - for (i = 0; i < vecs; i++)
>> - dev->entry[i].vector = i + pdev->irq;
>> - break;
>> + if (result > 0) {
>> + vecs = result;
>> + continue;
>> } else if (result < 0) {
>> vecs = 1;
>> - break;
>> }
>> - vecs = result;
>> + for (i = 0; i < vecs; i++)
>> + dev->entry[i].vector = i + pdev->irq;
>> + break;
>> }
>> }
next prev parent reply other threads:[~2014-01-17 22:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-17 16:02 [PATCH v2 0/9] Phase out pci_enable_msi_block() Alexander Gordeev
2014-01-17 16:02 ` [PATCH v2 5/9] nvme: Fix invalid call to irq_set_affinity_hint() Alexander Gordeev
2014-01-17 19:40 ` Bjorn Helgaas
2014-01-17 22:01 ` Keith Busch [this message]
2014-01-20 8:38 ` Alexander Gordeev
2014-01-20 8:40 ` [PATCH v3 6/9] nvme: Use pci_enable_msi_range() and pci_enable_msix_range() Alexander Gordeev
2014-02-05 13:07 ` Alexander Gordeev
2014-02-18 17:54 ` Keith Busch
2014-01-20 8:42 ` [PATCH] nvme: Cleanup nvme_dev_start() and fix IRQ leak Alexander Gordeev
2014-01-20 22:48 ` Keith Busch
2014-01-21 10:03 ` Alexander Gordeev
2014-01-21 10:06 ` [PATCH 1/2] Revert "NVMe: Disable admin queue on init failure" Alexander Gordeev
2014-01-21 10:07 ` [PATCH 2/2] nvme: Cleanup nvme_dev_start() and fix IRQ leak Alexander Gordeev
2014-01-21 19:06 ` Keith Busch
2014-01-20 8:43 ` [PATCH] nvme: Cleanup nvme_dev_start() Alexander Gordeev
2014-01-20 16:41 ` Keith Busch
2014-01-17 16:02 ` [PATCH v2 6/9] nvme: Use pci_enable_msi_range() and pci_enable_msix_range() Alexander Gordeev
2014-01-17 21:00 ` [PATCH v2 0/9] Phase out pci_enable_msi_block() Bjorn Helgaas
2014-01-18 7:15 ` Alexander Gordeev
2014-01-18 14:38 ` Bjorn Helgaas
2014-01-18 14:59 ` Tejun Heo
2014-01-29 21:48 ` Bjorn Helgaas
2014-01-29 13:59 ` Alexander Gordeev
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=alpine.LRH.2.03.1401171419370.25844@AMR \
--to=keith.busch@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