public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: KY Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>,
	"devel\@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	"Dan Carpenter" <dan.carpenter@oracle.com>
Subject: Re: [PATCH v2 3/3] Drivers: hv: vmbus: setup irq after synic is initialized
Date: Tue, 12 May 2015 18:34:25 +0200	[thread overview]
Message-ID: <87mw19n4a6.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <BY2PR0301MB0711D1B7FFE8BEE04BD4DD55A0D30@BY2PR0301MB0711.namprd03.prod.outlook.com> (KY Srinivasan's message of "Sun, 3 May 2015 01:58:47 +0000")

KY Srinivasan <kys@microsoft.com> writes:

>> -----Original Message-----
>> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> Sent: Tuesday, April 21, 2015 9:22 AM
>> To: KY Srinivasan
>> Cc: Haiyang Zhang; devel@linuxdriverproject.org; linux-
>> kernel@vger.kernel.org; Dexuan Cui; Dan Carpenter
>> Subject: [PATCH v2 3/3] Drivers: hv: vmbus: setup irq after synic is initialized
>> 
>> vmbus_isr() uses synic pages which are being setup in hv_synic_alloc(), we
>> need to register this irq handler only after we allocate all the required
>> pages.
>
> Why? Until we tell the hypervisor to route the vmbus interrupts on the specified vector,
> no vmbus interrupts will be delivered and this is done in the function hv_synic_init().
> So, the only requirement here is that all of the irq plumbing and allocations be done 
> before we enable the synthetic interrupt controller and register the vector with the
> hypervisor. What am I missing.

I should have made it clearer that I'm not fixing a bug here, it just
looks logical to me to put synic pages allocation (hv_synic_alloc())
before we register vmbus_isr() handler which uses these pages. You're
absolutely right and this handler won't be executed with unallocated
pages now, this patch was rather future-proof.


>
> Regards,
>
> K. Y
>> 
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>>  drivers/hv/vmbus_drv.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
>> index cf20400..e922804 100644
>> --- a/drivers/hv/vmbus_drv.c
>> +++ b/drivers/hv/vmbus_drv.c
>> @@ -822,11 +822,12 @@ static int vmbus_bus_init(int irq)
>>  	if (ret)
>>  		goto err_cleanup;
>> 
>> -	hv_setup_vmbus_irq(vmbus_isr);
>> -
>>  	ret = hv_synic_alloc();
>>  	if (ret)
>>  		goto err_alloc;
>> +
>> +	hv_setup_vmbus_irq(vmbus_isr);
>> +
>>  	/*
>>  	 * Initialize the per-cpu interrupt state and
>>  	 * connect to the host.
>> --
>> 1.9.3

-- 
  Vitaly

  reply	other threads:[~2015-05-12 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 16:21 [PATCH v2 0/3] Drivers: hv: vmbus: additional fixes for the setup/teardown path Vitaly Kuznetsov
2015-04-21 16:21 ` [PATCH v2 1/3] Drivers: hv: vmbus: do cleanup on all vmbus_open() failure paths Vitaly Kuznetsov
2015-04-21 16:21 ` [PATCH v2 2/3] Drivers: hv: vmbus: kill tasklets on module unload Vitaly Kuznetsov
2015-04-21 16:21 ` [PATCH v2 3/3] Drivers: hv: vmbus: setup irq after synic is initialized Vitaly Kuznetsov
2015-05-03  1:58   ` KY Srinivasan
2015-05-12 16:34     ` Vitaly Kuznetsov [this message]
2015-04-24  9:14 ` [PATCH v2 0/3] Drivers: hv: vmbus: additional fixes for the setup/teardown path Dexuan Cui
2015-04-24  9:24   ` Vitaly Kuznetsov

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=87mw19n4a6.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=decui@microsoft.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /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