Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753638AbbELQeg (ORCPT ); Tue, 12 May 2015 12:34:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40649 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbbELQec (ORCPT ); Tue, 12 May 2015 12:34:32 -0400 From: Vitaly Kuznetsov To: KY Srinivasan Cc: Haiyang Zhang , "devel\@linuxdriverproject.org" , "linux-kernel\@vger.kernel.org" , Dexuan Cui , "Dan Carpenter" Subject: Re: [PATCH v2 3/3] Drivers: hv: vmbus: setup irq after synic is initialized References: <1429633298-31142-1-git-send-email-vkuznets@redhat.com> <1429633298-31142-4-git-send-email-vkuznets@redhat.com> Date: Tue, 12 May 2015 18:34:25 +0200 In-Reply-To: (KY Srinivasan's message of "Sun, 3 May 2015 01:58:47 +0000") Message-ID: <87mw19n4a6.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2235 Lines: 66 KY Srinivasan 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 >> --- >> 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 -- 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/